diff options
| author | 2020-06-19 04:09:33 +0000 | |
|---|---|---|
| committer | 2020-06-19 04:09:33 +0000 | |
| commit | 9aeedae3a164bcbfda128e107a6def10fde86d9c (patch) | |
| tree | 19cb6c6526b4c2c4a49d1e1d712b2f7b4eabd38c | |
| parent | 14849cfbd4df62a0b305f72d008e4a847f47a5bb (diff) | |
| parent | 7d52dd65ecbb82292f16e066579803d3dff932a4 (diff) | |
Merge "Fix paused player glitch on lock screen" into rvc-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt | 11 | 
1 files changed, 10 insertions, 1 deletions
| diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt b/packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt index b86e1d0503d4..26fa29613dc4 100644 --- a/packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt +++ b/packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt @@ -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 { |