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

Commit 59de6b39 authored by Caitlin Cassidy's avatar Caitlin Cassidy
Browse files

[Dagger] Inject LockscreenGestureLogger into PanelViewController and

StatusBarNotificationPresenter.

Test: atest
Bug: 138786270

Change-Id: I81cb369944ceccb9b7552a681a37b0d1ff66834c
parent 3ea610af
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -24,7 +24,6 @@ import com.android.internal.logging.UiEvent;
import com.android.internal.logging.UiEventLogger;
import com.android.internal.logging.UiEventLogger;
import com.android.internal.logging.UiEventLoggerImpl;
import com.android.internal.logging.UiEventLoggerImpl;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.systemui.Dependency;
import com.android.systemui.EventLogConstants;
import com.android.systemui.EventLogConstants;
import com.android.systemui.EventLogTags;
import com.android.systemui.EventLogTags;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.SysUISingleton;
@@ -88,10 +87,11 @@ public class LockscreenGestureLogger {
    }
    }


    private ArrayMap<Integer, Integer> mLegacyMap;
    private ArrayMap<Integer, Integer> mLegacyMap;
    private final MetricsLogger mMetricsLogger = Dependency.get(MetricsLogger.class);
    private final MetricsLogger mMetricsLogger;


    @Inject
    @Inject
    public LockscreenGestureLogger() {
    public LockscreenGestureLogger(MetricsLogger metricsLogger) {
        mMetricsLogger = metricsLogger;
        mLegacyMap = new ArrayMap<>(EventLogConstants.METRICS_GESTURE_TYPE_MAP.length);
        mLegacyMap = new ArrayMap<>(EventLogConstants.METRICS_GESTURE_TYPE_MAP.length);
        for (int i = 0; i < EventLogConstants.METRICS_GESTURE_TYPE_MAP.length ; i++) {
        for (int i = 0; i < EventLogConstants.METRICS_GESTURE_TYPE_MAP.length ; i++) {
            mLegacyMap.put(EventLogConstants.METRICS_GESTURE_TYPE_MAP[i], i);
            mLegacyMap.put(EventLogConstants.METRICS_GESTURE_TYPE_MAP[i], i);
+13 −5
Original line number Original line Diff line number Diff line
@@ -482,7 +482,6 @@ public class NotificationPanelViewController extends PanelViewController {
    private float mLinearDarkAmount;
    private float mLinearDarkAmount;


    private boolean mPulsing;
    private boolean mPulsing;
    private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger();
    private boolean mUserSetupComplete;
    private boolean mUserSetupComplete;
    private int mQsNotificationTopPadding;
    private int mQsNotificationTopPadding;
    private boolean mHideIconsDuringLaunchAnimation = true;
    private boolean mHideIconsDuringLaunchAnimation = true;
@@ -742,12 +741,21 @@ public class NotificationPanelViewController extends PanelViewController {
            SplitShadeHeaderController splitShadeHeaderController,
            SplitShadeHeaderController splitShadeHeaderController,
            LockscreenSmartspaceController lockscreenSmartspaceController,
            LockscreenSmartspaceController lockscreenSmartspaceController,
            UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
            UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
            LockscreenGestureLogger lockscreenGestureLogger,
            NotificationRemoteInputManager remoteInputManager,
            NotificationRemoteInputManager remoteInputManager,
            ControlsComponent controlsComponent) {
            ControlsComponent controlsComponent) {
        super(view, falsingManager, dozeLog, keyguardStateController,
        super(view,
                (SysuiStatusBarStateController) statusBarStateController, vibratorHelper,
                falsingManager,
                statusBarKeyguardViewManager, latencyTracker, flingAnimationUtilsBuilder.get(),
                dozeLog,
                statusBarTouchableRegionManager, ambientState);
                keyguardStateController,
                (SysuiStatusBarStateController) statusBarStateController,
                vibratorHelper,
                statusBarKeyguardViewManager,
                latencyTracker,
                flingAnimationUtilsBuilder.get(),
                statusBarTouchableRegionManager,
                lockscreenGestureLogger,
                ambientState);
        mView = view;
        mView = view;
        mVibratorHelper = vibratorHelper;
        mVibratorHelper = vibratorHelper;
        mKeyguardMediaController = keyguardMediaController;
        mKeyguardMediaController = keyguardMediaController;
+3 −1
Original line number Original line Diff line number Diff line
@@ -79,7 +79,6 @@ public abstract class PanelViewController {
    protected long mDownTime;
    protected long mDownTime;
    protected boolean mTouchSlopExceededBeforeDown;
    protected boolean mTouchSlopExceededBeforeDown;
    private float mMinExpandHeight;
    private float mMinExpandHeight;
    private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger();
    private boolean mPanelUpdateWhenAnimatorEnds;
    private boolean mPanelUpdateWhenAnimatorEnds;
    private boolean mVibrateOnOpening;
    private boolean mVibrateOnOpening;
    protected boolean mIsLaunchAnimationRunning;
    protected boolean mIsLaunchAnimationRunning;
@@ -182,6 +181,7 @@ public abstract class PanelViewController {
    protected final KeyguardStateController mKeyguardStateController;
    protected final KeyguardStateController mKeyguardStateController;
    protected final SysuiStatusBarStateController mStatusBarStateController;
    protected final SysuiStatusBarStateController mStatusBarStateController;
    protected final AmbientState mAmbientState;
    protected final AmbientState mAmbientState;
    protected final LockscreenGestureLogger mLockscreenGestureLogger;


    protected void onExpandingFinished() {
    protected void onExpandingFinished() {
        mBar.onExpandingFinished();
        mBar.onExpandingFinished();
@@ -217,10 +217,12 @@ public abstract class PanelViewController {
            LatencyTracker latencyTracker,
            LatencyTracker latencyTracker,
            FlingAnimationUtils.Builder flingAnimationUtilsBuilder,
            FlingAnimationUtils.Builder flingAnimationUtilsBuilder,
            StatusBarTouchableRegionManager statusBarTouchableRegionManager,
            StatusBarTouchableRegionManager statusBarTouchableRegionManager,
            LockscreenGestureLogger lockscreenGestureLogger,
            AmbientState ambientState) {
            AmbientState ambientState) {
        mAmbientState = ambientState;
        mAmbientState = ambientState;
        mView = view;
        mView = view;
        mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
        mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
        mLockscreenGestureLogger = lockscreenGestureLogger;
        mView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
        mView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
            @Override
            @Override
            public void onViewAttachedToWindow(View v) {
            public void onViewAttachedToWindow(View v) {
+4 −0
Original line number Original line Diff line number Diff line
@@ -455,6 +455,7 @@ public class StatusBar extends SystemUI implements
    private BiometricUnlockController mBiometricUnlockController;
    private BiometricUnlockController mBiometricUnlockController;
    private final LightBarController mLightBarController;
    private final LightBarController mLightBarController;
    private final Lazy<LockscreenWallpaper> mLockscreenWallpaperLazy;
    private final Lazy<LockscreenWallpaper> mLockscreenWallpaperLazy;
    private final LockscreenGestureLogger mLockscreenGestureLogger;
    @Nullable
    @Nullable
    protected LockscreenWallpaper mLockscreenWallpaper;
    protected LockscreenWallpaper mLockscreenWallpaper;
    private final AutoHideController mAutoHideController;
    private final AutoHideController mAutoHideController;
@@ -837,6 +838,7 @@ public class StatusBar extends SystemUI implements
            DozeParameters dozeParameters,
            DozeParameters dozeParameters,
            ScrimController scrimController,
            ScrimController scrimController,
            Lazy<LockscreenWallpaper> lockscreenWallpaperLazy,
            Lazy<LockscreenWallpaper> lockscreenWallpaperLazy,
            LockscreenGestureLogger lockscreenGestureLogger,
            Lazy<BiometricUnlockController> biometricUnlockControllerLazy,
            Lazy<BiometricUnlockController> biometricUnlockControllerLazy,
            DozeServiceHost dozeServiceHost,
            DozeServiceHost dozeServiceHost,
            PowerManager powerManager,
            PowerManager powerManager,
@@ -929,6 +931,7 @@ public class StatusBar extends SystemUI implements
        mDozeParameters = dozeParameters;
        mDozeParameters = dozeParameters;
        mScrimController = scrimController;
        mScrimController = scrimController;
        mLockscreenWallpaperLazy = lockscreenWallpaperLazy;
        mLockscreenWallpaperLazy = lockscreenWallpaperLazy;
        mLockscreenGestureLogger = lockscreenGestureLogger;
        mScreenPinningRequest = screenPinningRequest;
        mScreenPinningRequest = screenPinningRequest;
        mDozeScrimController = dozeScrimController;
        mDozeScrimController = dozeScrimController;
        mBiometricUnlockControllerLazy = biometricUnlockControllerLazy;
        mBiometricUnlockControllerLazy = biometricUnlockControllerLazy;
@@ -1538,6 +1541,7 @@ public class StatusBar extends SystemUI implements
                mMediaManager,
                mMediaManager,
                mGutsManager,
                mGutsManager,
                mKeyguardUpdateMonitor,
                mKeyguardUpdateMonitor,
                mLockscreenGestureLogger,
                mInitController,
                mInitController,
                mNotificationInterruptStateProvider,
                mNotificationInterruptStateProvider,
                mRemoteInputManager,
                mRemoteInputManager,
+3 −4
Original line number Original line Diff line number Diff line
@@ -82,10 +82,6 @@ public class StatusBarNotificationPresenter implements NotificationPresenter,
        ConfigurationController.ConfigurationListener,
        ConfigurationController.ConfigurationListener,
        NotificationRowBinderImpl.BindRowCallback,
        NotificationRowBinderImpl.BindRowCallback,
        CommandQueue.Callbacks {
        CommandQueue.Callbacks {

    private final LockscreenGestureLogger mLockscreenGestureLogger =
            Dependency.get(LockscreenGestureLogger.class);

    private static final String TAG = "StatusBarNotificationPresenter";
    private static final String TAG = "StatusBarNotificationPresenter";


    private final ActivityStarter mActivityStarter = Dependency.get(ActivityStarter.class);
    private final ActivityStarter mActivityStarter = Dependency.get(ActivityStarter.class);
@@ -97,6 +93,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter,
    private final NotificationMediaManager mMediaManager;
    private final NotificationMediaManager mMediaManager;
    private final NotificationGutsManager mGutsManager;
    private final NotificationGutsManager mGutsManager;
    private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    private final LockscreenGestureLogger mLockscreenGestureLogger;


    private final NotificationPanelViewController mNotificationPanel;
    private final NotificationPanelViewController mNotificationPanel;
    private final HeadsUpManagerPhone mHeadsUpManager;
    private final HeadsUpManagerPhone mHeadsUpManager;
@@ -142,6 +139,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter,
            NotificationMediaManager notificationMediaManager,
            NotificationMediaManager notificationMediaManager,
            NotificationGutsManager notificationGutsManager,
            NotificationGutsManager notificationGutsManager,
            KeyguardUpdateMonitor keyguardUpdateMonitor,
            KeyguardUpdateMonitor keyguardUpdateMonitor,
            LockscreenGestureLogger lockscreenGestureLogger,
            InitController initController,
            InitController initController,
            NotificationInterruptStateProvider notificationInterruptStateProvider,
            NotificationInterruptStateProvider notificationInterruptStateProvider,
            NotificationRemoteInputManager remoteInputManager,
            NotificationRemoteInputManager remoteInputManager,
@@ -163,6 +161,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter,
        mMediaManager = notificationMediaManager;
        mMediaManager = notificationMediaManager;
        mGutsManager = notificationGutsManager;
        mGutsManager = notificationGutsManager;
        mKeyguardUpdateMonitor = keyguardUpdateMonitor;
        mKeyguardUpdateMonitor = keyguardUpdateMonitor;
        mLockscreenGestureLogger = lockscreenGestureLogger;
        mAboveShelfObserver = new AboveShelfObserver(stackScrollerController.getView());
        mAboveShelfObserver = new AboveShelfObserver(stackScrollerController.getView());
        mNotificationShadeWindowController = notificationShadeWindowController;
        mNotificationShadeWindowController = notificationShadeWindowController;
        mAboveShelfObserver.setListener(statusBarWindow.findViewById(
        mAboveShelfObserver.setListener(statusBarWindow.findViewById(
Loading