summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Eliot Courtney <edcourtney@google.com> 2017-12-14 19:57:51 +0900
committer Eliot Courtney <edcourtney@google.com> 2017-12-26 17:22:15 +0900
commit6c313d3224c878d832db3ed833f4a3dd3786fb1f (patch)
tree8ef78ae86f01b1fd6b28b9c675dfefb4b499d0c9
parent4a96b36fd9857cd3d3534ed0396ec3d7155a324c (diff)
Initialise Notification*Manager dependencies directly.
Currently, adding a new dependency to any of these classes means updating the constructors of any subclasses, and the construction in the corresponding SystemUIFactory classes and subclasses. In particular, updating these in separate vendor/ projects is annoying. So, initialise the dependencies using field initialisers. The downside is that it's harder to notice circular Dependencys. Bug: 63874929 Bug: 62602530 Test: runtest systemui Test: Compile and run Change-Id: I21d58d0cc0edeb6d53fb7b387c9baeec7bd80589
-rw-r--r--packages/SystemUI/src/com/android/systemui/SystemUIFactory.java36
-rw-r--r--packages/SystemUI/src/com/android/systemui/car/CarNotificationEntryManager.java28
-rw-r--r--packages/SystemUI/src/com/android/systemui/car/CarSystemUIFactory.java15
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java57
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationGutsManager.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationLogger.java13
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java22
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationEntryManagerTest.java25
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java2
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLoggerTest.java9
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java8
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java3
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java25
15 files changed, 85 insertions, 188 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java
index 47148a44d66c..0f3daf57e8c1 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 20418c3f59ad..a89a8ef5b70e 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 55965e7f1f8e..174584de9405 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 90b46c8d2cf9..6bbd09f715db 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<String, NotificationData.Entry> 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<NotificationData.Entry> 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 9dda2a218cef..87ad6f6bc948 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<String> 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 113a5a477410..0144f4244a8f 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 76825feac0ce..4225f83c5b11 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<NotificationVisibility> 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 03e941dcbc7c..f25379ab0b22 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<NotificationData.Entry> 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 b73b9b6eb4cc..266c09bc6c8d 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<ExpandableNotificationRow, List<ExpandableNotificationRow>>
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 90812cfef9df..0a683891e66f 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 9fbf7eab0cb8..ef5f071d11fa 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 b705241c803e..726810e3e177 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 e1d28e93b451..4829cb256e9d 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 60bdf0cb3399..fbe730a64c6f 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 bf6e9baa4de8..99202f4ac10c 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;
}