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

Commit 377c8455 authored by Lucas Dupin's avatar Lucas Dupin Committed by Automerger Merge Worker
Browse files

Merge "Fix paused player glitch on lock screen" into rvc-dev am: 9aeedae3...

Merge "Fix paused player glitch on lock screen" into rvc-dev am: 9aeedae3 am: 37996a52 am: 0b98baac am: 95c5ea86

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

Change-Id: Ife2176a8d94346326a280962be9aff30b98c9dd5
parents 1393a3cf 95c5ea86
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -193,6 +193,8 @@ class MediaHierarchyManager @Inject constructor(
            override fun onDozingChanged(isDozing: Boolean) {
                if (!isDozing) {
                    dozeAnimationRunning = false
                } else {
                    updateDesiredLocation()
                }
            }
        })
@@ -510,12 +512,19 @@ class MediaHierarchyManager @Inject constructor(
                (statusbarState == StatusBarState.KEYGUARD ||
                        statusbarState == StatusBarState.FULLSCREEN_USER_SWITCHER))
        val allowedOnLockscreen = notifLockscreenUserManager.shouldShowLockscreenNotifications()
        return when {
        val location = when {
            qsExpansion > 0.0f && !onLockscreen -> LOCATION_QS
            qsExpansion > 0.4f && onLockscreen -> LOCATION_QS
            onLockscreen && allowedOnLockscreen -> LOCATION_LOCKSCREEN
            else -> LOCATION_QQS
        }
        // When we're on lock screen and the player is not active, we should keep it in QS.
        // Otherwise it will try to animate a transition that doesn't make sense.
        if (location == LOCATION_LOCKSCREEN && getHost(location)?.visible != true &&
                !statusBarStateController.isDozing) {
            return LOCATION_QS
        }
        return location
    }

    companion object {