From 7182db30b7ddb314afec4eb18f83bb6b189fe2c0 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 28 Jul 2015 12:05:26 -0400 Subject: Ignore focus only when it is from a successful performAction --- app/src/main/java/com/zeapo/pwdstore/AutofillService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/com/zeapo/pwdstore/AutofillService.java b/app/src/main/java/com/zeapo/pwdstore/AutofillService.java index a490fe17..de5bcfd2 100644 --- a/app/src/main/java/com/zeapo/pwdstore/AutofillService.java +++ b/app/src/main/java/com/zeapo/pwdstore/AutofillService.java @@ -162,8 +162,7 @@ public class AutofillService extends AccessibilityService { String[] passContent = os.toString("UTF-8").split("\n"); // if the user focused on something else, take focus back // but this will open another dialog...hack to ignore this - ignoreActionFocus = true; - info.performAction(AccessibilityNodeInfo.ACTION_FOCUS); + ignoreActionFocus = info.performAction(AccessibilityNodeInfo.ACTION_FOCUS); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Bundle args = new Bundle(); args.putCharSequence(AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, -- cgit v1.2.3