diff options
author | 2025-03-24 06:17:26 -0700 | |
---|---|---|
committer | 2025-03-24 06:17:26 -0700 | |
commit | 1d5064b8dc0670afa28791cebfec6bb468e98e3e (patch) | |
tree | 762a0413e093c30b7a3b7cd94d0ccebeb51e7e1b /quickstep | |
parent | 173790f52db24424a054064f6b94d862a07914ce (diff) | |
parent | d6027ed5a6fc15bb45a7d08eaf2d7b627cc58b75 (diff) |
Merge "Add debug logging for task view touch controllers." into main
Diffstat (limited to 'quickstep')
3 files changed, 37 insertions, 3 deletions
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewDismissTouchController.kt b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewDismissTouchController.kt index eac5235dda..06e6734a37 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewDismissTouchController.kt +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewDismissTouchController.kt @@ -25,6 +25,7 @@ import com.android.launcher3.AbstractFloatingView import com.android.launcher3.R import com.android.launcher3.Utilities.EDGE_NAV_BAR import com.android.launcher3.Utilities.boundToRange +import com.android.launcher3.Utilities.debugLog import com.android.launcher3.Utilities.isRtl import com.android.launcher3.Utilities.mapToRange import com.android.launcher3.touch.SingleAxisSwipeDetector @@ -70,6 +71,7 @@ CONTAINER : RecentsViewContainer { // Don't intercept swipes on the nav bar, as user might be trying to go home during a // task dismiss animation. (ev.edgeFlags and EDGE_NAV_BAR) != 0 -> { + debugLog(TAG, "Not intercepting edge swipe on nav bar.") false } @@ -77,14 +79,23 @@ CONTAINER : RecentsViewContainer { AbstractFloatingView.getTopOpenViewWithType( container, AbstractFloatingView.TYPE_TOUCH_CONTROLLER_NO_INTERCEPT, - ) != null -> false + ) != null -> { + debugLog(TAG, "Not intercepting, open floating view blocking touch.") + false + } // Disable swiping if the task overlay is modal. taskViewRecentsTouchContext.isRecentsModal -> { + debugLog(TAG, "Not intercepting touch in modal overlay.") false } - else -> taskViewRecentsTouchContext.isRecentsInteractive + else -> + taskViewRecentsTouchContext.isRecentsInteractive.also { isRecentsInteractive -> + if (!isRecentsInteractive) { + debugLog(TAG, "Not intercepting touch, recents not interactive.") + } + } } override fun onControllerInterceptTouchEvent(ev: MotionEvent): Boolean { @@ -140,6 +151,7 @@ CONTAINER : RecentsViewContainer { override fun onDragStart(start: Boolean, startDisplacement: Float) { if (isBlockedDuringDismissal) return val taskBeingDragged = taskBeingDragged ?: return + debugLog(TAG, "Handling touch event.") initialDisplacement = taskBeingDragged.secondaryDismissTranslationProperty.get(taskBeingDragged) @@ -289,6 +301,8 @@ CONTAINER : RecentsViewContainer { } companion object { + private const val TAG = "TaskViewDismissTouchController" + private const val DISMISS_THRESHOLD_FRACTION = 0.5f private const val DISMISS_THRESHOLD_HAPTIC_RANGE = 10f diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewLaunchTouchController.kt b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewLaunchTouchController.kt index 8ee552d046..fe9cae55f9 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewLaunchTouchController.kt +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewLaunchTouchController.kt @@ -24,6 +24,7 @@ import com.android.launcher3.AbstractFloatingView import com.android.launcher3.LauncherAnimUtils import com.android.launcher3.Utilities.EDGE_NAV_BAR import com.android.launcher3.Utilities.boundToRange +import com.android.launcher3.Utilities.debugLog import com.android.launcher3.Utilities.isRtl import com.android.launcher3.anim.AnimatorPlaybackController import com.android.launcher3.touch.BaseSwipeDetector @@ -72,6 +73,7 @@ CONTAINER : RecentsViewContainer { // Don't intercept swipes on the nav bar, as user might be trying to go home during a // task dismiss animation. (ev.edgeFlags and EDGE_NAV_BAR) != 0 -> { + debugLog(TAG, "Not intercepting edge swipe on nav bar.") false } @@ -80,15 +82,22 @@ CONTAINER : RecentsViewContainer { container, AbstractFloatingView.TYPE_TOUCH_CONTROLLER_NO_INTERCEPT, ) != null -> { + debugLog(TAG, "Not intercepting, open floating view blocking touch.") false } // Disable swiping if the task overlay is modal. taskViewRecentsTouchContext.isRecentsModal -> { + debugLog(TAG, "Not intercepting touch in modal overlay.") false } - else -> taskViewRecentsTouchContext.isRecentsInteractive + else -> + taskViewRecentsTouchContext.isRecentsInteractive.also { isRecentsInteractive -> + if (!isRecentsInteractive) { + debugLog(TAG, "Not intercepting touch, recents not interactive.") + } + } } override fun onControllerInterceptTouchEvent(ev: MotionEvent): Boolean { @@ -128,6 +137,7 @@ CONTAINER : RecentsViewContainer { recentsView.pagedOrientationHandler.getTaskDragDisplacementFactor(isRtl) } if (!canTaskLaunchTaskView(taskBeingDragged)) { + debugLog(TAG, "Not intercepting touch, task cannot be launched.") return false } detector.setDetectableScrollConditions(downDirection, /* ignoreSlop= */ false) @@ -136,6 +146,7 @@ CONTAINER : RecentsViewContainer { override fun onDragStart(start: Boolean, startDisplacement: Float) { val taskBeingDragged = taskBeingDragged ?: return + debugLog(TAG, "Handling touch event.") val secondaryLayerDimension: Int = recentsView.pagedOrientationHandler.getSecondaryDimension(container.getDragLayer()) @@ -202,6 +213,7 @@ CONTAINER : RecentsViewContainer { } companion object { + private const val TAG = "TaskViewLaunchTouchController" private const val LAUNCH_THRESHOLD_FRACTION: Float = 0.5f } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchControllerDeprecated.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchControllerDeprecated.java index f26bd13586..57ffd9538d 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchControllerDeprecated.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchControllerDeprecated.java @@ -17,6 +17,7 @@ package com.android.launcher3.uioverrides.touchcontrollers; import static com.android.launcher3.AbstractFloatingView.TYPE_TOUCH_CONTROLLER_NO_INTERCEPT; import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS; +import static com.android.launcher3.Utilities.debugLog; import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_BOTH; import android.animation.Animator; @@ -56,6 +57,7 @@ import com.android.quickstep.views.TaskView; public class TaskViewTouchControllerDeprecated< CONTAINER extends Context & RecentsViewContainer> extends AnimatorListenerAdapter implements TouchController, SingleAxisSwipeDetector.Listener { + private static final String TAG = "TaskViewTouchControllerDeprecated"; private static final float ANIMATION_PROGRESS_FRACTION_MIDPOINT = 0.5f; private static final long MIN_TASK_DISMISS_ANIMATION_DURATION = 300; @@ -110,6 +112,7 @@ public class TaskViewTouchControllerDeprecated< if (mCurrentAnimation != null) { mCurrentAnimation.getAnimationPlayer().end(); } + debugLog(TAG, "Not intercepting edge swipe on nav bar."); return false; } if (mCurrentAnimation != null) { @@ -121,6 +124,7 @@ public class TaskViewTouchControllerDeprecated< } if (AbstractFloatingView.getTopOpenViewWithType( mContainer, TYPE_TOUCH_CONTROLLER_NO_INTERCEPT) != null) { + debugLog(TAG, "Not intercepting, open floating view blocking touch."); return false; } return mTaskViewRecentsTouchContext.isRecentsInteractive(); @@ -142,6 +146,7 @@ public class TaskViewTouchControllerDeprecated< if (ev.getAction() == MotionEvent.ACTION_DOWN) { mNoIntercept = !canInterceptTouch(ev); if (mNoIntercept) { + debugLog(TAG, "Not intercepting touch."); return false; } @@ -186,6 +191,7 @@ public class TaskViewTouchControllerDeprecated< } if (mTaskBeingDragged == null) { mNoIntercept = true; + debugLog(TAG, "Not intercepting touch, no task to drag."); return false; } } @@ -195,6 +201,7 @@ public class TaskViewTouchControllerDeprecated< } if (mNoIntercept) { + debugLog(TAG, "Not intercepting touch."); return false; } @@ -266,6 +273,7 @@ public class TaskViewTouchControllerDeprecated< @Override public void onDragStart(boolean start, float startDisplacement) { if (!mDraggingEnabled) return; + debugLog(TAG, "Handling touch."); RecentsPagedOrientationHandler orientationHandler = mRecentsView.getPagedOrientationHandler(); |