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

Commit 5342f7d2 authored by Dave Mankoff's avatar Dave Mankoff Committed by Steve Elliott
Browse files

Remove MetricsLogger from NSSL

Remove MetricsLogger from NotificationStackScrollLayout
and put it in the NotificationStackScrollLayoutController

Bug: 147245740
Test: atest SystemUITests
Change-Id: I7d1079c704e99ba37c7c7cc5d7c8f7698b9e8694
parent 46a06bb6
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -73,7 +73,6 @@ import android.widget.ScrollView;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.graphics.ColorUtils;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.keyguard.KeyguardSliceView;
import com.android.settingslib.Utils;
@@ -261,6 +260,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    protected EmptyShadeView mEmptyShadeView;
    private boolean mDismissAllInProgress;
    private boolean mFadeNotificationsOnDismiss;
    private FooterDismissListener mFooterDismissListener;

    /**
     * Was the scroller scrolled to the top when the down motion was observed?
@@ -448,8 +448,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private final Rect mTmpRect = new Rect();
    private DismissListener mDismissListener;
    private DismissAllAnimationListener mDismissAllAnimationListener;
    @VisibleForTesting
    protected final MetricsLogger mMetricsLogger = Dependency.get(MetricsLogger.class);
    private final NotificationRemoteInputManager mRemoteInputManager =
            Dependency.get(NotificationRemoteInputManager.class);

@@ -5328,9 +5326,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable

    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    @VisibleForTesting
    void clearNotifications(
            @SelectedRows int selection,
            boolean closeShade) {
    void clearNotifications(@SelectedRows int selection, boolean closeShade) {
        // animate-swipe all dismissable notifications, then animate the shade closed
        int numChildren = getChildCount();

@@ -5463,7 +5459,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        FooterView footerView = (FooterView) LayoutInflater.from(mContext).inflate(
                R.layout.status_bar_notification_footer, this, false);
        footerView.setDismissButtonClickListener(v -> {
            mMetricsLogger.action(MetricsEvent.ACTION_DISMISS_ALL_NOTES);
            if (mFooterDismissListener != null) {
                mFooterDismissListener.onDismiss();
            }
            clearNotifications(ROWS_ALL, true /* closeShade */);
        });
        footerView.setManageButtonClickListener(v -> {
@@ -5692,6 +5690,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mHighPriorityBeforeSpeedBump = highPriorityBeforeSpeedBump;
    }

    void setFooterDismissListener(FooterDismissListener listener) {
        mFooterDismissListener = listener;
    }

    /**
     * A listener that is notified when the empty space below the notifications is clicked on
     */
@@ -6303,6 +6305,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        void onDismiss(@SelectedRows int selectedRows);
    }

    interface FooterDismissListener {
        void onDismiss();
    }

    interface DismissAllAnimationListener {
        void onAnimationEnd(
                List<ExpandableNotificationRow> viewsToRemove, @SelectedRows int selectedRows);
+2 −0
Original line number Diff line number Diff line
@@ -628,6 +628,8 @@ public class NotificationStackScrollLayoutController {
        mView.setDismissAllAnimationListener(this::onAnimationEnd);
        mView.setDismissListener((selection) -> mUiEventLogger.log(
                NotificationPanelEvent.fromSelection(selection)));
        mView.setFooterDismissListener(() ->
                mMetricsLogger.action(MetricsEvent.ACTION_DISMISS_ALL_NOTES));

        if (mFgFeatureController.isForegroundServiceDismissalEnabled()) {
            mView.initializeForegroundServiceSection(
+0 −2
Original line number Diff line number Diff line
@@ -97,7 +97,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
    @Mock private EmptyShadeView mEmptyShadeView;
    @Mock private NotificationRemoteInputManager mRemoteInputManager;
    @Mock private RemoteInputController mRemoteInputController;
    @Mock private MetricsLogger mMetricsLogger;
    @Mock private NotificationRoundnessManager mNotificationRoundnessManager;
    @Mock private KeyguardBypassEnabledProvider mKeyguardBypassEnabledProvider;
    @Mock private NotificationSectionsManager mNotificationSectionsManager;
@@ -125,7 +124,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
                NotificationBlockingHelperManager.class,
                mBlockingHelperManager);
        mDependency.injectTestDependency(SysuiStatusBarStateController.class, mBarState);
        mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger);
        mDependency.injectTestDependency(NotificationRemoteInputManager.class,
                mRemoteInputManager);
        mDependency.injectMockDependency(ShadeController.class);