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

Commit 25fe3df5 authored by Beth Thibodeau's avatar Beth Thibodeau Committed by Automerger Merge Worker
Browse files

Merge "Fix transition after restarting inactive media" into sc-dev am: 5b541728 am: 8316e49f

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

Change-Id: I71af2ad9c7f8b06ec7ae4b2873982f23c91f4b15
parents 205029f6 8316e49f
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -537,8 +537,19 @@ class MediaHierarchyManager @Inject constructor(
    ) {
        val desiredLocation = calculateLocation()
        if (desiredLocation != this.desiredLocation || forceStateUpdate) {
            if (this.desiredLocation >= 0) {
            if (this.desiredLocation >= 0 && desiredLocation != this.desiredLocation) {
                // Only update previous location when it actually changes
                previousLocation = this.desiredLocation
            } else if (forceStateUpdate) {
                val onLockscreen = (!bypassController.bypassEnabled &&
                        (statusbarState == StatusBarState.KEYGUARD ||
                            statusbarState == StatusBarState.FULLSCREEN_USER_SWITCHER))
                if (desiredLocation == LOCATION_QS && previousLocation == LOCATION_LOCKSCREEN &&
                        !onLockscreen) {
                    // If media active state changed and the device is now unlocked, update the
                    // previous location so we animate between the correct hosts
                    previousLocation = LOCATION_QQS
                }
            }
            val isNewView = this.desiredLocation == -1
            this.desiredLocation = desiredLocation