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

Commit e888cc04 authored by Yifei Zhang's avatar Yifei Zhang
Browse files

wm: expose isKeyguardShowing() in WindowManagerInternal

- Right now, the KeyguardLockedStateListener callback argument has a
  different source (mPolicy.keyguardOn) from KeyguardManager.isKeyguardLocked().
- This change allows client to read the correct initial state through
  WindowManagerInternal API

Test: manual
Flag: EXEMPT, refactor (pure structural change)
Bug: 414604681
Change-Id: Icc9c1aed479bcbe62d83e67b0c6d0597ddf883e4
parent f880c8e4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -546,6 +546,13 @@ public abstract class WindowManagerInternal {
     */
    public abstract boolean isKeyguardLocked();

    /**
     * @return Whether the keyguard is showing, reported by WindowManager policy. This value matches
     * the initial value reported by {@link android.app.KeyguardManager#isKeyguardLocked()}, for
     * system_server internal use only.
     */
    public abstract boolean isKeyguardShowing();

    /**
    * @return Whether the keyguard is showing and not occluded.
    */
+5 −0
Original line number Diff line number Diff line
@@ -8098,6 +8098,11 @@ public class WindowManagerService extends IWindowManager.Stub
            return WindowManagerService.this.isKeyguardShowingAndNotOccluded();
        }

        @Override
        public boolean isKeyguardShowing() {
            return mPolicy.isKeyguardShowing();
        }

        @Override
        public boolean isKeyguardSecure(@UserIdInt int userId) {
            return mPolicy.isKeyguardSecure(userId);