Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -5103,6 +5103,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 Loading core/java/android/hardware/display/DisplayManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -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; Loading core/java/android/view/Display.java +24 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; Loading Loading @@ -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); Loading core/java/android/view/DisplayInfo.java +9 −0 Original line number Diff line number Diff line Loading @@ -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(); } } core/res/AndroidManifest.xml +4 −0 Original line number Diff line number Diff line Loading @@ -5028,6 +5028,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 Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -5103,6 +5103,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 Loading
core/java/android/hardware/display/DisplayManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -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; Loading
core/java/android/view/Display.java +24 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; Loading Loading @@ -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); Loading
core/java/android/view/DisplayInfo.java +9 −0 Original line number Diff line number Diff line Loading @@ -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(); } }
core/res/AndroidManifest.xml +4 −0 Original line number Diff line number Diff line Loading @@ -5028,6 +5028,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