dumpstate: Dump P10 touch information.

Dump the touch information and rawdata when bugreport is triggered.

Bug: 199105131
Test: adb bugreport

Change-Id: Ie2450a3530ebd615067eaa70f1a0d74985d0e758
This commit is contained in:
Mason Wang 2022-03-31 22:57:40 +08:00 committed by TreeHugger Robot
parent 5c95b36ea8
commit 0f7a0cb1a6

View file

@ -529,8 +529,63 @@ void DumpstateDevice::dumpTouchSection(int fd) {
"/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"; const char syna_cmd_path[] = "/sys/class/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs";
const char focaltech_cmd_path[] = "/proc/focaltech_touch";
char cmd[256]; char cmd[256];
if (!access(focaltech_cmd_path, R_OK)) {
// Enable: force touch active
snprintf(cmd, sizeof(cmd), "echo 21 > %s/force_active", focaltech_cmd_path);
RunCommandToFd(fd, "Enable Force Touch Active", {"/vendor/bin/sh", "-c", cmd});
// Touch Firmware Version
snprintf(cmd, sizeof(cmd), "%s/FW_Version", focaltech_cmd_path);
DumpFileToFd(fd, "Touch Firmware Version", cmd);
// Touch INT PIN Test
snprintf(cmd, sizeof(cmd), "%s/INT_PIN", focaltech_cmd_path);
DumpFileToFd(fd, "Touch INT PIN Test", cmd);
// Get Raw Data - Delta
snprintf(cmd, sizeof(cmd), "%s/selftest/Panel_Differ", focaltech_cmd_path);
DumpFileToFd(fd, "Get Raw Data - Panel_Differ", cmd);
// Get Raw Data - Raw
snprintf(cmd, sizeof(cmd), "%s/selftest/Rawdata", focaltech_cmd_path);
DumpFileToFd(fd, "Get Raw Data - Raw", cmd);
// Get Raw Data - Baseline
snprintf(cmd, sizeof(cmd), "%s/selftest/Baseline", focaltech_cmd_path);
DumpFileToFd(fd, "Get Raw Data - Baseline", cmd);
// Get Raw Data - Noise
snprintf(cmd, sizeof(cmd), "%s/selftest/Noise", focaltech_cmd_path);
DumpFileToFd(fd, "Get Raw Data - Noise", cmd);
// Get Raw Data - Uniformity
snprintf(cmd, sizeof(cmd), "%s/selftest/Rawdata_Uniformity", focaltech_cmd_path);
DumpFileToFd(fd, "Get Raw Data - Uniformity", cmd);
// Get Scap_CB
snprintf(cmd, sizeof(cmd), "%s/selftest/Scap_CB", focaltech_cmd_path);
DumpFileToFd(fd, "Get Scap_CB", cmd);
// Get Scap_CB - Raw
snprintf(cmd, sizeof(cmd), "%s/selftest/Scap_Rawdata", focaltech_cmd_path);
DumpFileToFd(fd, "Get Scap_Rawdata", cmd);
// Get Short Test
snprintf(cmd, sizeof(cmd), "%s/selftest/Short", focaltech_cmd_path);
DumpFileToFd(fd, "Get Short Test", cmd);
// Get HeatMap(ms,ss)
snprintf(cmd, sizeof(cmd), "%s/selftest/Strength", focaltech_cmd_path);
DumpFileToFd(fd, "Get HeatMap(ms,ss)", cmd);
// Disable: force touch active
snprintf(cmd, sizeof(cmd), "echo 20 > %s/force_active", focaltech_cmd_path);
RunCommandToFd(fd, "Disable Force Touch Active", {"/vendor/bin/sh", "-c", cmd});
}
if (!access(syna_cmd_path, R_OK)) { if (!access(syna_cmd_path, R_OK)) {
// Enable: force touch active // Enable: force touch active
snprintf(cmd, sizeof(cmd), "echo 21 > %s/force_active", syna_cmd_path); snprintf(cmd, sizeof(cmd), "echo 21 > %s/force_active", syna_cmd_path);