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

Commit 9d1ef70e authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Using a more generic Launcher method name in KeyguardUnlockAnimationController

Bug: 302621267
Test: Presubmit
Flag: N/A
Change-Id: I77113a1a8be09ed53ab787c1fab2ee4f72dcaee0
parent 278310e3
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -413,7 +413,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
    fun canPerformInWindowLauncherAnimations(): Boolean {
        // TODO(b/278086361): Refactor in-window animations.
        return !featureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR) &&
                isNexusLauncherUnderneath() &&
                isSupportedLauncherUnderneath() &&
                // If the launcher is underneath, but we're about to launch an activity, don't do
                // the animations since they won't be visible.
                !notificationShadeWindowController.isLaunchingActivity &&
@@ -427,7 +427,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
     */
    private fun logInWindowAnimationConditions() {
        Log.wtf(TAG, "canPerformInWindowLauncherAnimations expected all of these to be true: ")
        Log.wtf(TAG, "  isNexusLauncherUnderneath: ${isNexusLauncherUnderneath()}")
        Log.wtf(TAG, "  isNexusLauncherUnderneath: ${isSupportedLauncherUnderneath()}")
        Log.wtf(TAG, "  !notificationShadeWindowController.isLaunchingActivity: " +
                "${!notificationShadeWindowController.isLaunchingActivity}")
        Log.wtf(TAG, "  launcherUnlockController != null: ${launcherUnlockController != null}")
@@ -1050,7 +1050,7 @@ class KeyguardUnlockAnimationController @Inject constructor(

        // If our launcher isn't underneath, then we're unlocking to an app or custom launcher,
        // neither of which have a smartspace.
        if (!isNexusLauncherUnderneath()) {
        if (!isSupportedLauncherUnderneath()) {
            return false
        }

@@ -1120,11 +1120,11 @@ class KeyguardUnlockAnimationController @Inject constructor(
    }

    /**
     * Return whether the Google Nexus launcher is underneath the keyguard, vs. some other
     * launcher or an app. If so, we can communicate with it to perform in-window/shared element
     * transitions!
     * Return whether a launcher which supports coordinated transition is underneath the keyguard,
     * vs. some other launcher or an app. If so, we can communicate with it to perform
     * in-window/shared element transitions!
     */
    fun isNexusLauncherUnderneath(): Boolean {
    fun isSupportedLauncherUnderneath(): Boolean {
        return launcherActivityClass?.let { ActivityManagerWrapper.getInstance()
                .runningTask?.topActivity?.className?.equals(it) }
                ?: false
+3 −2
Original line number Diff line number Diff line
@@ -2832,7 +2832,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            // playing in-window animations for this particular unlock since a previous unlock might
            // have changed the Launcher state.
            if (mWakeAndUnlocking
                    && mKeyguardUnlockAnimationControllerLazy.get().isNexusLauncherUnderneath()) {
                    && mKeyguardUnlockAnimationControllerLazy.get()
                            .isSupportedLauncherUnderneath()) {
                flags |= KEYGUARD_GOING_AWAY_FLAG_TO_LAUNCHER_CLEAR_SNAPSHOT;
            }

@@ -3286,7 +3287,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            // of the in-window animations are reflected. This is needed even if we're not actually
            // playing in-window animations for this particular unlock since a previous unlock might
            // have changed the Launcher state.
            if (mKeyguardUnlockAnimationControllerLazy.get().isNexusLauncherUnderneath()) {
            if (mKeyguardUnlockAnimationControllerLazy.get().isSupportedLauncherUnderneath()) {
                flags |= KEYGUARD_GOING_AWAY_FLAG_TO_LAUNCHER_CLEAR_SNAPSHOT;
            }