diff options
author | Michael Wright <michaelwr@google.com> | 2016-03-22 16:52:13 -0700 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2016-04-21 19:11:18 -0700 |
commit | 03a53d1c7765eeb3af0bc34c3dff02ada1953fbf (patch) | |
tree | eb3466b1b14225cec1d89468849383d9f3d87bfd /services/inputflinger/InputDispatcher.h | |
parent | a59b827869a2ea04022dd225007f29af8d61837a (diff) | |
download | frameworks_native-03a53d1c7765eeb3af0bc34c3dff02ada1953fbf.zip frameworks_native-03a53d1c7765eeb3af0bc34c3dff02ada1953fbf.tar.gz frameworks_native-03a53d1c7765eeb3af0bc34c3dff02ada1953fbf.tar.bz2 |
Add new MotionEvent flag for partially obscured windows.
Due to more complex window layouts resulting in lots of overlapping
windows, the policy around FLAG_WINDOW_IS_OBSCURED has changed to
only be set when the point at which the window was touched is
obscured. Unfortunately, this doesn't prevent tapjacking attacks that
overlay the dialog's text, making a potentially dangerous operation
seem innocuous. To avoid this on particularly sensitive dialogs,
introduce a new flag that really does tell you when your window is
being even partially overlapped.
We aren't exposing this as API since we plan on making the original
flag more robust. This is really a workaround for system dialogs
since we generally know their layout and screen position, and that
they're unlikely to be overlapped by other applications.
Bug: 26677796
Change-Id: I9e336afe90f262ba22015876769a9c510048fd47
Diffstat (limited to 'services/inputflinger/InputDispatcher.h')
-rw-r--r-- | services/inputflinger/InputDispatcher.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/inputflinger/InputDispatcher.h b/services/inputflinger/InputDispatcher.h index 98355c6..1c054f5 100644 --- a/services/inputflinger/InputDispatcher.h +++ b/services/inputflinger/InputDispatcher.h @@ -89,7 +89,7 @@ struct InputTarget { /* This flag indicates that the event is being delivered to a foreground application. */ FLAG_FOREGROUND = 1 << 0, - /* This flag indicates that the target of a MotionEvent is partly or wholly + /* This flag indicates that the MotionEvent falls within the area of the target * obscured by another visible window above it. The motion event should be * delivered with flag AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED. */ FLAG_WINDOW_IS_OBSCURED = 1 << 1, @@ -139,6 +139,12 @@ struct InputTarget { | FLAG_DISPATCH_AS_HOVER_EXIT | FLAG_DISPATCH_AS_SLIPPERY_EXIT | FLAG_DISPATCH_AS_SLIPPERY_ENTER, + + /* This flag indicates that the target of a MotionEvent is partly or wholly + * obscured by another visible window above it. The motion event should be + * delivered with flag AMOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED. */ + FLAG_WINDOW_IS_PARTIALLY_OBSCURED = 1 << 14, + }; // The input channel to be targeted. @@ -1048,6 +1054,7 @@ private: const InjectionState* injectionState); bool isWindowObscuredAtPointLocked(const sp<InputWindowHandle>& windowHandle, int32_t x, int32_t y) const; + bool isWindowObscuredLocked(const sp<InputWindowHandle>& windowHandle) const; String8 getApplicationWindowLabelLocked(const sp<InputApplicationHandle>& applicationHandle, const sp<InputWindowHandle>& windowHandle); |