Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2dfc6180 authored by Lucas Silva's avatar Lucas Silva Committed by Android (Google) Code Review
Browse files

Merge "Redirect to the bouncer if an SLS activity does not have showWhenLocked enabled."

parents 73939c06 a3197125
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -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 {
+1 −2
Original line number Diff line number Diff line
@@ -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