From 84aa57b2d10a985626e3f954a63f1c15d5b8675d Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Tue, 7 Nov 2023 16:22:58 -0800 Subject: [PATCH] Diagnosing when Launcher is in invalid state Due to bugs, Launcher may end up showing incorrectly, i.e. Launcher app is present, but no workspace, all apps etc is visible. Improving diagnostics when this is the case. Bug: 187761685 Test: presubmit Flag: N/A Change-Id: Ibd0228bd26d2ba9ad710895ed8d2e5ece294db21 --- .../com/android/launcher3/tapl/LauncherInstrumentation.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 17169b3688..e30885b2a8 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -564,6 +564,9 @@ public final class LauncherInstrumentation { if (hasSystemLauncherObject(OVERVIEW_RES_ID)) return "Overview"; if (hasLauncherObject(WORKSPACE_RES_ID)) return "Workspace"; if (hasLauncherObject(APPS_RES_ID)) return "AllApps"; + if (mDevice.hasObject(By.pkg(getLauncherPackageName()).depth(0))) { + return ""; + } return "LaunchedApp (" + getVisiblePackages() + ")"; } @@ -2063,6 +2066,7 @@ public final class LauncherInstrumentation { } // TODO(b/270393900): Remove with ENABLE_ALL_APPS_SEARCH_IN_TASKBAR flag cleanup. + /** Refreshes the known overview target in TIS. */ public void refreshOverviewTarget() { getTestInfo(TestProtocol.REQUEST_REFRESH_OVERVIEW_TARGET);