Merge "Improving diags when Launcher is invisible when the test fails" into sc-v2-dev am: ec4be03dd3 am: 94db2b1122

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15352430

Change-Id: Ifcf96e693d091901481406f16fc46ac8a8864d7a
This commit is contained in:
TreeHugger Robot
2021-07-23 04:17:53 +00:00
committed by Automerger Merge Worker
@@ -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) {