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

Unverified Commit 80c0a800 authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

Merge tag 'android-security-8.1.0_r87' into staging/lineage-15.1_merge_android-security-8.1.0_r87

Android security 8.1.0 release 87

* tag 'android-security-8.1.0_r87':
  [DO NOT MERGE] Close screenshot process on user switched
  DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL.
  RESTRICT AUTOMERGE Allow CDM to hide overlays
  RESTRICT AUTOMERGE Prevent non-system overlays from showing over CDM UI

Change-Id: I8cb6d9a8e20cafbac59d1574ce1b1bc27e296b22
parents b22b25a2 8abed643
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
@@ -713,10 +713,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 {
@@ -805,7 +802,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);
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
    <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"/>

    <application
        android:allowClearUserData="true"
+4 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.companiondevicemanager;

import static android.companion.BluetoothDeviceFilterUtils.getDeviceMacAddress;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;

import android.app.Activity;
import android.companion.CompanionDeviceManager;
@@ -55,6 +56,8 @@ public class DeviceChooserActivity extends Activity {
            Log.e(LOG_TAG, "About to show UI, but no devices to show");
        }

        getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);

        if (getService().mRequest.isSingleDevice()) {
            setContentView(R.layout.device_confirmation);
            final DeviceFilterPair selectedDevice = getService().mDevicesFound.get(0);
+19 −6
Original line number Diff line number Diff line
@@ -6427,8 +6427,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        @Override public void run() {
            synchronized (mScreenshotLock) {
                if (mScreenshotConnection != null) {
                    mContext.unbindService(mScreenshotConnection);
                    mScreenshotConnection = null;
                    resetScreenshotConnection();
                    notifyScreenshotError();
                }
            }
@@ -6460,8 +6459,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);
                                    }
                                }
@@ -6484,8 +6482,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();
                        }
@@ -6547,6 +6544,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) {
@@ -7352,6 +7359,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();
                }
            }
        }
    };
Loading