Merge "gps: nstandby path depend on platform"
diff --git a/thermal/dump_thermal.sh b/thermal/dump_thermal.sh
index 2b87da9..748753c 100644
--- a/thermal/dump_thermal.sh
+++ b/thermal/dump_thermal.sh
@@ -44,3 +44,5 @@
cat /sys/module/gs_thermal/parameters/tmu_sub_reg_dump_rise_thres
echo "TMU_SUB fall thresholds:"
cat /sys/module/gs_thermal/parameters/tmu_sub_reg_dump_fall_thres
+echo "Temperature Residency Metrics:"
+cat /sys/kernel/metrics/temp_residency/temp_residency_all/stats
diff --git a/thermal/sepolicy/device.te b/thermal/sepolicy/device.te
new file mode 100644
index 0000000..63640e3
--- /dev/null
+++ b/thermal/sepolicy/device.te
@@ -0,0 +1,2 @@
+#vendor-metrics
+type sysfs_vendor_metrics, fs_type, sysfs_type;
diff --git a/thermal/sepolicy/dump_thermal.te b/thermal/sepolicy/dump_thermal.te
index 2dd6ba4..930b4dd 100644
--- a/thermal/sepolicy/dump_thermal.te
+++ b/thermal/sepolicy/dump_thermal.te
@@ -4,3 +4,7 @@
allow dump_thermal sysfs_thermal:file r_file_perms;
allow dump_thermal sysfs_thermal:lnk_file r_file_perms;
allow dump_thermal vendor_toolbox_exec:file execute_no_trans;
+
+#vendor-metrics
+r_dir_file(dump_thermal, sysfs_vendor_metrics)
+allow dump_thermal sysfs_vendor_metrics:lnk_file r_file_perms;
diff --git a/thermal/sepolicy/genfs_contexts b/thermal/sepolicy/genfs_contexts
index 1422e63..5cecbd3 100644
--- a/thermal/sepolicy/genfs_contexts
+++ b/thermal/sepolicy/genfs_contexts
@@ -1,3 +1,5 @@
# thermal sysfs files
genfscon sysfs /module/gs_thermal/parameters u:object_r:sysfs_thermal:s0
+#vendor-metrics
+genfscon sysfs /kernel/metrics/temp_residency/temp_residency_all/stats u:object_r:sysfs_vendor_metrics:s0
diff --git a/touch/gti/Android.bp b/touch/gti/Android.bp
new file mode 100644
index 0000000..b997aec
--- /dev/null
+++ b/touch/gti/Android.bp
@@ -0,0 +1,10 @@
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+sh_binary {
+ name: "dump_gti.sh",
+ src: "dump_gti.sh",
+ vendor: true,
+ sub_dir: "dump",
+}
diff --git a/touch/gti/dump_gti.sh b/touch/gti/dump_gti.sh
new file mode 100644
index 0000000..573962d
--- /dev/null
+++ b/touch/gti/dump_gti.sh
@@ -0,0 +1,32 @@
+#!/vendor/bin/sh
+path="/sys/devices/virtual/goog_touch_interface/gti.0"
+
+echo "------ Force Touch Active ------"
+echo 1 > $path/force_active
+
+echo "------ Touch Firmware Version ------"
+cat $path/fw_ver
+
+echo "------ Get Mutual Sensing Data - Baseline ------"
+cat $path/ms_base
+
+echo "------ Get Mutual Sensing Data - Delta ------"
+cat $path/ms_diff
+
+echo "------ Get Mutual Sensing Data - Raw ------"
+cat $path/ms_raw
+
+echo "------ Get Self Sensing Data - Baseline ------"
+cat $path/ss_base
+
+echo "------ Get Self Sensing Data - Delta ------"
+cat $path/ss_diff
+
+echo "------ Get Self Sensing Data - Raw ------"
+cat $path/ss_raw
+
+echo "------ Self Test ------"
+cat $path/self_test
+
+echo "------ Disable Force Touch Active ------"
+echo 0 > $path/force_active
diff --git a/touch/gti/gti.mk b/touch/gti/gti.mk
new file mode 100644
index 0000000..e2e42bd
--- /dev/null
+++ b/touch/gti/gti.mk
@@ -0,0 +1,3 @@
+BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/sepolicy
+
+PRODUCT_PACKAGES += dump_gti.sh
diff --git a/touch/gti/sepolicy/dump_gti.te b/touch/gti/sepolicy/dump_gti.te
new file mode 100644
index 0000000..af99a07
--- /dev/null
+++ b/touch/gti/sepolicy/dump_gti.te
@@ -0,0 +1,6 @@
+pixel_bugreport(dump_gti)
+
+allow dump_gti sysfs_touch:dir r_dir_perms;
+allow dump_gti sysfs_touch:file rw_file_perms;
+allow dump_gti vendor_toolbox_exec:file execute_no_trans;
+
diff --git a/touch/gti/sepolicy/file_contexts b/touch/gti/sepolicy/file_contexts
new file mode 100644
index 0000000..cbddadf
--- /dev/null
+++ b/touch/gti/sepolicy/file_contexts
@@ -0,0 +1,2 @@
+/vendor/bin/dump/dump_gti\.sh u:object_r:dump_gti_exec:s0
+