Snap for 7048988 from 2c1452d84e902fb31b685a3f5020fb36059eec7f to rvc-qpr2-release

Change-Id: Ica293f3a2661d72e5d03e254e0be48c3270a6efa
diff --git a/bramble/init.bramble.rc b/bramble/init.bramble.rc
index e6b5830..641f428 100644
--- a/bramble/init.bramble.rc
+++ b/bramble/init.bramble.rc
@@ -39,6 +39,8 @@
     class core
     group system wakelock
 
-# Override thermal HAL config for B5M
-on property:ro.boot.hardware.majorid=0x0F
-    setprop vendor.thermal.config thermal_info_config_m.json
+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/usbc-therm-monitor/trip_point_0_temp
+    chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/trip_point_0_hyst
diff --git a/device-bramble.mk b/device-bramble.mk
index cf1d8ce..f7f248c 100644
--- a/device-bramble.mk
+++ b/device-bramble.mk
@@ -153,7 +153,6 @@
 # Thermal HAL config
 PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/thermal_info_config_$(PRODUCT_HARDWARE).json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json \
-    $(LOCAL_PATH)/thermal_info_config_$(PRODUCT_HARDWARE)_m.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_m.json
 
 # Support to disable thermal protection at run time
 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 3d27a46..e355c36 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -685,7 +685,7 @@
     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`\";"});
+    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"});
diff --git a/thermal_info_config_bramble_m.json b/thermal_info_config_bramble_m.json
deleted file mode 100644
index ae7e2da..0000000
--- a/thermal_info_config_bramble_m.json
+++ /dev/null
@@ -1,297 +0,0 @@
-{
-    "Sensors":[
-        {
-            "Name":"cpu-0-0-usr",
-            "Type":"CPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"cpu-0-1-usr",
-            "Type":"CPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"cpu-0-2-usr",
-            "Type":"CPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"cpu-0-3-usr",
-            "Type":"CPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"cpu-0-4-usr",
-            "Type":"CPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"cpu-0-5-usr",
-            "Type":"CPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"cpu-1-0-usr",
-            "Type":"CPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"cpu-1-1-usr",
-            "Type":"CPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"cpu-1-2-usr",
-            "Type":"CPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"cpu-1-3-usr",
-            "Type":"CPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"gpuss-0-usr",
-            "Type":"GPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"gpuss-1-usr",
-            "Type":"GPU",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                95.0,
-                "NAN",
-                "NAN",
-                125.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"battery",
-            "Type":"BATTERY",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                "NAN",
-                "NAN",
-                "NAN",
-                60.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001
-        },
-        {
-            "Name":"skin-therm-monitor",
-            "Type":"SKIN",
-            "HotThreshold":[
-                "NAN",
-                37.0,
-                41.0,
-                43.0,
-                45.0,
-                49.0,
-                53.0
-            ],
-            "HotHysteresis":[
-                0.0,
-                1.9,
-                1.9,
-                1.9,
-                1.9,
-                1.9,
-                1.9
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001,
-            "Monitor":true,
-            "SendPowerHint":true
-        },
-        {
-            "Name":"cellular-emergency",
-            "Type":"POWER_AMPLIFIER",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                "NAN",
-                "NAN",
-                "51.0",
-                "NAN"
-            ],
-            "HotHysteresis":[
-                0.0,
-                0.0,
-                0.0,
-                0.0,
-                0.0,
-                1.9,
-                0.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001,
-            "Monitor":true
-        },
-        {
-            "Name":"usbc-therm-monitor",
-            "Type":"USB_PORT",
-            "HotThreshold":[
-                "NAN",
-                "NAN",
-                "NAN",
-                "NAN",
-                "NAN",
-                "70.0",
-                "NAN"
-            ],
-            "HotHysteresis":[
-                0.0,
-                0.0,
-                0.0,
-                0.0,
-                0.0,
-                5.0,
-                0.0
-            ],
-            "VrThreshold":"NAN",
-            "Multiplier":0.001,
-            "Monitor":true
-        }
-    ],
-    "CoolingDevices":[
-        {
-            "Name":"thermal-cpufreq-0",
-            "Type":"CPU"
-        },
-        {
-            "Name":"thermal-cpufreq-6",
-            "Type":"CPU"
-        },
-        {
-            "Name":"thermal-cpufreq-7",
-            "Type":"CPU"
-        },
-        {
-            "Name":"thermal-devfreq-0",
-            "Type":"GPU"
-        },
-        {
-            "Name":"fcc",
-            "Type":"BATTERY"
-        }
-    ]
-}