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

Commit 60f04557 authored by Dave Mankoff's avatar Dave Mankoff Committed by Steve Elliott
Browse files

Remove RemoteInputManager from rom NSSL

Remove RemoteInputManager from NotificationStackScrollLayout
and put it in the NotificationStackScrollLayoutController.

The controller passes in the needed RemoteInputController directly
for now.

Bug: 147245740
Test: atest SystemUITests
Change-Id: I98480518214a14238c8856894176293dbcde511e
parent 5342f7d2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -448,8 +448,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private final Rect mTmpRect = new Rect();
    private DismissListener mDismissListener;
    private DismissAllAnimationListener mDismissAllAnimationListener;
    private final NotificationRemoteInputManager mRemoteInputManager =
            Dependency.get(NotificationRemoteInputManager.class);
    private NotificationRemoteInputManager mRemoteInputManager;

    private final DisplayMetrics mDisplayMetrics = Dependency.get(DisplayMetrics.class);
    private final LockscreenGestureLogger mLockscreenGestureLogger =
@@ -5694,6 +5693,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mFooterDismissListener = listener;
    }

    public void setRemoteInputManager(NotificationRemoteInputManager remoteInputManager) {
        mRemoteInputManager = remoteInputManager;
    }

    /**
     * A listener that is notified when the empty space below the notifications is clicked on
     */
+6 −1
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationLockscreenUserManager.UserChangedListener;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationShelfController;
import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarState;
@@ -151,6 +152,7 @@ public class NotificationStackScrollLayoutController {
    private final ForegroundServiceDismissalFeatureController mFgFeatureController;
    private final ForegroundServiceSectionController mFgServicesSectionController;
    private final LayoutInflater mLayoutInflater;
    private final NotificationRemoteInputManager mRemoteInputManager;
    private final KeyguardMediaController mKeyguardMediaController;
    private final SysuiStatusBarStateController mStatusBarStateController;
    private final KeyguardBypassController mKeyguardBypassController;
@@ -573,7 +575,8 @@ public class NotificationStackScrollLayoutController {
            UiEventLogger uiEventLogger,
            ForegroundServiceDismissalFeatureController fgFeatureController,
            ForegroundServiceSectionController fgServicesSectionController,
            LayoutInflater layoutInflater) {
            LayoutInflater layoutInflater,
            NotificationRemoteInputManager remoteInputManager) {
        mAllowLongPress = allowLongPress;
        mNotificationGutsManager = notificationGutsManager;
        mHeadsUpManager = headsUpManager;
@@ -618,6 +621,7 @@ public class NotificationStackScrollLayoutController {
        mFgFeatureController = fgFeatureController;
        mFgServicesSectionController = fgServicesSectionController;
        mLayoutInflater = layoutInflater;
        mRemoteInputManager = remoteInputManager;
    }

    public void attach(NotificationStackScrollLayout view) {
@@ -630,6 +634,7 @@ public class NotificationStackScrollLayoutController {
                NotificationPanelEvent.fromSelection(selection)));
        mView.setFooterDismissListener(() ->
                mMetricsLogger.action(MetricsEvent.ACTION_DISMISS_ALL_NOTES));
        mView.setRemoteInputManager(mRemoteInputManager);

        if (mFgFeatureController.isForegroundServiceDismissalEnabled()) {
            mView.initializeForegroundServiceSection(
+5 −6
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ import android.testing.TestableLooper;
import androidx.test.annotation.UiThreadTest;
import androidx.test.filters.SmallTest;

import com.android.internal.logging.MetricsLogger;
import com.android.systemui.ExpandHelper;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
@@ -62,7 +61,6 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.FooterView;
import com.android.systemui.statusbar.notification.row.NotificationBlockingHelperManager;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.KeyguardBypassEnabledProvider;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.phone.ShadeController;
import com.android.systemui.statusbar.phone.StatusBar;

@@ -124,10 +122,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
                NotificationBlockingHelperManager.class,
                mBlockingHelperManager);
        mDependency.injectTestDependency(SysuiStatusBarStateController.class, mBarState);
        mDependency.injectTestDependency(NotificationRemoteInputManager.class,
                mRemoteInputManager);
        mDependency.injectMockDependency(ShadeController.class);
        when(mRemoteInputManager.getController()).thenReturn(mRemoteInputController);

        NotificationShelfController notificationShelfController =
                mock(NotificationShelfController.class);
        NotificationShelf notificationShelf = mock(NotificationShelf.class);
@@ -136,6 +132,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
                new NotificationSection[]{
                        mNotificationSection
                });
        when(mRemoteInputManager.getController()).thenReturn(mRemoteInputController);

        // The actual class under test.  You may need to work with this class directly when
        // testing anonymous class members of mStackScroller, like mMenuEventListener,
        // which refer to members of NotificationStackScrollLayout. The spy
@@ -158,6 +156,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
        when(mStackScrollLayoutController.getNoticationRoundessManager())
                .thenReturn(mNotificationRoundnessManager);
        mStackScroller.setController(mStackScrollLayoutController);
        mStackScroller.setRemoteInputManager(mRemoteInputManager);

        // Stub out functionality that isn't necessary to test.
        doNothing().when(mBar)
+8 −1
Original line number Diff line number Diff line
@@ -51,6 +51,8 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationLockscreenUserManager.UserChangedListener;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
import com.android.systemui.statusbar.notification.ForegroundServiceDismissalFeatureController;
@@ -122,6 +124,8 @@ public class NotificationStackScrollerControllerTest extends SysuiTestCase {
    @Mock private ForegroundServiceSectionController mFgServicesSectionController;
    @Mock private ForegroundServiceDungeonView mForegroundServiceDungeonView;
    @Mock private LayoutInflater mLayoutInflater;
    @Mock private NotificationRemoteInputManager mRemoteInputManager;
    @Mock private RemoteInputController mRemoteInputController;

    @Captor
    private ArgumentCaptor<StatusBarStateController.StateListener> mStateListenerArgumentCaptor;
@@ -136,6 +140,8 @@ public class NotificationStackScrollerControllerTest extends SysuiTestCase {
        when(mFeatureFlags.isNewNotifPipelineRenderingEnabled()).thenReturn(false);
        when(mFgServicesSectionController.createView(mLayoutInflater))
                .thenReturn(mForegroundServiceDungeonView);
        when(mRemoteInputManager.getController()).thenReturn(mRemoteInputController);

        mController = new NotificationStackScrollLayoutController(
                true,
                mNotificationGutsManager,
@@ -168,7 +174,8 @@ public class NotificationStackScrollerControllerTest extends SysuiTestCase {
                mUiEventLogger,
                mFgFeatureController,
                mFgServicesSectionController,
                mLayoutInflater
                mLayoutInflater,
                mRemoteInputManager
        );

        when(mNotificationStackScrollLayout.isAttachedToWindow()).thenReturn(true);