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

Commit 0796187e authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Deprecate FLAG_DISMISS_KEYGUARD

Since we now have an explicit dismiss method the flag is only
dangerous for falsing. The behavior will be migrated in the
following way:

- Insecure: Treat as FLAG_SHOW_WHEN_LOCKED
- Trusted: Actually dismiss Keyguard.
- Secure: Show bouncer.

We also restore the behavior to not allow dismissing the Keyguard
while it is occluded, which was the case in Nougat.

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
android.server.cts.KeyguardTests

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
android.server.cts.KeyguardLockedTests

Test: Insecure: Launch FLAG_DISMISS_KEYGUARD activity, make sure
Keyguard is occluded.

Test: Secure: Launch FLAG_DISMISS_KEYGUARD from SHOW_WHEN_LOCKED, make
sure bouncer is shown.

Test: Trusted: Launch FLAG_DISMISS_KEYGUARD from SHOW_WHEN_LOCKED, make
sure Keyguard gets unlocked.

Test: Trusted: Launch FLAG_DISMISS_KEYGUARD, lock screen, make sure
Keyguard is not dismissed/occluded.

Change-Id: I0d1ec9397a83975adb065c6cb81bf23b08c55395
parent 241ae10b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44180,7 +44180,7 @@ package android.view {
    field public static final int FLAG_ALT_FOCUSABLE_IM = 131072; // 0x20000
    field public static final deprecated int FLAG_BLUR_BEHIND = 4; // 0x4
    field public static final int FLAG_DIM_BEHIND = 2; // 0x2
    field public static final int FLAG_DISMISS_KEYGUARD = 4194304; // 0x400000
    field public static final deprecated int FLAG_DISMISS_KEYGUARD = 4194304; // 0x400000
    field public static final deprecated int FLAG_DITHER = 4096; // 0x1000
    field public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = -2147483648; // 0x80000000
    field public static final int FLAG_FORCE_NOT_FULLSCREEN = 2048; // 0x800
+1 −1
Original line number Diff line number Diff line
@@ -47351,7 +47351,7 @@ package android.view {
    field public static final int FLAG_ALT_FOCUSABLE_IM = 131072; // 0x20000
    field public static final deprecated int FLAG_BLUR_BEHIND = 4; // 0x4
    field public static final int FLAG_DIM_BEHIND = 2; // 0x2
    field public static final int FLAG_DISMISS_KEYGUARD = 4194304; // 0x400000
    field public static final deprecated int FLAG_DISMISS_KEYGUARD = 4194304; // 0x400000
    field public static final deprecated int FLAG_DITHER = 4096; // 0x1000
    field public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = -2147483648; // 0x80000000
    field public static final int FLAG_FORCE_NOT_FULLSCREEN = 2048; // 0x800
+1 −1
Original line number Diff line number Diff line
@@ -44425,7 +44425,7 @@ package android.view {
    field public static final int FLAG_ALT_FOCUSABLE_IM = 131072; // 0x20000
    field public static final deprecated int FLAG_BLUR_BEHIND = 4; // 0x4
    field public static final int FLAG_DIM_BEHIND = 2; // 0x2
    field public static final int FLAG_DISMISS_KEYGUARD = 4194304; // 0x400000
    field public static final deprecated int FLAG_DISMISS_KEYGUARD = 4194304; // 0x400000
    field public static final deprecated int FLAG_DITHER = 4096; // 0x1000
    field public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = -2147483648; // 0x80000000
    field public static final int FLAG_FORCE_NOT_FULLSCREEN = 2048; // 0x800
+4 −1
Original line number Diff line number Diff line
@@ -922,8 +922,11 @@ public interface WindowManager extends ViewManager {
         * unlock credential) than the user will still need to confirm it before
         * seeing this window, unless {@link #FLAG_SHOW_WHEN_LOCKED} has
         * also been set.
         * @see KeyguardManager#dismissKeyguard
         * @deprecated Use {@link #FLAG_SHOW_WHEN_LOCKED} or {@link KeyguardManager#dismissKeyguard}
         * instead. The Keyguard should never be dismissed automatically repeatedly as it also
         * guards against unintentional touches.
         */
        @Deprecated
        public static final int FLAG_DISMISS_KEYGUARD = 0x00400000;

        /** Window flag: when set the window will accept for touch events
+3 −4
Original line number Diff line number Diff line
@@ -1825,11 +1825,10 @@ final class ActivityStack extends ConfigurationContainer {
            // If keyguard is showing, nothing is visible, except if we are able to dismiss Keyguard
            // right away.
            return shouldBeVisible && mStackSupervisor.mKeyguardController
                    .canShowActivityWhileKeyguardShowing(dismissKeyguard);
                    .canShowActivityWhileKeyguardShowing(r, dismissKeyguard);
        } else if (keyguardLocked) {

            // Show when locked windows above keyguard.
            return shouldBeVisible && showWhenLocked;
            return shouldBeVisible && mStackSupervisor.mKeyguardController.canShowWhileOccluded(
                    dismissKeyguard, showWhenLocked);
        } else {
            return shouldBeVisible;
        }
Loading