Skip to content

Commit 613f63b

Browse files
Michael WrightThe Android Automerger
authored andcommitted
Add new, hidden MotionEvent flag for partially obscured windows.
Bug: 26677796 Change-Id: Ic4219b883bb760495e6172ef61e84e9725876ef6
1 parent 12332e0 commit 613f63b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

core/java/android/view/MotionEvent.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,21 @@ public final class MotionEvent extends InputEvent implements Parcelable {
416416
*/
417417
public static final int FLAG_WINDOW_IS_OBSCURED = 0x1;
418418

419+
/**
420+
* This flag indicates that the window that received this motion event is partly
421+
* or wholly obscured by another visible window above it. This flag is set to true
422+
* even if the event did not directly pass through the obscured area.
423+
* A security sensitive application can check this flag to identify situations in which
424+
* a malicious application may have covered up part of its content for the purpose
425+
* of misleading the user or hijacking touches. An appropriate response might be
426+
* to drop the suspect touches or to take additional precautions to confirm the user's
427+
* actual intent.
428+
*
429+
* Unlike FLAG_WINDOW_IS_OBSCURED, this is actually true.
430+
* @hide
431+
*/
432+
public static final int FLAG_WINDOW_IS_PARTIALLY_OBSCURED = 0x2;
433+
419434
/**
420435
* Private flag that indicates when the system has detected that this motion event
421436
* may be inconsistent with respect to the sequence of previously delivered motion events,

0 commit comments

Comments
 (0)