Loading packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayNotificationCountProvider.java +11 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.statusbar.NotificationListener; import com.android.systemui.statusbar.NotificationListener.NotificationHandler; import com.android.systemui.statusbar.policy.CallbackController; Loading @@ -30,6 +31,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.Executor; import javax.inject.Inject; Loading Loading @@ -78,10 +80,16 @@ public class DreamOverlayNotificationCountProvider @Inject public DreamOverlayNotificationCountProvider( NotificationListener notificationListener) { NotificationListener notificationListener, @Background Executor bgExecutor) { notificationListener.addNotificationHandler(mNotificationHandler); bgExecutor.execute(() -> { Arrays.stream(notificationListener.getActiveNotifications()) .forEach(sbn -> mNotificationKeys.add(sbn.getKey())); reportNotificationCountChanged(); } ); } @Override Loading packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayNotificationCountProviderTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,8 @@ public class DreamOverlayNotificationCountProviderTest extends SysuiTestCase { final StatusBarNotification[] notifications = {mNotification1}; when(mNotificationListener.getActiveNotifications()).thenReturn(notifications); mProvider = new DreamOverlayNotificationCountProvider(mNotificationListener); mProvider = new DreamOverlayNotificationCountProvider( mNotificationListener, Runnable::run); mProvider.addCallback(mCallback); } Loading Loading
packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayNotificationCountProvider.java +11 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.statusbar.NotificationListener; import com.android.systemui.statusbar.NotificationListener.NotificationHandler; import com.android.systemui.statusbar.policy.CallbackController; Loading @@ -30,6 +31,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.Executor; import javax.inject.Inject; Loading Loading @@ -78,10 +80,16 @@ public class DreamOverlayNotificationCountProvider @Inject public DreamOverlayNotificationCountProvider( NotificationListener notificationListener) { NotificationListener notificationListener, @Background Executor bgExecutor) { notificationListener.addNotificationHandler(mNotificationHandler); bgExecutor.execute(() -> { Arrays.stream(notificationListener.getActiveNotifications()) .forEach(sbn -> mNotificationKeys.add(sbn.getKey())); reportNotificationCountChanged(); } ); } @Override Loading
packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayNotificationCountProviderTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,8 @@ public class DreamOverlayNotificationCountProviderTest extends SysuiTestCase { final StatusBarNotification[] notifications = {mNotification1}; when(mNotificationListener.getActiveNotifications()).thenReturn(notifications); mProvider = new DreamOverlayNotificationCountProvider(mNotificationListener); mProvider = new DreamOverlayNotificationCountProvider( mNotificationListener, Runnable::run); mProvider.addCallback(mCallback); } Loading