Merge SP2A.220505.002

Bug: 231319788
Merged-In: Ic2ed06886679671a04a35f86665cb147b8103905
Change-Id: If57b905b6c2b165f3335af280c15174060ab2e1f
diff --git a/Android.mk b/Android.mk
index 103485c..46e75c8 100644
--- a/Android.mk
+++ b/Android.mk
@@ -16,6 +16,22 @@
 
 LOCAL_PATH := $(call my-dir)
 
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,default-permissions.xml,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,libnfc-nci.conf,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,fstab.postinstall,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,ueventd.rc,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,wpa_supplicant.conf,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,hals.conf,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,media_profiles_V1_0.xml,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,media_codecs_performance.xml,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,device_state_configuration.xml,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,task_profiles.json,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,p2p_supplicant.conf,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,wpa_supplicant.conf,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,device/google/bonito,wpa_supplicant_overlay.conf,SPDX-license-identifier-Apache-2.0,notice,build/soong/licenses/LICENSE,))
+
+$(eval $(call declare-1p-copy-files,device/google/bonito,audio_policy_configuration.xml))
+
 ifeq ($(USES_DEVICE_GOOGLE_B4S4),true)
   subdir_makefiles=$(call first-makefiles-under,$(LOCAL_PATH))
   $(foreach mk,$(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk)))
diff --git a/METADATA b/METADATA
index b454a1f..39d2873 100644
--- a/METADATA
+++ b/METADATA
@@ -1,4 +1,4 @@
 third_party {
-  # would be NOTICE save for sdm710/original-kernel-headers/
+  license_note: "would be NOTICE save for sdm710/original-kernel-headers/"
   license_type: RESTRICTED
 }
diff --git a/bonito/AndroidBoard.mk b/bonito/AndroidBoard.mk
index 5ad7cbd..4a4925e 100644
--- a/bonito/AndroidBoard.mk
+++ b/bonito/AndroidBoard.mk
@@ -29,6 +29,9 @@
 	$(hide) chmod a+r $@
 	$(hide) $(call assert-max-image-size,$@,$(BOARD_PERSISTIMAGE_PARTITION_SIZE))
 
+$(call declare-1p-container,$(INSTALLED_PERSISTIMAGE_TARGET),)
+$(call declare-container-license-deps,$(INSTALLED_PERSISTIMAGE_TARGET),$(INSTALLED_PERSISTIMAGE_FILES),$(INSTALLED_PERSISTIMAGE_TARGET):)
+
 ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_PERSISTIMAGE_TARGET)
 ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(INSTALLED_PERSISTIMAGE_TARGET)
 INSTALLED_RADIOIMAGE_TARGET += $(INSTALLED_PERSISTIMAGE_TARGET)
diff --git a/bonito/BoardConfig.mk b/bonito/BoardConfig.mk
index a15cdc9..484e783 100644
--- a/bonito/BoardConfig.mk
+++ b/bonito/BoardConfig.mk
@@ -14,8 +14,8 @@
 # limitations under the License.
 #
 
-ifdef PHONE_CAR_BOARD_CONFIG
-  include $(PHONE_CAR_BOARD_CONFIG)
+ifdef PHONE_CAR_BOARD_PRODUCT
+  include device/google_car/$(PHONE_CAR_BOARD_PRODUCT)/BoardConfig.mk
 else
   TARGET_BOOTLOADER_BOARD_NAME := bonito
   TARGET_SCREEN_DENSITY := 400
diff --git a/bonito/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml b/bonito/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml
index 22291ff..2668ad3 100644
--- a/bonito/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml
+++ b/bonito/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml
@@ -22,7 +22,7 @@
     <dimen name="status_bar_header_height_keyguard">@*android:dimen/status_bar_height</dimen>
 
     <!-- Margin on the right side of the system icon group on Keyguard. -->
-    <dimen name="system_icons_keyguard_padding_end">8.5dp</dimen>
+    <dimen name="system_icons_keyguard_padding_end">8dp</dimen>
 
     <!-- Location on the screen of the center of the physical power button. -->
     <dimen name="physical_power_button_center_screen_location_y">500px</dimen>
diff --git a/init.hardware.rc b/init.hardware.rc
index 0d88b17..ad788c9 100644
--- a/init.hardware.rc
+++ b/init.hardware.rc
@@ -374,9 +374,6 @@
     write /sys/kernel/boot_adsp/boot 1
     write /sys/kernel/boot_cdsp/boot 1
 
-    # Update dm-verity state and set partition.*.verified properties
-    verity_update_state
-
     # Permission for rainbow sensor
     chown cameraserver camera /sys/devices/platform/soc/ac4a000.qcom,cci/ac4a000.qcom,cci:qcom,rainbow@20/rainbow_enable
     chmod 0660 /sys/devices/platform/soc/ac4a000.qcom,cci/ac4a000.qcom,cci:qcom,rainbow@20/rainbow_enable
@@ -725,7 +722,7 @@
     class core
     user root
     group root
-    writepid /dev/cpuset/system-background/tasks
+    task_profiles ServiceCapacityLow
 
 service ppd /vendor/bin/mm-pp-dpps
     class late_start
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 57993b0..aae2943 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -141,15 +141,9 @@
          device does not support multiple advertisement-->
     <integer translatable="false" name="config_bluetooth_max_advertisers">4</integer>
 
-    <!-- Whether Hearing Aid profile is supported -->
-    <bool name="config_hearing_aid_profile_supported">true</bool>
-
     <!-- Operating voltage for bluetooth controller. 0 by default-->
     <integer translatable="false" name="config_bluetooth_operating_voltage_mv">3300</integer>
 
-    <!-- Boolean indicating if current platform supports HFP inband ringing -->
-    <bool name="config_bluetooth_hfp_inband_ringing_support">true</bool>
-
     <bool translatable="false" name="config_tether_upstream_automatic">true</bool>
 
     <!-- This string array should be overridden by the device to present a list of network
@@ -278,7 +272,6 @@
         <item>"/system/framework/services.jar"</item>
         <item>"/apex/com.android.art/javalib/core-oj.jar"</item>
         <item>"/apex/com.android.art/javalib/core-libart.jar"</item>
-        <item>"/apex/com.android.media/javalib/updatable-media.jar"</item>
         <item>"/system_ext/priv-app/SystemUIGoogle/SystemUIGoogle.apk"</item>
         <item>"/system/bin/surfaceflinger"</item>
     </string-array>
diff --git a/product.prop b/product.prop
index cb8e472..96b7c6c 100644
--- a/product.prop
+++ b/product.prop
@@ -87,3 +87,28 @@
 persist.bluetooth.bqr.event_mask=14
 # BQR minimum report interval configuration
 persist.bluetooth.bqr.min_interval_ms=500
+# Bluetooth operating voltage in millivolts
+bluetooth.hardware.power.operating_voltage_mv=3300
+
+# Set supported Bluetooth profiles to enabled
+bluetooth.profile.asha.central.enabled?=true
+bluetooth.profile.a2dp.source.enabled?=true
+bluetooth.profile.avrcp.target.enabled?=true
+bluetooth.profile.bap.broadcast.assist.enabled?=true
+bluetooth.profile.bap.unicast.client.enabled?=true
+bluetooth.profile.bas.client.enabled?=true
+bluetooth.profile.csip.set_coordinator.enabled?=true
+bluetooth.profile.gatt.enabled?=true
+bluetooth.profile.hap.client.enabled?=true
+bluetooth.profile.hfp.ag.enabled?=true
+bluetooth.profile.hid.device.enabled?=true
+bluetooth.profile.hid.host.enabled?=true
+bluetooth.profile.map.server.enabled?=true
+bluetooth.profile.mcp.server.enabled?=true
+bluetooth.profile.opp.enabled?=true
+bluetooth.profile.pan.nap.enabled?=true
+bluetooth.profile.pan.panu.enabled?=true
+bluetooth.profile.pbap.server.enabled?=true
+bluetooth.profile.sap.server.enabled?=true
+bluetooth.profile.ccp.server.enabled?=true
+bluetooth.profile.vcp.controller.enabled?=true
diff --git a/sargo/BoardConfig.mk b/sargo/BoardConfig.mk
index 112613e..7f0963a 100644
--- a/sargo/BoardConfig.mk
+++ b/sargo/BoardConfig.mk
@@ -14,8 +14,8 @@
 # limitations under the License.
 #
 
-ifdef PHONE_CAR_BOARD_CONFIG
-  include $(PHONE_CAR_BOARD_CONFIG)
+ifdef PHONE_CAR_BOARD_PRODUCT
+  include device/google_car/$(PHONE_CAR_BOARD_PRODUCT)/BoardConfig.mk
 else
   TARGET_BOOTLOADER_BOARD_NAME := sargo
   TARGET_SCREEN_DENSITY := 440
diff --git a/self-extractors/google_devices/staging/Android.mk b/self-extractors/google_devices/staging/Android.mk
index 339e800..5caef36 100644
--- a/self-extractors/google_devices/staging/Android.mk
+++ b/self-extractors/google_devices/staging/Android.mk
@@ -16,7 +16,11 @@
 
 LOCAL_PATH := $(call my-dir)
 
+$(call declare-license-metadata,$(LOCAL_PATH)/vendor.img,legacy_proprietary,proprietary,$(LOCAL_PATH)/../LICENSE,"Vendor Image",vendor)
+
 ifneq ($(filter bonito,$(TARGET_DEVICE)),)
   $(call add-radio-file,bootloader.img)
+  $(call declare-license-metadata,$(LOCAL_PATH)/bootloader.img,legacy_proprietary,proprietary,$(LOCAL_PATH)/../LICENSE,"Vendor Bootloader Image",vendor)
   $(call add-radio-file,radio.img)
+  $(call declare-license-metadata,$(LOCAL_PATH)/radio.img,legacy_proprietary,proprietary,$(LOCAL_PATH)/../LICENSE,"Vendor Radio Image",vendor)
 endif
diff --git a/self-extractors/qcom/staging/Android.mk b/self-extractors/qcom/staging/Android.mk
index 4ffd0cf..510d07a 100644
--- a/self-extractors/qcom/staging/Android.mk
+++ b/self-extractors/qcom/staging/Android.mk
@@ -1,5 +1,11 @@
 LOCAL_PATH := $(call my-dir)
 
+$(call declare-license-metadata,$(LOCAL_PATH)/vendor.img,legacy_proprietary,proprietary,$(LOCAL_PATH)/../LICENSE,"Vendor Image",vendor)
+
+$(eval $(call declare-copy-files-license-metadata,vendor/qcom/bonito,:qcom,legacy_proprietary,proprietary,vendor/qcom/bonito/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,vendor/qcom/bonito,.jar,legacy_proprietary,proprietary,vendor/qcom/bonito/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,vendor/qcom/bonito,.xml,legacy_proprietary,proprietary,vendor/qcom/bonito/LICENSE,))
+
 ifneq ($(filter bonito, $(TARGET_DEVICE)),)
 include $(CLEAR_VARS)
 LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
@@ -13,6 +19,10 @@
 LOCAL_MODULE_CLASS := APPS
 LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
 LOCAL_CERTIFICATE := platform
+# Disable dexpreopt and <uses-library> check because the APK depends on
+# libraries that are not present as modules in the build system.
+LOCAL_ENFORCE_USES_LIBRARIES := false
+LOCAL_DEX_PREOPT := false
 include $(BUILD_PREBUILT)
 
 include $(CLEAR_VARS)
@@ -27,5 +37,9 @@
 LOCAL_MODULE_CLASS := APPS
 LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
 LOCAL_CERTIFICATE := platform
+# Disable dexpreopt and <uses-library> check because the APK depends on
+# libraries that are not present as modules in the build system.
+LOCAL_ENFORCE_USES_LIBRARIES := false
+LOCAL_DEX_PREOPT := false
 include $(BUILD_PREBUILT)
 endif
diff --git a/self-extractors/root/proprietary/BoardConfigVendor.mk b/self-extractors/root/proprietary/BoardConfigVendor.mk
index 92356b0..3f0115e 100644
--- a/self-extractors/root/proprietary/BoardConfigVendor.mk
+++ b/self-extractors/root/proprietary/BoardConfigVendor.mk
@@ -13,10 +13,9 @@
 # limitations under the License.
 
 ifneq ($(filter sargo,$(TARGET_DEVICE)),)
-LOCAL_STEM := sargo/BoardConfigPartial.mk
+-include vendor/google_devices/sargo/BoardConfigPartial.mk
+-include vendor/qcom/sargo/BoardConfigPartial.mk
 else
-LOCAL_STEM := bonito/BoardConfigPartial.mk
+-include vendor/google_devices/bonito/BoardConfigPartial.mk
+-include vendor/qcom/bonito/BoardConfigPartial.mk
 endif
-
--include vendor/google_devices/$(LOCAL_STEM)
--include vendor/qcom/$(LOCAL_STEM)
diff --git a/self-extractors/root/proprietary/device-vendor.mk b/self-extractors/root/proprietary/device-vendor.mk
index b241870..261e52b 100644
--- a/self-extractors/root/proprietary/device-vendor.mk
+++ b/self-extractors/root/proprietary/device-vendor.mk
@@ -12,7 +12,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-LOCAL_STEM := bonito/device-partial.mk
-
-$(call inherit-product-if-exists, vendor/google_devices/$(LOCAL_STEM))
-$(call inherit-product-if-exists, vendor/qcom/$(LOCAL_STEM))
+$(call inherit-product-if-exists, vendor/google_devices/bonito/device-partial.mk)
+$(call inherit-product-if-exists, vendor/qcom/bonito/device-partial.mk)
diff --git a/self-extractors_sargo/google_devices/staging/Android.mk b/self-extractors_sargo/google_devices/staging/Android.mk
index eeae071..814ce95 100644
--- a/self-extractors_sargo/google_devices/staging/Android.mk
+++ b/self-extractors_sargo/google_devices/staging/Android.mk
@@ -16,7 +16,11 @@
 
 LOCAL_PATH := $(call my-dir)
 
+$(call declare-license-metadata,$(LOCAL_PATH)/vendor.img,legacy_proprietary,proprietary,$(LOCAL_PATH)/../LICENSE,"Vendor Image",vendor)
+
 ifneq ($(filter sargo,$(TARGET_DEVICE)),)
   $(call add-radio-file,bootloader.img)
+  $(call declare-license-metadata,$(LOCAL_PATH)/bootloader.img,legacy_proprietary,proprietary,$(LOCAL_PATH)/../LICENSE,"Vendor Bootloader Image",vendor)
   $(call add-radio-file,radio.img)
+  $(call declare-license-metadata,$(LOCAL_PATH)/radio.img,legacy_proprietary,proprietary,$(LOCAL_PATH)/../LICENSE,"Vendor Radio Image",vendor)
 endif
diff --git a/self-extractors_sargo/qcom/staging/Android.mk b/self-extractors_sargo/qcom/staging/Android.mk
index 577d632..346dc40 100644
--- a/self-extractors_sargo/qcom/staging/Android.mk
+++ b/self-extractors_sargo/qcom/staging/Android.mk
@@ -1,5 +1,11 @@
 LOCAL_PATH := $(call my-dir)
 
+$(call declare-license-metadata,$(LOCAL_PATH)/vendor.img,legacy_proprietary,proprietary,$(LOCAL_PATH)/../LICENSE,"Vendor Image",vendor)
+
+$(eval $(call declare-copy-files-license-metadata,vendor/qcom/sargo,:qcom,legacy_proprietary,proprietary,vendor/qcom/sargo/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,vendor/qcom/sargo,.jar,legacy_proprietary,proprietary,vendor/qcom/sargo/LICENSE,))
+$(eval $(call declare-copy-files-license-metadata,vendor/qcom/sargo,.xml,legacy_proprietary,proprietary,vendor/qcom/sargo/LICENSE,))
+
 ifneq ($(filter sargo, $(TARGET_DEVICE)),)
 include $(CLEAR_VARS)
 LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
@@ -13,6 +19,10 @@
 LOCAL_MODULE_CLASS := APPS
 LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
 LOCAL_CERTIFICATE := platform
+# Disable dexpreopt and <uses-library> check because the APK depends on
+# libraries that are not present as modules in the build system.
+LOCAL_ENFORCE_USES_LIBRARIES := false
+LOCAL_DEX_PREOPT := false
 include $(BUILD_PREBUILT)
 
 include $(CLEAR_VARS)
@@ -27,5 +37,9 @@
 LOCAL_MODULE_CLASS := APPS
 LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
 LOCAL_CERTIFICATE := platform
+# Disable dexpreopt and <uses-library> check because the APK depends on
+# libraries that are not present as modules in the build system.
+LOCAL_ENFORCE_USES_LIBRARIES := false
+LOCAL_DEX_PREOPT := false
 include $(BUILD_PREBUILT)
 endif
diff --git a/self-extractors_sargo/root/proprietary/BoardConfigVendor.mk b/self-extractors_sargo/root/proprietary/BoardConfigVendor.mk
index 92356b0..3f0115e 100644
--- a/self-extractors_sargo/root/proprietary/BoardConfigVendor.mk
+++ b/self-extractors_sargo/root/proprietary/BoardConfigVendor.mk
@@ -13,10 +13,9 @@
 # limitations under the License.
 
 ifneq ($(filter sargo,$(TARGET_DEVICE)),)
-LOCAL_STEM := sargo/BoardConfigPartial.mk
+-include vendor/google_devices/sargo/BoardConfigPartial.mk
+-include vendor/qcom/sargo/BoardConfigPartial.mk
 else
-LOCAL_STEM := bonito/BoardConfigPartial.mk
+-include vendor/google_devices/bonito/BoardConfigPartial.mk
+-include vendor/qcom/bonito/BoardConfigPartial.mk
 endif
-
--include vendor/google_devices/$(LOCAL_STEM)
--include vendor/qcom/$(LOCAL_STEM)
diff --git a/self-extractors_sargo/root/proprietary/device-vendor.mk b/self-extractors_sargo/root/proprietary/device-vendor.mk
index 5b8a174..fc429db 100644
--- a/self-extractors_sargo/root/proprietary/device-vendor.mk
+++ b/self-extractors_sargo/root/proprietary/device-vendor.mk
@@ -12,7 +12,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-LOCAL_STEM := sargo/device-partial.mk
-
-$(call inherit-product-if-exists, vendor/google_devices/$(LOCAL_STEM))
-$(call inherit-product-if-exists, vendor/qcom/$(LOCAL_STEM))
+$(call inherit-product-if-exists, vendor/google_devices/sargo/device-partial.mk)
+$(call inherit-product-if-exists, vendor/qcom/sargo/device-partial.mk)