From ecd9e0c0878652a7963db664ce68400789b456a0 Mon Sep 17 00:00:00 2001 From: Michael Mikhail Date: Fri, 18 Nov 2022 01:29:21 +0000 Subject: [PATCH] Fix media control flash when unlock device It adds a new condition when the large screen is in landscape, the media controls is on lockscreen, and the next location will be in qs. the media controls should not animate while switching from lockscreen location to qs location Bug: 251717467. Bug: 252981595. Test: atest MediaHierarchyManagerTest. Test: Check the media control is not flashing anymore. Change-Id: Ib242e7f6e87191fc6094aed260e4828ca5f13d70 --- .../media/controls/ui/MediaHierarchyManager.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt index cbb670ebf02d5..b252be1b4cdcd 100644 --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt @@ -798,6 +798,16 @@ constructor( return true } + if ( + desiredLocation == LOCATION_QS && + previousLocation == LOCATION_LOCKSCREEN && + statusbarState == StatusBarState.SHADE + ) { + // This is an invalid transition, can happen when tapping on home control and the UMO + // while being on landscape orientation in tablet. + return false + } + if ( statusbarState == StatusBarState.KEYGUARD && (currentLocation == LOCATION_LOCKSCREEN || previousLocation == LOCATION_LOCKSCREEN)