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

Commit 11f5cf93 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Send launch token to activity manager"

parents 017aee5a b3b43130
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -5123,6 +5123,8 @@ public class Intent implements Parcelable, Cloneable {
    private Intent mSelector;
    private ClipData mClipData;
    private int mContentUserHint = UserHandle.USER_CURRENT;
    /** Token to track instant app launches. Local only; do not copy cross-process. */
    private String mLaunchToken;

    // ---------------------------------------------------------------------

@@ -5143,6 +5145,7 @@ public class Intent implements Parcelable, Cloneable {
        this.mComponent = o.mComponent;
        this.mFlags = o.mFlags;
        this.mContentUserHint = o.mContentUserHint;
        this.mLaunchToken = o.mLaunchToken;
        if (o.mCategories != null) {
            this.mCategories = new ArraySet<String>(o.mCategories);
        }
@@ -6379,6 +6382,16 @@ public class Intent implements Parcelable, Cloneable {
        return mContentUserHint;
    }

    /** @hide */
    public String getLaunchToken() {
        return mLaunchToken;
    }

    /** @hide */
    public void setLaunchToken(String launchToken) {
        mLaunchToken = launchToken;
    }

    /**
     * Sets the ClassLoader that will be used when unmarshalling
     * any Parcelable values from the extras of this Intent.
+1 −0
Original line number Diff line number Diff line
@@ -321,6 +321,7 @@ class ActivityMetricsLogger {
            if (info.launchedActivity.info.launchToken != null) {
                builder.addTaggedData(FIELD_INSTANT_APP_LAUNCH_TOKEN,
                        info.launchedActivity.info.launchToken);
                info.launchedActivity.info.launchToken = null;
            }
            builder.addTaggedData(APP_TRANSITION_IS_EPHEMERAL,
                    info.launchedActivity.info.applicationInfo.isInstantApp() ? 1 : 0);
+4 −0
Original line number Diff line number Diff line
@@ -1227,6 +1227,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
                    mService.setProfileApp(aInfo.applicationInfo, aInfo.processName, profilerInfo);
                }
            }
            final String intentLaunchToken = intent.getLaunchToken();
            if (aInfo.launchToken == null && intentLaunchToken != null) {
                aInfo.launchToken = intentLaunchToken;
            }
        }
        return aInfo;
    }
+2 −0
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ public abstract class InstantAppResolver {
            // Intent that is launched if the package couldn't be installed for any reason.
            final Intent failureIntent = new Intent(origIntent);
            failureIntent.setFlags(failureIntent.getFlags() | Intent.FLAG_IGNORE_EPHEMERAL);
            failureIntent.setLaunchToken(token);
            try {
                final IIntentSender failureIntentTarget = ActivityManager.getService()
                        .getIntentSender(
@@ -216,6 +217,7 @@ public abstract class InstantAppResolver {

            // Intent that is launched if the package was installed successfully.
            final Intent successIntent = new Intent(origIntent);
            successIntent.setLaunchToken(token);
            try {
                final IIntentSender successIntentTarget = ActivityManager.getService()
                        .getIntentSender(