From 40c9cfa3c87fda871486486b16ca353d15073c3f Mon Sep 17 00:00:00 2001 From: vadimt Date: Tue, 14 Jul 2020 15:51:24 -0700 Subject: [PATCH] Productizing useful diags The bug doesn't repro, but it makes sense to keep the diags Bug: 156287114 Change-Id: I4a9f43e02eec1b1386067a90e4c17ad109adcfa5 --- .../launcher3/tapl/LauncherInstrumentation.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 0cf611ad26..f90dff281c 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -448,7 +448,7 @@ public final class LauncherInstrumentation { } } - dumpDiagnostics(); + dumpDiagnostics(message); log("Hierarchy dump for: " + message); dumpViewHierarchy(); @@ -456,10 +456,11 @@ public final class LauncherInstrumentation { return message; } - private void dumpDiagnostics() { - Log.e("b/156287114", "Input:"); + private void dumpDiagnostics(String message) { + log("Diagnostics for failure: " + message); + log("Input:"); logShellCommand("dumpsys input"); - Log.e("b/156287114", "TIS:"); + log("TIS:"); logShellCommand("dumpsys activity service TouchInteractionService"); } @@ -467,10 +468,10 @@ public final class LauncherInstrumentation { try { for (String line : mDevice.executeShellCommand(command).split("\\n")) { SystemClock.sleep(10); - Log.d("b/156287114", line); + log(line); } } catch (IOException e) { - Log.d("b/156287114", "Failed to execute " + command); + log("Failed to execute " + command); } } @@ -1365,7 +1366,7 @@ public final class LauncherInstrumentation { if (mCheckEventsForSuccessfulGestures) { final String message = eventChecker.verify(WAIT_TIME_MS, true); if (message != null) { - dumpDiagnostics(); + dumpDiagnostics(message); checkForAnomaly(); Assert.fail(formatSystemHealthMessage( "http://go/tapl : successful gesture produced " + message));