fix stackoverflow case by limiting the depth of search to 10

This commit is contained in:
Mohamed 2017-06-19 13:04:16 +02:00
parent 72e441aafe
commit 2a3b82eb8a

View File

@ -221,8 +221,11 @@ public class AutofillService extends AccessibilityService {
}
showDialog(packageName, appName, isWeb);
}
private String searchWebView(AccessibilityNodeInfo source) {
return searchWebView(source, 10);
}
private String searchWebView(AccessibilityNodeInfo source, int depth) {
if (source == null) {
return null;
}
@ -237,8 +240,9 @@ public class AutofillService extends AccessibilityService {
}
return "";
}
if (searchWebView(u) != null) {
return searchWebView(u);
String webView = searchWebView(u, depth - 1);
if (webView != null) {
return webView;
}
u.recycle();
}