diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/InputChannel.java | 7 | ||||
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/view/InputChannel.java b/core/java/android/view/InputChannel.java index ecb727c79016..346628bbdabd 100644 --- a/core/java/android/view/InputChannel.java +++ b/core/java/android/view/InputChannel.java @@ -111,6 +111,13 @@ public final class InputChannel implements Parcelable { } /** + * @hide + */ + public boolean isValid() { + return mPtr != 0; + } + + /** * Disposes the input channel. * Explicitly releases the reference this object is holding on the input channel. * When all references are released, the input channel will be closed. 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); |
