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

Commit 486744b1 authored by vadimt's avatar vadimt
Browse files

Including full diags from system alerts

Change-Id: I779d3ccb683aea46e7e1b58ed088933d5685c183
parent d4e7782d
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -334,15 +334,21 @@ public final class LauncherInstrumentation {

    private String getSystemAnomalyMessage() {
        try {
            final StringBuilder sb = new StringBuilder();

            UiObject2 object = mDevice.findObject(By.res("android", "alertTitle"));
            if (object != null) {
                return "System alert popup is visible: " + object.getText();
                sb.append("TITLE: ").append(object.getText());
            }

            object = mDevice.findObject(By.res("android", "message"));
            if (object != null) {
                return "Message popup by " + object.getApplicationPackage() + " is visible: "
                        + object.getText();
                sb.append(" PACKAGE: ").append(object.getApplicationPackage())
                        .append(" MESSAGE: ").append(object.getText());
            }

            if (sb.length() != 0) {
                return "System alert popup is visible: " + sb;
            }

            if (hasSystemUiObject("keyguard_status_view")) return "Phone is locked";