Merge "Add latency metrics for recents gesture" into ub-launcher3-master

This commit is contained in:
Winson Chung
2020-10-09 16:39:06 +00:00
committed by Android (Google) Code Review
3 changed files with 15 additions and 2 deletions
@@ -1479,6 +1479,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
mGestureEndCallback = gestureEndCallback;
}
@Override
public long getStartTouchTime() {
return mTouchTimeMs;
}
protected void linkRecentsViewScroll() {
SurfaceTransactionApplier.create(mRecentsView, applier -> {
mTransformParams.setSyncTransactionApplier(applier);
@@ -160,5 +160,12 @@ public class RecentsAnimationCallbacks implements
* Callback made when a task started from the recents is ready for an app transition.
*/
default void onTaskAppeared(RemoteAnimationTargetCompat appearedTaskTarget) {}
/**
* The time in milliseconds of the touch event that starts the recents animation.
*/
default long getStartTouchTime() {
return 0;
}
}
}
@@ -50,7 +50,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
public void preloadRecentsAnimation(Intent intent) {
// Pass null animation handler to indicate this start is for preloading
UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance()
.startRecentsActivity(intent, null, null, null, null));
.startRecentsActivity(intent, 0, null, null, null));
}
/**
@@ -119,10 +119,11 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
}
}
});
final long eventTime = listener.getStartTouchTime();
mCallbacks.addListener(gestureState);
mCallbacks.addListener(listener);
UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance()
.startRecentsActivity(intent, null, mCallbacks, null, null));
.startRecentsActivity(intent, eventTime, mCallbacks, null, null));
gestureState.setState(STATE_RECENTS_ANIMATION_INITIALIZED);
return mCallbacks;
}