diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt index 6b46d8f30cad7..cbb670ebf02d5 100644 --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt @@ -43,7 +43,8 @@ import com.android.systemui.dreams.DreamOverlayStateController import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.media.dream.MediaDreamComplication import com.android.systemui.plugins.statusbar.StatusBarStateController -import com.android.systemui.shade.NotifPanelEvents +import com.android.systemui.shade.ShadeStateEvents +import com.android.systemui.shade.ShadeStateEvents.ShadeStateEventsListener import com.android.systemui.statusbar.CrossFadeHelper import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.SysuiStatusBarStateController @@ -96,7 +97,7 @@ constructor( private val dreamOverlayStateController: DreamOverlayStateController, configurationController: ConfigurationController, wakefulnessLifecycle: WakefulnessLifecycle, - panelEventsEvents: NotifPanelEvents, + panelEventsEvents: ShadeStateEvents, private val secureSettings: SecureSettings, @Main private val handler: Handler, ) { @@ -534,8 +535,8 @@ constructor( mediaHosts.forEach { it?.updateViewVisibility() } } - panelEventsEvents.registerListener( - object : NotifPanelEvents.Listener { + panelEventsEvents.addShadeStateEventsListener( + object : ShadeStateEventsListener { override fun onExpandImmediateChanged(isExpandImmediateEnabled: Boolean) { skipQqsOnExpansion = isExpandImmediateEnabled updateDesiredLocation() diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index ddb57f74cacf8..026ef0e806866 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -135,7 +135,6 @@ import com.android.systemui.biometrics.AuthController; import com.android.systemui.camera.CameraGestureHelper; import com.android.systemui.classifier.Classifier; import com.android.systemui.classifier.FalsingCollector; -import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.DisplayId; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.doze.DozeLog; @@ -231,7 +230,6 @@ import com.android.systemui.statusbar.window.StatusBarWindowStateController; import com.android.systemui.unfold.SysUIUnfoldComponent; import com.android.systemui.util.Compile; import com.android.systemui.util.LargeScreenUtils; -import com.android.systemui.util.ListenerSet; import com.android.systemui.util.Utils; import com.android.systemui.util.time.SystemClock; import com.android.wm.shell.animation.FlingAnimationUtils; @@ -372,7 +370,6 @@ public final class NotificationPanelViewController { private final TapAgainViewController mTapAgainViewController; private final LargeScreenShadeHeaderController mLargeScreenShadeHeaderController; private final RecordingController mRecordingController; - private final PanelEventsEmitter mPanelEventsEmitter; private final boolean mVibrateOnOpening; private final VelocityTracker mVelocityTracker = VelocityTracker.obtain(); private final FlingAnimationUtils mFlingAnimationUtilsClosing; @@ -880,7 +877,6 @@ public final class NotificationPanelViewController { Provider keyguardBottomAreaViewControllerProvider, KeyguardUnlockAnimationController keyguardUnlockAnimationController, NotificationListContainer notificationListContainer, - PanelEventsEmitter panelEventsEmitter, NotificationStackSizeCalculator notificationStackSizeCalculator, UnlockedScreenOffAnimationController unlockedScreenOffAnimationController, ShadeTransitionController shadeTransitionController, @@ -993,7 +989,6 @@ public final class NotificationPanelViewController { mMediaDataManager = mediaDataManager; mTapAgainViewController = tapAgainViewController; mSysUiState = sysUiState; - mPanelEventsEmitter = panelEventsEmitter; pulseExpansionHandler.setPulseExpandAbortListener(() -> { if (mQs != null) { mQs.animateHeaderSlidingOut(); @@ -1948,7 +1943,7 @@ public final class NotificationPanelViewController { private void setQsExpandImmediate(boolean expandImmediate) { if (expandImmediate != mQsExpandImmediate) { mQsExpandImmediate = expandImmediate; - mPanelEventsEmitter.notifyExpandImmediateChange(expandImmediate); + mShadeExpansionStateManager.notifyExpandImmediateChange(expandImmediate); } } @@ -3889,7 +3884,7 @@ public final class NotificationPanelViewController { boolean wasRunning = mIsLaunchAnimationRunning; mIsLaunchAnimationRunning = running; if (wasRunning != mIsLaunchAnimationRunning) { - mPanelEventsEmitter.notifyLaunchingActivityChanged(running); + mShadeExpansionStateManager.notifyLaunchingActivityChanged(running); } } @@ -3898,7 +3893,7 @@ public final class NotificationPanelViewController { boolean wasClosing = isClosing(); mClosing = isClosing; if (wasClosing != isClosing) { - mPanelEventsEmitter.notifyPanelCollapsingChanged(isClosing); + mShadeExpansionStateManager.notifyPanelCollapsingChanged(isClosing); } mAmbientState.setIsClosing(isClosing); } @@ -5921,44 +5916,6 @@ public final class NotificationPanelViewController { } } - @SysUISingleton - static class PanelEventsEmitter implements NotifPanelEvents { - - private final ListenerSet mListeners = new ListenerSet<>(); - - @Inject - PanelEventsEmitter() { - } - - @Override - public void registerListener(@androidx.annotation.NonNull @NonNull Listener listener) { - mListeners.addIfAbsent(listener); - } - - @Override - public void unregisterListener(@androidx.annotation.NonNull @NonNull Listener listener) { - mListeners.remove(listener); - } - - private void notifyLaunchingActivityChanged(boolean isLaunchingActivity) { - for (Listener cb : mListeners) { - cb.onLaunchingActivityChanged(isLaunchingActivity); - } - } - - private void notifyPanelCollapsingChanged(boolean isCollapsing) { - for (NotifPanelEvents.Listener cb : mListeners) { - cb.onPanelCollapsingChanged(isCollapsing); - } - } - - private void notifyExpandImmediateChange(boolean expandImmediateEnabled) { - for (NotifPanelEvents.Listener cb : mListeners) { - cb.onExpandImmediateChanged(expandImmediateEnabled); - } - } - } - /** Handles MotionEvents for the Shade. */ public final class TouchHandler implements View.OnTouchListener { private long mLastTouchDownTime = -1L; diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotifPanelEventsModule.java b/packages/SystemUI/src/com/android/systemui/shade/ShadeEventsModule.java similarity index 77% rename from packages/SystemUI/src/com/android/systemui/shade/NotifPanelEventsModule.java rename to packages/SystemUI/src/com/android/systemui/shade/ShadeEventsModule.java index 67723843086a6..959c339ab3e53 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotifPanelEventsModule.java +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeEventsModule.java @@ -21,10 +21,9 @@ import com.android.systemui.dagger.SysUISingleton; import dagger.Binds; import dagger.Module; -/** Provides a {@link NotifPanelEvents} in {@link SysUISingleton} scope. */ +/** Provides a {@link ShadeStateEvents} in {@link SysUISingleton} scope. */ @Module -public abstract class NotifPanelEventsModule { +public abstract class ShadeEventsModule { @Binds - abstract NotifPanelEvents bindPanelEvents( - NotificationPanelViewController.PanelEventsEmitter impl); + abstract ShadeStateEvents bindShadeEvents(ShadeExpansionStateManager impl); } diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeExpansionStateManager.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeExpansionStateManager.kt index 7bba74a8b125e..667392c9796e0 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeExpansionStateManager.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeExpansionStateManager.kt @@ -20,6 +20,7 @@ import android.annotation.IntDef import android.util.Log import androidx.annotation.FloatRange import com.android.systemui.dagger.SysUISingleton +import com.android.systemui.shade.ShadeStateEvents.ShadeStateEventsListener import com.android.systemui.util.Compile import java.util.concurrent.CopyOnWriteArrayList import javax.inject.Inject @@ -30,11 +31,12 @@ import javax.inject.Inject * TODO(b/200063118): Make this class the one source of truth for the state of panel expansion. */ @SysUISingleton -class ShadeExpansionStateManager @Inject constructor() { +class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents { private val expansionListeners = CopyOnWriteArrayList() private val qsExpansionListeners = CopyOnWriteArrayList() private val stateListeners = CopyOnWriteArrayList() + private val shadeStateEventsListeners = CopyOnWriteArrayList() @PanelState private var state: Int = STATE_CLOSED @FloatRange(from = 0.0, to = 1.0) private var fraction: Float = 0f @@ -79,6 +81,14 @@ class ShadeExpansionStateManager @Inject constructor() { stateListeners.remove(listener) } + override fun addShadeStateEventsListener(listener: ShadeStateEventsListener) { + shadeStateEventsListeners.addIfAbsent(listener) + } + + override fun removeShadeStateEventsListener(listener: ShadeStateEventsListener) { + shadeStateEventsListeners.remove(listener) + } + /** Returns true if the panel is currently closed and false otherwise. */ fun isClosed(): Boolean = state == STATE_CLOSED @@ -162,6 +172,24 @@ class ShadeExpansionStateManager @Inject constructor() { stateListeners.forEach { it.onPanelStateChanged(state) } } + fun notifyLaunchingActivityChanged(isLaunchingActivity: Boolean) { + for (cb in shadeStateEventsListeners) { + cb.onLaunchingActivityChanged(isLaunchingActivity) + } + } + + fun notifyPanelCollapsingChanged(isCollapsing: Boolean) { + for (cb in shadeStateEventsListeners) { + cb.onPanelCollapsingChanged(isCollapsing) + } + } + + fun notifyExpandImmediateChange(expandImmediateEnabled: Boolean) { + for (cb in shadeStateEventsListeners) { + cb.onExpandImmediateChanged(expandImmediateEnabled) + } + } + private fun debugLog(msg: String) { if (!DEBUG) return Log.v(TAG, msg) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotifPanelEvents.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeStateEvents.kt similarity index 70% rename from packages/SystemUI/src/com/android/systemui/shade/NotifPanelEvents.kt rename to packages/SystemUI/src/com/android/systemui/shade/ShadeStateEvents.kt index 4558061de1a24..56bb1a6020cf7 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotifPanelEvents.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeStateEvents.kt @@ -16,27 +16,25 @@ package com.android.systemui.shade -/** Provides certain notification panel events. */ -interface NotifPanelEvents { +/** Provides certain notification panel events. */ +interface ShadeStateEvents { - /** Registers callbacks to be invoked when notification panel events occur. */ - fun registerListener(listener: Listener) + /** Registers callbacks to be invoked when notification panel events occur. */ + fun addShadeStateEventsListener(listener: ShadeStateEventsListener) - /** Unregisters callbacks previously registered via [registerListener] */ - fun unregisterListener(listener: Listener) + /** Unregisters callbacks previously registered via [addShadeStateEventsListener] */ + fun removeShadeStateEventsListener(listener: ShadeStateEventsListener) /** Callbacks for certain notification panel events. */ - interface Listener { + interface ShadeStateEventsListener { /** Invoked when the notification panel starts or stops collapsing. */ - @JvmDefault - fun onPanelCollapsingChanged(isCollapsing: Boolean) {} + @JvmDefault fun onPanelCollapsingChanged(isCollapsing: Boolean) {} /** * Invoked when the notification panel starts or stops launching an [android.app.Activity]. */ - @JvmDefault - fun onLaunchingActivityChanged(isLaunchingActivity: Boolean) {} + @JvmDefault fun onLaunchingActivityChanged(isLaunchingActivity: Boolean) {} /** * Invoked when the "expand immediate" attribute changes. @@ -47,7 +45,6 @@ interface NotifPanelEvents { * Another example is when full QS is showing, and we swipe up from the bottom. Instead of * going to QQS, the panel fully collapses. */ - @JvmDefault - fun onExpandImmediateChanged(isExpandImmediateEnabled: Boolean) {} + @JvmDefault fun onExpandImmediateChanged(isExpandImmediateEnabled: Boolean) {} } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/VisualStabilityCoordinator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/VisualStabilityCoordinator.java index d3bc257d8a544..3002a68209907 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/VisualStabilityCoordinator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/VisualStabilityCoordinator.java @@ -28,7 +28,7 @@ import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dump.DumpManager; import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shade.NotifPanelEvents; +import com.android.systemui.shade.ShadeStateEvents; import com.android.systemui.statusbar.notification.collection.GroupEntry; import com.android.systemui.statusbar.notification.collection.ListEntry; import com.android.systemui.statusbar.notification.collection.NotifPipeline; @@ -55,12 +55,12 @@ import javax.inject.Inject; // TODO(b/204468557): Move to @CoordinatorScope @SysUISingleton public class VisualStabilityCoordinator implements Coordinator, Dumpable, - NotifPanelEvents.Listener { + ShadeStateEvents.ShadeStateEventsListener { public static final String TAG = "VisualStability"; public static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.VERBOSE); private final DelayableExecutor mDelayableExecutor; private final HeadsUpManager mHeadsUpManager; - private final NotifPanelEvents mNotifPanelEvents; + private final ShadeStateEvents mShadeStateEvents; private final StatusBarStateController mStatusBarStateController; private final VisualStabilityProvider mVisualStabilityProvider; private final WakefulnessLifecycle mWakefulnessLifecycle; @@ -92,7 +92,7 @@ public class VisualStabilityCoordinator implements Coordinator, Dumpable, DelayableExecutor delayableExecutor, DumpManager dumpManager, HeadsUpManager headsUpManager, - NotifPanelEvents notifPanelEvents, + ShadeStateEvents shadeStateEvents, StatusBarStateController statusBarStateController, VisualStabilityProvider visualStabilityProvider, WakefulnessLifecycle wakefulnessLifecycle) { @@ -101,7 +101,7 @@ public class VisualStabilityCoordinator implements Coordinator, Dumpable, mWakefulnessLifecycle = wakefulnessLifecycle; mStatusBarStateController = statusBarStateController; mDelayableExecutor = delayableExecutor; - mNotifPanelEvents = notifPanelEvents; + mShadeStateEvents = shadeStateEvents; dumpManager.registerDumpable(this); } @@ -114,7 +114,7 @@ public class VisualStabilityCoordinator implements Coordinator, Dumpable, mStatusBarStateController.addCallback(mStatusBarStateControllerListener); mPulsing = mStatusBarStateController.isPulsing(); - mNotifPanelEvents.registerListener(this); + mShadeStateEvents.addShadeStateEventsListener(this); pipeline.setVisualStabilityManager(mNotifStabilityManager); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java index da4cceda531f0..ff63891415751 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java @@ -32,8 +32,8 @@ import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.people.widget.PeopleSpaceWidgetManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.settings.UserContextProvider; -import com.android.systemui.shade.NotifPanelEventsModule; import com.android.systemui.shade.ShadeController; +import com.android.systemui.shade.ShadeEventsModule; import com.android.systemui.statusbar.NotificationListener; import com.android.systemui.statusbar.notification.AssistantFeedbackController; import com.android.systemui.statusbar.notification.collection.NotifInflaterImpl; @@ -93,7 +93,7 @@ import dagger.Provides; @Module(includes = { CoordinatorsModule.class, KeyguardNotificationVisibilityProviderModule.class, - NotifPanelEventsModule.class, + ShadeEventsModule.class, NotifPipelineChoreographerModule.class, NotificationSectionHeadersModule.class, }) diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt index 071604dc57906..920801f95f5b9 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt @@ -31,7 +31,7 @@ import com.android.systemui.dreams.DreamOverlayStateController import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.media.dream.MediaDreamComplication import com.android.systemui.plugins.statusbar.StatusBarStateController -import com.android.systemui.shade.testing.FakeNotifPanelEvents +import com.android.systemui.shade.ShadeExpansionStateManager import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.SysuiStatusBarStateController import com.android.systemui.statusbar.phone.KeyguardBypassController @@ -89,7 +89,7 @@ class MediaHierarchyManagerTest : SysuiTestCase() { private lateinit var mediaHierarchyManager: MediaHierarchyManager private lateinit var mediaFrame: ViewGroup private val configurationController = FakeConfigurationController() - private val notifPanelEvents = FakeNotifPanelEvents() + private val notifPanelEvents = ShadeExpansionStateManager() private val settings = FakeSettings() private lateinit var testableLooper: TestableLooper private lateinit var fakeHandler: FakeHandler @@ -346,7 +346,7 @@ class MediaHierarchyManagerTest : SysuiTestCase() { @Test fun isCurrentlyInGuidedTransformation_hostsVisible_expandImmediateEnabled_returnsFalse() { - notifPanelEvents.changeExpandImmediate(expandImmediate = true) + notifPanelEvents.notifyExpandImmediateChange(true) goToLockscreen() enterGuidedTransformation() whenever(lockHost.visible).thenReturn(true) diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java index 02f28a235b951..300843f3da956 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java @@ -438,8 +438,6 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { when(mSysUiState.setFlag(anyInt(), anyBoolean())).thenReturn(mSysUiState); mMainHandler = new Handler(Looper.getMainLooper()); - NotificationPanelViewController.PanelEventsEmitter panelEventsEmitter = - new NotificationPanelViewController.PanelEventsEmitter(); mNotificationPanelViewController = new NotificationPanelViewController( mView, @@ -495,7 +493,6 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { () -> mKeyguardBottomAreaViewController, mKeyguardUnlockAnimationController, mNotificationListContainer, - panelEventsEmitter, mNotificationStackSizeCalculator, mUnlockedScreenOffAnimationController, mShadeTransitionController, diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/testing/FakeNotifPanelEvents.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/testing/FakeNotifPanelEvents.kt deleted file mode 100644 index d052138772325..0000000000000 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/testing/FakeNotifPanelEvents.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.shade.testing - -import com.android.systemui.shade.NotifPanelEvents - -/** Fake implementation of [NotifPanelEvents] for testing. */ -class FakeNotifPanelEvents : NotifPanelEvents { - - private val listeners = mutableListOf() - - override fun registerListener(listener: NotifPanelEvents.Listener) { - listeners.add(listener) - } - - override fun unregisterListener(listener: NotifPanelEvents.Listener) { - listeners.remove(listener) - } - - fun changeExpandImmediate(expandImmediate: Boolean) { - listeners.forEach { it.onExpandImmediateChanged(expandImmediate) } - } -} diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/VisualStabilityCoordinatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/VisualStabilityCoordinatorTest.java index c961cec392082..b4a5f5ce205f8 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/VisualStabilityCoordinatorTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/VisualStabilityCoordinatorTest.java @@ -36,7 +36,8 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.dump.DumpManager; import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shade.NotifPanelEvents; +import com.android.systemui.shade.ShadeStateEvents; +import com.android.systemui.shade.ShadeStateEvents.ShadeStateEventsListener; import com.android.systemui.statusbar.notification.collection.GroupEntry; import com.android.systemui.statusbar.notification.collection.GroupEntryBuilder; import com.android.systemui.statusbar.notification.collection.NotifPipeline; @@ -71,12 +72,12 @@ public class VisualStabilityCoordinatorTest extends SysuiTestCase { @Mock private StatusBarStateController mStatusBarStateController; @Mock private Pluggable.PluggableListener mInvalidateListener; @Mock private HeadsUpManager mHeadsUpManager; - @Mock private NotifPanelEvents mNotifPanelEvents; + @Mock private ShadeStateEvents mShadeStateEvents; @Mock private VisualStabilityProvider mVisualStabilityProvider; @Captor private ArgumentCaptor mWakefulnessObserverCaptor; @Captor private ArgumentCaptor mSBStateListenerCaptor; - @Captor private ArgumentCaptor mNotifPanelEventsCallbackCaptor; + @Captor private ArgumentCaptor mNotifPanelEventsCallbackCaptor; @Captor private ArgumentCaptor mNotifStabilityManagerCaptor; private FakeSystemClock mFakeSystemClock = new FakeSystemClock(); @@ -84,7 +85,7 @@ public class VisualStabilityCoordinatorTest extends SysuiTestCase { private WakefulnessLifecycle.Observer mWakefulnessObserver; private StatusBarStateController.StateListener mStatusBarStateListener; - private NotifPanelEvents.Listener mNotifPanelEventsCallback; + private ShadeStateEvents.ShadeStateEventsListener mNotifPanelEventsCallback; private NotifStabilityManager mNotifStabilityManager; private NotificationEntry mEntry; private GroupEntry mGroupEntry; @@ -97,7 +98,7 @@ public class VisualStabilityCoordinatorTest extends SysuiTestCase { mFakeExecutor, mDumpManager, mHeadsUpManager, - mNotifPanelEvents, + mShadeStateEvents, mStatusBarStateController, mVisualStabilityProvider, mWakefulnessLifecycle); @@ -111,7 +112,8 @@ public class VisualStabilityCoordinatorTest extends SysuiTestCase { verify(mStatusBarStateController).addCallback(mSBStateListenerCaptor.capture()); mStatusBarStateListener = mSBStateListenerCaptor.getValue(); - verify(mNotifPanelEvents).registerListener(mNotifPanelEventsCallbackCaptor.capture()); + verify(mShadeStateEvents).addShadeStateEventsListener( + mNotifPanelEventsCallbackCaptor.capture()); mNotifPanelEventsCallback = mNotifPanelEventsCallbackCaptor.getValue(); verify(mNotifPipeline).setVisualStabilityManager(mNotifStabilityManagerCaptor.capture());