Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +14 −9 Original line number Diff line number Diff line Loading @@ -163,7 +163,7 @@ public class NotificationMediaManager implements Dumpable { if (!isPlaybackActive(state.getState())) { clearCurrentMediaNotification(); } dispatchUpdateMediaMetaData(true /* changed */, true /* allowAnimation */); findAndUpdateMediaNotifications(); } } Loading Loading @@ -199,6 +199,16 @@ public class NotificationMediaManager implements Dumpable { mStatusBarWindowController = statusBarWindowController; mEntryManager = notificationEntryManager; notificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override public void onPendingEntryAdded(NotificationEntry entry) { findAndUpdateMediaNotifications(); } @Override public void onPreEntryUpdated(NotificationEntry entry) { findAndUpdateMediaNotifications(); } @Override public void onEntryRemoved( NotificationEntry entry, Loading Loading @@ -272,16 +282,12 @@ public class NotificationMediaManager implements Dumpable { boolean metaDataChanged = false; synchronized (mEntryManager.getNotificationData()) { ArrayList<NotificationEntry> activeNotifications = mEntryManager.getNotificationData().getActiveNotifications(); final int N = activeNotifications.size(); Set<NotificationEntry> allNotifications = mEntryManager.getAllNotifs(); // Promote the media notification with a controller in 'playing' state, if any. NotificationEntry mediaNotification = null; MediaController controller = null; for (int i = 0; i < N; i++) { final NotificationEntry entry = activeNotifications.get(i); for (NotificationEntry entry : allNotifications) { if (entry.isMediaNotification()) { final MediaSession.Token token = entry.getSbn().getNotification().extras.getParcelable( Loading Loading @@ -319,8 +325,7 @@ public class NotificationMediaManager implements Dumpable { // now to see if we have one like this final String pkg = aController.getPackageName(); for (int i = 0; i < N; i++) { final NotificationEntry entry = activeNotifications.get(i); for (NotificationEntry entry : allNotifications) { if (entry.getSbn().getPackageName().equals(pkg)) { if (DEBUG_MEDIA) { Log.v(TAG, "DEBUG_MEDIA: found controller matching " Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -53,8 +53,10 @@ import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import javax.inject.Inject; import javax.inject.Singleton; Loading Loading @@ -560,6 +562,15 @@ public class NotificationEntryManager implements return mPendingNotifications.values(); } /** * @return all notification we're currently aware of (both pending and visible notifications) */ public Set<NotificationEntry> getAllNotifs() { Set<NotificationEntry> allNotifs = new HashSet<>(mPendingNotifications.values()); allNotifs.addAll(mNotificationData.getActiveNotifications()); return allNotifs; } /** * Gets the pending or visible notification entry with the given key. Returns null if * notification doesn't exist. Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +0 −1 Original line number Diff line number Diff line Loading @@ -1528,7 +1528,6 @@ public class StatusBar extends SystemUI implements DemoMode, .start(); } } mMediaManager.findAndUpdateMediaNotifications(); } private void updateReportRejectedTouchVisibility() { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +14 −9 Original line number Diff line number Diff line Loading @@ -163,7 +163,7 @@ public class NotificationMediaManager implements Dumpable { if (!isPlaybackActive(state.getState())) { clearCurrentMediaNotification(); } dispatchUpdateMediaMetaData(true /* changed */, true /* allowAnimation */); findAndUpdateMediaNotifications(); } } Loading Loading @@ -199,6 +199,16 @@ public class NotificationMediaManager implements Dumpable { mStatusBarWindowController = statusBarWindowController; mEntryManager = notificationEntryManager; notificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override public void onPendingEntryAdded(NotificationEntry entry) { findAndUpdateMediaNotifications(); } @Override public void onPreEntryUpdated(NotificationEntry entry) { findAndUpdateMediaNotifications(); } @Override public void onEntryRemoved( NotificationEntry entry, Loading Loading @@ -272,16 +282,12 @@ public class NotificationMediaManager implements Dumpable { boolean metaDataChanged = false; synchronized (mEntryManager.getNotificationData()) { ArrayList<NotificationEntry> activeNotifications = mEntryManager.getNotificationData().getActiveNotifications(); final int N = activeNotifications.size(); Set<NotificationEntry> allNotifications = mEntryManager.getAllNotifs(); // Promote the media notification with a controller in 'playing' state, if any. NotificationEntry mediaNotification = null; MediaController controller = null; for (int i = 0; i < N; i++) { final NotificationEntry entry = activeNotifications.get(i); for (NotificationEntry entry : allNotifications) { if (entry.isMediaNotification()) { final MediaSession.Token token = entry.getSbn().getNotification().extras.getParcelable( Loading Loading @@ -319,8 +325,7 @@ public class NotificationMediaManager implements Dumpable { // now to see if we have one like this final String pkg = aController.getPackageName(); for (int i = 0; i < N; i++) { final NotificationEntry entry = activeNotifications.get(i); for (NotificationEntry entry : allNotifications) { if (entry.getSbn().getPackageName().equals(pkg)) { if (DEBUG_MEDIA) { Log.v(TAG, "DEBUG_MEDIA: found controller matching " Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -53,8 +53,10 @@ import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import javax.inject.Inject; import javax.inject.Singleton; Loading Loading @@ -560,6 +562,15 @@ public class NotificationEntryManager implements return mPendingNotifications.values(); } /** * @return all notification we're currently aware of (both pending and visible notifications) */ public Set<NotificationEntry> getAllNotifs() { Set<NotificationEntry> allNotifs = new HashSet<>(mPendingNotifications.values()); allNotifs.addAll(mNotificationData.getActiveNotifications()); return allNotifs; } /** * Gets the pending or visible notification entry with the given key. Returns null if * notification doesn't exist. Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +0 −1 Original line number Diff line number Diff line Loading @@ -1528,7 +1528,6 @@ public class StatusBar extends SystemUI implements DemoMode, .start(); } } mMediaManager.findAndUpdateMediaNotifications(); } private void updateReportRejectedTouchVisibility() { Loading