summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewRootImpl.java
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2020-12-11 12:59:08 -0800
committerRob Carr <racarr@google.com>2020-12-14 18:32:46 +0000
commit514b3297768f4a7469117a7005556663124040f9 (patch)
tree6a26d4f734f48e973ec129d5c50bbfd2edf81104 /core/java/android/view/ViewRootImpl.java
parent1a96cae4218853264f76301e568879f02f5b3696 (diff)
DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL.
NO_INPUT_CHANNEL is a hidden WM flag that allows creation of a window without an input channel. Unfortunately in releases prior to Android R this would allow creation of a Window which will not be known to the InputDispatcher at all. This means that the logic generating FLAG_OBSCURED will work and a window will be able to overlay another window without the overlayed window being notified. In Android R and later this isn't a problem as the InputDispatcher is informed of all windows, input channel or not. For past Android releases, this patch disables NO_INPUT_CHANNEL for use outside of the WM. Bug: 152064592 Test: Existing tests pass Change-Id: I7e1f45cba139eab92e7df88d1e052baba0ae2cc6
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
-rw-r--r--core/java/android/view/ViewRootImpl.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index aceb276e9fc0..735678cd096d 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -851,10 +851,7 @@ public final class ViewRootImpl implements ViewParent,
// manager, to make sure we do the relayout before receiving
// any other events from the system.
requestLayout();
- if ((mWindowAttributes.inputFeatures
- & WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL) == 0) {
- mInputChannel = new InputChannel();
- }
+ mInputChannel = new InputChannel();
mForceDecorViewVisibility = (mWindowAttributes.privateFlags
& PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY) != 0;
try {
@@ -947,7 +944,7 @@ public final class ViewRootImpl implements ViewParent,
mInputQueueCallback =
((RootViewSurfaceTaker)view).willYouTakeTheInputQueue();
}
- if (mInputChannel != null) {
+ if (mInputChannel.isValid()) {
if (mInputQueueCallback != null) {
mInputQueue = new InputQueue();
mInputQueueCallback.onInputQueueCreated(mInputQueue);