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

Commit d8e3a96c authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Log motion event classification and pointer count in ActiveGestureLog

Fixes: 276959586
Test: N/A
Change-Id: Ia040a0bd50471b1f4cb6ba85d6b013c36548ed5f
parent 47d47693
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.quickstep;
import static android.accessibilityservice.AccessibilityService.GLOBAL_ACTION_ACCESSIBILITY_ALL_APPS;
import static android.view.MotionEvent.ACTION_CANCEL;
import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_MOVE;
import static android.view.MotionEvent.ACTION_POINTER_DOWN;
import static android.view.MotionEvent.ACTION_POINTER_UP;
import static android.view.MotionEvent.ACTION_UP;
@@ -29,6 +30,7 @@ import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.quickstep.GestureState.DEFAULT_STATE;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.FLAG_USING_OTHER_ACTIVITY_INPUT_CONSUMER;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_DOWN;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_MOVE;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_UP;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY;
@@ -674,20 +676,24 @@ public class TouchInteractionService extends Service

        if (mUncheckedConsumer != InputConsumer.NO_OP) {
            switch (event.getActionMasked()) {
                case ACTION_DOWN:
                case ACTION_UP:
                case ACTION_DOWN, ACTION_UP ->
                    ActiveGestureLog.INSTANCE.addLog(
                            /* event= */ "onMotionEvent(" + (int) event.getRawX() + ", "
                                    + (int) event.getRawY() + "): "
                                    + MotionEvent.actionToString(event.getActionMasked()),
                                    + MotionEvent.actionToString(event.getActionMasked()) + ", "
                                    + MotionEvent.classificationToString(event.getClassification()),
                            /* gestureEvent= */ event.getActionMasked() == ACTION_DOWN
                                    ? MOTION_DOWN
                                    : MOTION_UP);
                    break;
                default:
                case ACTION_MOVE ->
                    ActiveGestureLog.INSTANCE.addLog("onMotionEvent: "
                            + MotionEvent.actionToString(event.getActionMasked()));
                    break;
                            + MotionEvent.actionToString(event.getActionMasked()) + ","
                            + MotionEvent.classificationToString(event.getClassification())
                            + ", pointerCount: " + event.getPointerCount(), MOTION_MOVE);
                default ->
                    ActiveGestureLog.INSTANCE.addLog("onMotionEvent: "
                            + MotionEvent.actionToString(event.getActionMasked()) + ","
                            + MotionEvent.classificationToString(event.getClassification()));
            }
        }

+5 −5
Original line number Diff line number Diff line
@@ -32,11 +32,11 @@ public class ActiveGestureErrorDetector {
     * Enums associated to gesture navigation events.
     */
    public enum GestureEvent {
        MOTION_DOWN, MOTION_UP, SET_END_TARGET, SET_END_TARGET_HOME, SET_END_TARGET_NEW_TASK,
        ON_SETTLED_ON_END_TARGET, START_RECENTS_ANIMATION, FINISH_RECENTS_ANIMATION,
        CANCEL_RECENTS_ANIMATION, SET_ON_PAGE_TRANSITION_END_CALLBACK, CANCEL_CURRENT_ANIMATION,
        CLEANUP_SCREENSHOT, SCROLLER_ANIMATION_ABORTED, TASK_APPEARED, EXPECTING_TASK_APPEARED,
        FLAG_USING_OTHER_ACTIVITY_INPUT_CONSUMER, LAUNCHER_DESTROYED,
        MOTION_DOWN, MOTION_UP, MOTION_MOVE, SET_END_TARGET, SET_END_TARGET_HOME,
        SET_END_TARGET_NEW_TASK, ON_SETTLED_ON_END_TARGET, START_RECENTS_ANIMATION,
        FINISH_RECENTS_ANIMATION, CANCEL_RECENTS_ANIMATION, SET_ON_PAGE_TRANSITION_END_CALLBACK,
        CANCEL_CURRENT_ANIMATION, CLEANUP_SCREENSHOT, SCROLLER_ANIMATION_ABORTED, TASK_APPEARED,
        EXPECTING_TASK_APPEARED, FLAG_USING_OTHER_ACTIVITY_INPUT_CONSUMER, LAUNCHER_DESTROYED,

        /**
         * These GestureEvents are specifically associated to state flags that get set in