Merge "Migrate FrameTracker to use ST Jank information (2/2)"

This commit is contained in:
Winson Chung
2021-01-13 19:36:00 +00:00
committed by Android (Google) Code Review
5 changed files with 14 additions and 16 deletions

View File

@@ -316,12 +316,4 @@ public abstract class BaseQuickstepLauncher extends Launcher
public void setHintUserWillBeActive() {
addActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE);
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
if (Utilities.ATLEAST_R) {
InteractionJankMonitorWrapper.init(getWindow().getDecorView());
}
}
}

View File

@@ -763,7 +763,7 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
anim.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationStart(Animator animation) {
InteractionJankMonitorWrapper.begin(cuj);
InteractionJankMonitorWrapper.begin(mDragLayer, cuj);
super.onAnimationStart(animation);
}

View File

@@ -721,9 +721,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
@UiThread
public void onGestureStarted(boolean isLikelyToStartNewTask) {
InteractionJankMonitorWrapper.begin(
InteractionJankMonitorWrapper.begin(mRecentsView,
InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH, 2000 /* ms timeout */);
InteractionJankMonitorWrapper.begin(
InteractionJankMonitorWrapper.begin(mRecentsView,
InteractionJankMonitorWrapper.CUJ_APP_CLOSE_TO_HOME);
notifyGestureStartedAsync();
setIsLikelyToStartNewTask(isLikelyToStartNewTask, false /* animate */);
@@ -805,7 +805,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
maybeUpdateRecentsAttachedState(false);
final GestureEndTarget endTarget = mGestureState.getEndTarget();
if (endTarget != NEW_TASK) {
InteractionJankMonitorWrapper.cancel(InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH);
InteractionJankMonitorWrapper.cancel(
InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH);
}
if (endTarget != HOME) {
InteractionJankMonitorWrapper.cancel(
@@ -1165,7 +1166,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
TaskInfoCompat.getPipSourceRectHint(runningTaskTarget.pictureInPictureParams),
TaskInfoCompat.getWindowConfigurationBounds(taskInfo),
startBounds,
destinationBounds);
destinationBounds,
mRecentsView);
// We would assume home and app window always in the same rotation While homeRotation
// is not ROTATION_0 (which implies the rotation is turned on in launcher settings).
if (homeRotation == ROTATION_0

View File

@@ -175,7 +175,9 @@ public class OverviewCommandHelper {
return;
}
InteractionJankMonitorWrapper.begin(InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH);
InteractionJankMonitorWrapper.begin(
mActivityInterface.getCreatedActivity().getRootView(),
InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH);
// Otherwise, start overview.
mListener = mActivityInterface.createActivityInitListener(this::onActivityReady);

View File

@@ -28,6 +28,7 @@ import android.graphics.RectF;
import android.util.Log;
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.View;
import androidx.annotation.NonNull;
@@ -91,7 +92,8 @@ public class SwipePipToHomeAnimator extends ValueAnimator implements
@NonNull Rect sourceRectHint,
@NonNull Rect appBounds,
@NonNull Rect startBounds,
@NonNull Rect destinationBounds) {
@NonNull Rect destinationBounds,
@NonNull View view) {
mTaskId = taskId;
mComponentName = componentName;
mLeash = leash;
@@ -110,7 +112,7 @@ public class SwipePipToHomeAnimator extends ValueAnimator implements
addListener(new AnimationSuccessListener() {
@Override
public void onAnimationStart(Animator animation) {
InteractionJankMonitorWrapper.begin(CUJ_APP_CLOSE_TO_PIP);
InteractionJankMonitorWrapper.begin(view, CUJ_APP_CLOSE_TO_PIP);
super.onAnimationStart(animation);
}