Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53e864d1 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

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
parent e8b200eb
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -23,9 +23,9 @@ import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_STARTED
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 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
            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));