Remove special handling of recents

.. now that they've moved over to use SYSTEM_APPLICAITON_OVERLAY instead
of SYSTEM_ALERT_WINDOW.

Also removes recents from the protectionLevel of SAW.

Bug: 169054709
Test: atest PermissionPolicyTest
Test: atest CtsWindowManagerDeviceTestCases:HideOverlayWindowsTest
Test: Manually verified with modified launcher that recent section is
still visible while browsing settings

Change-Id: Ie8e21158d6c12eb43c5411d0cb2259a8823ccacd
This commit is contained in:
Linus Tufvesson
2021-02-02 10:10:41 +00:00
parent 224e5f0b31
commit 35e18c5f4e
3 changed files with 4 additions and 9 deletions

View File

@@ -2698,11 +2698,11 @@
The app can check whether it has this authorization by calling
{@link android.provider.Settings#canDrawOverlays
Settings.canDrawOverlays()}.
<p>Protection level: signature|appop|installer|recents|appPredictor|pre23|development -->
<p>Protection level: signature|appop|installer|appPredictor|pre23|development -->
<permission android:name="android.permission.SYSTEM_ALERT_WINDOW"
android:label="@string/permlab_systemAlertWindow"
android:description="@string/permdesc_systemAlertWindow"
android:protectionLevel="signature|appop|installer|recents|appPredictor|pre23|development" />
android:protectionLevel="signature|appop|installer|appPredictor|pre23|development" />
<!-- @SystemApi @hide Allows an application to create windows using the type
{@link android.view.WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY},

View File

@@ -104,9 +104,6 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
final boolean mCanAddInternalSystemWindow;
private final boolean mCanStartTasksFromRecents;
// If non-system overlays from this process can be hidden by the user or app using
// HIDE_NON_SYSTEM_OVERLAY_WINDOWS.
final boolean mOverlaysCanBeHidden;
final boolean mCanCreateSystemApplicationOverlay;
final boolean mCanHideNonSystemOverlayWindows;
final boolean mCanAcquireSleepToken;
@@ -136,8 +133,6 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
== PERMISSION_GRANTED;
mCanStartTasksFromRecents = service.mContext.checkCallingOrSelfPermission(
START_TASKS_FROM_RECENTS) == PERMISSION_GRANTED;
mOverlaysCanBeHidden = !mCanAddInternalSystemWindow
&& !mService.mAtmInternal.isCallerRecents(mUid);
mCanAcquireSleepToken = service.mContext.checkCallingOrSelfPermission(DEVICE_POWER)
== PERMISSION_GRANTED;
mShowingAlertWindowNotificationAllowed = mService.mShowAlertWindowNotifications;
@@ -682,7 +677,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
boolean changed;
if (mOverlaysCanBeHidden && !mCanCreateSystemApplicationOverlay) {
if (!mCanAddInternalSystemWindow && !mCanCreateSystemApplicationOverlay) {
// We want to track non-system apps adding alert windows so we can post an
// on-going notification for the user to control their visibility.
if (visible) {

View File

@@ -3100,7 +3100,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
}
void setForceHideNonSystemOverlayWindowIfNeeded(boolean forceHide) {
if (!mSession.mOverlaysCanBeHidden
if (mSession.mCanAddInternalSystemWindow
|| (!isSystemAlertWindowType(mAttrs.type) && mAttrs.type != TYPE_TOAST)) {
return;
}