From 4a1566f550a5f2353c05292c422ab97e142d400a Mon Sep 17 00:00:00 2001 From: davidycchen Date: Tue, 18 Dec 2018 10:15:30 +0800 Subject: bonito: dumpstate: add touch resume function before dumpstate. 1. Add a resume function and let touch stay awake while we collect the touch information. 2. Collect 5 frame of touch rawdata. Bug: 121025845 Test: Check dumpstate can collect touch information correctly. Change-Id: I50a42253be507feb92e89f696661777e6a18be2d Signed-off-by: davidycchen --- dumpstate/DumpstateDevice.cpp | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'dumpstate') diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 2ab4b71d..4faa7426 100755 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -219,24 +219,32 @@ static void DumpTouch(int fd) { touch_sysfs_path + "buildid"); DumpFileToFd(fd, "Synaptics touch config version", touch_sysfs_path + "config"); + RunCommandToFd(fd, "keep touch stay awake", + {"/vendor/bin/sh", "-c", + "echo 02 >" + touch_sysfs_path + "suspend"}); DumpFileToFd(fd, "Synaptics touch noise information", touch_sysfs_path + "noise_state"); - RunCommandToFd(fd, "Touch Cm Raw data", - {"/vendor/bin/sh", "-c", - "echo 20 >" + touch_sysfs_path + "read_report" - " && cat " + touch_sysfs_path + "read_report"}); - RunCommandToFd(fd, "Touch Cm Jitter", - {"/vendor/bin/sh", "-c", - "echo 02 >" + touch_sysfs_path + "read_report" - " && cat " + touch_sysfs_path + "read_report"}); - RunCommandToFd(fd, "Touch Cs Raw data", - {"/vendor/bin/sh", "-c", - "echo 63 >" + touch_sysfs_path + "read_report" - " && cat " + touch_sysfs_path + "read_report"}); - RunCommandToFd(fd, "Touch Cs Jitter", + for (int i = 0; i < 5; i++) { + RunCommandToFd(fd, "Touch Cm Raw data", + {"/vendor/bin/sh", "-c", + "echo 20 >" + touch_sysfs_path + "read_report" + " && cat " + touch_sysfs_path + "read_report"}); + RunCommandToFd(fd, "Touch Cm Jitter", + {"/vendor/bin/sh", "-c", + "echo 02 >" + touch_sysfs_path + "read_report" + " && cat " + touch_sysfs_path + "read_report"}); + RunCommandToFd(fd, "Touch Cs Raw data", + {"/vendor/bin/sh", "-c", + "echo 63 >" + touch_sysfs_path + "read_report" + " && cat " + touch_sysfs_path + "read_report"}); + RunCommandToFd(fd, "Touch Cs Jitter", + {"/vendor/bin/sh", "-c", + "echo 59 >" + touch_sysfs_path + "read_report" + " && cat " + touch_sysfs_path + "read_report"}); + } + RunCommandToFd(fd, "keep touch stay awake disable", {"/vendor/bin/sh", "-c", - "echo 59 >" + touch_sysfs_path + "read_report" - " && cat " + touch_sysfs_path + "read_report"}); + "echo 00 >" + touch_sysfs_path + "suspend"}); } } -- cgit v1.2.3