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

Commit dce73ab8 authored by thiruram's avatar thiruram Committed by Automerger Merge Worker
Browse files

Migrates LS_* tron events to WW. am: ba2c4be0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11784243

Change-Id: Iccb15214790f39b245a029af8d186d894777f06f
parents 4f250c3f ba2c4be0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ import com.android.systemui.statusbar.phone.HeadsUpManagerPhone;
import com.android.systemui.statusbar.phone.HeadsUpTouchHelper;
import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.phone.NotificationGroupManager.OnGroupChangeListener;
import com.android.systemui.statusbar.phone.NotificationIconAreaController;
@@ -6633,6 +6634,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
                        MetricsEvent.ACTION_LS_SHADE,
                        (int) (dragLengthY / mDisplayMetrics.density),
                        0 /* velocityDp - N/A */);
                mLockscreenGestureLogger.log(LockscreenUiEvent.LOCKSCREEN_PULL_SHADE_OPEN);

                if (!mAmbientState.isDozing() || startingChild != null) {
                    // We have notifications, go to locked shade.
+60 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ import android.metrics.LogMaker;
import android.util.ArrayMap;

import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.UiEvent;
import com.android.internal.logging.UiEventLogger;
import com.android.internal.logging.UiEventLoggerImpl;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.systemui.Dependency;
import com.android.systemui.EventLogConstants;
@@ -34,6 +37,56 @@ import javax.inject.Singleton;
 */
@Singleton
public class LockscreenGestureLogger {

    /**
     * Contains Lockscreen related Westworld UiEvent enums.
     */
    public enum LockscreenUiEvent implements UiEventLogger.UiEventEnum {
        @UiEvent(doc = "Lockscreen > Pull shade open")
        LOCKSCREEN_PULL_SHADE_OPEN(539),

        @UiEvent(doc = "Lockscreen > Tap on lock, locks phone")
        LOCKSCREEN_LOCK_TAP(540),

        @UiEvent(doc = "Lockscreen > Swipe down to open quick settings")
        LOCKSCREEN_QUICK_SETTINGS_OPEN(541),

        @UiEvent(doc = "Swipe down to open quick settings when unlocked")
        LOCKSCREEN_UNLOCKED_QUICK_SETTINGS_OPEN(542),

        @UiEvent(doc = "Lockscreen > Tap on lock, shows hint")
        LOCKSCREEN_LOCK_SHOW_HINT(543),

        @UiEvent(doc = "Notification shade > Tap to open quick settings")
        LOCKSCREEN_NOTIFICATION_SHADE_QUICK_SETTINGS_OPEN(544),

        @UiEvent(doc = "Lockscreen > Dialer")
        LOCKSCREEN_DIALER(545),

        @UiEvent(doc = "Lockscreen > Camera")
        LOCKSCREEN_CAMERA(546),

        @UiEvent(doc = "Lockscreen > Unlock gesture")
        LOCKSCREEN_UNLOCK(547),

        @UiEvent(doc = "Lockscreen > Tap on notification, false touch rejection")
        LOCKSCREEN_NOTIFICATION_FALSE_TOUCH(548),

        @UiEvent(doc = "Expand the notification panel while unlocked")
        LOCKSCREEN_UNLOCKED_NOTIFICATION_PANEL_EXPAND(549);

        private final int mId;

        LockscreenUiEvent(int id) {
            mId = id;
        }

        @Override
        public int getId() {
            return mId;
        }
    }

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

@@ -54,6 +107,13 @@ public class LockscreenGestureLogger {
        EventLogTags.writeSysuiLockscreenGesture(safeLookup(gesture), length, velocity);
    }

    /**
     * Logs {@link LockscreenUiEvent}.
     */
    public void log(LockscreenUiEvent lockscreenUiEvent) {
        new UiEventLoggerImpl().log(lockscreenUiEvent);
    }

    /**
     * Record the location of a swipe gesture, expressed as percentages of the whole screen
     * @param category the action
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import com.android.systemui.statusbar.KeyguardIndicationController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator.WakeUpListener;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent;
import com.android.systemui.statusbar.policy.AccessibilityController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
@@ -436,6 +437,7 @@ public class LockscreenLockIconController {
    private boolean handleLongClick(View view) {
        mLockscreenGestureLogger.write(MetricsProto.MetricsEvent.ACTION_LS_LOCK,
                0 /* lengthDp - N/A */, 0 /* velocityDp - N/A */);
        mLockscreenGestureLogger.log(LockscreenUiEvent.LOCKSCREEN_LOCK_TAP);
        mKeyguardIndicationController.showTransientIndication(
                R.string.keyguard_indication_trust_disabled);
        mKeyguardUpdateMonitor.onLockIconPressed();
+5 −2
Original line number Diff line number Diff line
@@ -104,9 +104,9 @@ import com.android.systemui.statusbar.notification.row.ActivatableNotificationVi
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.ExpandableView;
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
import com.android.systemui.statusbar.notification.stack.MediaHeaderView;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent;
import com.android.systemui.statusbar.phone.dagger.StatusBarComponent;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
@@ -2474,6 +2474,8 @@ public class NotificationPanelViewController extends PanelViewController {
                    } else {
                        mLockscreenGestureLogger.write(MetricsEvent.ACTION_LS_HINT,
                                0 /* lengthDp - N/A */, 0 /* velocityDp - N/A */);
                        mLockscreenGestureLogger
                            .log(LockscreenUiEvent.LOCKSCREEN_LOCK_SHOW_HINT);
                        startUnlockHintAnimation();
                    }
                }
@@ -3257,7 +3259,7 @@ public class NotificationPanelViewController extends PanelViewController {
            int velocityDp = Math.abs((int) (vel / displayDensity));
            if (start) {
                mLockscreenGestureLogger.write(MetricsEvent.ACTION_LS_DIALER, lengthDp, velocityDp);

                mLockscreenGestureLogger.log(LockscreenUiEvent.LOCKSCREEN_DIALER);
                mFalsingManager.onLeftAffordanceOn();
                if (mFalsingManager.shouldEnforceBouncer()) {
                    mStatusBar.executeRunnableDismissingKeyguard(
@@ -3272,6 +3274,7 @@ public class NotificationPanelViewController extends PanelViewController {
                        mLastCameraLaunchSource)) {
                    mLockscreenGestureLogger.write(
                            MetricsEvent.ACTION_LS_CAMERA, lengthDp, velocityDp);
                    mLockscreenGestureLogger.log(LockscreenUiEvent.LOCKSCREEN_CAMERA);
                }
                mFalsingManager.onCameraOn();
                if (mFalsingManager.shouldEnforceBouncer()) {
+4 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import com.android.systemui.statusbar.FlingAnimationUtils;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.VibratorHelper;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent;
import com.android.systemui.statusbar.policy.KeyguardStateController;

import java.io.FileDescriptor;
@@ -319,6 +320,8 @@ public abstract class PanelViewController {

        mLockscreenGestureLogger.writeAtFractionalPosition(MetricsEvent.ACTION_PANEL_VIEW_EXPAND,
                (int) (event.getX() / width * 100), (int) (event.getY() / height * 100), rot);
        mLockscreenGestureLogger
                .log(LockscreenUiEvent.LOCKSCREEN_UNLOCKED_NOTIFICATION_PANEL_EXPAND);
    }

    protected void maybeVibrateOnOpening() {
@@ -378,6 +381,7 @@ public abstract class PanelViewController {
                int heightDp = (int) Math.abs((y - mInitialTouchY) / displayDensity);
                int velocityDp = (int) Math.abs(vel / displayDensity);
                mLockscreenGestureLogger.write(MetricsEvent.ACTION_LS_UNLOCK, heightDp, velocityDp);
                mLockscreenGestureLogger.log(LockscreenUiEvent.LOCKSCREEN_UNLOCK);
            }
            fling(vel, expand, isFalseTouch(x, y));
            onTrackingStopped(expand);
Loading