Loading services/core/java/com/android/server/policy/PermissionPolicyService.java +7 −15 Original line number Diff line number Diff line Loading @@ -82,12 +82,10 @@ import android.util.LongSparseLongArray; import android.util.Slog; import android.util.SparseBooleanArray; import com.android.internal.R; import com.android.internal.annotations.GuardedBy; import com.android.internal.app.IAppOpsCallback; import com.android.internal.app.IAppOpsService; import com.android.internal.infra.AndroidFuture; import com.android.internal.policy.AttributeCache; import com.android.internal.util.IntPair; import com.android.internal.util.function.pooled.PooledLambda; import com.android.server.FgThread; Loading Loading @@ -167,6 +165,7 @@ public final class PermissionPolicyService extends SystemService { private Context mContext; private PackageManagerInternal mPackageManagerInternal; private PermissionManagerServiceInternal mPermissionManagerInternal; private ActivityTaskManagerInternal mActivityTaskManagerInternal; private NotificationManagerInternal mNotificationManager; private TelephonyManager mTelephonyManager; private final KeyguardManager mKeyguardManager; Loading @@ -189,6 +188,7 @@ public final class PermissionPolicyService extends SystemService { PackageManagerInternal.class); mPermissionManagerInternal = LocalServices.getService( PermissionManagerServiceInternal.class); mActivityTaskManagerInternal = LocalServices.getService(ActivityTaskManagerInternal.class); final IAppOpsService appOpsService = IAppOpsService.Stub.asInterface( ServiceManager.getService(Context.APP_OPS_SERVICE)); Loading Loading @@ -1154,7 +1154,7 @@ public final class PermissionPolicyService extends SystemService { activityInfo.packageName, info.getCallingPackage(), info.getIntent(), info.getCheckedOptions(), activityInfo.name, true) || isNoDisplayActivity(activityInfo)) { || isNoDisplayActivity(activityInfo, info.getUserId())) { return; } UserHandle user = UserHandle.of(taskInfo.userId); Loading @@ -1170,9 +1170,7 @@ public final class PermissionPolicyService extends SystemService { }; private void onActivityManagerReady() { ActivityTaskManagerInternal atm = LocalServices.getService(ActivityTaskManagerInternal.class); atm.registerActivityStartInterceptor( mActivityTaskManagerInternal.registerActivityStartInterceptor( ActivityInterceptorCallback.PERMISSION_POLICY_ORDERED_ID, mActivityInterceptorCallback); } Loading Loading @@ -1227,20 +1225,14 @@ public final class PermissionPolicyService extends SystemService { null, activityName, false); } private boolean isNoDisplayActivity(@NonNull ActivityInfo aInfo) { private boolean isNoDisplayActivity(@NonNull ActivityInfo aInfo, int userId) { final int themeResource = aInfo.getThemeResource(); if (themeResource == Resources.ID_NULL) { return false; } boolean noDisplay = false; final AttributeCache.Entry ent = AttributeCache.instance() .get(aInfo.packageName, themeResource, R.styleable.Window, 0); if (ent != null) { noDisplay = ent.array.getBoolean(R.styleable.Window_windowNoDisplay, false); } return noDisplay; return mActivityTaskManagerInternal.isNoDisplay(aInfo.packageName, themeResource, userId); } /** Loading services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java +3 −0 Original line number Diff line number Diff line Loading @@ -617,6 +617,9 @@ public abstract class ActivityTaskManagerInternal { */ public abstract boolean isBaseOfLockedTask(String packageName); /** Returns the value of {@link android.R.attr#windowNoDisplay} from the given theme. */ public abstract boolean isNoDisplay(String packageName, int theme, int userId); /** * Creates an interface to update configuration for the calling application. */ Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -7447,6 +7447,18 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } @Override public boolean isNoDisplay(String packageName, int theme, int userId) { if (!com.android.window.flags.Flags.cacheWindowStyle()) { final AttributeCache.Entry ent = AttributeCache.instance() .get(packageName, theme, R.styleable.Window, userId); return ent != null && ent.array.getBoolean(R.styleable.Window_windowNoDisplay, false); } final ActivityRecord.WindowStyle style = getWindowStyle(packageName, theme, userId); return style != null && style.noDisplay(); } @Override public PackageConfigurationUpdater createPackageConfigurationUpdater() { return new PackageConfigurationUpdaterImpl(Binder.getCallingPid(), Loading services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +2 −0 Original line number Diff line number Diff line Loading @@ -1009,6 +1009,8 @@ public class ActivityRecordTests extends WindowTestsBase { assertTrue(style.disablePreview()); assertTrue(style.optOutEdgeToEdge()); assertEquals(1 /* icon_preferred */, style.mSplashScreenBehavior); assertEquals(style.noDisplay(), mAtm.mInternal.isNoDisplay(activity.packageName, activity.info.theme, activity.mUserId)); } /** Loading Loading
services/core/java/com/android/server/policy/PermissionPolicyService.java +7 −15 Original line number Diff line number Diff line Loading @@ -82,12 +82,10 @@ import android.util.LongSparseLongArray; import android.util.Slog; import android.util.SparseBooleanArray; import com.android.internal.R; import com.android.internal.annotations.GuardedBy; import com.android.internal.app.IAppOpsCallback; import com.android.internal.app.IAppOpsService; import com.android.internal.infra.AndroidFuture; import com.android.internal.policy.AttributeCache; import com.android.internal.util.IntPair; import com.android.internal.util.function.pooled.PooledLambda; import com.android.server.FgThread; Loading Loading @@ -167,6 +165,7 @@ public final class PermissionPolicyService extends SystemService { private Context mContext; private PackageManagerInternal mPackageManagerInternal; private PermissionManagerServiceInternal mPermissionManagerInternal; private ActivityTaskManagerInternal mActivityTaskManagerInternal; private NotificationManagerInternal mNotificationManager; private TelephonyManager mTelephonyManager; private final KeyguardManager mKeyguardManager; Loading @@ -189,6 +188,7 @@ public final class PermissionPolicyService extends SystemService { PackageManagerInternal.class); mPermissionManagerInternal = LocalServices.getService( PermissionManagerServiceInternal.class); mActivityTaskManagerInternal = LocalServices.getService(ActivityTaskManagerInternal.class); final IAppOpsService appOpsService = IAppOpsService.Stub.asInterface( ServiceManager.getService(Context.APP_OPS_SERVICE)); Loading Loading @@ -1154,7 +1154,7 @@ public final class PermissionPolicyService extends SystemService { activityInfo.packageName, info.getCallingPackage(), info.getIntent(), info.getCheckedOptions(), activityInfo.name, true) || isNoDisplayActivity(activityInfo)) { || isNoDisplayActivity(activityInfo, info.getUserId())) { return; } UserHandle user = UserHandle.of(taskInfo.userId); Loading @@ -1170,9 +1170,7 @@ public final class PermissionPolicyService extends SystemService { }; private void onActivityManagerReady() { ActivityTaskManagerInternal atm = LocalServices.getService(ActivityTaskManagerInternal.class); atm.registerActivityStartInterceptor( mActivityTaskManagerInternal.registerActivityStartInterceptor( ActivityInterceptorCallback.PERMISSION_POLICY_ORDERED_ID, mActivityInterceptorCallback); } Loading Loading @@ -1227,20 +1225,14 @@ public final class PermissionPolicyService extends SystemService { null, activityName, false); } private boolean isNoDisplayActivity(@NonNull ActivityInfo aInfo) { private boolean isNoDisplayActivity(@NonNull ActivityInfo aInfo, int userId) { final int themeResource = aInfo.getThemeResource(); if (themeResource == Resources.ID_NULL) { return false; } boolean noDisplay = false; final AttributeCache.Entry ent = AttributeCache.instance() .get(aInfo.packageName, themeResource, R.styleable.Window, 0); if (ent != null) { noDisplay = ent.array.getBoolean(R.styleable.Window_windowNoDisplay, false); } return noDisplay; return mActivityTaskManagerInternal.isNoDisplay(aInfo.packageName, themeResource, userId); } /** Loading
services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java +3 −0 Original line number Diff line number Diff line Loading @@ -617,6 +617,9 @@ public abstract class ActivityTaskManagerInternal { */ public abstract boolean isBaseOfLockedTask(String packageName); /** Returns the value of {@link android.R.attr#windowNoDisplay} from the given theme. */ public abstract boolean isNoDisplay(String packageName, int theme, int userId); /** * Creates an interface to update configuration for the calling application. */ Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -7447,6 +7447,18 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } @Override public boolean isNoDisplay(String packageName, int theme, int userId) { if (!com.android.window.flags.Flags.cacheWindowStyle()) { final AttributeCache.Entry ent = AttributeCache.instance() .get(packageName, theme, R.styleable.Window, userId); return ent != null && ent.array.getBoolean(R.styleable.Window_windowNoDisplay, false); } final ActivityRecord.WindowStyle style = getWindowStyle(packageName, theme, userId); return style != null && style.noDisplay(); } @Override public PackageConfigurationUpdater createPackageConfigurationUpdater() { return new PackageConfigurationUpdaterImpl(Binder.getCallingPid(), Loading
services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +2 −0 Original line number Diff line number Diff line Loading @@ -1009,6 +1009,8 @@ public class ActivityRecordTests extends WindowTestsBase { assertTrue(style.disablePreview()); assertTrue(style.optOutEdgeToEdge()); assertEquals(1 /* icon_preferred */, style.mSplashScreenBehavior); assertEquals(style.noDisplay(), mAtm.mInternal.isNoDisplay(activity.packageName, activity.info.theme, activity.mUserId)); } /** Loading