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

Commit 441f1431 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Removes unused fields from NotificationEntryManager."

parents 4278f47f 9258646f
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.annotation.Nullable;
import android.app.Notification;
import android.content.Context;
import android.os.Handler;
import android.os.PowerManager;
import android.os.UserHandle;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
@@ -91,9 +90,7 @@ public class NotificationEntryManager implements
    private Runnable mUpdateNotificationViewsCallback;

    private NotificationPresenter mPresenter;
    protected PowerManager mPowerManager;
    private NotificationListenerService.RankingMap mLatestRankingMap;
    protected HeadsUpManager mHeadsUpManager;
    protected NotificationData mNotificationData;
    protected NotificationListContainer mListContainer;
    @VisibleForTesting
@@ -129,7 +126,6 @@ public class NotificationEntryManager implements

    public NotificationEntryManager(Context context) {
        mContext = context;
        mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
        mBubbleController.setDismissListener(this /* bubbleEventListener */);
        mNotificationData = new NotificationData();
        mDeferredNotificationViewUpdateHandler = new Handler();
@@ -162,8 +158,7 @@ public class NotificationEntryManager implements
            HeadsUpManager headsUpManager) {
        mPresenter = presenter;
        mUpdateNotificationViewsCallback = mPresenter::updateNotificationViews;
        mHeadsUpManager = headsUpManager;
        mNotificationData.setHeadsUpManager(mHeadsUpManager);
        mNotificationData.setHeadsUpManager(headsUpManager);
        mListContainer = listContainer;

        mDeviceProvisionedController.addCallback(mDeviceProvisionedListener);
+1 −13
Original line number Diff line number Diff line
@@ -35,12 +35,7 @@ import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import android.os.Handler;
import android.os.IPowerManager;
import android.os.Looper;
import android.os.PowerManager;
import android.provider.Settings;
import android.service.dreams.IDreamManager;
import android.support.test.annotation.UiThreadTest;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
@@ -104,8 +99,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
    @Mock private NotificationData mNotificationData;
    @Mock private NotificationRemoteInputManager mRemoteInputManager;
    @Mock private RemoteInputController mRemoteInputController;
    @Mock private IDreamManager mDreamManager;
    private PowerManager mPowerManager;
    private TestableNotificationEntryManager mEntryManager;
    private int mOriginalInterruptionModelSetting;

@@ -122,12 +115,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
        mDependency.injectMockDependency(ShadeController.class);
        when(mRemoteInputManager.getController()).thenReturn(mRemoteInputController);

        IPowerManager powerManagerService = mock(IPowerManager.class);
        mPowerManager = new PowerManager(mContext, powerManagerService,
                Handler.createAsync(Looper.myLooper()));

        mEntryManager = new TestableNotificationEntryManager(mPowerManager,
                mContext);
        mEntryManager = new TestableNotificationEntryManager(mContext);
        mDependency.injectTestDependency(NotificationEntryManager.class, mEntryManager);
        Dependency.get(InitController.class).executePostInitTasks();
        mEntryManager.setUpForTest(mock(NotificationPresenter.class), null, mHeadsUpManager,
+2 −3
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ public class StatusBarTest extends SysuiTestCase {

        mMetricsLogger = new FakeMetricsLogger();
        mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger);
        mEntryManager = new TestableNotificationEntryManager(mPowerManager, mContext);
        mEntryManager = new TestableNotificationEntryManager(mContext);
        mNotificationLogger = new NotificationLogger(mNotificationListener,
                Dependency.get(UiOffloadThread.class), mEntryManager, mStatusBarStateController);
        mDependency.injectTestDependency(NotificationLogger.class, mNotificationLogger);
@@ -761,9 +761,8 @@ public class StatusBarTest extends SysuiTestCase {

    public static class TestableNotificationEntryManager extends NotificationEntryManager {

        public TestableNotificationEntryManager(PowerManager powerManager, Context context) {
        public TestableNotificationEntryManager(Context context) {
            super(context);
            mPowerManager = powerManager;
        }

        public void setUpForTest(NotificationPresenter presenter,