Merge RQ2A.210305.007

Bug: 180401296
Merged-In: I842b086c42c94450a7b9f903fcb163430f0826eb
Change-Id: Id59c0b97234edeb2c1bdb80b0a4f9cbec1248673
diff --git a/audio/sound_trigger_mixer_paths.xml b/audio/sound_trigger_mixer_paths.xml
index c717802..94a9eb6 100644
--- a/audio/sound_trigger_mixer_paths.xml
+++ b/audio/sound_trigger_mixer_paths.xml
@@ -91,9 +91,9 @@
     <ctl name="EC Reference SampleRate" value="0"/>
     <ctl name="PRI_TDM_TX_0 LSM Function" value="None" />
     <ctl name="PRI_TDM_TX_0 Channels" value="One" />
-    <ctl name="Sto1 ADC MIXL DMIC Switch" value="0" />
-    <ctl name="Sto2 ADC MIXL DMIC Switch" value="0" />
-    <ctl name="Sto2 ADC MIXR DMIC Switch" value="0" />
+    <ctl name="Sto1 ADC MIXL BargeIn DMIC Switch" value="0" />
+    <ctl name="Sto2 ADC MIXL BargeIn DMIC Switch" value="0" />
+    <ctl name="Sto2 ADC MIXR BargeIn DMIC Switch" value="0" />
     <ctl name="PRI TDM TX Channel Offset" id="0" value="0" />
     <ctl name="PRI TDM TX Channel Offset" id="1" value="8" />
     <ctl name="PRI TDM TX Channel Offset" id="2" value="12" />
@@ -262,7 +262,7 @@
         <ctl name="ADC1 Capture Volume" value="23" />
         <ctl name="ADC2 Capture Volume" value="23" />
         <ctl name="PRI_TDM_TX_0 Channels" value="One" />
-        <ctl name="Sto1 ADC MIXL DMIC Switch" value="1" />
+        <ctl name="Sto1 ADC MIXL BargeIn DMIC Switch" value="1" />
     </path>
 
     <path name="listen-ape-handset-dmic">
@@ -271,8 +271,8 @@
         <ctl name="PRI TDM TX Channel Offset" id="0" value="0"/>
         <ctl name="PRI TDM TX Channel Offset" id="1" value="12"/>
         <ctl name="PRI_TDM_TX_0 Channels" value="Two"/>
-        <ctl name="Sto1 ADC MIXL DMIC Switch" value="1" />
-        <ctl name="Sto2 ADC MIXR DMIC Switch" value="1" />
+        <ctl name="Sto1 ADC MIXL BargeIn DMIC Switch" value="1" />
+        <ctl name="Sto2 ADC MIXR BargeIn DMIC Switch" value="1" />
     </path>
 
     <path name="listen-ape-handset-tmic">
diff --git a/device-redfin.mk b/device-redfin.mk
index 6d72b97..de95157 100644
--- a/device-redfin.mk
+++ b/device-redfin.mk
@@ -18,15 +18,15 @@
 
 ifeq ($(TARGET_PREBUILT_KERNEL),)
     ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
-        LOCAL_KERNEL := device/google/redfin-kernel/Image.lz4
+        LOCAL_KERNEL := device/google/redbull-kernel/Image.lz4
     else
-        LOCAL_KERNEL := device/google/redfin-kernel/vintf/Image.lz4
+        LOCAL_KERNEL := device/google/redbull-kernel/vintf/Image.lz4
     endif
 else
     LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
 endif
 
-PRODUCT_VENDOR_KERNEL_HEADERS := device/google/redfin-kernel/sm7250/kernel-headers
+PRODUCT_VENDOR_KERNEL_HEADERS := device/google/redbull-kernel/sm7250/kernel-headers
 
 include build/make/target/product/iorap_large_memory_config.mk
 include device/google/redbull/device-common.mk
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 85aa453..598f2eb 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -454,6 +454,13 @@
                  touch_spi_path, touch_spi_path);
         RunCommandToFd(fd, "Self Raw Cap", {"/vendor/bin/sh", "-c", cmd});
 
+        //TYPE_OFFSET_DATA_SEC
+        snprintf(cmd, sizeof(cmd),
+                 "echo %s > %s/cmd && cat %s/cmd_result",
+                 "run_rawdata_read_type,19",
+                 touch_spi_path, touch_spi_path);
+        RunCommandToFd(fd, "TYPE_OFFSET_DATA_SEC", {"/vendor/bin/sh", "-c", cmd});
+
         //TYPE_AMBIENT_DATA
         snprintf(cmd, sizeof(cmd),
                  "echo %s > %s/cmd && cat %s/cmd_result",
@@ -697,6 +704,9 @@
     DumpFileToFd(fd, "TTF details", "/sys/class/power_supply/battery/ttf_details");
     DumpFileToFd(fd, "TTF stats", "/sys/class/power_supply/battery/ttf_stats");
     DumpFileToFd(fd, "ipc-local-ports", "/d/msm_ipc_router/dump_local_ports");
+    RunCommandToFd(fd, "TRICKLE-DEFEND Config", {"/vendor/bin/sh", "-c", " cd /sys/devices/platform/soc/soc:google,battery/power_supply/battery/; echo \"bd_trickle_enable: `cat bd_trickle_enable`\"; echo \"bd_trickle_cnt: `cat bd_trickle_cnt`\";  echo \"bd_trickle_recharge_soc: `cat bd_trickle_recharge_soc`\";  echo \"bd_trickle_dry_run: `cat bd_trickle_dry_run`\";  echo \"bd_trickle_reset_sec: `cat bd_trickle_reset_sec`\""});
+    RunCommandToFd(fd, "DWELL-DEFEND Config", {"/vendor/bin/sh", "-c", " cd /sys/devices/platform/soc/soc:google,charger/; for f in `ls charge_s*` ; do echo \"$f: `cat $f`\" ; done"});
+    RunCommandToFd(fd, "TEMP-DEFEND Config", {"/vendor/bin/sh", "-c", " cd /sys/devices/platform/soc/soc:google,charger/; for f in `ls bd_*` ; do echo \"$f: `cat $f`\" ; done"});
     RunCommandToFd(fd, "USB Device Descriptors", {"/vendor/bin/sh", "-c", "cd /sys/bus/usb/devices/1-1 && cat product && cat bcdDevice; cat descriptors | od -t x1 -w16 -N96"});
     RunCommandToFd(fd, "Power supply properties", {"/vendor/bin/sh", "-c", "for f in `ls /sys/class/power_supply/*/uevent` ; do echo \"------ $f\\n`cat $f`\\n\" ; done"});
     RunCommandToFd(fd, "PMIC Votables", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/pmic-votable/*/status"});
diff --git a/gnss_antenna_info.conf b/gnss_antenna_info.conf
index 2b5ba03..79a2aef 100644
--- a/gnss_antenna_info.conf
+++ b/gnss_antenna_info.conf
@@ -71,6 +71,14 @@
 # SIGNAL_GAIN_CORRECTION_UNC
 #   2D vectors of 1-sigma uncertainty in dBi associated with the signal
 #   gain correction values.
+#
+# The number of rows and columns could be the same for PC variation correction
+# and signal gain corrections, or could be different
+# If the former then NUMBER_OF_ROWS_ and NUMBER_OF_COLUMNS_ are specified once
+# only, if the latter then NUMBER_OF_ROWS_ and NUMBER_OF_COLUMNS_ represent
+# the number of rows/columns for PC variation correction and
+# NUMBER_OF_ROWS_SGC_ and NUMBER_OF_COLUMNS_SGC_ represent the number of
+# rows/columns for signal gain corrections
 
 ANTENNA_INFO_VECTOR_SIZE = 2
 
@@ -104,6 +112,8 @@
 
 NUMBER_OF_ROWS_1 = 4
 NUMBER_OF_COLUMNS_1 = 2
+NUMBER_OF_ROWS_SGC_1 = 3
+NUMBER_OF_COLUMNS_SGC_1 = 4
 
 PC_VARIATION_CORRECTION_1_ROW_0 = 55.66 77.88
 PC_VARIATION_CORRECTION_1_ROW_1 = 11.22 33.44
@@ -115,12 +125,10 @@
 PC_VARIATION_CORRECTION_UNC_1_ROW_2 = 2.1 2.2
 PC_VARIATION_CORRECTION_UNC_1_ROW_3 = 0.1 0.2
 
-SIGNAL_GAIN_CORRECTION_1_ROW_0 = 7.6 6.5
-SIGNAL_GAIN_CORRECTION_1_ROW_1 = 5.4 4.3
-SIGNAL_GAIN_CORRECTION_1_ROW_2 = 1.3 2.4
-SIGNAL_GAIN_CORRECTION_1_ROW_3 = 9.8 8.7
+SIGNAL_GAIN_CORRECTION_1_ROW_0 = 7.6 6.5 5.4 4.3
+SIGNAL_GAIN_CORRECTION_1_ROW_1 = 1.3 2.4 9.8 8.7
+SIGNAL_GAIN_CORRECTION_1_ROW_2 = 1.4 2.5 3.6 4.7
 
-SIGNAL_GAIN_CORRECTION_UNC_1_ROW_0 = 0.91 0.92
-SIGNAL_GAIN_CORRECTION_UNC_1_ROW_1 = 0.55 0.66
-SIGNAL_GAIN_CORRECTION_UNC_1_ROW_2 = 0.11 0.22
-SIGNAL_GAIN_CORRECTION_UNC_1_ROW_3 = 0.93 0.94
+SIGNAL_GAIN_CORRECTION_UNC_1_ROW_0 = 0.91 0.92 0.55 0.66
+SIGNAL_GAIN_CORRECTION_UNC_1_ROW_1 = 0.11 0.22 0.93 0.94
+SIGNAL_GAIN_CORRECTION_UNC_1_ROW_2 = 0.95 0.96 0.33 0.44
diff --git a/redfin/init.redfin.rc b/redfin/init.redfin.rc
index e786c18..5d05dce 100644
--- a/redfin/init.redfin.rc
+++ b/redfin/init.redfin.rc
@@ -55,6 +55,8 @@
     setprop persist.vendor.touch_sensitivity_mode 1
 
 on late-init
+    chown system system /sys/devices/virtual/thermal/tz-by-name/skin-therm-monitor/trip_point_0_temp
+    chown system system /sys/devices/virtual/thermal/tz-by-name/skin-therm-monitor/trip_point_0_hyst
     chown system system /sys/devices/virtual/thermal/tz-by-name/panel-audio-therm/trip_point_0_temp
     chown system system /sys/devices/virtual/thermal/tz-by-name/panel-audio-therm/trip_point_0_hyst
     chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-virt-monitor/trip_point_0_temp
diff --git a/redfin/overlay/frameworks/base/core/res/res/values/config.xml b/redfin/overlay/frameworks/base/core/res/res/values/config.xml
index 23cee03..bad2fae 100755
--- a/redfin/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/redfin/overlay/frameworks/base/core/res/res/values/config.xml
@@ -234,4 +234,12 @@
 
     <!-- default refresh rate in the zone defined by birghtness and ambient thresholds -->
     <integer name="config_defaultRefreshRateInZone">90</integer>
+
+    <!-- List of biometric sensors on the device, in decreasing strength. Consumed by AuthService
+     when registering authenticators with BiometricService. Format must be ID:Modality:Strength,
+     where: IDs are unique per device, Modality as defined in BiometricAuthenticator.java,
+     and Strength as defined in Authenticators.java -->
+    <string-array name="config_biometric_sensors" translatable="false" >
+        <item>0:2:15</item> <!-- ID0:Fingerprint:Strong -->
+    </string-array>
 </resources>
diff --git a/self-extractors/extract-lists.txt b/self-extractors/extract-lists.txt
index 5bcef9e..a08a5b2 100644
--- a/self-extractors/extract-lists.txt
+++ b/self-extractors/extract-lists.txt
@@ -10,6 +10,8 @@
             system_ext/etc/permissions/com.qualcomm.qcrilmsgtunnel.xml \
             system_ext/etc/permissions/org_codeaurora_ims.xml \
             system_ext/etc/permissions/qcrilhook.xml \
+            system_ext/etc/permissions/qti_telephony_hidl_wrapper.xml \
+            system_ext/etc/permissions/qti_telephony_utils.xml \
             system_ext/etc/permissions/telephonyservice.xml \
             system_ext/framework/com.qualcomm.qti.imscmservice-V2.0-java.jar \
             system_ext/framework/com.qualcomm.qti.imscmservice-V2.1-java.jar \
diff --git a/self-extractors/qcom/staging/device-partial.mk b/self-extractors/qcom/staging/device-partial.mk
index 7c0806d..4d0b147 100644
--- a/self-extractors/qcom/staging/device-partial.mk
+++ b/self-extractors/qcom/staging/device-partial.mk
@@ -37,6 +37,8 @@
      vendor/qcom/redfin/proprietary/com.qualcomm.qcrilmsgtunnel.xml:system_ext/etc/permissions/com.qualcomm.qcrilmsgtunnel.xml \
      vendor/qcom/redfin/proprietary/org_codeaurora_ims.xml:system_ext/etc/permissions/org_codeaurora_ims.xml \
      vendor/qcom/redfin/proprietary/qcrilhook.xml:system_ext/etc/permissions/qcrilhook.xml \
+     vendor/qcom/redfin/proprietary/qti_telephony_hidl_wrapper.xml:system_ext/etc/permissions/qti_telephony_hidl_wrapper.xml \
+     vendor/qcom/redfin/proprietary/qti_telephony_utils.xml:system_ext/etc/permissions/qti_telephony_utils.xml \
      vendor/qcom/redfin/proprietary/telephonyservice.xml:system_ext/etc/permissions/telephonyservice.xml \
      vendor/qcom/redfin/proprietary/com.qualcomm.qti.imscmservice-V2.0-java.jar:system_ext/framework/com.qualcomm.qti.imscmservice-V2.0-java.jar \
      vendor/qcom/redfin/proprietary/com.qualcomm.qti.imscmservice-V2.1-java.jar:system_ext/framework/com.qualcomm.qti.imscmservice-V2.1-java.jar \