Merge Android 14 QPR2 to AOSP main

Bug: 319669529
Merged-In: Ib4f988604c5d6275a36e6e0431a9c214682c23df
Change-Id: I9d9ac0a8a57e5ce259f7a0c9713c9e0efc481997
diff --git a/OWNERS b/OWNERS
index 79003ba..7eed0c3 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,4 +1,4 @@
 per-file powerhint.json = jychen@google.com,jenhaochen@google.com,wvw@google.com,joaodias@google.com
 
 # per-file for Pixel device makefiles, see go/pixel-device-mk-owner-checklist for details.
-per-file *.mk,*/BoardConfig.mk=file:device/google/gs-common:master:/OWNERS
+per-file *.mk,*/BoardConfig.mk=file:device/google/gs-common:main:/OWNERS
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
new file mode 100644
index 0000000..3826687
--- /dev/null
+++ b/PREUPLOAD.cfg
@@ -0,0 +1,2 @@
+[Builtin Hooks]
+jsonlint = true
\ No newline at end of file
diff --git a/bluejay/BoardConfig.mk b/bluejay/BoardConfig.mk
index ae13ab0..714c9c3 100644
--- a/bluejay/BoardConfig.mk
+++ b/bluejay/BoardConfig.mk
@@ -20,6 +20,15 @@
     TARGET_SCREEN_DENSITY := 420
 endif
 
+RELEASE_GOOGLE_PRODUCT_RADIO_DIR := $(RELEASE_GOOGLE_BLUEJAY_RADIO_DIR)
+ifneq (,$(filter AP1%,$(RELEASE_PLATFORM_VERSION)))
+RELEASE_GOOGLE_PRODUCT_BOOTLOADER_DIR := bootloader/24Q1
+else ifneq (,$(filter AP2%,$(RELEASE_PLATFORM_VERSION)))
+RELEASE_GOOGLE_PRODUCT_BOOTLOADER_DIR := bootloader/24Q2
+else
+RELEASE_GOOGLE_PRODUCT_BOOTLOADER_DIR := bootloader/trunk
+endif
+
 # Enable load module in parallel
 BOARD_BOOTCONFIG += androidboot.load_modules_parallel=true
 
diff --git a/device-bluejay.mk b/device-bluejay.mk
index 83b8f23..da89a1e 100644
--- a/device-bluejay.mk
+++ b/device-bluejay.mk
@@ -14,6 +14,9 @@
 # limitations under the License.
 #
 
+# Restrict the visibility of Android.bp files to improve build analysis time
+$(call inherit-product-if-exists, vendor/google/products/sources_pixel.mk)
+
 TARGET_KERNEL_DIR ?= device/google/bluejay-kernel
 TARGET_BOARD_KERNEL_HEADERS := device/google/bluejay-kernel/kernel-headers
 
@@ -24,23 +27,31 @@
 $(call inherit-product-if-exists, vendor/google_devices/bluejay/proprietary/bluejay/device-vendor-bluejay.mk)
 $(call inherit-product-if-exists, vendor/google_devices/bluejay/proprietary/WallpapersBluejay.mk)
 
-GOODIX_CONFIG_BUILD_VERSION := g7_trusty
 DEVICE_PACKAGE_OVERLAYS += device/google/bluejay/bluejay/overlay
 
 include device/google/gs101/fingerprint/extension/fingerprint.extension.mk
 include device/google/bluejay-sepolicy/bluejay-sepolicy.mk
 include device/google/bluejay/audio/bluejay/audio-tables.mk
 include device/google/gs101/device-shipping-common.mk
-include device/google/gs101/fingerprint/udfps_common.mk
 include device/google/gs101/telephony/pktrouter.mk
 include hardware/google/pixel/vibrator/cs40l26/device.mk
 include device/google/gs-common/bcmbt/bluetooth.mk
 include device/google/gs-common/touch/stm/stm11.mk
 
-ifeq ($(filter factory_bluejay, $(TARGET_PRODUCT)),)
-include device/google/gs101/fingerprint/udfps_shipping.mk
+# Fingerprint HAL
+GOODIX_CONFIG_BUILD_VERSION := g7_trusty
+ifneq (,$(filter AP1%,$(RELEASE_PLATFORM_VERSION)))
+PRODUCT_SOONG_NAMESPACES += vendor/google_devices/bluejay/prebuilts/firmware/fingerprint/24Q1
+else ifneq (,$(filter AP2%,$(RELEASE_PLATFORM_VERSION)))
+PRODUCT_SOONG_NAMESPACES += vendor/google_devices/bluejay/prebuilts/firmware/fingerprint/24Q2
 else
-include device/google/gs101/fingerprint/udfps_factory.mk
+PRODUCT_SOONG_NAMESPACES += vendor/google_devices/bluejay/prebuilts/firmware/fingerprint/trunk
+endif
+$(call inherit-product-if-exists, vendor/goodix/udfps/configuration/udfps_common.mk)
+ifeq ($(filter factory%, $(TARGET_PRODUCT)),)
+$(call inherit-product-if-exists, vendor/goodix/udfps/configuration/udfps_shipping.mk)
+else
+$(call inherit-product-if-exists, vendor/goodix/udfps/configuration/udfps_factory.mk)
 endif
 
 # go/lyric-soong-variables
@@ -124,7 +135,7 @@
 
 # Increment the SVN for any official public releases
 PRODUCT_VENDOR_PROPERTIES += \
-    ro.vendor.build.svn=52
+    ro.vendor.build.svn=54
 
 # DCK properties based on target
 PRODUCT_PROPERTY_OVERRIDES += \
@@ -133,6 +144,13 @@
 
 # Trusty liboemcrypto.so
 PRODUCT_SOONG_NAMESPACES += vendor/google_devices/bluejay/prebuilts
+ifneq (,$(filter AP1%,$(RELEASE_PLATFORM_VERSION)))
+PRODUCT_SOONG_NAMESPACES += vendor/google_devices/bluejay/prebuilts/trusty/24Q1
+else ifneq (,$(filter AP2%,$(RELEASE_PLATFORM_VERSION)))
+PRODUCT_SOONG_NAMESPACES += vendor/google_devices/bluejay/prebuilts/trusty/24Q2
+else
+PRODUCT_SOONG_NAMESPACES += vendor/google_devices/bluejay/prebuilts/trusty/trunk
+endif
 
 # Display
 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.lbe.supported=1
@@ -148,13 +166,13 @@
 
 # Bluetooth Tx power caps for bluejay
 PRODUCT_COPY_FILES += \
-    $(LOCAL_PATH)/bluetooth_power_limits.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits.csv \
-    $(LOCAL_PATH)/bluetooth_power_limits_GB17L_JP.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_JP.csv \
-    $(LOCAL_PATH)/bluetooth_power_limits_GX7AS_CA.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_CA.csv \
-    $(LOCAL_PATH)/bluetooth_power_limits_GB62Z_US.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_GB62Z_US.csv \
-    $(LOCAL_PATH)/bluetooth_power_limits_GX7AS_US.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_GX7AS_US.csv \
-    $(LOCAL_PATH)/bluetooth_power_limits_G1AZG_EU.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_G1AZG_EU.csv \
-    $(LOCAL_PATH)/bluetooth_power_limits_GB62Z_EU.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_GB62Z_EU.csv
+    device/google/bluejay/bluetooth_power_limits.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits.csv \
+    device/google/bluejay/bluetooth_power_limits_GB17L_JP.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_JP.csv \
+    device/google/bluejay/bluetooth_power_limits_GX7AS_CA.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_CA.csv \
+    device/google/bluejay/bluetooth_power_limits_GB62Z_US.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_GB62Z_US.csv \
+    device/google/bluejay/bluetooth_power_limits_GX7AS_US.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_GX7AS_US.csv \
+    device/google/bluejay/bluetooth_power_limits_G1AZG_EU.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_G1AZG_EU.csv \
+    device/google/bluejay/bluetooth_power_limits_GB62Z_EU.csv:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_power_limits_GB62Z_EU.csv
 
 # Bluetooth
 PRODUCT_PRODUCT_PROPERTIES += \
diff --git a/gps.xml.b3 b/gps.xml.b3
index 6e739e7..bed707a 100644
--- a/gps.xml.b3
+++ b/gps.xml.b3
@@ -35,7 +35,7 @@
        SuplVersion="2"
        SuplMinorVersion="0"
        SuplOtdoaCapable="true"
-       SuplOtdoaCapable2="false"
+       SuplOtdoaCapable2="true"
        SuplGlonassCapable = "true"
        SuplGalileoCapable = "true"
        SuplBdsCapable = "true"
diff --git a/gps_user.xml.b3 b/gps_user.xml.b3
index 7e321e8..ca7ae02 100644
--- a/gps_user.xml.b3
+++ b/gps_user.xml.b3
@@ -34,7 +34,7 @@
        SuplVersion="2"
        SuplMinorVersion="0"
        SuplOtdoaCapable="true"
-       SuplOtdoaCapable2="false"
+       SuplOtdoaCapable2="true"
        SuplGlonassCapable = "true"
        SuplGalileoCapable = "true"
        SuplBdsCapable = "true"
diff --git a/powerhint.json b/powerhint.json
index 90063f3..6dc9ebc 100644
--- a/powerhint.json
+++ b/powerhint.json
@@ -47,6 +47,16 @@
       "ResetOnInit": true
     },
     {
+      "Name": "CPULittleClusterDownRateLimitUs",
+      "Path": "/sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/down_rate_limit_us",
+      "Values": [
+        "5000",
+        "500"
+      ],
+      "DefaultIndex": 0,
+      "ResetOnInit": true
+    },
+    {
       "Name": "CPUMidClusterMaxFreq",
       "Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq",
       "Values": [
@@ -74,6 +84,16 @@
       "ResetOnInit": true
     },
     {
+      "Name": "CPUMidClusterDownRateLimitUs",
+      "Path": "/sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/down_rate_limit_us",
+      "Values": [
+        "20000",
+        "3000"
+      ],
+      "DefaultIndex": 0,
+      "ResetOnInit": true
+    },
+    {
       "Name": "CPUBigClusterMaxFreq",
       "Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq",
       "Values": [
@@ -101,6 +121,16 @@
       "ResetOnInit": true
     },
     {
+      "Name": "CPUBigClusterDownRateLimitUs",
+      "Path": "/sys/devices/system/cpu/cpu6/cpufreq/sched_pixel/down_rate_limit_us",
+      "Values": [
+        "20000",
+        "3000"
+      ],
+      "DefaultIndex": 0,
+      "ResetOnInit": true
+    },
+    {
       "Name": "GPUMinFreq",
       "Path": "/sys/devices/platform/1c500000.mali/hint_min_freq",
       "Values": [
@@ -135,12 +165,23 @@
       "Path": "/proc/vendor_sched/dvfs_headroom",
       "Values": [
         "1280",
+        "1100",
         "1100 1078 1024"
       ],
       "DefaultIndex": 0,
       "ResetOnInit": true
     },
     {
+      "Name": "CPUTaperedDVFSHeadroomEnable",
+      "Path": "/proc/vendor_sched/tapered_dvfs_headroom_enable",
+      "Values": [
+        "0",
+        "1"
+      ],
+      "DefaultIndex": 0,
+      "ResetOnInit": true
+    },
+    {
       "Name": "MIFTargetLoad",
       "Path": "/sys/class/devfreq/17000010.devfreq_mif/interactive/target_load",
       "Values": [
@@ -151,7 +192,7 @@
     },
     {
       "Name": "TAUClampBoost",
-      "Path": "/proc/vendor_sched/ta_uclamp_min",
+      "Path": "/proc/vendor_sched/groups/ta/uclamp_min",
       "Values": [
         "692",
         "1"
@@ -160,7 +201,7 @@
     },
     {
       "Name": "FGUClampBoost",
-      "Path": "/proc/vendor_sched/fg_uclamp_min",
+      "Path": "/proc/vendor_sched/groups/fg/uclamp_min",
       "Values": [
         "202",
         "0"
@@ -169,7 +210,7 @@
     },
     {
       "Name": "MLUclampBoost",
-      "Path": "/proc/vendor_sched/nnapi_uclamp_min",
+      "Path": "/proc/vendor_sched/groups/nnapi/uclamp_min",
       "Values": [
           "225",
           "640"
@@ -188,7 +229,7 @@
     },
     {
       "Name": "CDPreferIdle",
-      "Path": "/proc/vendor_sched/cam_prefer_idle",
+      "Path": "/proc/vendor_sched/groups/cam/prefer_idle",
       "Values": [
         "0",
         "1"
@@ -237,7 +278,7 @@
     },
     {
       "Name": "TAPreferHighCap",
-      "Path": "/proc/vendor_sched/ta_prefer_high_cap",
+      "Path": "/proc/vendor_sched/groups/ta/prefer_high_cap",
       "Values": [
         "1",
         "0"
@@ -246,7 +287,7 @@
     },
     {
       "Name": "TAPreferIdle",
-      "Path": "/proc/vendor_sched/ta_prefer_idle",
+      "Path": "/proc/vendor_sched/groups/ta/prefer_idle",
       "Values": [
         "0",
         "1"
@@ -255,7 +296,7 @@
     },
     {
       "Name": "FGPreferIdle",
-      "Path": "/proc/vendor_sched/fg_prefer_idle",
+      "Path": "/proc/vendor_sched/groups/fg/prefer_idle",
       "Values": [
         "1",
         "0"
@@ -265,7 +306,7 @@
     },
     {
       "Name": "CDPreferHighCap",
-      "Path": "/proc/vendor_sched/cam_prefer_high_cap",
+      "Path": "/proc/vendor_sched/groups/cam/prefer_high_cap",
       "Values": [
         "1",
         "0"
@@ -501,7 +542,7 @@
     },
     {
       "Name": "Dex2oatGroup",
-      "Path": "/proc/vendor_sched/dex2oat_ug",
+      "Path": "/proc/vendor_sched/groups/dex2oat/ug",
       "Values": [
         "1",
         "0"
@@ -549,6 +590,36 @@
     },
     {
       "PowerHint": "LAUNCH",
+      "Node": "CPUDVFSHeadroom",
+      "Duration": 5000,
+      "Value": "1280"
+    },
+    {
+      "PowerHint": "LAUNCH",
+      "Node": "CPUTaperedDVFSHeadroomEnable",
+      "Duration": 5000,
+      "Value": "0"
+    },
+    {
+      "PowerHint": "LAUNCH",
+      "Node": "CPULittleClusterDownRateLimitUs",
+      "Duration": 5000,
+      "Value": "5000"
+    },
+    {
+      "PowerHint": "LAUNCH",
+      "Node": "CPUMidClusterDownRateLimitUs",
+      "Duration": 5000,
+      "Value": "20000"
+    },
+    {
+      "PowerHint": "LAUNCH",
+      "Node": "CPUBigClusterDownRateLimitUs",
+      "Duration": 5000,
+      "Value": "20000"
+    },
+    {
+      "PowerHint": "LAUNCH",
       "Node": "CPUBigClusterMaxFreq",
       "Duration": 5000,
       "Value": "9999999"
@@ -619,6 +690,66 @@
       "Value": "9999999"
     },
     {
+      "PowerHint": "DISPLAY_CHANGE",
+      "Node": "ReducePreferIdle",
+      "Duration": 5000,
+      "Value": "0"
+    },
+    {
+      "PowerHint": "DISPLAY_CHANGE",
+      "Node": "FGPreferIdle",
+      "Duration": 5000,
+      "Value": "1"
+    },
+    {
+      "PowerHint": "DISPLAY_CHANGE",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 5000,
+      "Value": "9999999"
+    },
+    {
+      "PowerHint": "DISPLAY_CHANGE",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 5000,
+      "Value": "9999999"
+    },
+    {
+      "PowerHint": "DISPLAY_CHANGE",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 5000,
+      "Value": "9999999"
+    },
+    {
+      "PowerHint": "DISPLAY_CHANGE",
+      "Node": "TAUClampBoost",
+      "Duration": 5000,
+      "Value": "692"
+    },
+    {
+      "PowerHint": "DISPLAY_CHANGE",
+      "Node": "FGUClampBoost",
+      "Duration": 5000,
+      "Value": "202"
+    },
+    {
+      "PowerHint": "DISPLAY_CHANGE",
+      "Node": "MemFreq",
+      "Duration": 5000,
+      "Value": "3172000"
+    },
+    {
+      "PowerHint": "DISPLAY_CHANGE",
+      "Node": "GPUPowerPolicy",
+      "Duration": 5000,
+      "Value": "always_on"
+    },
+    {
+      "PowerHint": "DISPLAY_CHANGE",
+      "Node": "NPITaskPacking",
+      "Duration": 5000,
+      "Value": "0"
+    },
+    {
       "PowerHint": "CPU_LOAD_RESET",
       "Node": "MemFreq",
       "Duration": 33,
@@ -1478,6 +1609,36 @@
       "Value": "400000"
     },
     {
+      "PowerHint": "GAME",
+      "Node": "CPUDVFSHeadroom",
+      "Duration": 0,
+      "Value": "1100"
+    },
+    {
+      "PowerHint": "GAME",
+      "Node": "CPUTaperedDVFSHeadroomEnable",
+      "Duration": 0,
+      "Value": "1"
+    },
+    {
+      "PowerHint": "GAME",
+      "Node": "CPULittleClusterDownRateLimitUs",
+      "Duration": 0,
+      "Value": "500"
+    },
+    {
+      "PowerHint": "GAME",
+      "Node": "CPUMidClusterDownRateLimitUs",
+      "Duration": 0,
+      "Value": "3000"
+    },
+    {
+      "PowerHint": "GAME",
+      "Node": "CPUBigClusterDownRateLimitUs",
+      "Duration": 0,
+      "Value": "3000"
+    },
+    {
       "PowerHint": "THERMAL_VIRTUAL-SKIN-HINT_LIGHT",
       "Node": "PMU_POLL",
       "Duration": 0,
diff --git a/thermal_info_config_bluejay.json b/thermal_info_config_bluejay.json
index 6d90a20..a8a1166 100644
--- a/thermal_info_config_bluejay.json
+++ b/thermal_info_config_bluejay.json
@@ -261,8 +261,8 @@
             "VirtualSensor":true,
             "TriggerSensor":"neutral_therm",
             "Formula":"MAXIMUM",
-            "Combination":["VIRTUAL-NEUTRAL-SKIN2", "VIRTUAL-NEUTRAL", "VIRTUAL-QUIET-NEUTRAL"],
-            "Coefficient":["1.0", "1.0", "1.0"],
+            "Combination":["VIRTUAL-SKIN"],
+            "Coefficient":["1.0"],
             "HotThreshold":["NAN", 37.0, 43.0, 45.0, 47.0, 52.0, 55.0],
             "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9],
             "Multiplier":0.001,
@@ -277,8 +277,8 @@
             "VirtualSensor":true,
             "TriggerSensor":"neutral_therm",
             "Formula":"MAXIMUM",
-            "Combination":["VIRTUAL-NEUTRAL-SKIN2", "VIRTUAL-NEUTRAL", "VIRTUAL-QUIET-NEUTRAL"],
-            "Coefficient":["1.0", "1.0", "1.0"],
+            "Combination":["VIRTUAL-SKIN"],
+            "Coefficient":["1.0"],
             "HotThreshold":["NAN", 37.0, 39.0, 41.0, 46.5, 52.0, 140.0],
             "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9],
             "Multiplier":0.001,
@@ -333,8 +333,8 @@
             "VirtualSensor":true,
             "TriggerSensor":"neutral_therm",
             "Formula":"MAXIMUM",
-            "Combination":["VIRTUAL-NEUTRAL-SKIN2", "VIRTUAL-NEUTRAL", "VIRTUAL-QUIET-NEUTRAL"],
-            "Coefficient":["1.0", "1.0", "1.0"],
+            "Combination":["VIRTUAL-SKIN"],
+            "Coefficient":["1.0"],
             "HotThreshold":["NAN", 37.0, 43.0, 45.0, 46.5, 52.0, 140.0],
             "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9],
             "Multiplier":0.001,
@@ -397,16 +397,8 @@
             "VirtualSensor":true,
             "TriggerSensor":"neutral_therm",
             "Formula":"MAXIMUM",
-            "Combination":[
-                "VIRTUAL-NEUTRAL-SKIN2",
-                "VIRTUAL-NEUTRAL",
-                "VIRTUAL-QUIET-NEUTRAL"
-            ],
-            "Coefficient":[
-                "1.0",
-                "1.0",
-                "1.0"
-            ],
+            "Combination":["VIRTUAL-SKIN"],
+            "Coefficient":["1.0"],
             "HotThreshold":[
                 "NAN",
                 "39.0",
@@ -447,16 +439,8 @@
             "VirtualSensor":true,
             "TriggerSensor":"neutral_therm",
             "Formula":"MAXIMUM",
-            "Combination":[
-                "VIRTUAL-NEUTRAL-SKIN2",
-                "VIRTUAL-NEUTRAL",
-                "VIRTUAL-QUIET-NEUTRAL"
-            ],
-            "Coefficient":[
-                "1.0",
-                "1.0",
-                "1.0"
-            ],
+            "Combination":["VIRTUAL-SKIN"],
+            "Coefficient":["1.0"],
             "HotThreshold":[
                 "NAN",
                 "NAN",
@@ -1210,4 +1194,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}