diff options
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java index ecbe32f1b737..38a208b72edc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java @@ -60,6 +60,7 @@ import com.android.systemui.statusbar.notification.collection.notifcollection.Co import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.KeyguardStateController; +import com.android.systemui.util.ListenerSet; import com.android.systemui.util.settings.SecureSettings; import java.io.PrintWriter; @@ -110,6 +111,8 @@ public class NotificationLockscreenUserManagerImpl implements protected KeyguardManager mKeyguardManager; private int mState = StatusBarState.SHADE; private List<KeyguardNotificationSuppressor> mKeyguardSuppressors = new ArrayList<>(); + private final ListenerSet<NotificationStateChangedListener> mNotifStateChangedListeners = + new ListenerSet<>(); protected final BroadcastReceiver mAllUsersReceiver = new BroadcastReceiver() { @Override @@ -121,6 +124,8 @@ public class NotificationLockscreenUserManagerImpl implements mUsersAllowingPrivateNotifications.clear(); updateLockscreenNotificationSetting(); getEntryManager().updateNotifications("ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED"); + // TODO(b/231976036): Consolidate pipeline invalidations related to this event + // notifyNotificationStateChanged(); } } }; @@ -254,6 +259,7 @@ public class NotificationLockscreenUserManagerImpl implements updateLockscreenNotificationSetting(); getEntryManager().updateNotifications("LOCK_SCREEN_SHOW_NOTIFICATIONS," + " or LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS change"); + notifyNotificationStateChanged(); } }; @@ -264,6 +270,8 @@ public class NotificationLockscreenUserManagerImpl implements if (mDeviceProvisionedController.isDeviceProvisioned()) { getEntryManager().updateNotifications("LOCK_SCREEN_ALLOW_REMOTE_INPUT" + " or ZEN_MODE change"); + // TODO(b/231976036): Consolidate pipeline invalidations related to this event + // notifyNotificationStateChanged(); } } }; @@ -651,6 +659,8 @@ public class NotificationLockscreenUserManagerImpl implements mUsersWithSeparateWorkChallenge.put(userId, needsSeparateChallenge); } getEntryManager().updateNotifications("NotificationLockscreenUserManager.updatePublicMode"); + // TODO(b/234738798): Migrate KeyguardNotificationVisibilityProvider to use this listener + // notifyNotificationStateChanged(); } @Override @@ -668,6 +678,22 @@ public class NotificationLockscreenUserManagerImpl implements mListeners.remove(listener); } + @Override + public void addNotificationStateChangedListener(NotificationStateChangedListener listener) { + mNotifStateChangedListeners.addIfAbsent(listener); + } + + @Override + public void removeNotificationStateChangedListener(NotificationStateChangedListener listener) { + mNotifStateChangedListeners.remove(listener); + } + + private void notifyNotificationStateChanged() { + for (NotificationStateChangedListener listener : mNotifStateChangedListeners) { + listener.onNotificationStateChanged(); + } + } + // public void updatePublicMode() { // //TODO: I think there may be a race condition where mKeyguardViewManager.isShowing() returns // // false when it should be true. Therefore, if we are not on the SHADE, don't even bother |