From 23b113592a5f461ec66026cbf8bce253cb8d3a46 Mon Sep 17 00:00:00 2001 From: RoboErik Date: Wed, 24 Sep 2014 09:24:54 -0700 Subject: [PATCH] Clear the volume cache for all inactive state transitions bug:16988480 Change-Id: I0426c76681f8ec832c3f72842ee494d286050fea --- .../core/java/com/android/server/media/MediaSessionStack.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/media/MediaSessionStack.java b/services/core/java/com/android/server/media/MediaSessionStack.java index a9bc8180f63f4..e464be7c16b25 100644 --- a/services/core/java/com/android/server/media/MediaSessionStack.java +++ b/services/core/java/com/android/server/media/MediaSessionStack.java @@ -94,8 +94,8 @@ public class MediaSessionStack { mSessions.add(0, record); clearCache(); return true; - } else if (newState == PlaybackState.STATE_PAUSED) { - // Just clear the volume cache in this case + } else if (!MediaSession.isActiveState(newState)) { + // Just clear the volume cache when a state goes inactive mCachedVolumeDefault = null; } return false;