diff options
author | Matthew Wong <wongma@protonmail.ch> | 2015-08-09 22:46:08 -0400 |
---|---|---|
committer | Matthew Wong <wongma@protonmail.ch> | 2015-08-14 17:36:49 -0400 |
commit | 3523a0497b3268485ffcf7107480d473cc930223 (patch) | |
tree | 58adebd08b13e6650396fdc5978ebde2a34b29ca | |
parent | 1ceb41acb69f8cd780d44b438ff8db3410cbe225 (diff) |
Fix recursive filter; don't act twice on focus+click event
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java | 9 | ||||
-rw-r--r-- | app/src/main/res/xml/autofill_config.xml | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java index 4731f1d4..ebe12c9c 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java @@ -83,8 +83,13 @@ public class AutofillService extends AccessibilityService { return; } - // if past this point, a new dialog will be created, so dismiss the existing if (dialog != null && dialog.isShowing()) { + // if the view was clicked, the click event follows the focus event + // since the focus event was already handled, ignore click event + if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_CLICKED) { + return; + } + // if past this point, a new dialog will be created, so dismiss the existing dialog.dismiss(); } @@ -145,7 +150,7 @@ public class AutofillService extends AccessibilityService { PasswordRepository.getPasswords(dir); for (PasswordItem item : passwordItems) { if (item.getType() == PasswordItem.TYPE_CATEGORY) { - recursiveFilter(filter, item.getFile()); + items.addAll(recursiveFilter(filter, item.getFile())); } if (item.toString().toLowerCase().contains(filter.toLowerCase())) { items.add(item); diff --git a/app/src/main/res/xml/autofill_config.xml b/app/src/main/res/xml/autofill_config.xml index 36ef5aaa..adf418e6 100644 --- a/app/src/main/res/xml/autofill_config.xml +++ b/app/src/main/res/xml/autofill_config.xml @@ -1,6 +1,6 @@ <accessibility-service xmlns:android="http://schemas.android.com/apk/res/android" android:description="@string/autofill_description" - android:accessibilityEventTypes="typeViewFocused|typeWindowStateChanged|typeViewClicked" + android:accessibilityEventTypes="typeViewFocused|typeViewClicked|typeWindowStateChanged" android:accessibilityFlags="flagDefault" android:accessibilityFeedbackType="feedbackGeneric" android:notificationTimeout="100" |