Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c102221 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[CS] 2/4: Have NotificationLogger listen to shade/LS visibility directly

Removes some CentralSurfaces logic by having NotificationLogger listen
directly to WindowRootViewVisibilityInteractor instead of requiring
CentralSurfaces to notify NotificationLogger.

Also removes some NotificationLogger internal logic around starting &
stopping logging. When I added some debug logging, the CentralSurfaces
calls to start/stop logging were *always* happening at the same cadence
as the internal NotificationLogger tracking. So, I removed the internal
tracking to have NotificationLogger use only one source of truth.

Bug: 296050180
Test: manual: verified via logging that notif logging starts when device
wakes to lockscreen or when shade is pulled down while unlocked.
Verified notif logging stops when on bouncer, device is unlocked, or
device goes to sleep.
Test: atest NotificationLoggerTest CentralSurfacesImplTest

Change-Id: Id05ddf681d42b5185517faf2689761ac36bfff8a
parent eb73eca1
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -19,12 +19,13 @@ package com.android.systemui.statusbar.notification.dagger;
import android.content.Context;

import com.android.internal.jank.InteractionJankMonitor;
import com.android.systemui.CoreStartable;
import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.scene.domain.interactor.WindowRootViewVisibilityInteractor;
import com.android.systemui.shade.ShadeEventsModule;
import com.android.systemui.shade.ShadeExpansionStateManager;
import com.android.systemui.statusbar.NotificationListener;
import com.android.systemui.statusbar.notification.NotificationActivityStarter;
import com.android.systemui.statusbar.notification.NotificationLaunchAnimatorControllerProvider;
@@ -76,10 +77,13 @@ import com.android.systemui.statusbar.notification.stack.ui.viewmodel.Notificati
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone;
import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.StatusBarNotificationActivityStarter;
import com.android.systemui.util.kotlin.JavaAdapter;

import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import dagger.multibindings.ClassKey;
import dagger.multibindings.IntoMap;

import java.util.concurrent.Executor;

@@ -125,7 +129,8 @@ public interface NotificationsModule {
            NotificationVisibilityProvider visibilityProvider,
            NotifPipeline notifPipeline,
            StatusBarStateController statusBarStateController,
            ShadeExpansionStateManager shadeExpansionStateManager,
            WindowRootViewVisibilityInteractor windowRootViewVisibilityInteractor,
            JavaAdapter javaAdapter,
            NotificationLogger.ExpansionStateLogger expansionStateLogger,
            NotificationPanelLogger notificationPanelLogger) {
        return new NotificationLogger(
@@ -135,11 +140,18 @@ public interface NotificationsModule {
                visibilityProvider,
                notifPipeline,
                statusBarStateController,
                shadeExpansionStateManager,
                windowRootViewVisibilityInteractor,
                javaAdapter,
                expansionStateLogger,
                notificationPanelLogger);
    }

    /** Binds {@link NotificationLogger} as a {@link CoreStartable}. */
    @Binds
    @IntoMap
    @ClassKey(NotificationLogger.class)
    CoreStartable bindsNotificationLogger(NotificationLogger notificationLogger);

    /** Provides an instance of {@link NotificationPanelLogger} */
    @SysUISingleton
    @Provides
+32 −64
Original line number Diff line number Diff line
@@ -33,10 +33,11 @@ import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.NotificationVisibility;
import com.android.systemui.CoreStartable;
import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
import com.android.systemui.shade.ShadeExpansionStateManager;
import com.android.systemui.scene.domain.interactor.WindowRootViewVisibilityInteractor;
import com.android.systemui.statusbar.NotificationListener;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.collection.NotifLiveDataStore;
@@ -48,6 +49,7 @@ import com.android.systemui.statusbar.notification.dagger.NotificationsModule;
import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
import com.android.systemui.util.Compile;
import com.android.systemui.util.kotlin.JavaAdapter;

import java.util.Collection;
import java.util.Collections;
@@ -62,7 +64,7 @@ import javax.inject.Inject;
 * Handles notification logging, in particular, logging which notifications are visible and which
 * are not.
 */
public class NotificationLogger implements StateListener {
public class NotificationLogger implements StateListener, CoreStartable {
    static final String TAG = "NotificationLogger";
    private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);

@@ -81,6 +83,8 @@ public class NotificationLogger implements StateListener {
    private final NotifPipeline mNotifPipeline;
    private final NotificationPanelLogger mNotificationPanelLogger;
    private final ExpansionStateLogger mExpansionStateLogger;
    private final WindowRootViewVisibilityInteractor mWindowRootViewVisibilityInteractor;
    private final JavaAdapter mJavaAdapter;

    protected Handler mHandler = new Handler();
    protected IStatusBarService mBarService;
@@ -88,10 +92,7 @@ public class NotificationLogger implements StateListener {
    private NotificationListContainer mListContainer;
    private final Object mDozingLock = new Object();
    @GuardedBy("mDozingLock")
    private Boolean mDozing = null;  // Use null to indicate state is not yet known
    @GuardedBy("mDozingLock")
    private Boolean mLockscreen = null;  // Use null to indicate state is not yet known
    private Boolean mPanelExpanded = null;  // Use null to indicate state is not yet known
    private boolean mLogging = false;

    // Tracks notifications currently visible in mNotificationStackScroller and
@@ -202,7 +203,8 @@ public class NotificationLogger implements StateListener {
            NotificationVisibilityProvider visibilityProvider,
            NotifPipeline notifPipeline,
            StatusBarStateController statusBarStateController,
            ShadeExpansionStateManager shadeExpansionStateManager,
            WindowRootViewVisibilityInteractor windowRootViewVisibilityInteractor,
            JavaAdapter javaAdapter,
            ExpansionStateLogger expansionStateLogger,
            NotificationPanelLogger notificationPanelLogger) {
        mNotificationListener = notificationListener;
@@ -214,9 +216,10 @@ public class NotificationLogger implements StateListener {
                ServiceManager.getService(Context.STATUS_BAR_SERVICE));
        mExpansionStateLogger = expansionStateLogger;
        mNotificationPanelLogger = notificationPanelLogger;
        mWindowRootViewVisibilityInteractor = windowRootViewVisibilityInteractor;
        mJavaAdapter = javaAdapter;
        // Not expected to be destroyed, don't need to unsubscribe
        statusBarStateController.addCallback(this);
        shadeExpansionStateManager.addFullExpansionListener(this::onShadeExpansionFullyChanged);

        registerNewPipelineListener();
    }
@@ -239,6 +242,22 @@ public class NotificationLogger implements StateListener {
        mListContainer = listContainer;
    }

    @Override
    public void start() {
        mJavaAdapter.alwaysCollectFlow(
                mWindowRootViewVisibilityInteractor.isLockscreenOrShadeVisibleAndInteractive(),
                this::onLockscreenOrShadeVisibleAndInteractiveChanged);
    }

    private void onLockscreenOrShadeVisibleAndInteractiveChanged(boolean visible) {
        if (visible) {
            startNotificationLogging();
        } else {
            // Ensure we stop notification logging when the device isn't interactive.
            stopNotificationLogging();
        }
    }

    public void stopNotificationLogging() {
        if (mLogging) {
            mLogging = false;
@@ -257,16 +276,19 @@ public class NotificationLogger implements StateListener {
        }
    }

    @GuardedBy("mDozingLock")
    public void startNotificationLogging() {
        if (!mLogging) {
            mLogging = true;
            if (DEBUG) {
                Log.i(TAG, "startNotificationLogging");
            }
            boolean lockscreen = mLockscreen != null && mLockscreen;
            mNotificationPanelLogger.logPanelShown(lockscreen, getVisibleNotifications());
            mListContainer.setChildLocationsChangedListener(this::onChildLocationsChanged);
            // Some transitions like mVisibleToUser=false -> mVisibleToUser=true don't
            // cause the scroller to emit child location events. Hence generate
            // one ourselves to guarantee that we're reporting visible
            // Sometimes, the transition from lockscreenOrShadeVisible=false ->
            // lockscreenOrShadeVisible=true doesn't cause the scroller to emit child location
            // events. Hence generate one ourselves to guarantee that we're reporting visible
            // notifications.
            // (Note that in cases where the scroller does emit events, this
            // additional event doesn't break anything.)
@@ -274,13 +296,6 @@ public class NotificationLogger implements StateListener {
        }
    }

    private void setDozing(boolean dozing) {
        synchronized (mDozingLock) {
            mDozing = dozing;
            maybeUpdateLoggingStatus();
        }
    }

    private void logNotificationVisibilityChanges(
            Collection<NotificationVisibility> newlyVisible,
            Collection<NotificationVisibility> noLongerVisible) {
@@ -362,39 +377,6 @@ public class NotificationLogger implements StateListener {
        }
    }

    @Override
    public void onDozingChanged(boolean isDozing) {
        if (DEBUG) {
            Log.i(TAG, "onDozingChanged: new=" + isDozing);
        }
        setDozing(isDozing);
    }

    @GuardedBy("mDozingLock")
    private void maybeUpdateLoggingStatus() {
        if (mPanelExpanded == null || mDozing == null) {
            if (DEBUG) {
                Log.i(TAG, "Panel status unclear: panelExpandedKnown="
                        + (mPanelExpanded == null) + " dozingKnown=" + (mDozing == null));
            }
            return;
        }
        // Once we know panelExpanded and Dozing, turn logging on & off when appropriate
        boolean lockscreen = mLockscreen == null ? false : mLockscreen;
        if (mPanelExpanded && !mDozing) {
            mNotificationPanelLogger.logPanelShown(lockscreen, getVisibleNotifications());
            if (DEBUG) {
                Log.i(TAG, "Notification panel shown, lockscreen=" + lockscreen);
            }
            startNotificationLogging();
        } else {
            if (DEBUG) {
                Log.i(TAG, "Notification panel hidden, lockscreen=" + lockscreen);
            }
            stopNotificationLogging();
        }
    }

    /**
     * Called when the notification is expanded / collapsed.
     */
@@ -403,20 +385,6 @@ public class NotificationLogger implements StateListener {
        mExpansionStateLogger.onExpansionChanged(key, isUserAction, isExpanded, location);
    }

    @VisibleForTesting
    void onShadeExpansionFullyChanged(Boolean isExpanded) {
        // mPanelExpanded is initialized as null
        if (mPanelExpanded == null || !mPanelExpanded.equals(isExpanded)) {
            if (DEBUG) {
                Log.i(TAG, "onPanelExpandedChanged: new=" + isExpanded);
            }
            mPanelExpanded = isExpanded;
            synchronized (mDozingLock) {
                maybeUpdateLoggingStatus();
            }
        }
    }

    @VisibleForTesting
    void onChildLocationsChanged() {
        if (mHandler.hasCallbacks(mVisibilityReporter)) {
+0 −7
Original line number Diff line number Diff line
@@ -221,7 +221,6 @@ import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator
import com.android.systemui.statusbar.notification.data.repository.NotificationExpansionRepository;
import com.android.systemui.statusbar.notification.init.NotificationsController;
import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider;
import com.android.systemui.statusbar.notification.logging.NotificationLogger;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
@@ -489,7 +488,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
    private View mReportRejectedTouch;

    private final NotificationGutsManager mGutsManager;
    private final NotificationLogger mNotificationLogger;
    private final ShadeExpansionStateManager mShadeExpansionStateManager;
    private final KeyguardViewMediator mKeyguardViewMediator;
    protected final NotificationInterruptStateProvider mNotificationInterruptStateProvider;
@@ -694,7 +692,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
            FalsingCollector falsingCollector,
            BroadcastDispatcher broadcastDispatcher,
            NotificationGutsManager notificationGutsManager,
            NotificationLogger notificationLogger,
            NotificationInterruptStateProvider notificationInterruptStateProvider,
            ShadeExpansionStateManager shadeExpansionStateManager,
            KeyguardViewMediator keyguardViewMediator,
@@ -803,7 +800,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        mFalsingManager = falsingManager;
        mBroadcastDispatcher = broadcastDispatcher;
        mGutsManager = notificationGutsManager;
        mNotificationLogger = notificationLogger;
        mNotificationInterruptStateProvider = notificationInterruptStateProvider;
        mShadeExpansionStateManager = shadeExpansionStateManager;
        mKeyguardViewMediator = keyguardViewMediator;
@@ -2176,8 +2172,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
    protected void handleVisibleToUserChanged(boolean visibleToUser) {
        if (visibleToUser) {
            onVisibleToUser();
            mNotificationLogger.startNotificationLogging();

            if (!mIsBackCallbackRegistered) {
                ViewRootImpl viewRootImpl = getViewRootImpl();
                if (viewRootImpl != null) {
@@ -2192,7 +2186,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
                if (DEBUG) Log.d(TAG, "is now VISIBLE to user, BUT callback ALREADY unregistered");
            }
        } else {
            mNotificationLogger.stopNotificationLogging();
            onInvisibleToUser();

            if (mIsBackCallbackRegistered) {
+66 −23
Original line number Diff line number Diff line
@@ -40,8 +40,14 @@ import androidx.test.filters.SmallTest;
import com.android.internal.logging.InstanceId;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.NotificationVisibility;
import com.android.keyguard.TestScopeProvider;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.shade.ShadeExpansionStateManager;
import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository;
import com.android.systemui.keyguard.shared.model.WakeSleepReason;
import com.android.systemui.keyguard.shared.model.WakefulnessModel;
import com.android.systemui.keyguard.shared.model.WakefulnessState;
import com.android.systemui.scene.data.repository.WindowRootViewVisibilityRepository;
import com.android.systemui.scene.domain.interactor.WindowRootViewVisibilityInteractor;
import com.android.systemui.statusbar.NotificationListener;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.StatusBarStateControllerImpl;
@@ -55,6 +61,7 @@ import com.android.systemui.statusbar.notification.logging.nano.Notifications;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
import com.android.systemui.util.concurrency.FakeExecutor;
import com.android.systemui.util.kotlin.JavaAdapter;
import com.android.systemui.util.time.FakeSystemClock;

import com.google.android.collect.Lists;
@@ -71,6 +78,8 @@ import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;

import kotlinx.coroutines.test.TestScope;

@SmallTest
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
@@ -89,7 +98,6 @@ public class NotificationLoggerTest extends SysuiTestCase {
    @Mock private NotificationVisibilityProvider mVisibilityProvider;
    @Mock private NotifPipeline mNotifPipeline;
    @Mock private NotificationListener mListener;
    @Mock private ShadeExpansionStateManager mShadeExpansionStateManager;

    private NotificationEntry mEntry;
    private TestableNotificationLogger mLogger;
@@ -97,12 +105,22 @@ public class NotificationLoggerTest extends SysuiTestCase {
    private FakeExecutor mUiBgExecutor = new FakeExecutor(new FakeSystemClock());
    private NotificationPanelLoggerFake mNotificationPanelLoggerFake =
            new NotificationPanelLoggerFake();
    private final TestScope mTestScope = TestScopeProvider.getTestScope();
    private final FakeKeyguardRepository mKeyguardRepository = new FakeKeyguardRepository();
    private final WindowRootViewVisibilityInteractor mWindowRootViewVisibilityInteractor =
            new WindowRootViewVisibilityInteractor(
                    mTestScope.getBackgroundScope(),
                    new WindowRootViewVisibilityRepository(),
                    mKeyguardRepository);
    private final JavaAdapter mJavaAdapter = new JavaAdapter(mTestScope.getBackgroundScope());

    @Before
    public void setUp() {
        MockitoAnnotations.initMocks(this);
        when(mNotifLiveDataStore.getActiveNotifList()).thenReturn(mActiveNotifEntries);

        mWindowRootViewVisibilityInteractor.setIsLockscreenOrShadeVisible(true);

        mEntry = new NotificationEntryBuilder()
                .setPkg(TEST_PACKAGE_NAME)
                .setOpPkg(TEST_PACKAGE_NAME)
@@ -120,10 +138,12 @@ public class NotificationLoggerTest extends SysuiTestCase {
                mVisibilityProvider,
                mNotifPipeline,
                mock(StatusBarStateControllerImpl.class),
                mShadeExpansionStateManager,
                mWindowRootViewVisibilityInteractor,
                mJavaAdapter,
                mBarService,
                mExpansionStateLogger
        );
        mLogger.start();
        mLogger.setUpWithContainer(mListContainer);
        verify(mNotifPipeline).addCollectionListener(any());
    }
@@ -183,31 +203,26 @@ public class NotificationLoggerTest extends SysuiTestCase {
        Mockito.reset(mBarService);

        setStateAsleep();
        mLogger.onDozingChanged(false);  // Wake to lockscreen
        mLogger.onDozingChanged(true);  // And go back to sleep, turning off logging

        setStateAwake();  // Wake to lockscreen

        setStateAsleep();  // And go back to sleep, turning off logging
        mUiBgExecutor.runAllReady();

        // The visibility objects are recycled by NotificationLogger, so we can't use specific
        // matchers here.
        verify(mBarService, times(1)).onNotificationVisibilityChanged(any(), any());
    }

    private void setStateAsleep() {
        mLogger.onShadeExpansionFullyChanged(true);
        mLogger.onDozingChanged(true);
        mLogger.onStateChanged(StatusBarState.KEYGUARD);
    }

    private void setStateAwake() {
        mLogger.onShadeExpansionFullyChanged(false);
        mLogger.onDozingChanged(false);
        mLogger.onStateChanged(StatusBarState.SHADE);
    }

    @Test
    public void testLogPanelShownOnWake() {
    public void testLogPanelShownOnWakeToLockscreen() {
        when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
        setStateAsleep();
        mLogger.onDozingChanged(false);  // Wake to lockscreen

        // Wake to lockscreen
        mLogger.onStateChanged(StatusBarState.KEYGUARD);
        setStateAwake();

        assertEquals(1, mNotificationPanelLoggerFake.getCalls().size());
        assertTrue(mNotificationPanelLoggerFake.get(0).isLockscreen);
        assertEquals(1, mNotificationPanelLoggerFake.get(0).list.notifications.length);
@@ -222,9 +237,14 @@ public class NotificationLoggerTest extends SysuiTestCase {
    @Test
    public void testLogPanelShownOnShadePull() {
        when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(mEntry));
        // Start as awake, but with the panel not visible
        setStateAwake();
        mWindowRootViewVisibilityInteractor.setIsLockscreenOrShadeVisible(false);

        // Now expand panel
        mLogger.onShadeExpansionFullyChanged(true);
        mLogger.onStateChanged(StatusBarState.SHADE);
        mWindowRootViewVisibilityInteractor.setIsLockscreenOrShadeVisible(true);

        assertEquals(1, mNotificationPanelLoggerFake.getCalls().size());
        assertFalse(mNotificationPanelLoggerFake.get(0).isLockscreen);
        assertEquals(1, mNotificationPanelLoggerFake.get(0).list.notifications.length);
@@ -251,13 +271,34 @@ public class NotificationLoggerTest extends SysuiTestCase {

        when(mActiveNotifEntries.getValue()).thenReturn(Lists.newArrayList(entry));
        setStateAsleep();
        mLogger.onDozingChanged(false);  // Wake to lockscreen

        // Wake to lockscreen
        setStateAwake();

        assertEquals(1, mNotificationPanelLoggerFake.getCalls().size());
        assertEquals(1, mNotificationPanelLoggerFake.get(0).list.notifications.length);
        Notifications.Notification n = mNotificationPanelLoggerFake.get(0).list.notifications[0];
        assertEquals(0, n.instanceId);
    }

    private void setStateAsleep() {
        mKeyguardRepository.setWakefulnessModel(
                new WakefulnessModel(
                        WakefulnessState.ASLEEP,
                        WakeSleepReason.OTHER,
                        WakeSleepReason.OTHER));
        mTestScope.getTestScheduler().runCurrent();
    }

    private void setStateAwake() {
        mKeyguardRepository.setWakefulnessModel(
                new WakefulnessModel(
                        WakefulnessState.AWAKE,
                        WakeSleepReason.OTHER,
                        WakeSleepReason.OTHER));
        mTestScope.getTestScheduler().runCurrent();
    }

    private class TestableNotificationLogger extends NotificationLogger {

        TestableNotificationLogger(NotificationListener notificationListener,
@@ -266,7 +307,8 @@ public class NotificationLoggerTest extends SysuiTestCase {
                NotificationVisibilityProvider visibilityProvider,
                NotifPipeline notifPipeline,
                StatusBarStateControllerImpl statusBarStateController,
                ShadeExpansionStateManager shadeExpansionStateManager,
                WindowRootViewVisibilityInteractor windowRootViewVisibilityInteractor,
                JavaAdapter javaAdapter,
                IStatusBarService barService,
                ExpansionStateLogger expansionStateLogger) {
            super(
@@ -276,7 +318,8 @@ public class NotificationLoggerTest extends SysuiTestCase {
                    visibilityProvider,
                    notifPipeline,
                    statusBarStateController,
                    shadeExpansionStateManager,
                    windowRootViewVisibilityInteractor,
                    javaAdapter,
                    expansionStateLogger,
                    mNotificationPanelLoggerFake
            );
+0 −20
Original line number Diff line number Diff line
@@ -159,7 +159,6 @@ import com.android.systemui.statusbar.notification.NotificationActivityStarter;
import com.android.systemui.statusbar.notification.NotificationLaunchAnimatorControllerProvider;
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
import com.android.systemui.statusbar.notification.collection.NotifLiveDataStore;
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder;
import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider;
@@ -168,10 +167,7 @@ import com.android.systemui.statusbar.notification.init.NotificationsController;
import com.android.systemui.statusbar.notification.interruption.KeyguardNotificationVisibilityProvider;
import com.android.systemui.statusbar.notification.interruption.NotificationInterruptLogger;
import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProviderImpl;
import com.android.systemui.statusbar.notification.logging.NotificationLogger;
import com.android.systemui.statusbar.notification.logging.NotificationPanelLoggerFake;
import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent;
@@ -228,7 +224,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
    @Mock private KeyguardIndicationController mKeyguardIndicationController;
    @Mock private NotificationStackScrollLayout mStackScroller;
    @Mock private NotificationStackScrollLayoutController mStackScrollerController;
    @Mock private NotificationListContainer mNotificationListContainer;
    @Mock private HeadsUpManagerPhone mHeadsUpManager;
    @Mock private NotificationPanelViewController mNotificationPanelViewController;
    @Mock private ShadeLogger mShadeLogger;
@@ -255,7 +250,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
    @Mock private StatusBarNotificationPresenter mNotificationPresenter;
    @Mock private NotificationActivityStarter mNotificationActivityStarter;
    @Mock private AmbientDisplayConfiguration mAmbientDisplayConfiguration;
    @Mock private NotificationLogger.ExpansionStateLogger mExpansionStateLogger;
    @Mock private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    @Mock private StatusBarSignalPolicy mStatusBarSignalPolicy;
    @Mock private BroadcastDispatcher mBroadcastDispatcher;
@@ -389,18 +383,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
        mContext.addMockSystemService(FingerprintManager.class, mock(FingerprintManager.class));

        mMetricsLogger = new FakeMetricsLogger();
        NotificationLogger notificationLogger = new NotificationLogger(
                mNotificationListener,
                mUiBgExecutor,
                mNotifLiveDataStore,
                mVisibilityProvider,
                mock(NotifPipeline.class),
                mStatusBarStateController,
                mShadeExpansionStateManager,
                mExpansionStateLogger,
                new NotificationPanelLoggerFake()
        );
        notificationLogger.setVisibilityReporter(mock(Runnable.class));

        when(mCommandQueue.asBinder()).thenReturn(new Binder());

@@ -492,7 +474,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
                new FalsingCollectorFake(),
                mBroadcastDispatcher,
                mNotificationGutsManager,
                notificationLogger,
                mNotificationInterruptStateProvider,
                new ShadeExpansionStateManager(),
                mKeyguardViewMediator,
@@ -611,7 +592,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
                PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "sysui:GestureWakeLock");
        mCentralSurfaces.startKeyguard();
        mInitController.executePostInitTasks();
        notificationLogger.setUpWithContainer(mNotificationListContainer);
        mCentralSurfaces.registerCallbacks();
    }