Merge tag 'android-10.0.0_r23' into staging/lineage-17.1_merge-android-10.0.0_r23

Android 10.0.0 release 23

* tag 'android-10.0.0_r23':
  audio: free and assign NULL to global static device pointer

Change-Id: Ib07c17230f97f54746d3713c3137a04ca9428194
diff --git a/Android.mk b/Android.mk
index 826a88d..26d26fe 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,6 +1,6 @@
 # TODO:  Find a better way to separate build configs for ADP vs non-ADP devices
 ifneq ($(TARGET_BOARD_AUTO),true)
-  ifneq ($(filter msm8960 msm8226 msm8x26 msm8x84 msm8084 msm8992 msm8994 msm8996 msm8909 msm8952 msm8998 sdm845 sdm710,$(TARGET_BOARD_PLATFORM)),)
+  ifneq ($(filter msm8960 msm8226 msm8x26 msm8974 msm8x74 msm8x84 msm8084 msm8992 msm8994 msm8996 msm8909 msm8952 msm8998 sdm845 sdm710,$(TARGET_BOARD_PLATFORM)),)
 
     MY_LOCAL_PATH := $(call my-dir)
 
diff --git a/hal/Android.mk b/hal/Android.mk
index e6be0a6..edd50bc 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -230,6 +230,8 @@
 
 LOCAL_HEADER_LIBRARIES += libhardware_headers
 
+LOCAL_HEADER_LIBRARIES += generated_kernel_headers
+
 LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
 
 LOCAL_MODULE_RELATIVE_PATH := hw
diff --git a/hal/acdb.c b/hal/acdb.c
index 58f219a..0c008e1 100644
--- a/hal/acdb.c
+++ b/hal/acdb.c
@@ -99,7 +99,13 @@
         ctl = mixer_get_ctl_by_name(mixer, CVD_VERSION_MIXER_CTL);
         if (!ctl) {
             ALOGE("%s: Could not get ctl for mixer cmd - %s",  __func__, CVD_VERSION_MIXER_CTL);
-            goto cleanup;
+            /* CVD is required for ACDB v2/3, so fail fully there.
+             * For ACDB v1, the CVD version code can be skipped.
+             */
+            if (my_data->acdb_init_v2 || my_data->acdb_init_v3)
+                goto cleanup;
+            else
+                goto card_name;
         }
         mixer_ctl_update(ctl);
 
@@ -114,6 +120,7 @@
         }
     }
 
+card_name:
     /* Get Sound card name */
     snd_card_name = strdup(mixer_get_name(mixer));
     if (!snd_card_name) {
diff --git a/post_proc/Android.mk b/post_proc/Android.mk
index ce84e41..c12db2d 100644
--- a/post_proc/Android.mk
+++ b/post_proc/Android.mk
@@ -38,6 +38,9 @@
 
 LOCAL_HEADER_LIBRARIES += libhardware_headers
 LOCAL_HEADER_LIBRARIES += libsystem_headers
+
+LOCAL_HEADER_LIBRARIES += generated_kernel_headers
+
 include $(BUILD_SHARED_LIBRARY)
 endif
 
@@ -70,6 +73,9 @@
 
 LOCAL_HEADER_LIBRARIES += libhardware_headers
 LOCAL_HEADER_LIBRARIES += libsystem_headers
+
+LOCAL_HEADER_LIBRARIES += generated_kernel_headers
+
 include $(BUILD_SHARED_LIBRARY)
 
 endif
@@ -103,6 +109,9 @@
 
 LOCAL_HEADER_LIBRARIES += libhardware_headers
 LOCAL_HEADER_LIBRARIES += libsystem_headers
+
+LOCAL_HEADER_LIBRARIES += generated_kernel_headers
+
 include $(BUILD_SHARED_LIBRARY)
 
 endif