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

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

Snap for 6359775 from b6cde4b8 to qt-qpr3-release

Change-Id: I6f81740291a717c85bb40dfeae7f50ec04fcb81b
parents 33522b77 b6cde4b8
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -26,18 +26,18 @@ import android.content.res.Resources;
import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManager.DisplayListener;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.Display;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
import android.os.Handler;
import android.os.Message;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;

/**
 * Base class for presentations.
@@ -116,9 +116,7 @@ import android.view.WindowManagerImpl;
 * The display manager keeps track of all displays in the system.  However, not all
 * displays are appropriate for showing presentations.  For example, if an activity
 * attempted to show a presentation on the main display it might obscure its own content
 * (it's like opening a dialog on top of your activity).  Creating a presentation on the main
 * display will result in {@link android.view.WindowManager.InvalidDisplayException} being thrown
 * when invoking {@link #show()}.
 * (it's like opening a dialog on top of your activity).
 * </p><p>
 * Here's how to identify suitable displays for showing presentations using
 * {@link DisplayManager#getDisplays(String)} and the
@@ -245,7 +243,7 @@ public class Presentation extends Dialog {
    /**
     * Inherited from {@link Dialog#show}. Will throw
     * {@link android.view.WindowManager.InvalidDisplayException} if the specified secondary
     * {@link Display} can't be found or if it does not have {@link Display#FLAG_PRESENTATION} set.
     * {@link Display} can't be found.
     */
    @Override
    public void show() {
+5 −0
Original line number Diff line number Diff line
@@ -3530,6 +3530,11 @@
    <permission android:name="android.permission.OBSERVE_ROLE_HOLDERS"
                android:protectionLevel="signature|installer" />

    <!-- Allows an application to manage the companion devices.
         @hide -->
    <permission android:name="android.permission.MANAGE_COMPANION_DEVICES"
                android:protectionLevel="signature" />

    <!-- @SystemApi Allows an application to use SurfaceFlinger's low level features.
         <p>Not for use by third-party applications.
         @hide
+1 −0
Original line number Diff line number Diff line
@@ -181,6 +181,7 @@
    <uses-permission android:name="android.permission.READ_CLIPBOARD_IN_BACKGROUND" />
    <!-- Permission needed to wipe the device for Test Harness Mode -->
    <uses-permission android:name="android.permission.ENABLE_TEST_HARNESS_MODE" />
    <uses-permission android:name="android.permission.MANAGE_COMPANION_DEVICES" />

    <uses-permission android:name="android.permission.MANAGE_APPOPS" />

+5 −0
Original line number Diff line number Diff line
@@ -660,6 +660,11 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
                + "associate USER_ID PACKAGE MAC_ADDRESS\n"
                + "disassociate USER_ID PACKAGE MAC_ADDRESS";

        ShellCmd() {
            getContext().enforceCallingOrSelfPermission(
                    android.Manifest.permission.MANAGE_COMPANION_DEVICES, "ShellCmd");
        }

        @Override
        public int onCommand(String cmd) {
            switch (cmd) {
+0 −8
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_DREAM;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG;
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR;
import static android.view.WindowManager.LayoutParams.TYPE_PRESENTATION;
import static android.view.WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION;
import static android.view.WindowManager.LayoutParams.TYPE_QS_DIALOG;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
@@ -1298,13 +1297,6 @@ public class WindowManagerService extends IWindowManager.Stub
                return WindowManagerGlobal.ADD_PERMISSION_DENIED;
            }

            if (type == TYPE_PRESENTATION && !displayContent.getDisplay().isPublicPresentation()) {
                Slog.w(TAG_WM,
                        "Attempted to add presentation window to a non-suitable display.  "
                                + "Aborting.");
                return WindowManagerGlobal.ADD_INVALID_DISPLAY;
            }

            AppWindowToken atoken = null;
            final boolean hasParent = parentWindow != null;
            // Use existing parent window token for child windows since they go in the same token