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

Commit 8f6b6dff authored by Charles Chen's avatar Charles Chen Committed by Automerger Merge Worker
Browse files

Merge "Trust System UI owned display to receive keys" into rvc-dev am:...

Merge "Trust System UI owned display to receive keys" into rvc-dev am: 94deecfd am: d09b0f10 am: 8fccd6e1 am: a7050e96

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11570100

Change-Id: I6fcea62dffe51d3cbc522beb8e63e90ab27fb6d1
parents f6ce15ce a7050e96
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5098,6 +5098,7 @@ package android.view {
    method @NonNull public android.graphics.ColorSpace[] getSupportedWideColorGamut();
    method public int getType();
    method public boolean hasAccess(int);
    field public static final int FLAG_TRUSTED = 128; // 0x80
    field public static final int TYPE_EXTERNAL = 2; // 0x2
    field public static final int TYPE_INTERNAL = 1; // 0x1
    field public static final int TYPE_OVERLAY = 4; // 0x4
+12 −0
Original line number Diff line number Diff line
@@ -303,13 +303,25 @@ public final class DisplayManager {
    /**
     * Virtual display flag: Indicates that the display should support system decorations. Virtual
     * displays without this flag shouldn't show home, IME or any other system decorations.
     * <p>This flag doesn't work without {@link #VIRTUAL_DISPLAY_FLAG_TRUSTED}</p>
     *
     * @see #createVirtualDisplay
     * @see #VIRTUAL_DISPLAY_FLAG_TRUSTED
     * @hide
     */
    // TODO (b/114338689): Remove the flag and use IWindowManager#setShouldShowSystemDecors
    public static final int VIRTUAL_DISPLAY_FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS = 1 << 9;

    /**
     * Virtual display flags: Indicates that the display is trusted to show system decorations and
     * receive inputs without users' touch.
     *
     * @see #createVirtualDisplay
     * @see #VIRTUAL_DISPLAY_FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS
     * @hide
     */
    public static final int VIRTUAL_DISPLAY_FLAG_TRUSTED = 1 << 10;

    /** @hide */
    public DisplayManager(Context context) {
        mContext = context;
+24 −0
Original line number Diff line number Diff line
@@ -241,12 +241,25 @@ public final class Display {
     * This flag identifies secondary displays that should show system decorations, such as status
     * bar, navigation bar, home activity or IME.
     * </p>
     * <p>Note that this flag doesn't work without {@link #FLAG_TRUSTED}</p>
     *
     * @see #getFlags()
     * @hide
     */
    // TODO (b/114338689): Remove the flag and use IWindowManager#setShouldShowSystemDecors
    public static final int FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS = 1 << 6;

    /**
     * Flag: The display is trusted to show system decorations and receive inputs without users'
     * touch.
     * @see #FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS
     *
     * @see #getFlags()
     * @hide
     */
    @TestApi
    public static final int FLAG_TRUSTED = 1 << 7;

    /**
     * Display flag: Indicates that the contents of the display should not be scaled
     * to fit the physical screen dimensions.  Used for development only to emulate
@@ -564,6 +577,7 @@ public final class Display {
     * @see #FLAG_SUPPORTS_PROTECTED_BUFFERS
     * @see #FLAG_SECURE
     * @see #FLAG_PRIVATE
     * @see #FLAG_ROUND
     */
    public int getFlags() {
        return mFlags;
@@ -1222,6 +1236,16 @@ public final class Display {
                Display.FLAG_PRESENTATION;
    }

    /**
     * @return {@code true} if the display is a trusted display.
     *
     * @see #FLAG_TRUSTED
     * @hide
     */
    public boolean isTrusted() {
        return (mFlags & FLAG_TRUSTED) == FLAG_TRUSTED;
    }

    private void updateDisplayInfoLocked() {
        // Note: The display manager caches display info objects on our behalf.
        DisplayInfo newInfo = mGlobal.getDisplayInfo(mDisplayId);
+9 −0
Original line number Diff line number Diff line
@@ -717,6 +717,15 @@ public final class DisplayInfo implements Parcelable {
        if ((flags & Display.FLAG_ROUND) != 0) {
            result.append(", FLAG_ROUND");
        }
        if ((flags & Display.FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD) != 0) {
            result.append(", FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD");
        }
        if ((flags & Display.FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) != 0) {
            result.append(", FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS");
        }
        if ((flags & Display.FLAG_TRUSTED) != 0) {
            result.append(", FLAG_TRUSTED");
        }
        return result.toString();
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -5027,6 +5027,10 @@
    <permission android:name="android.permission.ACCESS_TV_DESCRAMBLER"
        android:protectionLevel="signature|privileged|vendorPrivileged" />

    <!-- Allows an application to create trusted displays. @hide -->
    <permission android:name="android.permission.ADD_TRUSTED_DISPLAY"
                android:protectionLevel="signature" />

    <!-- @hide @SystemApi Allows an application to access locusId events in the usage stats. -->
    <permission android:name="android.permission.ACCESS_LOCUS_ID_USAGE_STATS"
                android:protectionLevel="signature|appPredictor" />
Loading