Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c1331ca authored by vadimt's avatar vadimt
Browse files

Improving diags when Launcher is invisible when the test fails

Test: presubmit
Bug: 187761685
Change-Id: I69a930ef076dbf6cca5af516228ebe689fac91eb
parent d6e33dc3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -396,12 +396,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) {