Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 735a40b0 authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL." into qt-qpr1-dev

parents 9023676d d0ad4beb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -110,6 +110,13 @@ public final class InputChannel implements Parcelable {
        return name != null ? name : "uninitialized";
    }

    /**
     * @hide
     */
    public boolean isValid() {
        return mPtr != 0;
    }

    /**
     * Disposes the input channel.
     * Explicitly releases the reference this object is holding on the input channel.
+2 −5
Original line number Diff line number Diff line
@@ -875,10 +875,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();
                }
                mForceDecorViewVisibility = (mWindowAttributes.privateFlags
                        & PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY) != 0;
                try {
@@ -971,7 +968,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);
+7 −2
Original line number Diff line number Diff line
@@ -1462,8 +1462,13 @@ public class WindowManagerService extends IWindowManager.Stub
                return res;
            }

            final boolean openInputChannels = (outInputChannel != null
            boolean openInputChannels = (outInputChannel != null
                && (attrs.inputFeatures & INPUT_FEATURE_NO_INPUT_CHANNEL) == 0);
            if (callingUid != SYSTEM_UID) {
                Slog.e(TAG_WM,
                    "App trying to use insecure INPUT_FEATURE_NO_INPUT_CHANNEL flag. Ignoring");
                openInputChannels = true;
            }
            if  (openInputChannels) {
                win.openInputChannel(outInputChannel);
            }