diff options
| author | 2025-01-24 18:58:14 +0000 | |
|---|---|---|
| committer | 2025-01-24 19:06:25 +0000 | |
| commit | b950a185491e41c6b8b0457c1e3eda89c5328ca2 (patch) | |
| tree | 90e70bd1582958ea85a2187cfcaeba3b3daf5dc5 | |
| parent | 23ee7594e599a3d448924f3e92b77091b829b88a (diff) | |
Refresh state when updating seekbar visibility
The issue was not with the comparison algorithm. It seems we used to
rely on media notification updates to update seekbar visibility. We need
to refresh the state to get an immediate update on seekbar to show.
Flag: EXEMPT bugfix
Fixes: 373533563
Test: Checked UI.
Change-Id: I997454739600aad9cfd46c8767fbd641025233c3
2 files changed, 17 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java index dccf61d4e6c7..2bf6a10c5258 100644 --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java @@ -435,6 +435,12 @@ public class MediaControlPanel { } this.mIsSeekBarEnabled = isSeekBarEnabled; updateSeekBarVisibility(); + mMainExecutor.execute(() -> { + if (!mMetadataAnimationHandler.isRunning()) { + // Trigger a state refresh so that we immediately update visibilities. + mMediaViewController.refreshState(); + } + }); } /** diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaViewController.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaViewController.kt index 975f8f45f9c4..c00e14c5957e 100644 --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaViewController.kt @@ -225,6 +225,12 @@ constructor( if (isSeekBarEnabled == enabled) return isSeekBarEnabled = enabled MediaControlViewBinder.updateSeekBarVisibility(expandedLayout, isSeekBarEnabled) + mainExecutor.execute { + if (!metadataAnimationHandler.isRunning) { + // Trigger a state refresh so that we immediately update visibilities. + refreshState() + } + } } } @@ -899,7 +905,11 @@ constructor( // If the view isn't bound, we can drop the animation, otherwise we'll execute it animateNextStateChange = false if (transitionLayout == null) { - logger.logMediaLocation("setCurrentState: view not bound", startLocation, endLocation) + logger.logMediaLocation( + "setCurrentState: view not bound", + startLocation, + endLocation, + ) return } |