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

Commit e24853ba authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [2947251, 2947338, 2947252, 2947253, 2946095, 2946096,...

Merge cherrypicks of [2947251, 2947338, 2947252, 2947253, 2946095, 2946096, 2946097, 2946098, 2947211, 2947212, 2947254, 2947255, 2947256, 2947257, 2947258, 2947349, 2947350, 2947351, 2947352, 2947353, 2946976, 2946977, 2946978, 2946979, 2946980, 2947354, 2947355, 2947435, 2947356, 2947357c, 2947358, 2947359, 2947360, 2947418, 2947421, 2947422, 2947306] into oc-r3-release

Change-Id: I05f8062e187d9a345f9421a1fee03d34c292c207
parents b29c373f de32b1f7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ package android {
    field public static final java.lang.String GRANT_RUNTIME_PERMISSIONS = "android.permission.GRANT_RUNTIME_PERMISSIONS";
    field public static final java.lang.String HARDWARE_TEST = "android.permission.HARDWARE_TEST";
    field public static final java.lang.String HDMI_CEC = "android.permission.HDMI_CEC";
    field public static final java.lang.String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS";
    field public static final java.lang.String INJECT_EVENTS = "android.permission.INJECT_EVENTS";
    field public static final java.lang.String INSTALL_GRANT_RUNTIME_PERMISSIONS = "android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS";
    field public static final java.lang.String INSTALL_LOCATION_PROVIDER = "android.permission.INSTALL_LOCATION_PROVIDER";
+5 −7
Original line number Diff line number Diff line
@@ -1380,15 +1380,13 @@ public interface WindowManager extends ViewManager {
        public static final int PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE = 0x00040000;

        /**
         * Flag to indicate that this window is used as a task snapshot window. A task snapshot
         * window is a starting window that gets shown with a screenshot from the previous state
         * that is active until the app has drawn its first frame.
         *
         * <p>If this flag is set, SystemUI flags are ignored such that the real window behind can
         * set the SystemUI flags.
         * Flag to indicate that any window added by an application process that is of type
         * {@link #TYPE_TOAST} or that requires
         * {@link android.app.AppOpsManager#OP_SYSTEM_ALERT_WINDOW} permission should be hidden when
         * this window is visible.
         * @hide
         */
        public static final int PRIVATE_FLAG_TASK_SNAPSHOT = 0x00080000;
        public static final int PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS = 0x00080000;

        /**
         * Control flags that are private to the platform.
+9 −0
Original line number Diff line number Diff line
@@ -2333,6 +2333,15 @@
    <permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW"
        android:protectionLevel="signature" />

    <!-- @SystemApi Allows an application to use
         {@link android.view.WindowManager.LayoutsParams#PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS}
         to hide non-system-overlay windows.
         <p>Not for use by third-party applications.
         @hide
    -->
    <permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"
                android:protectionLevel="signature|installer" />

    <!-- @SystemApi Allows an application to manage (create, destroy,
         Z-order) application tokens in the window manager.
         <p>Not for use by third-party applications.
+11 −4
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.app.ActivityManager;
import android.app.AppGlobals;
import android.app.AppOpsManager;
import android.app.IActivityManager;
import android.app.KeyguardManager;
import android.content.ClipData;
import android.content.ClipDescription;
import android.content.ContentProvider;
@@ -304,7 +305,7 @@ public class ClipboardService extends SystemService {
        public ClipData getPrimaryClip(String pkg) {
            synchronized (this) {
                if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, pkg,
                            Binder.getCallingUid())) {
                            Binder.getCallingUid()) || isDeviceLocked()) {
                    return null;
                }
                addActiveOwnerLocked(Binder.getCallingUid(), pkg);
@@ -316,7 +317,7 @@ public class ClipboardService extends SystemService {
        public ClipDescription getPrimaryClipDescription(String callingPackage) {
            synchronized (this) {
                if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, callingPackage,
                            Binder.getCallingUid())) {
                            Binder.getCallingUid()) || isDeviceLocked()) {
                    return null;
                }
                PerUserClipboard clipboard = getClipboard();
@@ -328,7 +329,7 @@ public class ClipboardService extends SystemService {
        public boolean hasPrimaryClip(String callingPackage) {
            synchronized (this) {
                if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, callingPackage,
                            Binder.getCallingUid())) {
                            Binder.getCallingUid()) || isDeviceLocked()) {
                    return false;
                }
                return getClipboard().primaryClip != null;
@@ -355,7 +356,7 @@ public class ClipboardService extends SystemService {
        public boolean hasClipboardText(String callingPackage) {
            synchronized (this) {
                if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, callingPackage,
                            Binder.getCallingUid())) {
                            Binder.getCallingUid()) || isDeviceLocked()) {
                    return false;
                }
                PerUserClipboard clipboard = getClipboard();
@@ -433,6 +434,12 @@ public class ClipboardService extends SystemService {
        }
    }

    private boolean isDeviceLocked() {
        final KeyguardManager keyguardManager = getContext().getSystemService(
                    KeyguardManager.class);
        return keyguardManager != null && keyguardManager.isDeviceLocked();
    }

    private final void checkUriOwnerLocked(Uri uri, int uid) {
        if (!"content".equals(uri.getScheme())) {
            return;
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.wm;

import static android.Manifest.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
@@ -82,6 +83,7 @@ public class Session extends IWindowSession.Stub
    // Set of visible alert window surfaces connected to this session.
    private final Set<WindowSurfaceController> mAlertWindowSurfaces = new HashSet<>();
    final boolean mCanAddInternalSystemWindow;
    final boolean mCanHideNonSystemOverlayWindows;
    private AlertWindowNotification mAlertWindowNotification;
    private boolean mShowingAlertWindowNotificationAllowed;
    private boolean mClientDead = false;
@@ -99,6 +101,8 @@ public class Session extends IWindowSession.Stub
        mLastReportedAnimatorScale = service.getCurrentAnimatorScale();
        mCanAddInternalSystemWindow = service.mContext.checkCallingOrSelfPermission(
                INTERNAL_SYSTEM_WINDOW) == PERMISSION_GRANTED;
        mCanHideNonSystemOverlayWindows = service.mContext.checkCallingOrSelfPermission(
                HIDE_NON_SYSTEM_OVERLAY_WINDOWS) == PERMISSION_GRANTED;
        mShowingAlertWindowNotificationAllowed = mService.mShowAlertWindowNotifications;
        StringBuilder sb = new StringBuilder();
        sb.append("Session{");
Loading