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

Commit 626ffb45 authored by Guang Zhu's avatar Guang Zhu Committed by Android (Google) Code Review
Browse files

Merge "Revert "Per user setting for instant app""

parents 9a044dad be9ffa15
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -553,12 +553,8 @@ public final class Pm {
                    sessionParams.abiOverride = checkAbiArgument(nextOptionData());
                    break;
                case "--ephemeral":
                case "--instant":
                    sessionParams.setInstallAsInstantApp(true /*isInstantApp*/);
                    break;
                case "--full":
                    sessionParams.setInstallAsInstantApp(false /*isInstantApp*/);
                    break;
                case "--user":
                    params.userId = UserHandle.parseUserArg(nextOptionData());
                    break;
+1 −1
Original line number Diff line number Diff line
@@ -1687,7 +1687,7 @@ public class ApplicationPackageManager extends PackageManager {
    public int installExistingPackageAsUser(String packageName, int userId)
            throws NameNotFoundException {
        try {
            int res = mPM.installExistingPackageAsUser(packageName, userId, 0 /*installFlags*/,
            int res = mPM.installExistingPackageAsUser(packageName, userId,
                    PackageManager.INSTALL_REASON_UNKNOWN);
            if (res == INSTALL_FAILED_INVALID_URI) {
                throw new NameNotFoundException("Package " + packageName + " doesn't exist");
+12 −1
Original line number Diff line number Diff line
@@ -284,6 +284,8 @@ public class IntentFilter implements Parcelable {

    /** Whether or not the intent filter is visible to ephemeral apps. */
    private boolean mVisibleToEphemeral;
    /** Whether or not the intent filter is part of an ephemeral app. */
    private boolean mEphemeral;
    // These functions are the start of more optimized code for managing
    // the string sets...  not yet implemented.

@@ -654,10 +656,19 @@ public class IntentFilter implements Parcelable {
        mVisibleToEphemeral = visibleToEmphemeral;
    }
    /** @hide */
    public boolean isVisibleToInstantApp() {
    public boolean isVisibleToEphemeral() {
        return mVisibleToEphemeral;
    }

    /** @hide */
    public void setEphemeral(boolean ephemeral) {
        mEphemeral = ephemeral;
    }
    /** @hide */
    public boolean isEphemeral() {
        return mEphemeral;
    }

    /**
     * Add a new Intent action to match against.  If any actions are included
     * in the filter, then an Intent's action must be one of those values for
+12 −30
Original line number Diff line number Diff line
@@ -498,12 +498,11 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
    public static final int PRIVATE_FLAG_DIRECT_BOOT_AWARE = 1 << 6;

    /**
     * Value for {@link #privateFlags}: {@code true} if the application is installed
     * as instant app.
     *
     * @hide
     * Value for {@link #flags}: {@code true} if the application is blocked via restrictions
     * and for most purposes is considered as not installed.
     * {@hide}
     */
    public static final int PRIVATE_FLAG_INSTANT = 1 << 7;
    public static final int PRIVATE_FLAG_EPHEMERAL = 1 << 7;

    /**
     * When set, at least one component inside this application is direct boot
@@ -682,21 +681,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
     *
     * {@hide}
     */
    public String seInfo = "default";

    /**
     * The seinfo tag generated per-user. This value may change based upon the
     * user's configuration. For example, when an instant app is installed for
     * a user. It is an error if this field is ever {@code null} when trying to
     * start a new process.
     * <p>NOTE: We need to separate this out because we modify per-user values
     * multiple times. This needs to be refactored since we're performing more
     * work than necessary and these values should only be set once. When that
     * happens, we can merge the per-user value with the seInfo state above.
     *
     * {@hide}
     */
    public String seInfoUser;
    public String seinfo = "default";

    /**
     * Paths to all shared libraries this application is linked against.  This
@@ -1024,9 +1009,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        if (resourceDirs != null) {
            pw.println(prefix + "resourceDirs=" + Arrays.toString(resourceDirs));
        }
        if ((flags&DUMP_FLAG_DETAILS) != 0 && seInfo != null) {
            pw.println(prefix + "seinfo=" + seInfo);
            pw.println(prefix + "seinfoUser=" + seInfoUser);
        if ((flags&DUMP_FLAG_DETAILS) != 0 && seinfo != null) {
            pw.println(prefix + "seinfo=" + seinfo);
        }
        pw.println(prefix + "dataDir=" + dataDir);
        if ((flags&DUMP_FLAG_DETAILS) != 0) {
@@ -1136,8 +1120,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        primaryCpuAbi = orig.primaryCpuAbi;
        secondaryCpuAbi = orig.secondaryCpuAbi;
        resourceDirs = orig.resourceDirs;
        seInfo = orig.seInfo;
        seInfoUser = orig.seInfoUser;
        seinfo = orig.seinfo;
        sharedLibraryFiles = orig.sharedLibraryFiles;
        dataDir = orig.dataDir;
        deviceEncryptedDataDir = deviceProtectedDataDir = orig.deviceProtectedDataDir;
@@ -1198,8 +1181,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        dest.writeString(primaryCpuAbi);
        dest.writeString(secondaryCpuAbi);
        dest.writeStringArray(resourceDirs);
        dest.writeString(seInfo);
        dest.writeString(seInfoUser);
        dest.writeString(seinfo);
        dest.writeStringArray(sharedLibraryFiles);
        dest.writeString(dataDir);
        dest.writeString(deviceProtectedDataDir);
@@ -1260,8 +1242,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        primaryCpuAbi = source.readString();
        secondaryCpuAbi = source.readString();
        resourceDirs = source.readStringArray();
        seInfo = source.readString();
        seInfoUser = source.readString();
        seinfo = source.readString();
        sharedLibraryFiles = source.readStringArray();
        dataDir = source.readString();
        deviceEncryptedDataDir = deviceProtectedDataDir = source.readString();
@@ -1349,6 +1330,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        } else {
            dataDir = credentialProtectedDataDir;
        }
        // TODO: modify per-user ephemerality
    }

    /**
@@ -1433,7 +1415,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
     * @hide
     */
    public boolean isInstantApp() {
        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_INSTANT) != 0;
        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_EPHEMERAL) != 0;
    }

    /**
+1 −2
Original line number Diff line number Diff line
@@ -553,8 +553,7 @@ interface IPackageManager {
    boolean setInstallLocation(int loc);
    int getInstallLocation();

    int installExistingPackageAsUser(String packageName, int userId, int installFlags,
            int installReason);
    int installExistingPackageAsUser(String packageName, int userId, int installReason);

    void verifyPendingInstall(int id, int verificationCode);
    void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay);
Loading