mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
Merge "Dumping TIS state on failures" into ub-launcher3-rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b0948db99d
@@ -442,15 +442,7 @@ public final class LauncherInstrumentation {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Log.e("b/156287114", "Input:");
|
||||
for (String line : mDevice.executeShellCommand("dumpsys input").split("\\n")) {
|
||||
SystemClock.sleep(10);
|
||||
Log.d("b/156287114", line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
dumpDiagnostics();
|
||||
|
||||
log("Hierarchy dump for: " + message);
|
||||
dumpViewHierarchy();
|
||||
@@ -458,6 +450,24 @@ public final class LauncherInstrumentation {
|
||||
return message;
|
||||
}
|
||||
|
||||
private void dumpDiagnostics() {
|
||||
Log.e("b/156287114", "Input:");
|
||||
logShellCommand("dumpsys input");
|
||||
Log.e("b/156287114", "TIS:");
|
||||
logShellCommand("dumpsys activity service TouchInteractionService");
|
||||
}
|
||||
|
||||
private void logShellCommand(String command) {
|
||||
try {
|
||||
for (String line : mDevice.executeShellCommand(command).split("\\n")) {
|
||||
SystemClock.sleep(10);
|
||||
Log.d("b/156287114", line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.d("b/156287114", "Failed to execute " + command);
|
||||
}
|
||||
}
|
||||
|
||||
private void fail(String message) {
|
||||
checkForAnomaly();
|
||||
Assert.fail(formatSystemHealthMessage(formatErrorWithEvents(
|
||||
@@ -1340,17 +1350,7 @@ public final class LauncherInstrumentation {
|
||||
if (mCheckEventsForSuccessfulGestures) {
|
||||
final String message = sEventChecker.verify(WAIT_TIME_MS, true);
|
||||
if (message != null) {
|
||||
try {
|
||||
Log.e("b/156287114", "Input:");
|
||||
for (String line : mDevice.executeShellCommand("dumpsys input").split(
|
||||
"\\n")) {
|
||||
SystemClock.sleep(10);
|
||||
Log.d("b/156287114", line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
dumpDiagnostics();
|
||||
checkForAnomaly();
|
||||
Assert.fail(formatSystemHealthMessage(
|
||||
"http://go/tapl : successful gesture produced " + message));
|
||||
|
||||
Reference in New Issue
Block a user