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

Unverified Commit 236afaa4 authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

Merge tag 'android-security-9.0.0_r67' into staging/lineage-16.0_merge_android-security-9.0.0_r67

Android security 9.0.0 release 67

* tag 'android-security-9.0.0_r67':
  [DO NOT MERGE] Close screenshot process on user switched
  DO NOT MERGE: Do not inject mock location to chipset
  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: Id56b6e80d8ede545578e4f80f141b375626a289a
parents 58e87536 3da64c81
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
@@ -745,10 +745,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 {
@@ -838,7 +835,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);
+31 −6
Original line number Diff line number Diff line
package com.android.internal.util;

import static android.content.Intent.ACTION_USER_SWITCHED;

import android.annotation.NonNull;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.os.Handler;
import android.os.IBinder;
@@ -29,8 +33,21 @@ public class ScreenshotHelper {
    private ServiceConnection mScreenshotConnection = null;
    private final Context mContext;

    private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            synchronized (mScreenshotLock) {
                if (ACTION_USER_SWITCHED.equals(intent.getAction())) {
                    resetConnection();
                }
            }
        }
    };

    public ScreenshotHelper(Context context) {
        mContext = context;
        IntentFilter filter = new IntentFilter(ACTION_USER_SWITCHED);
        mContext.registerReceiver(mBroadcastReceiver, filter);
    }

    /**
@@ -57,8 +74,8 @@ public class ScreenshotHelper {
                @Override public void run() {
                    synchronized (mScreenshotLock) {
                        if (mScreenshotConnection != null) {
                            mContext.unbindService(mScreenshotConnection);
                            mScreenshotConnection = null;
                            Log.e(TAG, "Timed out before getting screenshot capture response");
                            resetConnection();
                            notifyScreenshotError();
                        }
                    }
@@ -81,8 +98,7 @@ public class ScreenshotHelper {
                            public void handleMessage(Message msg) {
                                synchronized (mScreenshotLock) {
                                    if (mScreenshotConnection == myConn) {
                                        mContext.unbindService(mScreenshotConnection);
                                        mScreenshotConnection = null;
                                        resetConnection();
                                        handler.removeCallbacks(mScreenshotTimeout);
                                    }
                                }
@@ -103,8 +119,7 @@ public class ScreenshotHelper {
                public void onServiceDisconnected(ComponentName name) {
                    synchronized (mScreenshotLock) {
                        if (mScreenshotConnection != null) {
                            mContext.unbindService(mScreenshotConnection);
                            mScreenshotConnection = null;
                            resetConnection();
                            handler.removeCallbacks(mScreenshotTimeout);
                            notifyScreenshotError();
                        }
@@ -120,6 +135,16 @@ public class ScreenshotHelper {
        }
    }

    /**
     * Unbinds the current screenshot connection (if any).
     */
    private void resetConnection() {
        if (mScreenshotConnection != null) {
            mContext.unbindService(mScreenshotConnection);
            mScreenshotConnection = null;
        }
    }

    /**
     * Notifies the screenshot service to show an error.
     */
+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;
@@ -56,6 +57,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);
Loading