Merge changes from topic "touch_dumpstate_priority-24D1-dev" into 24D1-dev

* changes:
  dumpstate: touch: Add touch_predump for syna
  dumpstate: touch: Add touch_predump for gti
  dumpstate: touch: Init touch_predump service
This commit is contained in:
Ravi Jain 2024-04-19 05:47:46 +00:00 committed by Android (Google) Code Review
commit 3defa6f8ea
27 changed files with 197 additions and 0 deletions

View File

@ -33,3 +33,19 @@ cc_binary {
],
vendor: true,
}
sh_binary {
name: "predump_gti0.sh",
src: "dump_gti0.sh",
init_rc: ["init.touch.gti0.rc"],
vendor: true,
sub_dir: "dump_touch",
}
sh_binary {
name: "predump_gti1.sh",
src: "dump_gti1.sh",
init_rc: ["init.touch.gti1.rc"],
vendor: true,
sub_dir: "dump_touch",
}

7
touch/gti/predump_gti.mk Normal file
View File

@ -0,0 +1,7 @@
include device/google/gs-common/touch/predump/predump_touch.mk
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/predump_sepolicy
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/ical/sepolicy
PRODUCT_PACKAGES += predump_gti0.sh
PRODUCT_PACKAGES += touch_gti_ical

View File

@ -0,0 +1,6 @@
include device/google/gs-common/touch/gti/predump_gti.mk
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/predump_sepolicy_gti_dual
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/ical/sepolicy_gti_dual
PRODUCT_PACKAGES += predump_gti1.sh

View File

@ -0,0 +1,3 @@
type proc_touch_gti, proc_type, fs_type;
type sysfs_touch_gti, sysfs_type, fs_type;

View File

@ -0,0 +1 @@
/vendor/bin/dump_touch/predump_gti0\.sh u:object_r:predump_touch_exec:s0

View File

@ -0,0 +1,4 @@
# Touch
genfscon sysfs /devices/virtual/goog_touch_interface u:object_r:sysfs_touch_gti:s0
genfscon proc /goog_touch_interface u:object_r:proc_touch_gti:s0

View File

@ -0,0 +1,4 @@
allow predump_touch proc_touch_gti:dir r_dir_perms;
allow predump_touch proc_touch_gti:file rw_file_perms;
allow predump_touch sysfs_touch_gti:dir r_dir_perms;
allow predump_touch sysfs_touch_gti:file rw_file_perms;

View File

@ -0,0 +1,2 @@
/vendor/bin/dump_touch/predump_gti1\.sh u:object_r:predump_touch_exec:s0

17
touch/predump/Android.bp Normal file
View File

@ -0,0 +1,17 @@
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
sh_binary {
name: "predump_touch.sh",
src: "predump_touch.sh",
init_rc: ["init.touch.predump.rc"],
vendor: true,
}
sh_binary {
name: "dump_touch.sh",
src: "dump_touch.sh",
vendor: true,
sub_dir: "dump",
}

View File

@ -0,0 +1,25 @@
#!/vendor/bin/sh
DIR=/data/vendor/dump_touch
LOCKFILE="$DIR"/dumping
LOGFILE="$DIR"/dump.log
if [ ! -f $LOCKFILE ]
then
echo "-----------------------------------------------------"
echo "Error : PreDump Touch Logs couldn't be found."
echo "-----------------------------------------------------"
exit 2
fi
state=$(cat $LOCKFILE)
if [ "$state" != 2 ]
then
echo "Unexpected state! Expected 2 but found ${state}" >> $LOGFILE
fi
cat $LOGFILE
echo "" > $LOGFILE
echo 0 > $LOCKFILE

View File

@ -0,0 +1,12 @@
service vendor.touch_dumpstate /vendor/bin/predump_touch.sh
class main
user system
group system shell
disabled
oneshot
on post-fs-data
mkdir /data/vendor/dump_touch 0775 system system
on property:init.svc.dumpstatez=running
start vendor.touch_dumpstate

View File

@ -0,0 +1,4 @@
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/predump/sepolicy
PRODUCT_PACKAGES += predump_touch.sh
PRODUCT_PACKAGES += dump_touch.sh

View File

@ -0,0 +1,44 @@
#!/vendor/bin/sh
DIR=/data/vendor/dump_touch
SCRIPT_DIR=/vendor/bin/dump_touch
LOCKFILE="$DIR"/dumping
LOGFILE="$DIR"/dump.log
if [ ! -f $LOCKFILE ]
then
#Init Setup
echo 0 > $LOCKFILE
echo "" > $LOGFILE
chmod 660 $LOCKFILE
chmod 660 $LOGFILE
fi
echo $(date) >> $LOGFILE
state=$(cat $LOCKFILE)
if [ "$state" != 0 ]
then
echo "Unexpected state! Expected 0 but found ${state}" >> $LOGFILE
fi
echo 1 > $LOCKFILE
for entry in "$SCRIPT_DIR"/*.sh
do
echo "----------------------------------" >> $LOGFILE
echo "$entry" >> $LOGFILE
echo "----------------------------------" >> $LOGFILE
sh $entry >> $LOGFILE
echo "----------------------------------" >> $LOGFILE
done
state=$(cat $LOCKFILE)
if [ "$state" != 1 ]
then
echo "Unexpected state! Expected 1 but found ${state}" >> $LOGFILE
fi
echo 2 > $LOCKFILE

View File

@ -0,0 +1,5 @@
pixel_bugreport(dump_touch)
allow dump_touch vendor_touch_dump_file:dir r_dir_perms;
allow dump_touch vendor_touch_dump_file:file rw_file_perms;
allow dump_touch vendor_toolbox_exec:file execute_no_trans;

View File

@ -0,0 +1 @@
type vendor_touch_dump_file, file_type, data_file_type;

View File

@ -0,0 +1,5 @@
/vendor/bin/predump_touch\.sh u:object_r:predump_touch_exec:s0
/vendor/bin/dump/dump_touch\.sh u:object_r:dump_touch_exec:s0
/data/vendor/dump_touch/dump\.log u:object_r:vendor_touch_dump_file:s0
/data/vendor/dump_touch/dumping u:object_r:vendor_touch_dump_file:s0
/data/vendor/dump_touch u:object_r:vendor_touch_dump_file:s0

View File

@ -0,0 +1,9 @@
type predump_touch, domain;
type predump_touch_exec, vendor_file_type, exec_type, file_type;
init_daemon_domain(predump_touch)
allow predump_touch vendor_touch_dump_file:dir rw_dir_perms;
allow predump_touch vendor_touch_dump_file:file create_file_perms;
allow predump_touch vendor_toolbox_exec:file execute_no_trans;
allow predump_touch vendor_shell_exec:file execute_no_trans;

View File

@ -10,3 +10,10 @@ sh_binary {
sub_dir: "dump",
}
sh_binary {
name: "predump_syna.sh",
src: "dump_syna.sh",
init_rc: ["init.touch.syna.rc"],
vendor: true,
sub_dir: "dump_touch",
}

View File

@ -0,0 +1,2 @@
type sysfs_touch, sysfs_type, fs_type;

View File

@ -0,0 +1,2 @@
/vendor/bin/dump_touch/predump_syna\.sh u:object_r:predump_touch_exec:s0

View File

@ -0,0 +1,3 @@
genfscon sysfs /devices/platform/10d10000.spi/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0
genfscon sysfs /devices/platform/111c0000.spi/spi_master/spi19/spi19.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0
genfscon sysfs /devices/platform/111d0000.spi/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0

View File

@ -0,0 +1,5 @@
allow predump_touch sysfs_touch:dir r_dir_perms;
allow predump_touch sysfs_touch:file rw_file_perms;
get_prop(predump_touch, vendor_touch_dump_path_prop)

View File

@ -0,0 +1 @@
vendor_internal_prop(vendor_touch_dump_path_prop)

View File

@ -0,0 +1 @@
ro.vendor.touch.dump. u:object_r:vendor_touch_dump_path_prop:s0

View File

@ -0,0 +1 @@
set_prop(vendor_init, vendor_touch_dump_path_prop)

View File

@ -0,0 +1,5 @@
PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/class/spi_master/spi19/spi19.0/synaptics_tcm.0/sysfs
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/syna/predump_sepolicy
PRODUCT_PACKAGES += predump_syna.sh

View File

@ -0,0 +1,5 @@
PRODUCT_VENDOR_PROPERTIES += ro.vendor.touch.dump.sys=/sys/devices/platform/111d0000.spi/spi_master/spi20/spi20.0/synaptics_tcm.0/sysfs
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/syna/predump_sepolicy
PRODUCT_PACKAGES += predump_syna.sh