From 183b40794ea329604a630d4f57604e0c4370d4f1 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Thu, 20 Aug 2020 11:17:05 -0400 Subject: [PATCH] Media - Fix old players being left around In addressing sorting, the oldKey was removed but it prevented the actual player view from being removed. Let the downstream code handle oldKey -> key migration during resumption scenarios Fixes: 161031927 Test: atest MediaPlayerDataTest Change-Id: I937a2732615225235bf1103a2bba0170d3e0b905 --- .../src/com/android/systemui/media/MediaCarouselController.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt index a003d83658105..e5a9ac10389fa 100644 --- a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt +++ b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt @@ -172,7 +172,6 @@ class MediaCarouselController @Inject constructor( // This view is inactive, let's remove this! This happens e.g when dismissing / // timing out a view. We still have the data around because resumption could // be on, but we should save the resources and release this. - oldKey?.let { MediaPlayerData.removeMediaPlayer(it) } onMediaDataRemoved(key) } else { addOrUpdatePlayer(key, oldKey, data)