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

Commit 0d4eb971 authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/cm-14.1' into v1-nougat

parents 80f3672c 07580f82
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -103,6 +103,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
@@ -627,10 +627,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 {
@@ -719,7 +716,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);
+3 −0
Original line number Diff line number Diff line
@@ -1069,6 +1069,9 @@ public class GnssLocationProvider implements LocationProviderInterface {
    }

    private void handleUpdateLocation(Location location) {
        if (location.isFromMockProvider()) {
            return;
        }
        if (location.hasAccuracy()) {
            native_inject_location(location.getLatitude(), location.getLongitude(),
                    location.getAccuracy());
+19 −6
Original line number Diff line number Diff line
@@ -6349,8 +6349,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        @Override public void run() {
            synchronized (mScreenshotLock) {
                if (mScreenshotConnection != null) {
                    mContext.unbindService(mScreenshotConnection);
                    mScreenshotConnection = null;
                    resetScreenshotConnection();
                    notifyScreenshotError();
                }
            }
@@ -6382,8 +6381,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                            public void handleMessage(Message msg) {
                                synchronized (mScreenshotLock) {
                                    if (mScreenshotConnection == myConn) {
                                        mContext.unbindService(mScreenshotConnection);
                                        mScreenshotConnection = null;
                                        resetScreenshotConnection();
                                        mHandler.removeCallbacks(mScreenshotTimeout);
                                    }
                                }
@@ -6406,8 +6404,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                public void onServiceDisconnected(ComponentName name) {
                    synchronized (mScreenshotLock) {
                        if (mScreenshotConnection != null) {
                            mContext.unbindService(mScreenshotConnection);
                            mScreenshotConnection = null;
                            resetScreenshotConnection();
                            mHandler.removeCallbacks(mScreenshotTimeout);
                            notifyScreenshotError();
                        }
@@ -6467,6 +6464,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
    }

    /**
     * Reset the screenshot connection.
     */
    private void resetScreenshotConnection() {
        if (mScreenshotConnection != null) {
            mContext.unbindService(mScreenshotConnection);
            mScreenshotConnection = null;
        }
    }

    /** {@inheritDoc} */
    @Override
    public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags) {
@@ -7285,6 +7292,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    mLastSystemUiFlags = 0;
                    updateSystemUiVisibilityLw();
                }

                // close the screenshot connection on user switch so that screenshots
                // are always started with the correct user's context
                synchronized(mScreenshotLock) {
                  resetScreenshotConnection();
                }
            }
        }
    };
+7 −2
Original line number Diff line number Diff line
@@ -2082,8 +2082,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 != Process.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);
            }