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

Commit f3f0e287 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Reland slow gesture callback handling

Now that b/329324086 has been fixed, we can be more certain that launcher always gets a signal to clean up from WM.

- Relanding original fix for b/285636175 with some additional error checking
- We will now check whether the recents animation start is pending on ACTION_UP
- We will now block entire swipes to prevent sending additional inputs an input consumer while the recents animation start is pending
- We will now only stop blocking inputs on ACTION_DOWN

Flag: LEGACY ENABLE_HANDLE_DELAYED_GESTURE_CALLBACKS TEAMFOOD
Bug: 329324927
Fixes: 285636175
Test: added a delay in RecentsAnimationCallbacks.onAnimationStart and attempted several rapid gestures
Change-Id: I9805114da34bf44e6b28c2a8a665e4cca88904c2
parent 63bf93cf
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -229,3 +229,13 @@ flag {
    description: "Enables an add button in the widget picker"
    bug: "323886237"
}

flag {
  name: "enable_handle_delayed_gesture_callbacks"
  namespace: "launcher"
  description: "Enables additional handling for delayed mid-gesture callbacks"
  bug: "285636175"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+9 −8
Original line number Diff line number Diff line
@@ -516,13 +516,14 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL
        return mSwipeUpStartTimeMs;
    }

    public void dump(PrintWriter pw) {
        pw.println("GestureState:");
        pw.println("  gestureID=" + mGestureId);
        pw.println("  runningTask=" + mRunningTask);
        pw.println("  endTarget=" + mEndTarget);
        pw.println("  lastAppearedTaskTargetId=" + Arrays.toString(mLastAppearedTaskTargets));
        pw.println("  lastStartedTaskId=" + Arrays.toString(mLastStartedTaskId));
        pw.println("  isRecentsAnimationRunning=" + isRecentsAnimationRunning());
    public void dump(String prefix, PrintWriter pw) {
        pw.println(prefix + "GestureState:");
        pw.println(prefix + "\tgestureID=" + mGestureId);
        pw.println(prefix + "\trunningTask=" + mRunningTask);
        pw.println(prefix + "\tendTarget=" + mEndTarget);
        pw.println(prefix + "\tlastAppearedTaskTargetId="
                + Arrays.toString(mLastAppearedTaskTargets));
        pw.println(prefix + "\tlastStartedTaskId=" + Arrays.toString(mLastStartedTaskId));
        pw.println(prefix + "\tisRecentsAnimationRunning=" + isRecentsAnimationRunning());
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import com.android.quickstep.util.ActiveGestureLog;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -219,6 +220,13 @@ public class RecentsAnimationCallbacks implements
        }
    }

    public void dump(String prefix, PrintWriter pw) {
        pw.println(prefix + "RecentsAnimationCallbacks:");

        pw.println(prefix + "\tmAllowMinimizeSplitScreen=" + mAllowMinimizeSplitScreen);
        pw.println(prefix + "\tmCancelled=" + mCancelled);
    }

    /**
     * Listener for the recents animation callbacks.
     */
+11 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;

import java.io.PrintWriter;
import java.util.function.Consumer;

/**
@@ -267,4 +268,14 @@ public class RecentsAnimationController {
    public boolean getFinishTargetIsLauncher() {
        return mFinishTargetIsLauncher;
    }

    public void dump(String prefix, PrintWriter pw) {
        pw.println(prefix + "RecentsAnimationController:");

        pw.println(prefix + "\tmAllowMinimizeSplitScreen=" + mAllowMinimizeSplitScreen);
        pw.println(prefix + "\tmUseLauncherSysBarFlags=" + mUseLauncherSysBarFlags);
        pw.println(prefix + "\tmSplitScreenMinimized=" + mSplitScreenMinimized);
        pw.println(prefix + "\tmFinishRequested=" + mFinishRequested);
        pw.println(prefix + "\tmFinishTargetIsLauncher=" + mFinishTargetIsLauncher);
    }
}
+12 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ import android.graphics.Rect;
import android.os.Bundle;
import android.view.RemoteAnimationTarget;

import java.io.PrintWriter;

/**
 * Extension of {@link RemoteAnimationTargets} with additional information about swipe
 * up animation
@@ -63,4 +65,14 @@ public class RecentsAnimationTargets extends RemoteAnimationTargets {
        }
        return false;
    }

    @Override
    public void dump(String prefix, PrintWriter pw) {
        super.dump(prefix, pw);
        prefix += '\t';
        pw.println(prefix + "RecentsAnimationTargets:");

        pw.println(prefix + "\thomeContentInsets=" + homeContentInsets);
        pw.println(prefix + "\tminimizedHomeBounds=" + minimizedHomeBounds);
    }
}
Loading