Loading services/core/java/com/android/server/communal/CommunalManagerService.java +12 −1 Original line number Diff line number Diff line Loading @@ -236,7 +236,18 @@ public final class CommunalManagerService extends SystemService { private boolean shouldIntercept(ActivityInfo activityInfo) { if (!mCommunalViewIsShowing.get() || !mKeyguardManager.isKeyguardLocked()) return false; return !isAppAllowed(activityInfo.applicationInfo); ApplicationInfo appInfo = activityInfo.applicationInfo; // Dreams are allowed to show, and don't require the showWhenLocked attribute. if (isActiveDream(appInfo)) return false; // If the activity doesn't have showWhenLocked enabled, disallow the activity. final boolean showWhenLocked = (activityInfo.flags & ActivityInfo.FLAG_SHOW_WHEN_LOCKED) != 0; if (!showWhenLocked) { return true; } return !isAppAllowed(appInfo); } private final class BinderService extends ICommunalManager.Stub { Loading services/tests/mockingservicestests/src/com/android/server/communal/CommunalManagerServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -259,8 +259,7 @@ public class CommunalManagerServiceTest { mAInfo.flags = 0; allowPackages(TEST_PACKAGE_NAME); // TODO(b/191994709): Fix this assertion once we start checking showWhenLocked assertDoesNotIntercept(); assertDoesIntercept(); } @Test Loading Loading
services/core/java/com/android/server/communal/CommunalManagerService.java +12 −1 Original line number Diff line number Diff line Loading @@ -236,7 +236,18 @@ public final class CommunalManagerService extends SystemService { private boolean shouldIntercept(ActivityInfo activityInfo) { if (!mCommunalViewIsShowing.get() || !mKeyguardManager.isKeyguardLocked()) return false; return !isAppAllowed(activityInfo.applicationInfo); ApplicationInfo appInfo = activityInfo.applicationInfo; // Dreams are allowed to show, and don't require the showWhenLocked attribute. if (isActiveDream(appInfo)) return false; // If the activity doesn't have showWhenLocked enabled, disallow the activity. final boolean showWhenLocked = (activityInfo.flags & ActivityInfo.FLAG_SHOW_WHEN_LOCKED) != 0; if (!showWhenLocked) { return true; } return !isAppAllowed(appInfo); } private final class BinderService extends ICommunalManager.Stub { Loading
services/tests/mockingservicestests/src/com/android/server/communal/CommunalManagerServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -259,8 +259,7 @@ public class CommunalManagerServiceTest { mAInfo.flags = 0; allowPackages(TEST_PACKAGE_NAME); // TODO(b/191994709): Fix this assertion once we start checking showWhenLocked assertDoesNotIntercept(); assertDoesIntercept(); } @Test Loading