Loading packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessor.kt +7 −3 Original line number Diff line number Diff line Loading @@ -330,6 +330,7 @@ class MediaDataProcessor( fun onNotificationAdded(key: String, sbn: StatusBarNotification) { if (useQsMediaPlayer && isMediaNotification(sbn)) { var isNewlyActiveEntry = false var isConvertingToActive = false Assert.isMainThread() val oldKey = findExistingEntry(key, sbn.packageName) if (oldKey == null) { Loading @@ -347,9 +348,10 @@ class MediaDataProcessor( // Resume -> active conversion; move to new key val oldData = mediaDataRepository.removeMediaEntry(oldKey)!! isNewlyActiveEntry = true isConvertingToActive = true mediaDataRepository.addMediaEntry(key, oldData) } loadMediaData(key, sbn, oldKey, isNewlyActiveEntry) loadMediaData(key, sbn, oldKey, isNewlyActiveEntry, isConvertingToActive) } else { onNotificationRemoved(key) } Loading Loading @@ -488,10 +490,11 @@ class MediaDataProcessor( sbn: StatusBarNotification, oldKey: String?, isNewlyActiveEntry: Boolean = false, isConvertingToActive: Boolean = false, ) { if (Flags.mediaLoadMetadataViaMediaDataLoader()) { applicationScope.launch { loadMediaDataWithLoader(key, sbn, oldKey, isNewlyActiveEntry) loadMediaDataWithLoader(key, sbn, oldKey, isNewlyActiveEntry, isConvertingToActive) } } else { backgroundExecutor.execute { loadMediaDataInBg(key, sbn, oldKey, isNewlyActiveEntry) } Loading Loading @@ -835,10 +838,11 @@ class MediaDataProcessor( sbn: StatusBarNotification, oldKey: String?, isNewlyActiveEntry: Boolean = false, isConvertingToActive: Boolean = false, ) = withContext(backgroundDispatcher) { val lastActive = systemClock.elapsedRealtime() val result = mediaDataLoader.get().loadMediaData(key, sbn) val result = mediaDataLoader.get().loadMediaData(key, sbn, isConvertingToActive) if (result == null) { Log.d(TAG, "No result from loadMediaData") return@withContext Loading Loading
packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessor.kt +7 −3 Original line number Diff line number Diff line Loading @@ -330,6 +330,7 @@ class MediaDataProcessor( fun onNotificationAdded(key: String, sbn: StatusBarNotification) { if (useQsMediaPlayer && isMediaNotification(sbn)) { var isNewlyActiveEntry = false var isConvertingToActive = false Assert.isMainThread() val oldKey = findExistingEntry(key, sbn.packageName) if (oldKey == null) { Loading @@ -347,9 +348,10 @@ class MediaDataProcessor( // Resume -> active conversion; move to new key val oldData = mediaDataRepository.removeMediaEntry(oldKey)!! isNewlyActiveEntry = true isConvertingToActive = true mediaDataRepository.addMediaEntry(key, oldData) } loadMediaData(key, sbn, oldKey, isNewlyActiveEntry) loadMediaData(key, sbn, oldKey, isNewlyActiveEntry, isConvertingToActive) } else { onNotificationRemoved(key) } Loading Loading @@ -488,10 +490,11 @@ class MediaDataProcessor( sbn: StatusBarNotification, oldKey: String?, isNewlyActiveEntry: Boolean = false, isConvertingToActive: Boolean = false, ) { if (Flags.mediaLoadMetadataViaMediaDataLoader()) { applicationScope.launch { loadMediaDataWithLoader(key, sbn, oldKey, isNewlyActiveEntry) loadMediaDataWithLoader(key, sbn, oldKey, isNewlyActiveEntry, isConvertingToActive) } } else { backgroundExecutor.execute { loadMediaDataInBg(key, sbn, oldKey, isNewlyActiveEntry) } Loading Loading @@ -835,10 +838,11 @@ class MediaDataProcessor( sbn: StatusBarNotification, oldKey: String?, isNewlyActiveEntry: Boolean = false, isConvertingToActive: Boolean = false, ) = withContext(backgroundDispatcher) { val lastActive = systemClock.elapsedRealtime() val result = mediaDataLoader.get().loadMediaData(key, sbn) val result = mediaDataLoader.get().loadMediaData(key, sbn, isConvertingToActive) if (result == null) { Log.d(TAG, "No result from loadMediaData") return@withContext Loading