From 426124bc8a4eabacedc78db4547285e503cdabb8 Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Tue, 19 Oct 2021 17:33:41 -0700 Subject: WM: Use task bounds for modal window touchable region If the task is organized and the window is modal then use the parent surface control to set the touchable region. Bug: 168252846 Test: Dismiss dialog in splitscreen mode by tapping outside Change-Id: I8fdd850a142022f979b12a66bb8ead32438123e3 --- core/java/android/view/WindowManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/java/android/view/WindowManager.java') diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 51cd95e42742..c25fde472431 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -4750,6 +4750,16 @@ public interface WindowManager extends ViewManager { return Integer.toString(inputFeature); } } + + /** + * True if the window should consume all pointer events itself, regardless of whether they + * are inside of the window. If the window is modal, its touchable region will expand to the + * size of its task. + * @hide + */ + public boolean isModal() { + return (flags & (FLAG_NOT_TOUCH_MODAL | FLAG_NOT_FOCUSABLE)) == 0; + } } /** -- cgit v1.2.3