summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewDismissTouchController.kt18
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewLaunchTouchController.kt14
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchControllerDeprecated.java8
-rw-r--r--src/com/android/launcher3/Utilities.java11
4 files changed, 48 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();
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index d6ae3a6335..79774b26c6 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -964,4 +964,15 @@ public final class Utilities {
return null;
}
}
+
+ /**
+ * Logs with DEBUG priority if the current device is a debug device.
+ *
+ * <p>Debug devices by default include -eng and -userdebug builds, but not -user builds.
+ */
+ public static void debugLog(String tag, String message) {
+ if (BuildConfig.IS_DEBUG_DEVICE) {
+ Log.d(tag, message);
+ }
+ }
}