dumpstate: read C10 touch information
Dump the touch information and rawdata when bugreport is triggered. Bug: 199104466 Test: adb bugreport Signed-off-by: davidycchen <davidycchen@google.com> Change-Id: I1047ddfd063d90114b3ff2173c3b4da3a2bb414a
This commit is contained in:
parent
2dcb8a176f
commit
8b35b3cf81
1 changed files with 30 additions and 0 deletions
|
@ -501,8 +501,38 @@ void DumpstateDevice::dumpTouchSection(int fd) {
|
||||||
"/sys/class/spi_master/spi6/spi6.0",
|
"/sys/class/spi_master/spi6/spi6.0",
|
||||||
"/proc/fts_ext/driver_test"};
|
"/proc/fts_ext/driver_test"};
|
||||||
const char lsi_spi_path[] = "/sys/devices/virtual/sec/tsp";
|
const char lsi_spi_path[] = "/sys/devices/virtual/sec/tsp";
|
||||||
|
const char syna_cmd_path[] = "/sys/class/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs";
|
||||||
char cmd[256];
|
char cmd[256];
|
||||||
|
|
||||||
|
if (!access(syna_cmd_path, R_OK)) {
|
||||||
|
// Enable: force touch active
|
||||||
|
snprintf(cmd, sizeof(cmd), "echo 21 > %s/force_active", syna_cmd_path);
|
||||||
|
RunCommandToFd(fd, "Enable Force Touch Active", {"/vendor/bin/sh", "-c", cmd});
|
||||||
|
|
||||||
|
// Touch Firmware Information
|
||||||
|
snprintf(cmd, sizeof(cmd), "%s/info", syna_cmd_path);
|
||||||
|
DumpFileToFd(fd, "Touch Firmware Information", cmd);
|
||||||
|
|
||||||
|
// Get Raw Data - Delta
|
||||||
|
snprintf(cmd, sizeof(cmd),
|
||||||
|
"echo 12 > %s/get_raw_data && cat %s/get_raw_data", syna_cmd_path, syna_cmd_path);
|
||||||
|
RunCommandToFd(fd, "Get Raw Data - Delta", {"/vendor/bin/sh", "-c", cmd});
|
||||||
|
|
||||||
|
// Get Raw Data - Raw
|
||||||
|
snprintf(cmd, sizeof(cmd),
|
||||||
|
"echo 13 > %s/get_raw_data && cat %s/get_raw_data", syna_cmd_path, syna_cmd_path);
|
||||||
|
RunCommandToFd(fd, "Get Raw Data - Raw", {"/vendor/bin/sh", "-c", cmd});
|
||||||
|
|
||||||
|
// Get Raw Data - Baseline
|
||||||
|
snprintf(cmd, sizeof(cmd),
|
||||||
|
"echo 14 > %s/get_raw_data && cat %s/get_raw_data", syna_cmd_path, syna_cmd_path);
|
||||||
|
RunCommandToFd(fd, "Get Raw Data - Baseline", {"/vendor/bin/sh", "-c", cmd});
|
||||||
|
|
||||||
|
// Disable: force touch active
|
||||||
|
snprintf(cmd, sizeof(cmd), "echo 20 > %s/force_active", syna_cmd_path);
|
||||||
|
RunCommandToFd(fd, "Disable Force Touch Active", {"/vendor/bin/sh", "-c", cmd});
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 4; i+=2) {
|
for (int i = 0; i < 4; i+=2) {
|
||||||
snprintf(cmd, sizeof(cmd), "%s", stm_cmd_path[i + 1]);
|
snprintf(cmd, sizeof(cmd), "%s", stm_cmd_path[i + 1]);
|
||||||
if (!access(cmd, R_OK)) {
|
if (!access(cmd, R_OK)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue