Loading core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ package android { field public static final String GET_PACKAGE_SIZE = "android.permission.GET_PACKAGE_SIZE"; field @Deprecated public static final String GET_TASKS = "android.permission.GET_TASKS"; field public static final String GLOBAL_SEARCH = "android.permission.GLOBAL_SEARCH"; field public static final String HIDE_OVERLAY_WINDOWS = "android.permission.HIDE_OVERLAY_WINDOWS"; field public static final String INSTALL_LOCATION_PROVIDER = "android.permission.INSTALL_LOCATION_PROVIDER"; field public static final String INSTALL_PACKAGES = "android.permission.INSTALL_PACKAGES"; field public static final String INSTALL_SHORTCUT = "com.android.launcher.permission.INSTALL_SHORTCUT"; Loading Loading @@ -49424,6 +49425,7 @@ package android.view { method public void setFlags(int, int); method public void setFormat(int); method public void setGravity(int); method @RequiresPermission(android.Manifest.permission.HIDE_OVERLAY_WINDOWS) public final void setHideOverlayWindows(boolean); method public void setIcon(@DrawableRes int); method public void setLayout(int, int); method public void setLocalFocus(boolean, boolean); core/api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ package android { field public static final String HANDLE_CAR_MODE_CHANGES = "android.permission.HANDLE_CAR_MODE_CHANGES"; field public static final String HARDWARE_TEST = "android.permission.HARDWARE_TEST"; field public static final String HDMI_CEC = "android.permission.HDMI_CEC"; field public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"; field @Deprecated public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"; field public static final String INJECT_EVENTS = "android.permission.INJECT_EVENTS"; field public static final String INSTALL_DYNAMIC_SYSTEM = "android.permission.INSTALL_DYNAMIC_SYSTEM"; field public static final String INSTALL_GRANT_RUNTIME_PERMISSIONS = "android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS"; Loading core/java/android/view/Window.java +25 −0 Original line number Diff line number Diff line Loading @@ -16,7 +16,11 @@ package android.view; import static android.Manifest.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS; import static android.Manifest.permission.HIDE_OVERLAY_WINDOWS; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; import android.annotation.ColorInt; import android.annotation.DrawableRes; Loading @@ -24,6 +28,7 @@ import android.annotation.IdRes; import android.annotation.LayoutRes; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.StyleRes; import android.annotation.SystemApi; import android.annotation.TestApi; Loading Loading @@ -990,6 +995,26 @@ public abstract class Window { mRestrictedCaptionAreaRect = listener != null ? new Rect() : null; } /** * Prevent non-system overlay windows from being drawn on top of this window. * * @param hide whether non-system overlay windows should be hidden. */ @RequiresPermission(HIDE_OVERLAY_WINDOWS) public final void setHideOverlayWindows(boolean hide) { // This permission check is here to throw early and let the developer know that they need // to hold HIDE_OVERLAY_WINDOWS for the flag to have any effect. The WM verifies that the // owner of the window has the permission before applying the flag, but this is done // asynchronously. if (mContext.checkSelfPermission(HIDE_NON_SYSTEM_OVERLAY_WINDOWS) != PERMISSION_GRANTED && mContext.checkSelfPermission(HIDE_OVERLAY_WINDOWS) != PERMISSION_GRANTED) { throw new SecurityException( "Permission denial: setHideOverlayWindows: HIDE_OVERLAY_WINDOWS"); } setPrivateFlags(hide ? SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS : 0, SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); } /** * Take ownership of this window's surface. The window's view hierarchy * will no longer draw into the surface, though it will otherwise continue Loading core/res/AndroidManifest.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2732,6 +2732,10 @@ <permission android:name="android.permission.TOGGLE_AUTOMOTIVE_PROJECTION" android:protectionLevel="signature|privileged" /> <!-- Allows an app to prevent non-system-overlay windows from being drawn on top of it --> <permission android:name="android.permission.HIDE_OVERLAY_WINDOWS" android:protectionLevel="normal" /> <!-- ================================== --> <!-- Permissions affecting the system wallpaper --> <!-- ================================== --> Loading Loading @@ -3286,6 +3290,7 @@ {@link android.view.WindowManager.LayoutsParams#SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS} to hide non-system-overlay windows. <p>Not for use by third-party applications. @deprecated Use {@link android.Manifest.permission#HIDE_OVERLAY_WINDOWS} instead @hide --> <permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" Loading packages/Shell/AndroidManifest.xml +3 −0 Original line number Diff line number Diff line Loading @@ -364,6 +364,9 @@ <!-- Permissions required for CTS tests to close system dialogs --> <uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS" /> <!-- Permission required for CTS test - HideOverlayWindowsTest --> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <application android:label="@string/app_label" android:theme="@android:style/Theme.DeviceDefault.DayNight" android:defaultToDeviceProtectedStorage="true" Loading Loading
core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ package android { field public static final String GET_PACKAGE_SIZE = "android.permission.GET_PACKAGE_SIZE"; field @Deprecated public static final String GET_TASKS = "android.permission.GET_TASKS"; field public static final String GLOBAL_SEARCH = "android.permission.GLOBAL_SEARCH"; field public static final String HIDE_OVERLAY_WINDOWS = "android.permission.HIDE_OVERLAY_WINDOWS"; field public static final String INSTALL_LOCATION_PROVIDER = "android.permission.INSTALL_LOCATION_PROVIDER"; field public static final String INSTALL_PACKAGES = "android.permission.INSTALL_PACKAGES"; field public static final String INSTALL_SHORTCUT = "com.android.launcher.permission.INSTALL_SHORTCUT"; Loading Loading @@ -49424,6 +49425,7 @@ package android.view { method public void setFlags(int, int); method public void setFormat(int); method public void setGravity(int); method @RequiresPermission(android.Manifest.permission.HIDE_OVERLAY_WINDOWS) public final void setHideOverlayWindows(boolean); method public void setIcon(@DrawableRes int); method public void setLayout(int, int); method public void setLocalFocus(boolean, boolean);
core/api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ package android { field public static final String HANDLE_CAR_MODE_CHANGES = "android.permission.HANDLE_CAR_MODE_CHANGES"; field public static final String HARDWARE_TEST = "android.permission.HARDWARE_TEST"; field public static final String HDMI_CEC = "android.permission.HDMI_CEC"; field public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"; field @Deprecated public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"; field public static final String INJECT_EVENTS = "android.permission.INJECT_EVENTS"; field public static final String INSTALL_DYNAMIC_SYSTEM = "android.permission.INSTALL_DYNAMIC_SYSTEM"; field public static final String INSTALL_GRANT_RUNTIME_PERMISSIONS = "android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS"; Loading
core/java/android/view/Window.java +25 −0 Original line number Diff line number Diff line Loading @@ -16,7 +16,11 @@ package android.view; import static android.Manifest.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS; import static android.Manifest.permission.HIDE_OVERLAY_WINDOWS; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; import android.annotation.ColorInt; import android.annotation.DrawableRes; Loading @@ -24,6 +28,7 @@ import android.annotation.IdRes; import android.annotation.LayoutRes; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.StyleRes; import android.annotation.SystemApi; import android.annotation.TestApi; Loading Loading @@ -990,6 +995,26 @@ public abstract class Window { mRestrictedCaptionAreaRect = listener != null ? new Rect() : null; } /** * Prevent non-system overlay windows from being drawn on top of this window. * * @param hide whether non-system overlay windows should be hidden. */ @RequiresPermission(HIDE_OVERLAY_WINDOWS) public final void setHideOverlayWindows(boolean hide) { // This permission check is here to throw early and let the developer know that they need // to hold HIDE_OVERLAY_WINDOWS for the flag to have any effect. The WM verifies that the // owner of the window has the permission before applying the flag, but this is done // asynchronously. if (mContext.checkSelfPermission(HIDE_NON_SYSTEM_OVERLAY_WINDOWS) != PERMISSION_GRANTED && mContext.checkSelfPermission(HIDE_OVERLAY_WINDOWS) != PERMISSION_GRANTED) { throw new SecurityException( "Permission denial: setHideOverlayWindows: HIDE_OVERLAY_WINDOWS"); } setPrivateFlags(hide ? SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS : 0, SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); } /** * Take ownership of this window's surface. The window's view hierarchy * will no longer draw into the surface, though it will otherwise continue Loading
core/res/AndroidManifest.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2732,6 +2732,10 @@ <permission android:name="android.permission.TOGGLE_AUTOMOTIVE_PROJECTION" android:protectionLevel="signature|privileged" /> <!-- Allows an app to prevent non-system-overlay windows from being drawn on top of it --> <permission android:name="android.permission.HIDE_OVERLAY_WINDOWS" android:protectionLevel="normal" /> <!-- ================================== --> <!-- Permissions affecting the system wallpaper --> <!-- ================================== --> Loading Loading @@ -3286,6 +3290,7 @@ {@link android.view.WindowManager.LayoutsParams#SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS} to hide non-system-overlay windows. <p>Not for use by third-party applications. @deprecated Use {@link android.Manifest.permission#HIDE_OVERLAY_WINDOWS} instead @hide --> <permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" Loading
packages/Shell/AndroidManifest.xml +3 −0 Original line number Diff line number Diff line Loading @@ -364,6 +364,9 @@ <!-- Permissions required for CTS tests to close system dialogs --> <uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS" /> <!-- Permission required for CTS test - HideOverlayWindowsTest --> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <application android:label="@string/app_label" android:theme="@android:style/Theme.DeviceDefault.DayNight" android:defaultToDeviceProtectedStorage="true" Loading