From c8e20afa3c60ff6aeb0e60bf8b225fa15a8fe3e7 Mon Sep 17 00:00:00 2001 From: Phil Weaver Date: Wed, 5 Apr 2017 09:28:32 -0700 Subject: [PATCH] Don't enable a11y service if scary dialog obscured We were only checking if the OK button itself was obscured. Changing to check if any part of the window is obscured. Bug: 31855267 Test: Created a sample a11y service that displays a UI to cover part of the window, but not the OK button. It was possible to enable an a11y service before this change, but now it displays a warning toast. Change-Id: I21974535aba734da6ea9d7accf67fb9237fd16fc --- src/com/android/settings/accessibility/AccessibilityServiceWarning.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/accessibility/AccessibilityServiceWarning.java b/src/com/android/settings/accessibility/AccessibilityServiceWarning.java index 71cafbad65..9f89bc1e7e 100644 --- a/src/com/android/settings/accessibility/AccessibilityServiceWarning.java +++ b/src/com/android/settings/accessibility/AccessibilityServiceWarning.java @@ -53,7 +53,7 @@ public class AccessibilityServiceWarning { final View.OnTouchListener filterTouchListener = (View v, MotionEvent event) -> { // Filter obscured touches by consuming them. - if ((event.getFlags() & MotionEvent.FLAG_WINDOW_IS_OBSCURED) != 0) { + if ((event.getFlags() & MotionEvent.FLAG_WINDOW_IS_PARTIALLY_OBSCURED) != 0) { if (event.getAction() == MotionEvent.ACTION_UP) { Toast.makeText(v.getContext(), R.string.touch_filtered_warning, Toast.LENGTH_SHORT).show(); -- 2.11.0