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

Commit 9eabdea8 authored by Lucas Dupin's avatar Lucas Dupin Committed by Automerger Merge Worker
Browse files

Merge "Don't blur during app launch animations" into sc-dev am: d377bbc2

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

Change-Id: Ifdf0007db98c2f29a36f8498e6482741c3a6a7aa
parents b4a424f9 d377bbc2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ class ActivityLaunchAnimator(
        // If we expect an animation, post a timeout to cancel it in case the remote animation is
        // never started.
        if (willAnimate) {
            keyguardHandler.disableKeyguardBlurs()
            runner.postTimeout()

            // Hide the keyguard using the launch animation instead of the default unlock animation.
@@ -218,6 +219,9 @@ class ActivityLaunchAnimator(

        /** Hide the keyguard and animate using [runner]. */
        fun hideKeyguardWithAnimation(runner: IRemoteAnimationRunner)

        /** Disable window blur so they don't overlap with the window launch animation **/
        fun disableKeyguardBlurs()
    }

    /**
+13 −1
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationShadeDepthController;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.phone.BiometricUnlockController;
import com.android.systemui.statusbar.phone.DozeParameters;
@@ -240,6 +241,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
    private final SysuiStatusBarStateController mStatusBarStateController;
    private final Executor mUiBgExecutor;
    private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
    private final Lazy<NotificationShadeDepthController> mNotificationShadeDepthController;

    private boolean mSystemReady;
    private boolean mBootCompleted;
@@ -810,13 +812,15 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
            SysuiStatusBarStateController statusBarStateController,
            KeyguardStateController keyguardStateController,
            Lazy<KeyguardUnlockAnimationController> keyguardUnlockAnimationControllerLazy,
            UnlockedScreenOffAnimationController unlockedScreenOffAnimationController) {
            UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
            Lazy<NotificationShadeDepthController> notificationShadeDepthController) {
        super(context);
        mFalsingCollector = falsingCollector;
        mLockPatternUtils = lockPatternUtils;
        mBroadcastDispatcher = broadcastDispatcher;
        mKeyguardViewControllerLazy = statusBarKeyguardViewManagerLazy;
        mDismissCallbackRegistry = dismissCallbackRegistry;
        mNotificationShadeDepthController = notificationShadeDepthController;
        mUiBgExecutor = uiBgExecutor;
        mUpdateMonitor = keyguardUpdateMonitor;
        mPM = powerManager;
@@ -1657,6 +1661,14 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
        hideLocked();
    }

    /**
     * Disable notification shade background blurs until the keyguard is dismissed.
     * (Used during app launch animations)
     */
    public void disableBlursUntilHidden() {
        mNotificationShadeDepthController.get().setIgnoreShadeBlurUntilHidden(true);
    }

    public boolean isSecure() {
        return isSecure(KeyguardUpdateMonitor.getCurrentUser());
    }
+5 −2
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.NotificationShadeDepthController;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.phone.DozeParameters;
@@ -99,7 +100,8 @@ public class KeyguardModule {
            SysuiStatusBarStateController statusBarStateController,
            KeyguardStateController keyguardStateController,
            Lazy<KeyguardUnlockAnimationController> keyguardUnlockAnimationController,
            UnlockedScreenOffAnimationController unlockedScreenOffAnimationController) {
            UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
            Lazy<NotificationShadeDepthController> notificationShadeDepthController) {
        return new KeyguardViewMediator(
                context,
                falsingCollector,
@@ -119,7 +121,8 @@ public class KeyguardModule {
                statusBarStateController,
                keyguardStateController,
                keyguardUnlockAnimationController,
                unlockedScreenOffAnimationController
                unlockedScreenOffAnimationController,
                notificationShadeDepthController
        );
    }

+6 −12
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import com.android.systemui.animation.Interpolators
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dump.DumpManager
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.statusbar.notification.ExpandAnimationParameters
import com.android.systemui.statusbar.phone.BiometricUnlockController
import com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK
import com.android.systemui.statusbar.phone.DozeParameters
@@ -79,7 +78,6 @@ class NotificationShadeDepthController @Inject constructor(
    private var notificationAnimator: Animator? = null
    private var updateScheduled: Boolean = false
    private var shadeExpansion = 0f
    private var ignoreShadeBlurUntilHidden: Boolean = false
    private var isClosed: Boolean = true
    private var isOpen: Boolean = false
    private var isBlurred: Boolean = false
@@ -119,18 +117,17 @@ class NotificationShadeDepthController @Inject constructor(
     * When launching an app from the shade, the animations progress should affect how blurry the
     * shade is, overriding the expansion amount.
     */
    var notificationLaunchAnimationParams: ExpandAnimationParameters? = null
    var ignoreShadeBlurUntilHidden: Boolean = false
        set(value) {
            field = value
            if (value != null) {
                scheduleUpdate()
            if (field == value) {
                return
            }
            field = value
            scheduleUpdate()

            if (shadeSpring.radius == 0 && shadeAnimation.radius == 0) {
                return
            }
            ignoreShadeBlurUntilHidden = true
            shadeSpring.animateTo(0)
            shadeSpring.finishIfRunning()

@@ -171,8 +168,6 @@ class NotificationShadeDepthController @Inject constructor(
        combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsPanelExpansion))
        combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(transitionToFullShadeProgress))
        var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius).toFloat()
        val launchProgress = notificationLaunchAnimationParams?.linearProgress ?: 0f
        shadeRadius *= (1f - launchProgress) * (1f - launchProgress)

        if (ignoreShadeBlurUntilHidden) {
            if (shadeRadius == 0f) {
@@ -195,7 +190,8 @@ class NotificationShadeDepthController @Inject constructor(
            blur = 0
        }

        blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur, scrimsVisible)
        val opaque = scrimsVisible && !ignoreShadeBlurUntilHidden
        blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur, opaque)
        val zoomOut = blurUtils.ratioOfBlurRadius(blur)
        try {
            if (root.isAttachedToWindow && root.windowToken != null) {
@@ -430,8 +426,6 @@ class NotificationShadeDepthController @Inject constructor(
            it.println("shadeAnimation: ${shadeAnimation.radius}")
            it.println("globalActionsRadius: ${globalActionsSpring.radius}")
            it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius")
            it.println("notificationLaunchAnimationProgress: " +
                    "${notificationLaunchAnimationParams?.linearProgress}")
            it.println("ignoreShadeBlurUntilHidden: $ignoreShadeBlurUntilHidden")
        }
    }
+0 −5
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@ package com.android.systemui.statusbar.notification
import android.view.ViewGroup
import com.android.internal.jank.InteractionJankMonitor
import com.android.systemui.animation.ActivityLaunchAnimator
import com.android.systemui.statusbar.NotificationShadeDepthController
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.stack.NotificationListContainer
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone
@@ -15,7 +14,6 @@ import kotlin.math.max
class NotificationLaunchAnimatorControllerProvider(
    private val notificationShadeWindowViewController: NotificationShadeWindowViewController,
    private val notificationListContainer: NotificationListContainer,
    private val depthController: NotificationShadeDepthController,
    private val headsUpManager: HeadsUpManagerPhone
) {
    fun getAnimatorController(
@@ -24,7 +22,6 @@ class NotificationLaunchAnimatorControllerProvider(
        return NotificationLaunchAnimatorController(
            notificationShadeWindowViewController,
            notificationListContainer,
            depthController,
            notification,
            headsUpManager
        )
@@ -39,7 +36,6 @@ class NotificationLaunchAnimatorControllerProvider(
class NotificationLaunchAnimatorController(
    private val notificationShadeWindowViewController: NotificationShadeWindowViewController,
    private val notificationListContainer: NotificationListContainer,
    private val depthController: NotificationShadeDepthController,
    private val notification: ExpandableNotificationRow,
    private val headsUpManager: HeadsUpManagerPhone
) : ActivityLaunchAnimator.Controller {
@@ -128,7 +124,6 @@ class NotificationLaunchAnimatorController(
    private fun applyParams(params: ExpandAnimationParameters?) {
        notification.applyExpandAnimationParams(params)
        notificationListContainer.applyExpandAnimationParams(params)
        depthController.notificationLaunchAnimationParams = params
    }

    override fun onLaunchAnimationProgress(
Loading