diff --git a/protos/launcher_trace.proto b/protos/launcher_trace.proto index c6f3543c09..65fcfe512b 100644 --- a/protos/launcher_trace.proto +++ b/protos/launcher_trace.proto @@ -28,4 +28,40 @@ message LauncherTraceProto { message TouchInteractionServiceProto { optional bool service_connected = 1; + optional OverviewComponentObserverProto overview_component_obvserver = 2; + optional InputConsumerProto input_consumer = 3; +} + +message OverviewComponentObserverProto { + + optional bool overview_activity_started = 1; + optional bool overview_activity_resumed = 2; +} + +message InputConsumerProto { + + optional string name = 1; + optional SwipeHandlerProto swipe_handler = 2; +} + +message SwipeHandlerProto { + + optional GestureStateProto gesture_state = 1; + optional bool is_recents_attached_to_app_window = 2; + optional int32 scroll_offset = 3; + // Swipe up progress from 0 (app) to 1 (overview); can be > 1 if swiping past overview. + optional float app_to_overview_progress = 4; +} + +message GestureStateProto { + + optional GestureEndTarget endTarget = 1 [default = UNSET]; + + enum GestureEndTarget { + UNSET = 0; + HOME = 1; + RECENTS = 2; + NEW_TASK = 3; + LAST_TASK = 4; + } } diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 5e05a7dbe1..cee9854880 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -77,6 +77,8 @@ import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.logging.StatsLogManager.StatsLogger; import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.testing.TestProtocol; +import com.android.launcher3.tracing.InputConsumerProto; +import com.android.launcher3.tracing.SwipeHandlerProto; import com.android.launcher3.util.TraceHelper; import com.android.launcher3.util.VibratorWrapper; import com.android.launcher3.util.WindowBounds; @@ -88,6 +90,7 @@ import com.android.quickstep.util.ActivityInitListener; import com.android.quickstep.util.AnimatorControllerWithResistance; import com.android.quickstep.util.InputConsumerProxy; import com.android.quickstep.util.MotionPauseDetector; +import com.android.quickstep.util.ProtoTracer; import com.android.quickstep.util.RectFSpringAnim; import com.android.quickstep.util.SurfaceTransactionApplier; import com.android.quickstep.util.TransformParams; @@ -1556,6 +1559,27 @@ public abstract class AbsSwipeUpHandler, Q extends } mTaskViewSimulator.apply(mTransformParams); } + ProtoTracer.INSTANCE.get(mContext).scheduleFrameUpdate(); + } + + /** + * Used for winscope tracing, see launcher_trace.proto + * @see com.android.systemui.shared.tracing.ProtoTraceable#writeToProto + * @param inputConsumerProto The parent of this proto message. + */ + public void writeToProto(InputConsumerProto.Builder inputConsumerProto) { + SwipeHandlerProto.Builder swipeHandlerProto = SwipeHandlerProto.newBuilder(); + + mGestureState.writeToProto(swipeHandlerProto); + + swipeHandlerProto.setIsRecentsAttachedToAppWindow( + mAnimationFactory.isRecentsAttachedToAppWindow()); + swipeHandlerProto.setScrollOffset(mRecentsView == null + ? 0 + : mRecentsView.getScrollOffset()); + swipeHandlerProto.setAppToOverviewProgress(mCurrentShift.value); + + inputConsumerProto.setSwipeHandler(swipeHandlerProto); } public interface Factory { diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index d35e270dd5..9089ae5f96 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -297,6 +297,10 @@ public abstract class BaseActivityInterface