From 7329e7fc0185c0800e36fc03d04f060955cc9193 Mon Sep 17 00:00:00 2001 From: Naomi Musgrave Date: Fri, 21 May 2021 13:54:57 +0100 Subject: [PATCH] Remove SystemUI exclusion for sandboxing SystemUI was excluded from being returned an activity window's bounds if the activity is eligible for size compat mode. SystemUI was identified by the permissions check for INTERNAL_SYSTEM_WINDOW. After confirming with SystemUI, this is no longer necessary. Note that SystemUI has been returned DisplayArea bounds from the display APIs for a few months now, with no ill effects. Bug: 187491004 Test: atest com.android.server.wm.SizeCompatTests Change-Id: Id2812cb389bb854ee02c11968fb960c9f044b175 --- .../java/com/android/server/wm/ActivityRecord.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 8f3702ac1a5e7..2c4cfd439d8d8 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -16,7 +16,6 @@ package com.android.server.wm; -import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW; import static android.app.ActivityManager.LOCK_TASK_MODE_NONE; import static android.app.ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND; import static android.app.ActivityOptions.ANIM_CLIP_REVEAL; @@ -90,7 +89,6 @@ import static android.content.pm.ActivityInfo.SIZE_CHANGES_SUPPORTED_OVERRIDE; import static android.content.pm.ActivityInfo.SIZE_CHANGES_UNSUPPORTED_OVERRIDE; import static android.content.pm.ActivityInfo.isFixedOrientationLandscape; import static android.content.pm.ActivityInfo.isFixedOrientationPortrait; -import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.content.res.Configuration.ASSETS_SEQ_UNDEFINED; import static android.content.res.Configuration.EMPTY; import static android.content.res.Configuration.ORIENTATION_LANDSCAPE; @@ -281,7 +279,6 @@ import android.os.SystemClock; import android.os.Trace; import android.os.UserHandle; import android.os.storage.StorageManager; -import android.permission.PermissionManager; import android.service.dreams.DreamActivity; import android.service.dreams.DreamManagerInternal; import android.service.voice.IVoiceInteractionSession; @@ -7343,11 +7340,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A @Override public boolean providesMaxBounds() { - // System and SystemUI should always be able to access the physical display bounds, - // so do not provide it with the overridden maximum bounds. - // TODO(b/179179513) check WindowState#mOwnerCanAddInternalSystemWindow instead - if (getUid() == SYSTEM_UID || PermissionManager.checkPermission(INTERNAL_SYSTEM_WINDOW, - getPid(), info.applicationInfo.uid) == PERMISSION_GRANTED) { + // System should always be able to access the DisplayArea bounds, so do not provide it with + // compat max window bounds. + if (getUid() == SYSTEM_UID) { return false; } // Do not sandbox to activity window bounds if the feature is disabled.