From d8e3a96c5ece95e1f6b39db0c70b1d991527891e Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Tue, 4 Apr 2023 23:06:37 -0700 Subject: [PATCH] Log motion event classification and pointer count in ActiveGestureLog Fixes: 276959586 Test: N/A Change-Id: Ia040a0bd50471b1f4cb6ba85d6b013c36548ed5f --- .../quickstep/TouchInteractionService.java | 20 ++++++++++++------- .../util/ActiveGestureErrorDetector.java | 10 +++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 9ca89282ca..93363a0ff2 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -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())); } } diff --git a/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java b/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java index 2964868aa0..6eadd2bf15 100644 --- a/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java +++ b/quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java @@ -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