From 36ed357ccd24afc085173c0969033dc5077e5e1a Mon Sep 17 00:00:00 2001 From: Caitlin Shkuratov Date: Fri, 26 May 2023 16:10:40 +0000 Subject: [PATCH] [Central Surfaces] NSSLC snoozes with NotificationsController directly. Removes a CentralSurfaces reference by having NSSLC talk directly to NotificationsController. Bug: 277764509 Bug: 277762009 Test: manual: verified NotificationsController still notified when notification is snoozed Test: atest NotificationStackScrollLayoutControllerTest CentralSurfacesImplTest Change-Id: I2e9948e2c0d0f6677c34b2f3dc758334fbe6289a --- .../stack/NotificationStackScrollLayoutController.java | 2 +- .../android/systemui/statusbar/phone/CentralSurfaces.java | 5 ----- .../systemui/statusbar/phone/CentralSurfacesImpl.java | 7 ------- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java index 44e4a3c479f84..12b2ef89aab75 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java @@ -433,7 +433,7 @@ public class NotificationStackScrollLayoutController { @Override public void onSnooze(StatusBarNotification sbn, NotificationSwipeActionHelper.SnoozeOption snoozeOption) { - mCentralSurfaces.setNotificationSnoozed(sbn, snoozeOption); + mNotificationsController.setNotificationSnoozed(sbn, snoozeOption); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index f78ed854573ed..8bd9158c91899 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -26,7 +26,6 @@ import android.content.pm.PackageManager; import android.os.Bundle; import android.os.PowerManager; import android.os.UserHandle; -import android.service.notification.StatusBarNotification; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.RemoteAnimationAdapter; @@ -44,7 +43,6 @@ import com.android.systemui.Dumpable; import com.android.systemui.animation.ActivityLaunchAnimator; import com.android.systemui.navigationbar.NavigationBarView; import com.android.systemui.plugins.ActivityStarter.OnDismissAction; -import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper; import com.android.systemui.qs.QSPanelController; import com.android.systemui.shade.ShadeViewController; import com.android.systemui.shared.system.RemoteAnimationRunnerCompat; @@ -381,9 +379,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner { boolean isDeviceInteractive(); - void setNotificationSnoozed(StatusBarNotification sbn, - NotificationSwipeActionHelper.SnoozeOption snoozeOption); - void awakenDreams(); void clearNotificationEffects(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index fc9e0fd512db5..45b65bd4b7c77 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -173,7 +173,6 @@ import com.android.systemui.plugins.PluginDependencyProvider; import com.android.systemui.plugins.PluginListener; import com.android.systemui.plugins.PluginManager; import com.android.systemui.plugins.qs.QS; -import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.qs.QSFragment; import com.android.systemui.qs.QSPanelController; @@ -3571,12 +3570,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } }; - @Override - public void setNotificationSnoozed(StatusBarNotification sbn, SnoozeOption snoozeOption) { - mNotificationsController.setNotificationSnoozed(sbn, snoozeOption); - } - - @Override public void awakenDreams() { mUiBgExecutor.execute(() -> {