Loading services/core/java/com/android/server/media/MediaSessionStack.java +0 −10 Original line number Diff line number Diff line Loading @@ -63,8 +63,6 @@ class MediaSessionStack { */ private MediaSessionRecordImpl mMediaButtonSession; private MediaSessionRecordImpl mCachedVolumeDefault; /** * Cache the result of the {@link #getActiveSessions} per user. */ Loading Loading @@ -145,9 +143,6 @@ class MediaSessionStack { mSessions.remove(record); mSessions.add(0, record); clearCache(record.getUserId()); } else if (record.checkPlaybackActiveState(false)) { // Just clear the volume cache when a state goes inactive mCachedVolumeDefault = null; } // In most cases, playback state isn't needed for finding media button session, Loading Loading @@ -318,15 +313,11 @@ class MediaSessionStack { } public MediaSessionRecordImpl getDefaultVolumeSession() { if (mCachedVolumeDefault != null) { return mCachedVolumeDefault; } List<MediaSessionRecord> records = getPriorityList(true, UserHandle.USER_ALL); int size = records.size(); for (int i = 0; i < size; i++) { MediaSessionRecord record = records.get(i); if (record.checkPlaybackActiveState(true) && record.canHandleVolumeKey()) { mCachedVolumeDefault = record; return record; } } Loading Loading @@ -406,7 +397,6 @@ class MediaSessionStack { } private void clearCache(int userId) { mCachedVolumeDefault = null; mCachedActiveLists.remove(userId); // mCachedActiveLists may also include the list of sessions for UserHandle.USER_ALL, // so they also need to be cleared. Loading Loading
services/core/java/com/android/server/media/MediaSessionStack.java +0 −10 Original line number Diff line number Diff line Loading @@ -63,8 +63,6 @@ class MediaSessionStack { */ private MediaSessionRecordImpl mMediaButtonSession; private MediaSessionRecordImpl mCachedVolumeDefault; /** * Cache the result of the {@link #getActiveSessions} per user. */ Loading Loading @@ -145,9 +143,6 @@ class MediaSessionStack { mSessions.remove(record); mSessions.add(0, record); clearCache(record.getUserId()); } else if (record.checkPlaybackActiveState(false)) { // Just clear the volume cache when a state goes inactive mCachedVolumeDefault = null; } // In most cases, playback state isn't needed for finding media button session, Loading Loading @@ -318,15 +313,11 @@ class MediaSessionStack { } public MediaSessionRecordImpl getDefaultVolumeSession() { if (mCachedVolumeDefault != null) { return mCachedVolumeDefault; } List<MediaSessionRecord> records = getPriorityList(true, UserHandle.USER_ALL); int size = records.size(); for (int i = 0; i < size; i++) { MediaSessionRecord record = records.get(i); if (record.checkPlaybackActiveState(true) && record.canHandleVolumeKey()) { mCachedVolumeDefault = record; return record; } } Loading Loading @@ -406,7 +397,6 @@ class MediaSessionStack { } private void clearCache(int userId) { mCachedVolumeDefault = null; mCachedActiveLists.remove(userId); // mCachedActiveLists may also include the list of sessions for UserHandle.USER_ALL, // so they also need to be cleared. Loading