diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 1f64131703..5cd03e4259 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -406,12 +406,15 @@ public final class LauncherInstrumentation { } private String getVisiblePackages() { - return mDevice.findObjects(getAnyObjectSelector()) + final String apps = mDevice.findObjects(getAnyObjectSelector()) .stream() .map(LauncherInstrumentation::getApplicationPackageSafe) .distinct() - .filter(pkg -> pkg != null && !"com.android.systemui".equals(pkg)) + .filter(pkg -> pkg != null && !SYSTEMUI_PACKAGE.equals(pkg)) .collect(Collectors.joining(", ")); + return !apps.isEmpty() + ? "active app: " + apps + : "the test doesn't see views from any app, including Launcher"; } private static String getApplicationPackageSafe(UiObject2 object) {