Merge "Add navigation mode diags to the system anomaly detection" into ub-launcher3-rvc-dev
This commit is contained in:
commit
32d76efb79
1 file changed
+17
-12
@@ -332,26 +332,31 @@ public final class LauncherInstrumentation {
|
|||||||
|
|
||||||
private String getSystemAnomalyMessage() {
|
private String getSystemAnomalyMessage() {
|
||||||
try {
|
try {
|
||||||
final StringBuilder sb = new StringBuilder();
|
{
|
||||||
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
UiObject2 object = mDevice.findObject(By.res("android", "alertTitle"));
|
UiObject2 object = mDevice.findObject(By.res("android", "alertTitle"));
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
sb.append("TITLE: ").append(object.getText());
|
sb.append("TITLE: ").append(object.getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
object = mDevice.findObject(By.res("android", "message"));
|
object = mDevice.findObject(By.res("android", "message"));
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
sb.append(" PACKAGE: ").append(object.getApplicationPackage())
|
sb.append(" PACKAGE: ").append(object.getApplicationPackage())
|
||||||
.append(" MESSAGE: ").append(object.getText());
|
.append(" MESSAGE: ").append(object.getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sb.length() != 0) {
|
if (sb.length() != 0) {
|
||||||
return "System alert popup is visible: " + sb;
|
return "System alert popup is visible: " + sb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasSystemUiObject("keyguard_status_view")) return "Phone is locked";
|
if (hasSystemUiObject("keyguard_status_view")) return "Phone is locked";
|
||||||
|
|
||||||
if (!mDevice.hasObject(By.textStartsWith(""))) return "Screen is empty";
|
if (!mDevice.hasObject(By.textStartsWith(""))) return "Screen is empty";
|
||||||
|
|
||||||
|
final String navigationModeError = getNavigationModeMismatchError();
|
||||||
|
if (navigationModeError != null) return navigationModeError;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Log.w(TAG, "getSystemAnomalyMessage failed", e);
|
Log.w(TAG, "getSystemAnomalyMessage failed", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user