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

Commit 68ed78c0 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

Add SETTINGS_SLIDER CUJ to InteractionJankMonitor

Also add a default onStopTrackingTouch() method in the
SeekBarVolumizer.Callback to let Settings inject the jank monitor.

Bug: 230285829
Test: make build
Change-Id: I9f5f511183f62caf809d7326766549b87d226b0b
parent 1f274466
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -68,9 +68,18 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
        void onMuted(boolean muted, boolean zenMuted);
        /**
         * Callback reporting that the seek bar is start tracking.
         *
         * @param sbv - The seek bar that start tracking
         */
        void onStartTrackingTouch(SeekBarVolumizer sbv);

        /**
         * Callback reporting that the seek bar is stop tracking.
         *
         * @param sbv - The seek bar that stop tracking
         */
        default void onStopTrackingTouch(SeekBarVolumizer sbv) {
        }
    }

    private static final int MSG_GROUP_VOLUME_CHANGED = 1;
@@ -451,6 +460,9 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba

    public void onStopTrackingTouch(SeekBar seekBar) {
        postStartSample();
        if (mCallback != null) {
            mCallback.onStopTrackingTouch(this);
        }
    }

    public boolean isSamplePlaying() {
+7 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_IN
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SCREEN_OFF;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SCREEN_OFF_SHOW_AOD;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SETTINGS_PAGE_SCROLL;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SETTINGS_SLIDER;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_APP_LAUNCH;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_APP_LAUNCH_FROM_HISTORY_BUTTON;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_APP_LAUNCH_FROM_MEDIA_PLAYER;
@@ -192,6 +193,7 @@ public class InteractionJankMonitor {
    public static final int CUJ_SPLIT_SCREEN_EXIT = 50;
    public static final int CUJ_LOCKSCREEN_LAUNCH_CAMERA = 51; // reserved.
    public static final int CUJ_SPLIT_SCREEN_RESIZE = 52;
    public static final int CUJ_SETTINGS_SLIDER = 53;

    private static final int NO_STATSD_LOGGING = -1;

@@ -253,6 +255,7 @@ public class InteractionJankMonitor {
            UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_EXIT,
            UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_LAUNCH_CAMERA,
            UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_RESIZE,
            UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SETTINGS_SLIDER,
    };

    private static volatile InteractionJankMonitor sInstance;
@@ -325,7 +328,8 @@ public class InteractionJankMonitor {
            CUJ_SPLIT_SCREEN_ENTER,
            CUJ_SPLIT_SCREEN_EXIT,
            CUJ_LOCKSCREEN_LAUNCH_CAMERA,
            CUJ_SPLIT_SCREEN_RESIZE
            CUJ_SPLIT_SCREEN_RESIZE,
            CUJ_SETTINGS_SLIDER,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface CujType {
@@ -750,6 +754,8 @@ public class InteractionJankMonitor {
                return "CUJ_LOCKSCREEN_LAUNCH_CAMERA";
            case CUJ_SPLIT_SCREEN_RESIZE:
                return "CUJ_SPLIT_SCREEN_RESIZE";
            case CUJ_SETTINGS_SLIDER:
                return "SETTINGS_SLIDER";
        }
        return "UNKNOWN";
    }