mirror of
https://github.com/android-password-store/Android-Password-Store.git
synced 2025-09-07 16:09:38 +02:00
getRootInActiveWindow throws an exception if it is unable to get root
This commit is contained in:
parent
9b646222ce
commit
a45946988e
|
@ -110,6 +110,7 @@ public class AutofillService extends AccessibilityService {
|
||||||
&& (event.getPackageName().equals("com.android.chrome")
|
&& (event.getPackageName().equals("com.android.chrome")
|
||||||
|| event.getPackageName().equals("com.android.browser")))) {
|
|| event.getPackageName().equals("com.android.browser")))) {
|
||||||
// there is a chance for getRootInActiveWindow() to return null at any time. save it.
|
// there is a chance for getRootInActiveWindow() to return null at any time. save it.
|
||||||
|
try {
|
||||||
AccessibilityNodeInfo root = getRootInActiveWindow();
|
AccessibilityNodeInfo root = getRootInActiveWindow();
|
||||||
webViewTitle = searchWebView(root);
|
webViewTitle = searchWebView(root);
|
||||||
webViewURL = null;
|
webViewURL = null;
|
||||||
|
@ -132,6 +133,10 @@ public class AutofillService extends AccessibilityService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// sadly we were unable to access the data we wanted
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// nothing to do if not password field focus, field is keychain app
|
// nothing to do if not password field focus, field is keychain app
|
||||||
|
|
Loading…
Reference in a new issue