Set launch source info for shell recents animation
In legacy animation, it was set in RecentsAnimation
#startRecentsActivity. Now because shell transition use
startActivity, it can be set directly to the options.
Bug: 218847872
Test: adb shell setprop persist.debug.shell_transit 1; reboot
Enable statsd log: "adb shell cmd stats print-logs"
Swipe up gesture navigation bar from an app.
adb logcat | grep statsd | grep "(48)"
The line may contain 0x100000->4[I] 0x110000->20[I]
that means 4=by recents and 20=latency 20ms.
Change-Id: Ia7bef23f8dc6cbf371cd1cdfb42f1f68d88d0787
diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
index 914c939..14ec2a7 100644
--- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java
+++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
@@ -23,9 +23,9 @@
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME;
import android.app.ActivityManager;
+import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
-import android.os.Bundle;
import android.os.SystemProperties;
import android.util.Log;
import android.view.RemoteAnimationTarget;
@@ -196,9 +196,10 @@
RemoteTransitionCompat transition = new RemoteTransitionCompat(mCallbacks,
mController != null ? mController.getController() : null,
mCtx.getIApplicationThread());
- Bundle options = ActivityOptionsCompat.makeRemoteTransition(transition)
- .setTransientLaunch().toBundle();
- UI_HELPER_EXECUTOR.execute(() -> mCtx.startActivity(intent, options));
+ final ActivityOptions options = ActivityOptionsCompat.makeRemoteTransition(transition)
+ .setTransientLaunch();
+ options.setSourceInfo(ActivityOptions.SourceInfo.TYPE_RECENTS_ANIMATION, eventTime);
+ UI_HELPER_EXECUTOR.execute(() -> mCtx.startActivity(intent, options.toBundle()));
} else {
UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance()
.startRecentsActivity(intent, eventTime, mCallbacks, null, null));