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

Commit 3605e89e authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Add ACTION_SHADE_WINDOW_DISPLAY_CHANGE to LatencyTracker

This new value will allow to track the time it takes to move the shade window from one display to the other.

Bug: 362719719
Bug: 378688537
Test: None - see child cls
Flag: com.android.systemui.shade_window_goes_around
Change-Id: I18bc01216a36d74f99faf97e1f6357f849a715ea
parent ed840f82
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPOR
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_ROTATE_SCREEN;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_ROTATE_SCREEN_CAMERA_CHECK;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_ROTATE_SCREEN_SENSOR;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHADE_WINDOW_DISPLAY_CHANGE;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHOW_BACK_ARROW;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHOW_SELECTION_TOOLBAR;
import static com.android.internal.util.FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHOW_VOICE_INTERACTION;
@@ -257,6 +258,14 @@ public class LatencyTracker {
     */
    public static final int ACTION_KEYGUARD_FACE_UNLOCK_TO_HOME = 28;

    /**
     * Time it takes for the shade window to move display after a user interaction.
     * <p>
     * This starts when the user does an interaction that triggers the window reparenting, and
     * finishes after the first doFrame done with the new display configuration.
     */
    public static final int ACTION_SHADE_WINDOW_DISPLAY_CHANGE = 29;

    private static final int[] ACTIONS_ALL = {
        ACTION_EXPAND_PANEL,
        ACTION_TOGGLE_RECENTS,
@@ -287,6 +296,7 @@ public class LatencyTracker {
        ACTION_NOTIFICATIONS_HIDDEN_FOR_MEASURE,
        ACTION_NOTIFICATIONS_HIDDEN_FOR_MEASURE_WITH_SHADE_OPEN,
        ACTION_KEYGUARD_FACE_UNLOCK_TO_HOME,
        ACTION_SHADE_WINDOW_DISPLAY_CHANGE,
    };

    /** @hide */
@@ -320,6 +330,7 @@ public class LatencyTracker {
        ACTION_NOTIFICATIONS_HIDDEN_FOR_MEASURE,
        ACTION_NOTIFICATIONS_HIDDEN_FOR_MEASURE_WITH_SHADE_OPEN,
        ACTION_KEYGUARD_FACE_UNLOCK_TO_HOME,
        ACTION_SHADE_WINDOW_DISPLAY_CHANGE,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface Action {
@@ -356,6 +367,7 @@ public class LatencyTracker {
            UIACTION_LATENCY_REPORTED__ACTION__ACTION_NOTIFICATIONS_HIDDEN_FOR_MEASURE,
            UIACTION_LATENCY_REPORTED__ACTION__ACTION_NOTIFICATIONS_HIDDEN_FOR_MEASURE_WITH_SHADE_OPEN,
            UIACTION_LATENCY_REPORTED__ACTION__ACTION_KEYGUARD_FACE_UNLOCK_TO_HOME,
            UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHADE_WINDOW_DISPLAY_CHANGE,
    };

    private final Object mLock = new Object();
@@ -554,6 +566,8 @@ public class LatencyTracker {
                return "ACTION_NOTIFICATIONS_HIDDEN_FOR_MEASURE_WITH_SHADE_OPEN";
            case UIACTION_LATENCY_REPORTED__ACTION__ACTION_KEYGUARD_FACE_UNLOCK_TO_HOME:
                return "ACTION_KEYGUARD_FACE_UNLOCK_TO_HOME";
            case UIACTION_LATENCY_REPORTED__ACTION__ACTION_SHADE_WINDOW_DISPLAY_CHANGE:
                return "ACTION_SHADE_WINDOW_DISPLAY_CHANGE";
            default:
                throw new IllegalArgumentException("Invalid action");
        }