Merge "Postponing CUJ_QUICK_SWITCH and CUJ_APP_CLOSE_TO_HOME" into sc-dev am: a5a61dddfd am: 896c4afbd0

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14805586

Change-Id: I0c83a637e545e5fa77b0971feb88a6e774035257
This commit is contained in:
Vadim Tryshev
2021-06-04 18:20:19 +00:00
committed by Automerger Merge Worker
@@ -745,10 +745,25 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
TaskUtils.closeSystemWindowsAsync(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
if (mRecentsView != null) {
InteractionJankMonitorWrapper.begin(mRecentsView,
InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH, 2000 /* ms timeout */);
InteractionJankMonitorWrapper.begin(mRecentsView,
InteractionJankMonitorWrapper.CUJ_APP_CLOSE_TO_HOME);
mRecentsView.getViewTreeObserver().addOnDrawListener(new OnDrawListener() {
boolean mHandled = false;
@Override
public void onDraw() {
if (mHandled) {
return;
}
mHandled = true;
InteractionJankMonitorWrapper.begin(mRecentsView,
InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH, 2000 /* ms timeout */);
InteractionJankMonitorWrapper.begin(mRecentsView,
InteractionJankMonitorWrapper.CUJ_APP_CLOSE_TO_HOME);
mRecentsView.post(() ->
mRecentsView.getViewTreeObserver().removeOnDrawListener(this));
}
});
}
notifyGestureStartedAsync();
setIsLikelyToStartNewTask(isLikelyToStartNewTask, false /* animate */);