Dumpstate: Avoid to dumps on invalid file node [DO NOT MERGE]

Bug: 226475119
Test: Verify pass by touch dump data in bugreport.
Change-Id: I9088ca44a9111ae36462f340da57dfe27d4b86ec
This commit is contained in:
Mason Wang 2022-11-04 14:46:00 +08:00
parent ef3195940e
commit 0cdf324421

View file

@ -617,7 +617,10 @@ void Dumpstate::dumpTouchSection(int fd) {
RunCommandToFd(fd, "Disable Force Touch Active", {"/vendor/bin/sh", "-c", cmd}); 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) { // ftm5
snprintf(cmd, sizeof(cmd), "%s", stm_cmd_path[i]);
if (!access(cmd, R_OK))
continue;
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)) {
snprintf(cmd, sizeof(cmd), "echo A0 01 01 > %s", stm_cmd_path[i + 1]); snprintf(cmd, sizeof(cmd), "echo A0 01 01 > %s", stm_cmd_path[i + 1]);