diff options
author | Matthew Wong <wongma7@outlook.com> | 2016-01-03 20:27:26 -0500 |
---|---|---|
committer | Matthew Wong <wongma7@outlook.com> | 2016-01-03 20:27:26 -0500 |
commit | 6ef9e3bbcabdc24ee6d89529dd2513ac842df986 (patch) | |
tree | 835ae32ee849e6ad3120b3762b8690d415210307 /app/src/main/java | |
parent | 35e30a67c49055b89633b1330a0151a176a74ef2 (diff) |
avoid event.getsource nullpointerexception
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java | 3 |
1 files changed, 2 insertions, 1 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 ae99ba6d..7346973c 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java @@ -105,6 +105,7 @@ public class AutofillService extends AccessibilityService { // or if page changes in chrome if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED || (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED + && event.getSource() != null && (event.getSource().getPackageName().equals("com.android.chrome") || event.getSource().getPackageName().equals("com.android.browser")))) { webViewTitle = searchWebView(getRootInActiveWindow()); @@ -164,7 +165,7 @@ public class AutofillService extends AccessibilityService { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(this)) { Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, - Uri.parse("package:" + getApplicationContext().getPackageName())); + Uri.parse("package:" + getPackageName())); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); return; |