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

Commit 2ae4420a authored by Schneider Victor-tulias's avatar Schneider Victor-tulias Committed by Android (Google) Code Review
Browse files

Merge "Expand on gesture navigation error detection." into tm-qpr-dev

parents db32818a 7ad70b60
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -334,6 +334,12 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
            return ActiveGestureErrorDetector.GestureEvent.STATE_GESTURE_COMPLETED;
        } else if (stateFlag == STATE_GESTURE_CANCELLED) {
            return ActiveGestureErrorDetector.GestureEvent.STATE_GESTURE_CANCELLED;
        } else if (stateFlag == STATE_SCREENSHOT_CAPTURED) {
            return ActiveGestureErrorDetector.GestureEvent.STATE_SCREENSHOT_CAPTURED;
        } else if (stateFlag == STATE_CAPTURE_SCREENSHOT) {
            return ActiveGestureErrorDetector.GestureEvent.STATE_CAPTURE_SCREENSHOT;
        } else if (stateFlag == STATE_HANDLER_INVALIDATED) {
            return ActiveGestureErrorDetector.GestureEvent.STATE_HANDLER_INVALIDATED;
        }
        return null;
    }
@@ -1222,6 +1228,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
        // Let RecentsView handle the scrolling to the task, which we launch in startNewTask()
        // or resumeLastTask().
        if (mRecentsView != null) {
            ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent
                    .SET_ON_PAGE_TRANSITION_END_CALLBACK);
            mRecentsView.setOnPageTransitionEndCallback(
                    () -> mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED));
        } else {
@@ -1699,6 +1707,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
     * handler (in case of quick switch).
     */
    private void cancelCurrentAnimation() {
        ActiveGestureLog.INSTANCE.addLog(
                "AbsSwipeUpHandler.cancelCurrentAnimation",
                ActiveGestureErrorDetector.GestureEvent.CANCEL_CURRENT_ANIMATION);
        mCanceled = true;
        mCurrentShift.cancelAnimation();

+2 −0
Original line number Diff line number Diff line
@@ -189,6 +189,8 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL
            return ActiveGestureErrorDetector.GestureEvent.STATE_END_TARGET_ANIMATION_FINISHED;
        } else if (stateFlag == STATE_RECENTS_SCROLLING_FINISHED) {
            return ActiveGestureErrorDetector.GestureEvent.STATE_RECENTS_SCROLLING_FINISHED;
        } else if (stateFlag == STATE_RECENTS_ANIMATION_CANCELED) {
            return ActiveGestureErrorDetector.GestureEvent.STATE_RECENTS_ANIMATION_CANCELED;
        }
        return null;
    }
+8 −1
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ import androidx.annotation.UiThread;

import com.android.launcher3.util.Preconditions;
import com.android.launcher3.util.RunnableList;
import com.android.quickstep.util.ActiveGestureErrorDetector;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
@@ -172,7 +174,12 @@ public class RecentsAnimationController {
     */
    @UiThread
    public void cleanupScreenshot() {
        UI_HELPER_EXECUTOR.execute(() -> mController.cleanupScreenshot());
        UI_HELPER_EXECUTOR.execute(() -> {
            ActiveGestureLog.INSTANCE.addLog(
                    "cleanupScreenshot",
                    ActiveGestureErrorDetector.GestureEvent.CLEANUP_SCREENSHOT);
            mController.cleanupScreenshot();
        });
    }

    /**
+4 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ import androidx.annotation.UiThread;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.quickstep.TopTaskTracker.CachedTaskInfo;
import com.android.quickstep.util.ActiveGestureErrorDetector;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -136,6 +138,8 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
                    // handling this call entirely
                    return;
                }
                ActiveGestureLog.INSTANCE.addLog("TaskAnimationManager.startRecentsAnimation",
                        ActiveGestureErrorDetector.GestureEvent.START_RECENTS_ANIMATION);
                mController = controller;
                mTargets = targets;
                mLastAppearedTaskTarget = mTargets.findTask(mLastGestureState.getRunningTaskId());
+25 −8
Original line number Diff line number Diff line
@@ -721,8 +721,10 @@ public class TouchInteractionService extends Service
            gestureState.updateRunningTask(taskInfo);
        }
        // Log initial state for the gesture.
        ActiveGestureLog.INSTANCE.addLog(
                "Current SystemUi state flags= " + mDeviceState.getSystemUiStateString());
        ActiveGestureLog.INSTANCE.addLog(new CompoundString("Current running task package name=")
                .append(taskInfo == null ? "no running task" : taskInfo.getPackageName()));
        ActiveGestureLog.INSTANCE.addLog(new CompoundString("Current SystemUi state flags=")
                .append(mDeviceState.getSystemUiStateString()));
        return gestureState;
    }

@@ -1024,12 +1026,27 @@ public class TouchInteractionService extends Service
                            .append("activity == null, trying to use default input consumer"));
        }

        if (activity.getRootView().hasWindowFocus()
                || previousGestureState.isRunningAnimationToLauncher()
                || (ASSISTANT_GIVES_LAUNCHER_FOCUS.get()
                    && forceOverviewInputConsumer)
                || (ENABLE_QUICKSTEP_LIVE_TILE.get()
                && gestureState.getActivityInterface().isInLiveTileMode())) {
        boolean hasWindowFocus = activity.getRootView().hasWindowFocus();
        boolean isPreviousGestureAnimatingToLauncher =
                previousGestureState.isRunningAnimationToLauncher();
        boolean forcingOverviewInputConsumer =
                ASSISTANT_GIVES_LAUNCHER_FOCUS.get() && forceOverviewInputConsumer;
        boolean isInLiveTileMode = ENABLE_QUICKSTEP_LIVE_TILE.get()
                && gestureState.getActivityInterface().isInLiveTileMode();
        reasonString.append(SUBSTRING_PREFIX)
                .append(hasWindowFocus
                        ? "activity has window focus"
                        : (isPreviousGestureAnimatingToLauncher
                                ? "previous gesture is still animating to launcher"
                                : (forcingOverviewInputConsumer
                                        ? "assistant gives launcher focus and forcing focus"
                                        : (isInLiveTileMode
                                                ? "device is in live mode"
                                                : "all overview focus conditions failed"))));
        if (hasWindowFocus
                || isPreviousGestureAnimatingToLauncher
                || forcingOverviewInputConsumer
                || isInLiveTileMode) {
            reasonString.append(SUBSTRING_PREFIX)
                    .append("overview should have focus, using OverviewInputConsumer");
            return new OverviewInputConsumer(gestureState, activity, mInputMonitorCompat,
Loading