diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java index 47148a44d66ce..0f3daf57e8c1e 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java @@ -127,35 +127,13 @@ public class SystemUIFactory { providers.put(VisualStabilityManager.class, VisualStabilityManager::new); providers.put(NotificationGroupManager.class, NotificationGroupManager::new); providers.put(NotificationMediaManager.class, () -> new NotificationMediaManager(context)); - providers.put(NotificationGutsManager.class, () -> new NotificationGutsManager( - Dependency.get(NotificationLockscreenUserManager.class), context)); + providers.put(NotificationGutsManager.class, () -> new NotificationGutsManager(context)); providers.put(NotificationRemoteInputManager.class, - () -> new NotificationRemoteInputManager( - Dependency.get(NotificationLockscreenUserManager.class), context)); - providers.put(NotificationListener.class, () -> new NotificationListener( - Dependency.get(NotificationRemoteInputManager.class), context)); - providers.put(NotificationLogger.class, () -> new NotificationLogger( - Dependency.get(NotificationListener.class), - Dependency.get(UiOffloadThread.class))); - providers.put(NotificationViewHierarchyManager.class, () -> - new NotificationViewHierarchyManager( - Dependency.get(NotificationLockscreenUserManager.class), - Dependency.get(NotificationGroupManager.class), - Dependency.get(VisualStabilityManager.class), - context)); - providers.put(NotificationEntryManager.class, () -> - new NotificationEntryManager( - Dependency.get(NotificationLockscreenUserManager.class), - Dependency.get(NotificationGroupManager.class), - Dependency.get(NotificationGutsManager.class), - Dependency.get(NotificationRemoteInputManager.class), - Dependency.get(NotificationMediaManager.class), - Dependency.get(ForegroundServiceController.class), - Dependency.get(NotificationListener.class), - Dependency.get(MetricsLogger.class), - Dependency.get(DeviceProvisionedController.class), - Dependency.get(VisualStabilityManager.class), - Dependency.get(UiOffloadThread.class), - context)); + () -> new NotificationRemoteInputManager(context)); + providers.put(NotificationListener.class, () -> new NotificationListener(context)); + providers.put(NotificationLogger.class, NotificationLogger::new); + providers.put(NotificationViewHierarchyManager.class, + () -> new NotificationViewHierarchyManager(context)); + providers.put(NotificationEntryManager.class, () -> new NotificationEntryManager(context)); } } diff --git a/packages/SystemUI/src/com/android/systemui/car/CarNotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/car/CarNotificationEntryManager.java index 20418c3f59ad2..a89a8ef5b70ec 100644 --- a/packages/SystemUI/src/com/android/systemui/car/CarNotificationEntryManager.java +++ b/packages/SystemUI/src/com/android/systemui/car/CarNotificationEntryManager.java @@ -18,37 +18,13 @@ package com.android.systemui.car; import android.content.Context; import android.service.notification.StatusBarNotification; -import com.android.internal.logging.MetricsLogger; -import com.android.systemui.ForegroundServiceController; -import com.android.systemui.UiOffloadThread; import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.NotificationEntryManager; -import com.android.systemui.statusbar.NotificationGutsManager; -import com.android.systemui.statusbar.NotificationListener; -import com.android.systemui.statusbar.NotificationLockscreenUserManager; -import com.android.systemui.statusbar.NotificationMediaManager; -import com.android.systemui.statusbar.NotificationRemoteInputManager; -import com.android.systemui.statusbar.notification.VisualStabilityManager; -import com.android.systemui.statusbar.phone.NotificationGroupManager; -import com.android.systemui.statusbar.policy.DeviceProvisionedController; public class CarNotificationEntryManager extends NotificationEntryManager { - public CarNotificationEntryManager( - NotificationLockscreenUserManager lockscreenUserManager, - NotificationGroupManager groupManager, - NotificationGutsManager gutsManager, - NotificationRemoteInputManager remoteInputManager, - NotificationMediaManager mediaManager, - ForegroundServiceController foregroundServiceController, - NotificationListener notificationListener, - MetricsLogger metricsLogger, - DeviceProvisionedController deviceProvisionedController, - VisualStabilityManager visualStabilityManager, - UiOffloadThread uiOffloadThread, Context context) { - super(lockscreenUserManager, groupManager, gutsManager, remoteInputManager, mediaManager, - foregroundServiceController, notificationListener, metricsLogger, - deviceProvisionedController, visualStabilityManager, uiOffloadThread, context); + public CarNotificationEntryManager(Context context) { + super(context); } /** diff --git a/packages/SystemUI/src/com/android/systemui/car/CarSystemUIFactory.java b/packages/SystemUI/src/com/android/systemui/car/CarSystemUIFactory.java index 55965e7f1f8e8..174584de9405e 100644 --- a/packages/SystemUI/src/com/android/systemui/car/CarSystemUIFactory.java +++ b/packages/SystemUI/src/com/android/systemui/car/CarSystemUIFactory.java @@ -45,18 +45,7 @@ public class CarSystemUIFactory extends SystemUIFactory { Context context) { super.injectDependencies(providers, context); providers.put(VolumeDialogController.class, () -> new CarVolumeDialogController(context)); - providers.put(NotificationEntryManager.class, () -> new CarNotificationEntryManager( - Dependency.get(NotificationLockscreenUserManager.class), - Dependency.get(NotificationGroupManager.class), - Dependency.get(NotificationGutsManager.class), - Dependency.get(NotificationRemoteInputManager.class), - Dependency.get(NotificationMediaManager.class), - Dependency.get(ForegroundServiceController.class), - Dependency.get(NotificationListener.class), - Dependency.get(MetricsLogger.class), - Dependency.get(DeviceProvisionedController.class), - Dependency.get(VisualStabilityManager.class), - Dependency.get(UiOffloadThread.class), - context)); + providers.put(NotificationEntryManager.class, + () -> new CarNotificationEntryManager(context)); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java index 90b46c8d2cf99..6bbd09f715db6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java @@ -80,24 +80,36 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater. protected static final boolean DEBUG = false; protected static final boolean ENABLE_HEADS_UP = true; protected static final String SETTING_HEADS_UP_TICKER = "ticker_gets_heads_up"; + protected final NotificationMessagingUtil mMessagingUtil; protected final Context mContext; - protected final NotificationLockscreenUserManager mLockscreenUserManager; - protected final NotificationGroupManager mGroupManager; - protected final NotificationGutsManager mGutsManager; - protected final NotificationRemoteInputManager mRemoteInputManager; protected final HashMap mPendingNotifications = new HashMap<>(); - protected final NotificationMediaManager mMediaManager; - protected final MetricsLogger mMetricsLogger; - protected final DeviceProvisionedController mDeviceProvisionedController; - protected final VisualStabilityManager mVisualStabilityManager; - protected final UiOffloadThread mUiOffloadThread; - protected final ForegroundServiceController mForegroundServiceController; - protected final NotificationListener mNotificationListener; protected final NotificationClicker mNotificationClicker = new NotificationClicker(); protected final ArraySet mHeadsUpEntriesToRemoveOnSwitch = new ArraySet<>(); + // Dependencies: + protected final NotificationLockscreenUserManager mLockscreenUserManager = + Dependency.get(NotificationLockscreenUserManager.class); + protected final NotificationGroupManager mGroupManager = + Dependency.get(NotificationGroupManager.class); + protected final NotificationGutsManager mGutsManager = + Dependency.get(NotificationGutsManager.class); + protected final NotificationRemoteInputManager mRemoteInputManager = + Dependency.get(NotificationRemoteInputManager.class); + protected final NotificationMediaManager mMediaManager = + Dependency.get(NotificationMediaManager.class); + protected final MetricsLogger mMetricsLogger = Dependency.get(MetricsLogger.class); + protected final DeviceProvisionedController mDeviceProvisionedController = + Dependency.get(DeviceProvisionedController.class); + protected final VisualStabilityManager mVisualStabilityManager = + Dependency.get(VisualStabilityManager.class); + protected final UiOffloadThread mUiOffloadThread = Dependency.get(UiOffloadThread.class); + protected final ForegroundServiceController mForegroundServiceController = + Dependency.get(ForegroundServiceController.class); + protected final NotificationListener mNotificationListener = + Dependency.get(NotificationListener.class); + protected IStatusBarService mBarService; protected NotificationPresenter mPresenter; protected Callback mCallback; @@ -205,28 +217,7 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater. pw.println(mUseHeadsUp); } - public NotificationEntryManager(NotificationLockscreenUserManager lockscreenUserManager, - NotificationGroupManager groupManager, - NotificationGutsManager gutsManager, - NotificationRemoteInputManager remoteInputManager, - NotificationMediaManager mediaManager, - ForegroundServiceController foregroundServiceController, - NotificationListener notificationListener, - MetricsLogger metricsLogger, - DeviceProvisionedController deviceProvisionedController, - VisualStabilityManager visualStabilityManager, - UiOffloadThread uiOffloadThread, Context context) { - mLockscreenUserManager = lockscreenUserManager; - mGroupManager = groupManager; - mGutsManager = gutsManager; - mRemoteInputManager = remoteInputManager; - mMediaManager = mediaManager; - mForegroundServiceController = foregroundServiceController; - mNotificationListener = notificationListener; - mMetricsLogger = metricsLogger; - mDeviceProvisionedController = deviceProvisionedController; - mVisualStabilityManager = visualStabilityManager; - mUiOffloadThread = uiOffloadThread; + public NotificationEntryManager(Context context) { mContext = context; mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); mBarService = IStatusBarService.Stub.asInterface( diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGutsManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGutsManager.java index 9dda2a218cef6..87ad6f6bc9484 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGutsManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGutsManager.java @@ -66,7 +66,10 @@ public class NotificationGutsManager implements Dumpable { private final Set mNonBlockablePkgs; private final Context mContext; private final AccessibilityManager mAccessibilityManager; - private final NotificationLockscreenUserManager mLockscreenUserManager; + + // Dependencies: + private final NotificationLockscreenUserManager mLockscreenUserManager = + Dependency.get(NotificationLockscreenUserManager.class); // which notification is currently being longpress-examined by the user private NotificationGuts mNotificationGutsExposed; @@ -78,10 +81,7 @@ public class NotificationGutsManager implements Dumpable { private OnSettingsClickListener mOnSettingsClickListener; private String mKeyToRemoveOnGutsClosed; - public NotificationGutsManager( - NotificationLockscreenUserManager lockscreenUserManager, - Context context) { - mLockscreenUserManager = lockscreenUserManager; + public NotificationGutsManager(Context context) { mContext = context; Resources res = context.getResources(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java index 113a5a477410e..0144f4244a8f9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java @@ -27,6 +27,7 @@ import android.os.UserHandle; import android.service.notification.StatusBarNotification; import android.util.Log; +import com.android.systemui.Dependency; import com.android.systemui.statusbar.phone.NotificationListenerWithPlugins; /** @@ -36,15 +37,16 @@ import com.android.systemui.statusbar.phone.NotificationListenerWithPlugins; public class NotificationListener extends NotificationListenerWithPlugins { private static final String TAG = "NotificationListener"; - private final NotificationRemoteInputManager mRemoteInputManager; + // Dependencies: + private final NotificationRemoteInputManager mRemoteInputManager = + Dependency.get(NotificationRemoteInputManager.class); + private final Context mContext; protected NotificationPresenter mPresenter; protected NotificationEntryManager mEntryManager; - public NotificationListener(NotificationRemoteInputManager remoteInputManager, - Context context) { - mRemoteInputManager = remoteInputManager; + public NotificationListener(Context context) { mContext = context; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLogger.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLogger.java index 76825feac0ce4..4225f83c5b116 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLogger.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLogger.java @@ -27,6 +27,7 @@ import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; +import com.android.systemui.Dependency; import com.android.systemui.UiOffloadThread; import java.util.ArrayList; @@ -46,8 +47,11 @@ public class NotificationLogger { /** Keys of notifications currently visible to the user. */ private final ArraySet mCurrentlyVisibleNotifications = new ArraySet<>(); - private final NotificationListenerService mNotificationListener; - private final UiOffloadThread mUiOffloadThread; + + // Dependencies: + private final NotificationListenerService mNotificationListener = + Dependency.get(NotificationListener.class); + private final UiOffloadThread mUiOffloadThread = Dependency.get(UiOffloadThread.class); protected NotificationEntryManager mEntryManager; protected Handler mHandler = new Handler(); @@ -132,10 +136,7 @@ public class NotificationLogger { } }; - public NotificationLogger(NotificationListenerService notificationListener, - UiOffloadThread uiOffloadThread) { - mNotificationListener = notificationListener; - mUiOffloadThread = uiOffloadThread; + public NotificationLogger() { mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java index 03e941dcbc7cb..f25379ab0b22e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java @@ -39,6 +39,7 @@ import android.widget.TextView; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.statusbar.IStatusBarService; +import com.android.systemui.Dependency; import com.android.systemui.Dumpable; import com.android.systemui.statusbar.policy.RemoteInputView; @@ -70,7 +71,10 @@ public class NotificationRemoteInputManager implements Dumpable { protected final ArraySet mRemoteInputEntriesToRemoveOnCollapse = new ArraySet<>(); - protected final NotificationLockscreenUserManager mLockscreenUserManager; + + // Dependencies: + protected final NotificationLockscreenUserManager mLockscreenUserManager = + Dependency.get(NotificationLockscreenUserManager.class); /** * Notifications with keys in this set are not actually around anymore. We kept them around @@ -264,9 +268,7 @@ public class NotificationRemoteInputManager implements Dumpable { } }; - public NotificationRemoteInputManager(NotificationLockscreenUserManager lockscreenUserManager, - Context context) { - mLockscreenUserManager = lockscreenUserManager; + public NotificationRemoteInputManager(Context context) { mContext = context; mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java index b73b9b6eb4cc5..266c09bc6c8d2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java @@ -22,6 +22,7 @@ import android.util.Log; import android.view.View; import android.view.ViewGroup; +import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.statusbar.notification.VisualStabilityManager; import com.android.systemui.statusbar.phone.NotificationGroupManager; @@ -43,9 +44,14 @@ public class NotificationViewHierarchyManager { private final HashMap> mTmpChildOrderMap = new HashMap<>(); - protected final NotificationLockscreenUserManager mLockscreenUserManager; - protected final NotificationGroupManager mGroupManager; - protected final VisualStabilityManager mVisualStabilityManager; + + // Dependencies: + protected final NotificationLockscreenUserManager mLockscreenUserManager = + Dependency.get(NotificationLockscreenUserManager.class); + protected final NotificationGroupManager mGroupManager = + Dependency.get(NotificationGroupManager.class); + protected final VisualStabilityManager mVisualStabilityManager = + Dependency.get(VisualStabilityManager.class); /** * {@code true} if notifications not part of a group should by default be rendered in their @@ -58,15 +64,7 @@ public class NotificationViewHierarchyManager { private NotificationEntryManager mEntryManager; private NotificationListContainer mListContainer; - public NotificationViewHierarchyManager( - NotificationLockscreenUserManager lockscreenUserManager, - NotificationGroupManager groupManager, - VisualStabilityManager visualStabilityManager, - Context context) { - mLockscreenUserManager = lockscreenUserManager; - mGroupManager = groupManager; - mVisualStabilityManager = visualStabilityManager; - + public NotificationViewHierarchyManager(Context context) { Resources res = context.getResources(); mAlwaysExpandNonGroupedNotification = res.getBoolean(R.bool.config_alwaysExpandNonGroupedNotifications); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationEntryManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationEntryManagerTest.java index 90812cfef9df3..0a683891e66fd 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationEntryManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationEntryManagerTest.java @@ -101,22 +101,8 @@ public class NotificationEntryManagerTest extends SysuiTestCase { private class TestableNotificationEntryManager extends NotificationEntryManager { private final CountDownLatch mCountDownLatch; - public TestableNotificationEntryManager( - NotificationLockscreenUserManager lockscreenUserManager, - NotificationGroupManager groupManager, - NotificationGutsManager gutsManager, - NotificationRemoteInputManager remoteInputManager, - NotificationMediaManager mediaManager, - ForegroundServiceController foregroundServiceController, - NotificationListener notificationListener, - MetricsLogger metricsLogger, - DeviceProvisionedController deviceProvisionedController, - VisualStabilityManager visualStabilityManager, - UiOffloadThread uiOffloadThread, Context context, - IStatusBarService barService) { - super(lockscreenUserManager, groupManager, gutsManager, remoteInputManager, - mediaManager, foregroundServiceController, notificationListener, metricsLogger, - deviceProvisionedController, visualStabilityManager, uiOffloadThread, context); + public TestableNotificationEntryManager(Context context, IStatusBarService barService) { + super(context); mBarService = barService; mCountDownLatch = new CountDownLatch(1); mUseHeadsUp = true; @@ -170,12 +156,7 @@ public class NotificationEntryManagerTest extends SysuiTestCase { mEntry = new NotificationData.Entry(mSbn); mEntry.expandedIcon = mock(StatusBarIconView.class); - mEntryManager = new TestableNotificationEntryManager(mLockscreenUserManager, - mGroupManager, mGutsManager, mRemoteInputManager, mMediaManager, - mForegroundServiceController, mNotificationListener, mMetricsLogger, - mDeviceProvisionedController, mVisualStabilityManager, - mDependency.get(UiOffloadThread.class), mContext, - mBarService); + mEntryManager = new TestableNotificationEntryManager(mContext, mBarService); mEntryManager.setUpWithPresenter(mPresenter, mListContainer, mCallback, mHeadsUpManager); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java index 9fbf7eab0cb87..ef5f071d11fa5 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java @@ -77,7 +77,7 @@ public class NotificationListenerTest extends SysuiTestCase { when(mEntryManager.getNotificationData()).thenReturn(mNotificationData); when(mRemoteInputManager.getKeysKeptForRemoteInput()).thenReturn(mKeysKeptForRemoteInput); - mListener = new NotificationListener(mRemoteInputManager, mContext); + mListener = new NotificationListener(mContext); mSbn = new StatusBarNotification(TEST_PACKAGE_NAME, TEST_PACKAGE_NAME, 0, null, TEST_UID, 0, new Notification(), UserHandle.CURRENT, null, 0); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLoggerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLoggerTest.java index b705241c803ea..726810e3e1770 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLoggerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLoggerTest.java @@ -80,8 +80,7 @@ public class NotificationLoggerTest extends SysuiTestCase { mEntry = new NotificationData.Entry(mSbn); mEntry.row = mRow; - mLogger = new TestableNotificationLogger(mListener, mDependency.get(UiOffloadThread.class), - mBarService); + mLogger = new TestableNotificationLogger(mBarService); mLogger.setUpWithEntryManager(mEntryManager, mListContainer); } @@ -127,11 +126,7 @@ public class NotificationLoggerTest extends SysuiTestCase { private class TestableNotificationLogger extends NotificationLogger { - public TestableNotificationLogger( - NotificationListenerService notificationListener, - UiOffloadThread uiOffloadThread, - IStatusBarService barService) { - super(notificationListener, uiOffloadThread); + public TestableNotificationLogger(IStatusBarService barService) { mBarService = barService; // Make this on the main thread so we can wait for it during tests. mHandler = new Handler(Looper.getMainLooper()); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java index e1d28e93b4511..4829cb256e9de 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java @@ -61,8 +61,7 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase { when(mPresenter.getHandler()).thenReturn(mHandler); when(mEntryManager.getLatestRankingMap()).thenReturn(mRanking); - mRemoteInputManager = new TestableNotificationRemoteInputManager(mLockscreenUserManager, - mContext); + mRemoteInputManager = new TestableNotificationRemoteInputManager(mContext); mSbn = new StatusBarNotification(TEST_PACKAGE_NAME, TEST_PACKAGE_NAME, 0, null, TEST_UID, 0, new Notification(), UserHandle.CURRENT, null, 0); mEntry = new NotificationData.Entry(mSbn); @@ -108,9 +107,8 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase { private class TestableNotificationRemoteInputManager extends NotificationRemoteInputManager { - public TestableNotificationRemoteInputManager( - NotificationLockscreenUserManager lockscreenUserManager, Context context) { - super(lockscreenUserManager, context); + public TestableNotificationRemoteInputManager(Context context) { + super(context); } public void setUpWithPresenterForTest(NotificationPresenter presenter, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java index 60bdf0cb3399d..fbe730a64c6fd 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java @@ -73,8 +73,7 @@ public class NotificationViewHierarchyManagerTest extends SysuiTestCase { when(mEntryManager.getNotificationData()).thenReturn(mNotificationData); - mViewHierarchyManager = new NotificationViewHierarchyManager(mLockscreenUserManager, - mGroupManager, mVisualStabilityManager, mContext); + mViewHierarchyManager = new NotificationViewHierarchyManager(mContext); mViewHierarchyManager.setUpWithPresenter(mPresenter, mEntryManager, mListContainer); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java index bf6e9baa4de81..99202f4ac10c2 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java @@ -150,8 +150,7 @@ public class StatusBarTest extends SysuiTestCase { mMetricsLogger = new FakeMetricsLogger(); mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger); - mNotificationLogger = new NotificationLogger(mNotificationListener, - mDependency.get(UiOffloadThread.class)); + mNotificationLogger = new NotificationLogger(); mDependency.injectTestDependency(NotificationLogger.class, mNotificationLogger); IPowerManager powerManagerService = mock(IPowerManager.class); @@ -183,8 +182,8 @@ public class StatusBarTest extends SysuiTestCase { return null; }).when(mStatusBarKeyguardViewManager).addAfterKeyguardGoneRunnable(any()); - mEntryManager = new TestableNotificationEntryManager(mMetricsLogger, - mSystemServicesProxy, mPowerManager, mContext); + mEntryManager = new TestableNotificationEntryManager(mSystemServicesProxy, mPowerManager, + mContext); mStatusBar = new TestableStatusBar(mStatusBarKeyguardViewManager, mUnlockMethodCache, mKeyguardIndicationController, mStackScroller, mHeadsUpManager, mPowerManager, mNotificationPanelView, mBarService, mNotificationListener, @@ -637,21 +636,9 @@ public class StatusBarTest extends SysuiTestCase { private class TestableNotificationEntryManager extends NotificationEntryManager { - public TestableNotificationEntryManager(MetricsLogger metricsLogger, - SystemServicesProxy systemServicesProxy, PowerManager powerManager, - Context context) { - super(mDependency.get(NotificationLockscreenUserManager.class), - mDependency.get(NotificationGroupManager.class), - mDependency.get(NotificationGutsManager.class), - mDependency.get(NotificationRemoteInputManager.class), - mDependency.get(NotificationMediaManager.class), - mDependency.get(ForegroundServiceController.class), - mDependency.get(NotificationListener.class), - metricsLogger, - mDependency.get(DeviceProvisionedController.class), - mDependency.get(VisualStabilityManager.class), - mDependency.get(UiOffloadThread.class), - context); + public TestableNotificationEntryManager(SystemServicesProxy systemServicesProxy, + PowerManager powerManager, Context context) { + super(context); mSystemServicesProxy = systemServicesProxy; mPowerManager = powerManager; }