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

Commit b9024d28 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[flexiglass] Respect FoldGracePeriodProvider when showing dismissible LS

TSIA

Bug: 341445974
Test: manually verified that the feature falls back to just shutting off
the display if the for-eng system prop is turned off with adb shell setprop persist.fold_grace_period_enabled false && adb reboot
Test: manually verified that the feature still works if the system prop
is set to true
Flag: com.android.systemui.scene_container

Change-Id: Ia3157bca6d5152641d5024155cc5d8c08918787c
parent ce840f5b
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ import android.window.RemoteTransitionStub;
import android.window.TransitionInfo;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.foldables.FoldGracePeriodProvider;
import com.android.internal.policy.IKeyguardDismissCallback;
import com.android.internal.policy.IKeyguardDrawnCallback;
import com.android.internal.policy.IKeyguardExitCallback;
@@ -308,6 +309,13 @@ public class KeyguardService extends Service {

    private final WindowManagerOcclusionManager mWmOcclusionManager;

    private final Lazy<FoldGracePeriodProvider> mFoldGracePeriodProvider = new Lazy<>() {
        @Override
        public FoldGracePeriodProvider get() {
            return new FoldGracePeriodProvider();
        }
    };

    @Inject
    public KeyguardService(
            KeyguardViewMediator keyguardViewMediator,
@@ -609,7 +617,8 @@ public class KeyguardService extends Service {
            trace("showDismissibleKeyguard");
            checkPermission();
            mKeyguardViewMediator.showDismissibleKeyguard();
            if (SceneContainerFlag.isEnabled()) {

            if (SceneContainerFlag.isEnabled() && mFoldGracePeriodProvider.get().isEnabled()) {
                mSceneInteractorLazy.get().changeScene(
                        Scenes.Lockscreen, "KeyguardService.showDismissibleKeyguard");
            }