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

Commit 15997fd9 authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

Merge "Refactor SysUI's interface with...

Merge "Refactor SysUI's interface with ATMS#setLockScreenShown/keyguardGoingAway." into udc-qpr-dev am: 9c708647

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23881103



Change-Id: I438f14d51e3673520ed3ff5611d7bfd8a7506d95
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1c204270 9c708647
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -78,6 +78,7 @@ import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.flags.Flags;
import com.android.systemui.keyguard.domain.interactor.KeyguardFaceAuthInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardFaceAuthInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
import com.android.systemui.log.SessionTracker;
import com.android.systemui.log.SessionTracker;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.FalsingManager;
@@ -126,6 +127,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
    private final KeyguardFaceAuthInteractor mKeyguardFaceAuthInteractor;
    private final KeyguardFaceAuthInteractor mKeyguardFaceAuthInteractor;
    private final BouncerMessageInteractor mBouncerMessageInteractor;
    private final BouncerMessageInteractor mBouncerMessageInteractor;
    private int mTranslationY;
    private int mTranslationY;
    private final KeyguardTransitionInteractor mKeyguardTransitionInteractor;
    // Whether the volume keys should be handled by keyguard. If true, then
    // Whether the volume keys should be handled by keyguard. If true, then
    // they will be handled here for specific media types such as music, otherwise
    // they will be handled here for specific media types such as music, otherwise
    // the audio service will bring up the volume dialog.
    // the audio service will bring up the volume dialog.
@@ -299,6 +301,10 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
                    mViewMediatorCallback.keyguardDone(fromPrimaryAuth, targetUserId);
                    mViewMediatorCallback.keyguardDone(fromPrimaryAuth, targetUserId);
                }
                }
            }
            }

            if (mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                mKeyguardTransitionInteractor.startDismissKeyguardTransition();
            }
        }
        }


        @Override
        @Override
@@ -424,6 +430,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
            Provider<JavaAdapter> javaAdapter,
            Provider<JavaAdapter> javaAdapter,
            UserInteractor userInteractor,
            UserInteractor userInteractor,
            FaceAuthAccessibilityDelegate faceAuthAccessibilityDelegate,
            FaceAuthAccessibilityDelegate faceAuthAccessibilityDelegate,
            KeyguardTransitionInteractor keyguardTransitionInteractor,
            Provider<AuthenticationInteractor> authenticationInteractor
            Provider<AuthenticationInteractor> authenticationInteractor
    ) {
    ) {
        super(view);
        super(view);
@@ -455,6 +462,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
        mUserInteractor = userInteractor;
        mUserInteractor = userInteractor;
        mAuthenticationInteractor = authenticationInteractor;
        mAuthenticationInteractor = authenticationInteractor;
        mJavaAdapter = javaAdapter;
        mJavaAdapter = javaAdapter;
        mKeyguardTransitionInteractor = keyguardTransitionInteractor;
    }
    }


    @Override
    @Override
+13 −0
Original line number Original line Diff line number Diff line
@@ -302,6 +302,19 @@ object Flags {
            R.bool.flag_stop_pulsing_face_scanning_animation,
            R.bool.flag_stop_pulsing_face_scanning_animation,
            "stop_pulsing_face_scanning_animation")
            "stop_pulsing_face_scanning_animation")


    /**
     * TODO(b/278086361): Tracking bug
     * Complete rewrite of the interactions between System UI and Window Manager involving keyguard
     * state. When enabled, calls to ActivityTaskManagerService from System UI will exclusively
     * occur from [WmLockscreenVisibilityManager] rather than the legacy KeyguardViewMediator.
     *
     * This flag is under development; some types of unlock may not animate properly if you enable
     * it.
     */
    @JvmField
    val KEYGUARD_WM_STATE_REFACTOR: UnreleasedFlag =
            unreleasedFlag("keyguard_wm_state_refactor")

    // 300 - power menu
    // 300 - power menu
    // TODO(b/254512600): Tracking Bug
    // TODO(b/254512600): Tracking Bug
    @JvmField val POWER_MENU_LITE = releasedFlag("power_menu_lite")
    @JvmField val POWER_MENU_LITE = releasedFlag("power_menu_lite")
+32 −1
Original line number Original line Diff line number Diff line
@@ -73,6 +73,14 @@ import com.android.internal.policy.IKeyguardService;
import com.android.internal.policy.IKeyguardStateCallback;
import com.android.internal.policy.IKeyguardStateCallback;
import com.android.keyguard.mediator.ScreenOnCoordinator;
import com.android.keyguard.mediator.ScreenOnCoordinator;
import com.android.systemui.SystemUIApplication;
import com.android.systemui.SystemUIApplication;
import com.android.systemui.dagger.qualifiers.Application;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.keyguard.ui.binder.KeyguardSurfaceBehindParamsApplier;
import com.android.systemui.keyguard.ui.binder.KeyguardSurfaceBehindViewBinder;
import com.android.systemui.keyguard.ui.binder.WindowManagerLockscreenVisibilityViewBinder;
import com.android.systemui.keyguard.ui.viewmodel.KeyguardSurfaceBehindViewModel;
import com.android.systemui.keyguard.ui.viewmodel.WindowManagerLockscreenVisibilityViewModel;
import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.settings.DisplayTracker;
import com.android.wm.shell.transition.ShellTransitions;
import com.android.wm.shell.transition.ShellTransitions;
import com.android.wm.shell.transition.Transitions;
import com.android.wm.shell.transition.Transitions;
@@ -85,10 +93,13 @@ import java.util.WeakHashMap;


import javax.inject.Inject;
import javax.inject.Inject;


import kotlinx.coroutines.CoroutineScope;

public class KeyguardService extends Service {
public class KeyguardService extends Service {
    static final String TAG = "KeyguardService";
    static final String TAG = "KeyguardService";
    static final String PERMISSION = android.Manifest.permission.CONTROL_KEYGUARD;
    static final String PERMISSION = android.Manifest.permission.CONTROL_KEYGUARD;


    private final FeatureFlags mFlags;
    private final KeyguardViewMediator mKeyguardViewMediator;
    private final KeyguardViewMediator mKeyguardViewMediator;
    private final KeyguardLifecyclesDispatcher mKeyguardLifecyclesDispatcher;
    private final KeyguardLifecyclesDispatcher mKeyguardLifecyclesDispatcher;
    private final ScreenOnCoordinator mScreenOnCoordinator;
    private final ScreenOnCoordinator mScreenOnCoordinator;
@@ -291,13 +302,33 @@ public class KeyguardService extends Service {
                           KeyguardLifecyclesDispatcher keyguardLifecyclesDispatcher,
                           KeyguardLifecyclesDispatcher keyguardLifecyclesDispatcher,
                           ScreenOnCoordinator screenOnCoordinator,
                           ScreenOnCoordinator screenOnCoordinator,
                           ShellTransitions shellTransitions,
                           ShellTransitions shellTransitions,
                           DisplayTracker displayTracker) {
                           DisplayTracker displayTracker,
                           WindowManagerLockscreenVisibilityViewModel
                                   wmLockscreenVisibilityViewModel,
                           WindowManagerLockscreenVisibilityManager wmLockscreenVisibilityManager,
                           KeyguardSurfaceBehindViewModel keyguardSurfaceBehindViewModel,
                           KeyguardSurfaceBehindParamsApplier keyguardSurfaceBehindAnimator,
                           @Application CoroutineScope scope,
                           FeatureFlags featureFlags) {
        super();
        super();
        mKeyguardViewMediator = keyguardViewMediator;
        mKeyguardViewMediator = keyguardViewMediator;
        mKeyguardLifecyclesDispatcher = keyguardLifecyclesDispatcher;
        mKeyguardLifecyclesDispatcher = keyguardLifecyclesDispatcher;
        mScreenOnCoordinator = screenOnCoordinator;
        mScreenOnCoordinator = screenOnCoordinator;
        mShellTransitions = shellTransitions;
        mShellTransitions = shellTransitions;
        mDisplayTracker = displayTracker;
        mDisplayTracker = displayTracker;
        mFlags = featureFlags;

        if (mFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
            WindowManagerLockscreenVisibilityViewBinder.bind(
                    wmLockscreenVisibilityViewModel,
                    wmLockscreenVisibilityManager,
                    scope);

            KeyguardSurfaceBehindViewBinder.bind(
                    keyguardSurfaceBehindViewModel,
                    keyguardSurfaceBehindAnimator,
                    scope);
        }
    }
    }


    @Override
    @Override
+56 −49
Original line number Original line Diff line number Diff line
@@ -403,7 +403,9 @@ class KeyguardUnlockAnimationController @Inject constructor(
     * the device.
     * the device.
     */
     */
    fun canPerformInWindowLauncherAnimations(): Boolean {
    fun canPerformInWindowLauncherAnimations(): Boolean {
        return isNexusLauncherUnderneath() &&
        // TODO(b/278086361): Refactor in-window animations.
        return !featureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR) &&
                isNexusLauncherUnderneath() &&
                // If the launcher is underneath, but we're about to launch an activity, don't do
                // If the launcher is underneath, but we're about to launch an activity, don't do
                // the animations since they won't be visible.
                // the animations since they won't be visible.
                !notificationShadeWindowController.isLaunchingActivity &&
                !notificationShadeWindowController.isLaunchingActivity &&
@@ -847,14 +849,16 @@ class KeyguardUnlockAnimationController @Inject constructor(
        }
        }


        surfaceBehindRemoteAnimationTargets?.forEach { surfaceBehindRemoteAnimationTarget ->
        surfaceBehindRemoteAnimationTargets?.forEach { surfaceBehindRemoteAnimationTarget ->
            val surfaceHeight: Int = surfaceBehindRemoteAnimationTarget.screenSpaceBounds.height()
            if (!featureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                val surfaceHeight: Int =
                        surfaceBehindRemoteAnimationTarget.screenSpaceBounds.height()


                var scaleFactor = (SURFACE_BEHIND_START_SCALE_FACTOR +
                var scaleFactor = (SURFACE_BEHIND_START_SCALE_FACTOR +
                        (1f - SURFACE_BEHIND_START_SCALE_FACTOR) *
                        (1f - SURFACE_BEHIND_START_SCALE_FACTOR) *
                        MathUtils.clamp(amount, 0f, 1f))
                        MathUtils.clamp(amount, 0f, 1f))


            // If we're dismissing via swipe to the Launcher, we'll play in-window scale animations,
                // If we're dismissing via swipe to the Launcher, we'll play in-window scale
            // so don't also scale the window.
                // animations, so don't also scale the window.
                if (keyguardStateController.isDismissingFromSwipe &&
                if (keyguardStateController.isDismissingFromSwipe &&
                        willUnlockWithInWindowLauncherAnimations) {
                        willUnlockWithInWindowLauncherAnimations) {
                    scaleFactor = 1f
                    scaleFactor = 1f
@@ -897,6 +901,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
                    )
                    )
                }
                }
            }
            }
        }


        if (wallpapers) {
        if (wallpapers) {
            setWallpaperAppearAmount(amount)
            setWallpaperAppearAmount(amount)
@@ -983,10 +988,12 @@ class KeyguardUnlockAnimationController @Inject constructor(
        if (keyguardStateController.isShowing) {
        if (keyguardStateController.isShowing) {
            // Hide the keyguard, with no fade out since we animated it away during the unlock.
            // Hide the keyguard, with no fade out since we animated it away during the unlock.


            if (!featureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                keyguardViewController.hide(
                keyguardViewController.hide(
                        surfaceBehindRemoteAnimationStartTime,
                        surfaceBehindRemoteAnimationStartTime,
                        0 /* fadeOutDuration */
                        0 /* fadeOutDuration */
                )
                )
            }
        } else {
        } else {
            Log.i(TAG, "#hideKeyguardViewAfterRemoteAnimation called when keyguard view is not " +
            Log.i(TAG, "#hideKeyguardViewAfterRemoteAnimation called when keyguard view is not " +
                    "showing. Ignoring...")
                    "showing. Ignoring...")
+76 −30
Original line number Original line Diff line number Diff line
@@ -171,8 +171,6 @@ import com.android.systemui.util.time.SystemClock;
import com.android.systemui.wallpapers.data.repository.WallpaperRepository;
import com.android.systemui.wallpapers.data.repository.WallpaperRepository;
import com.android.wm.shell.keyguard.KeyguardTransitions;
import com.android.wm.shell.keyguard.KeyguardTransitions;


import dagger.Lazy;

import java.io.PrintWriter;
import java.io.PrintWriter;
import java.lang.annotation.Retention;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.RetentionPolicy;
@@ -182,6 +180,7 @@ import java.util.Objects;
import java.util.concurrent.Executor;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
import java.util.function.Consumer;


import dagger.Lazy;
import kotlinx.coroutines.CoroutineDispatcher;
import kotlinx.coroutines.CoroutineDispatcher;


/**
/**
@@ -1035,12 +1034,19 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                IRemoteAnimationFinishedCallback finishedCallback) {
                IRemoteAnimationFinishedCallback finishedCallback) {
            Trace.beginSection("mExitAnimationRunner.onAnimationStart#startKeyguardExitAnimation");
            Trace.beginSection("mExitAnimationRunner.onAnimationStart#startKeyguardExitAnimation");
            startKeyguardExitAnimation(transit, apps, wallpapers, nonApps, finishedCallback);
            startKeyguardExitAnimation(transit, apps, wallpapers, nonApps, finishedCallback);
            if (mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                mWmLockscreenVisibilityManager.get().onKeyguardGoingAwayRemoteAnimationStart(
                        transit, apps, wallpapers, nonApps, finishedCallback);
            }
            Trace.endSection();
            Trace.endSection();
        }
        }


        @Override // Binder interface
        @Override // Binder interface
        public void onAnimationCancelled() {
        public void onAnimationCancelled() {
            cancelKeyguardExitAnimation();
            cancelKeyguardExitAnimation();
            if (mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                mWmLockscreenVisibilityManager.get().onKeyguardGoingAwayRemoteAnimationCancelled();
            }
        }
        }
    };
    };


@@ -1106,7 +1112,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,


                        mOccludeByDreamAnimator = ValueAnimator.ofFloat(0f, 1f);
                        mOccludeByDreamAnimator = ValueAnimator.ofFloat(0f, 1f);
                        mOccludeByDreamAnimator.setDuration(mDreamOpenAnimationDuration);
                        mOccludeByDreamAnimator.setDuration(mDreamOpenAnimationDuration);
                        mOccludeByDreamAnimator.setInterpolator(Interpolators.LINEAR);
                        //mOccludeByDreamAnimator.setInterpolator(Interpolators.LINEAR);
                        mOccludeByDreamAnimator.addUpdateListener(
                        mOccludeByDreamAnimator.addUpdateListener(
                                animation -> {
                                animation -> {
                                    SyncRtSurfaceTransactionApplier.SurfaceParams.Builder
                                    SyncRtSurfaceTransactionApplier.SurfaceParams.Builder
@@ -1335,6 +1341,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            mDreamingToLockscreenTransitionViewModel;
            mDreamingToLockscreenTransitionViewModel;
    private RemoteAnimationTarget mRemoteAnimationTarget;
    private RemoteAnimationTarget mRemoteAnimationTarget;


    private Lazy<WindowManagerLockscreenVisibilityManager> mWmLockscreenVisibilityManager;

    /**
    /**
     * Injected constructor. See {@link KeyguardModule}.
     * Injected constructor. See {@link KeyguardModule}.
     */
     */
@@ -1377,7 +1385,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            SystemClock systemClock,
            SystemClock systemClock,
            @Main CoroutineDispatcher mainDispatcher,
            @Main CoroutineDispatcher mainDispatcher,
            Lazy<DreamingToLockscreenTransitionViewModel> dreamingToLockscreenTransitionViewModel,
            Lazy<DreamingToLockscreenTransitionViewModel> dreamingToLockscreenTransitionViewModel,
            SystemPropertiesHelper systemPropertiesHelper) {
            SystemPropertiesHelper systemPropertiesHelper,
            Lazy<WindowManagerLockscreenVisibilityManager> wmLockscreenVisibilityManager) {
        mContext = context;
        mContext = context;
        mUserTracker = userTracker;
        mUserTracker = userTracker;
        mFalsingCollector = falsingCollector;
        mFalsingCollector = falsingCollector;
@@ -1443,8 +1452,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        mUiEventLogger = uiEventLogger;
        mUiEventLogger = uiEventLogger;
        mSessionTracker = sessionTracker;
        mSessionTracker = sessionTracker;


        mMainDispatcher = mainDispatcher;
        mDreamingToLockscreenTransitionViewModel = dreamingToLockscreenTransitionViewModel;
        mDreamingToLockscreenTransitionViewModel = dreamingToLockscreenTransitionViewModel;
        mWmLockscreenVisibilityManager = wmLockscreenVisibilityManager;
        mMainDispatcher = mainDispatcher;
    }
    }


    public void userActivity() {
    public void userActivity() {
@@ -2677,6 +2687,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            if (DEBUG) {
            if (DEBUG) {
                Log.d(TAG, "updateActivityLockScreenState(" + showing + ", " + aodShowing + ")");
                Log.d(TAG, "updateActivityLockScreenState(" + showing + ", " + aodShowing + ")");
            }
            }

            if (mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                // Handled in WmLockscreenVisibilityManager if flag is enabled.
                return;
            }

            try {
            try {
                ActivityTaskManager.getService().setLockScreenShown(showing, aodShowing);
                ActivityTaskManager.getService().setLockScreenShown(showing, aodShowing);
            } catch (RemoteException e) {
            } catch (RemoteException e) {
@@ -2716,7 +2732,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            }
            }
            mHiding = false;
            mHiding = false;


            if (!mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                // Handled directly in StatusBarKeyguardViewManager if enabled.
                mKeyguardViewControllerLazy.get().show(options);
                mKeyguardViewControllerLazy.get().show(options);
            }

            resetKeyguardDonePendingLocked();
            resetKeyguardDonePendingLocked();
            mHideAnimationRun = false;
            mHideAnimationRun = false;
            adjustStatusBarLocked();
            adjustStatusBarLocked();
@@ -2787,11 +2807,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            mUpdateMonitor.setKeyguardGoingAway(true);
            mUpdateMonitor.setKeyguardGoingAway(true);
            mKeyguardViewControllerLazy.get().setKeyguardGoingAwayState(true);
            mKeyguardViewControllerLazy.get().setKeyguardGoingAwayState(true);


            // Don't actually hide the Keyguard at the moment, wait for window
            // Handled in WmLockscreenVisibilityManager if flag is enabled.
            // manager until it tells us it's safe to do so with
            if (!mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
            // startKeyguardExitAnimation.
                // Don't actually hide the Keyguard at the moment, wait for window manager until it
            // Posting to mUiOffloadThread to ensure that calls to ActivityTaskManager will be in
                // tells us it's safe to do so with startKeyguardExitAnimation.
            // order.
                // Posting to mUiOffloadThread to ensure that calls to ActivityTaskManager will be
                // in order.
                final int keyguardFlag = flags;
                final int keyguardFlag = flags;
                mUiBgExecutor.execute(() -> {
                mUiBgExecutor.execute(() -> {
                    try {
                    try {
@@ -2800,6 +2821,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                        Log.e(TAG, "Error while calling WindowManager", e);
                        Log.e(TAG, "Error while calling WindowManager", e);
                    }
                    }
                });
                });
            }

            Trace.endSection();
            Trace.endSection();
        }
        }
    };
    };
@@ -2913,7 +2936,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            if (!mHiding
            if (!mHiding
                    && !mSurfaceBehindRemoteAnimationRequested
                    && !mSurfaceBehindRemoteAnimationRequested
                    && !mKeyguardStateController.isFlingingToDismissKeyguardDuringSwipeGesture()) {
                    && !mKeyguardStateController.isFlingingToDismissKeyguardDuringSwipeGesture()) {
                if (finishedCallback != null) {
                // If the flag is enabled, remote animation state is handled in
                // WmLockscreenVisibilityManager.
                if (finishedCallback != null
                        && !mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                    // There will not execute animation, send a finish callback to ensure the remote
                    // There will not execute animation, send a finish callback to ensure the remote
                    // animation won't hang there.
                    // animation won't hang there.
                    try {
                    try {
@@ -2939,11 +2965,13 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                        new IRemoteAnimationFinishedCallback() {
                        new IRemoteAnimationFinishedCallback() {
                            @Override
                            @Override
                            public void onAnimationFinished() throws RemoteException {
                            public void onAnimationFinished() throws RemoteException {
                                if (!mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                                    try {
                                    try {
                                        finishedCallback.onAnimationFinished();
                                        finishedCallback.onAnimationFinished();
                                    } catch (RemoteException e) {
                                    } catch (RemoteException e) {
                                        Slog.w(TAG, "Failed to call onAnimationFinished", e);
                                        Slog.w(TAG, "Failed to call onAnimationFinished", e);
                                    }
                                    }
                                }
                                onKeyguardExitFinished();
                                onKeyguardExitFinished();
                                mKeyguardViewControllerLazy.get().hide(0 /* startTime */,
                                mKeyguardViewControllerLazy.get().hide(0 /* startTime */,
                                        0 /* fadeoutDuration */);
                                        0 /* fadeoutDuration */);
@@ -2969,7 +2997,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            // it will dismiss the panel in that case.
            // it will dismiss the panel in that case.
            } else if (!mStatusBarStateController.leaveOpenOnKeyguardHide()
            } else if (!mStatusBarStateController.leaveOpenOnKeyguardHide()
                    && apps != null && apps.length > 0) {
                    && apps != null && apps.length > 0) {
                if (!mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                    // Handled in WmLockscreenVisibilityManager. Other logic in this class will
                    // short circuit when this is null.
                    mSurfaceBehindRemoteAnimationFinishedCallback = finishedCallback;
                    mSurfaceBehindRemoteAnimationFinishedCallback = finishedCallback;
                }
                mSurfaceBehindRemoteAnimationRunning = true;
                mSurfaceBehindRemoteAnimationRunning = true;


                mInteractionJankMonitor.begin(
                mInteractionJankMonitor.begin(
@@ -2989,7 +3021,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                        createInteractionJankMonitorConf(
                        createInteractionJankMonitorConf(
                                CUJ_LOCKSCREEN_UNLOCK_ANIMATION, "RemoteAnimationDisabled"));
                                CUJ_LOCKSCREEN_UNLOCK_ANIMATION, "RemoteAnimationDisabled"));


                if (!mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                    // Handled directly in StatusBarKeyguardViewManager if enabled.
                    mKeyguardViewControllerLazy.get().hide(startTime, fadeoutDuration);
                    mKeyguardViewControllerLazy.get().hide(startTime, fadeoutDuration);
                }


                // TODO(bc-animation): When remote animation is enabled for keyguard exit animation,
                // TODO(bc-animation): When remote animation is enabled for keyguard exit animation,
                // apps, wallpapers and finishedCallback are set to non-null. nonApps is not yet
                // apps, wallpapers and finishedCallback are set to non-null. nonApps is not yet
@@ -3003,13 +3038,17 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                    }
                    }
                    if (apps == null || apps.length == 0) {
                    if (apps == null || apps.length == 0) {
                        Slog.e(TAG, "Keyguard exit without a corresponding app to show.");
                        Slog.e(TAG, "Keyguard exit without a corresponding app to show.");

                        try {
                        try {
                            if (!mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                                finishedCallback.onAnimationFinished();
                                finishedCallback.onAnimationFinished();
                            }
                        } catch (RemoteException e) {
                        } catch (RemoteException e) {
                            Slog.e(TAG, "RemoteException");
                            Slog.e(TAG, "RemoteException");
                        } finally {
                        } finally {
                            mInteractionJankMonitor.end(CUJ_LOCKSCREEN_UNLOCK_ANIMATION);
                            mInteractionJankMonitor.end(CUJ_LOCKSCREEN_UNLOCK_ANIMATION);
                        }
                        }

                        return;
                        return;
                    }
                    }


@@ -3033,7 +3072,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                        @Override
                        @Override
                        public void onAnimationEnd(Animator animation) {
                        public void onAnimationEnd(Animator animation) {
                            try {
                            try {
                                if (!mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                                    finishedCallback.onAnimationFinished();
                                    finishedCallback.onAnimationFinished();
                                }
                            } catch (RemoteException e) {
                            } catch (RemoteException e) {
                                Slog.e(TAG, "RemoteException");
                                Slog.e(TAG, "RemoteException");
                            } finally {
                            } finally {
@@ -3044,7 +3085,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                        @Override
                        @Override
                        public void onAnimationCancel(Animator animation) {
                        public void onAnimationCancel(Animator animation) {
                            try {
                            try {
                                if (!mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                                    finishedCallback.onAnimationFinished();
                                    finishedCallback.onAnimationFinished();
                                }
                            } catch (RemoteException e) {
                            } catch (RemoteException e) {
                                Slog.e(TAG, "RemoteException");
                                Slog.e(TAG, "RemoteException");
                            } finally {
                            } finally {
@@ -3193,7 +3236,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                flags |= KEYGUARD_GOING_AWAY_FLAG_TO_LAUNCHER_CLEAR_SNAPSHOT;
                flags |= KEYGUARD_GOING_AWAY_FLAG_TO_LAUNCHER_CLEAR_SNAPSHOT;
            }
            }


            if (!mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                // Handled in WmLockscreenVisibilityManager.
                ActivityTaskManager.getService().keyguardGoingAway(flags);
                ActivityTaskManager.getService().keyguardGoingAway(flags);
            }
            mKeyguardStateController.notifyKeyguardGoingAway(true);
            mKeyguardStateController.notifyKeyguardGoingAway(true);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            mSurfaceBehindRemoteAnimationRequested = false;
            mSurfaceBehindRemoteAnimationRequested = false;
Loading