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

Commit 67392f3a authored by William Loh's avatar William Loh
Browse files

Rename isKeepApplicationEnabledSetting API

Renaming to isApplicationEnabledSettingPersistent.

Bug: 261684344
Test: atest PackageManagerShellCommandTest#testAppUpdateSkipEnable
Change-Id: Ief4184c33cbd6ee37ed797af54cf4d980d8c662f
parent ae953564
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -11992,7 +11992,7 @@ package android.content.pm {
    method @NonNull public int[] getChildSessionIds();
    method @NonNull public String[] getNames() throws java.io.IOException;
    method public int getParentSessionId();
    method public boolean isKeepApplicationEnabledSetting();
    method public boolean isApplicationEnabledSettingPersistent();
    method public boolean isMultiPackage();
    method public boolean isRequestUpdateOwnership();
    method public boolean isStaged();
@@ -12047,8 +12047,8 @@ package android.content.pm {
    method @NonNull public android.os.UserHandle getUser();
    method public boolean hasParentSessionId();
    method public boolean isActive();
    method public boolean isApplicationEnabledSettingPersistent();
    method public boolean isCommitted();
    method public boolean isKeepApplicationEnabledSetting();
    method public boolean isMultiPackage();
    method public boolean isRequestUpdateOwnership();
    method public boolean isSealed();
@@ -12078,12 +12078,12 @@ package android.content.pm {
    method public void setAppIcon(@Nullable android.graphics.Bitmap);
    method public void setAppLabel(@Nullable CharSequence);
    method public void setAppPackageName(@Nullable String);
    method public void setApplicationEnabledSettingPersistent();
    method @Deprecated public void setAutoRevokePermissionsMode(boolean);
    method public void setInstallLocation(int);
    method public void setInstallReason(int);
    method public void setInstallScenario(int);
    method public void setInstallerPackageName(@Nullable String);
    method public void setKeepApplicationEnabledSetting();
    method public void setMultiPackage();
    method public void setOriginatingUid(int);
    method public void setOriginatingUri(@Nullable android.net.Uri);
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ interface IPackageInstallerSession {

    void requestUserPreapproval(in PackageInstaller.PreapprovalDetails details, in IntentSender statusReceiver);

    boolean isKeepApplicationEnabledSetting();
    boolean isApplicationEnabledSettingPersistent();
    boolean isRequestUpdateOwnership();

    ParcelFileDescriptor getAppMetadataFd();
+15 −14
Original line number Diff line number Diff line
@@ -2010,9 +2010,9 @@ public class PackageInstaller {
         * @return {@code true} if this session will keep the existing application enabled setting
         * after installation.
         */
        public boolean isKeepApplicationEnabledSetting() {
        public boolean isApplicationEnabledSettingPersistent() {
            try {
                return mSession.isKeepApplicationEnabledSetting();
                return mSession.isApplicationEnabledSettingPersistent();
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
@@ -2265,7 +2265,7 @@ public class PackageInstaller {
        /** {@hide} */
        public int requireUserAction = USER_ACTION_UNSPECIFIED;
        /** {@hide} */
        public boolean keepApplicationEnabledSetting = false;
        public boolean applicationEnabledSettingPersistent = false;

        /**
         * Construct parameters for a new package install session.
@@ -2310,7 +2310,7 @@ public class PackageInstaller {
            rollbackDataPolicy = source.readInt();
            requireUserAction = source.readInt();
            packageSource = source.readInt();
            keepApplicationEnabledSetting = source.readBoolean();
            applicationEnabledSettingPersistent = source.readBoolean();
        }

        /** {@hide} */
@@ -2341,7 +2341,7 @@ public class PackageInstaller {
            ret.rollbackDataPolicy = rollbackDataPolicy;
            ret.requireUserAction = requireUserAction;
            ret.packageSource = packageSource;
            ret.keepApplicationEnabledSetting = keepApplicationEnabledSetting;
            ret.applicationEnabledSettingPersistent = applicationEnabledSettingPersistent;
            return ret;
        }

@@ -2839,8 +2839,8 @@ public class PackageInstaller {
         * Request to keep the original application enabled setting. This will prevent the
         * application from being enabled if it was previously in a disabled state.
         */
        public void setKeepApplicationEnabledSetting() {
            this.keepApplicationEnabledSetting = true;
        public void setApplicationEnabledSettingPersistent() {
            this.applicationEnabledSettingPersistent = true;
        }

        /**
@@ -2895,7 +2895,8 @@ public class PackageInstaller {
            pw.printPair("requiredInstalledVersionCode", requiredInstalledVersionCode);
            pw.printPair("dataLoaderParams", dataLoaderParams);
            pw.printPair("rollbackDataPolicy", rollbackDataPolicy);
            pw.printPair("keepApplicationEnabledSetting", keepApplicationEnabledSetting);
            pw.printPair("applicationEnabledSettingPersistent",
                    applicationEnabledSettingPersistent);
            pw.println();
        }

@@ -2936,7 +2937,7 @@ public class PackageInstaller {
            dest.writeInt(rollbackDataPolicy);
            dest.writeInt(requireUserAction);
            dest.writeInt(packageSource);
            dest.writeBoolean(keepApplicationEnabledSetting);
            dest.writeBoolean(applicationEnabledSettingPersistent);
        }

        public static final Parcelable.Creator<SessionParams>
@@ -3139,7 +3140,7 @@ public class PackageInstaller {
        public boolean isPreapprovalRequested;

        /** @hide */
        public boolean keepApplicationEnabledSetting;
        public boolean applicationEnabledSettingPersistent;

        /** @hide */
        public int pendingUserActionReason;
@@ -3197,7 +3198,7 @@ public class PackageInstaller {
            requireUserAction = source.readInt();
            installerUid = source.readInt();
            packageSource = source.readInt();
            keepApplicationEnabledSetting = source.readBoolean();
            applicationEnabledSettingPersistent = source.readBoolean();
            pendingUserActionReason = source.readInt();
        }

@@ -3732,8 +3733,8 @@ public class PackageInstaller {
         * Returns {@code true} if this session will keep the existing application enabled setting
         * after installation.
         */
        public boolean isKeepApplicationEnabledSetting() {
            return keepApplicationEnabledSetting;
        public boolean isApplicationEnabledSettingPersistent() {
            return applicationEnabledSettingPersistent;
        }

        /**
@@ -3811,7 +3812,7 @@ public class PackageInstaller {
            dest.writeInt(requireUserAction);
            dest.writeInt(installerUid);
            dest.writeInt(packageSource);
            dest.writeBoolean(keepApplicationEnabledSetting);
            dest.writeBoolean(applicationEnabledSettingPersistent);
            dest.writeInt(pendingUserActionReason);
        }

+3 −3
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ final class InstallArgs {
    final boolean mForceQueryableOverride;
    final int mDataLoaderType;
    final int mPackageSource;
    final boolean mKeepApplicationEnabledSetting;
    final boolean mApplicationEnabledSettingPersistent;

    // The list of instruction sets supported by this app. This is currently
    // only used during the rmdex() phase to clean up resources. We can get rid of this
@@ -74,7 +74,7 @@ final class InstallArgs {
            int autoRevokePermissionsMode, String traceMethod, int traceCookie,
            SigningDetails signingDetails, int installReason, int installScenario,
            boolean forceQueryableOverride, int dataLoaderType, int packageSource,
            boolean keepApplicationEnabledSetting) {
            boolean applicationEnabledSettingPersistent) {
        mOriginInfo = originInfo;
        mMoveInfo = moveInfo;
        mInstallFlags = installFlags;
@@ -95,7 +95,7 @@ final class InstallArgs {
        mForceQueryableOverride = forceQueryableOverride;
        mDataLoaderType = dataLoaderType;
        mPackageSource = packageSource;
        mKeepApplicationEnabledSetting = keepApplicationEnabledSetting;
        mApplicationEnabledSettingPersistent = applicationEnabledSettingPersistent;
    }

    /**
+3 −3
Original line number Diff line number Diff line
@@ -2127,7 +2127,7 @@ final class InstallPackageHelper {
                    }
                    // Enable system package for requested users
                    if (installedForUsers != null
                            && !installRequest.isKeepApplicationEnabledSetting()) {
                            && !installRequest.isApplicationEnabledSettingPersistent()) {
                        for (int origUserId : installedForUsers) {
                            if (userId == UserHandle.USER_ALL || userId == origUserId) {
                                ps.setEnabled(COMPONENT_ENABLED_STATE_DEFAULT,
@@ -2180,7 +2180,7 @@ final class InstallPackageHelper {
                    // be installed and enabled. The caller, however, can explicitly specify to
                    // keep the existing enabled state.
                    ps.setInstalled(true, userId);
                    if (!installRequest.isKeepApplicationEnabledSetting()) {
                    if (!installRequest.isApplicationEnabledSettingPersistent()) {
                        ps.setEnabled(COMPONENT_ENABLED_STATE_DEFAULT, userId,
                                installerPackageName);
                    }
@@ -2189,7 +2189,7 @@ final class InstallPackageHelper {
                    // Thus, updating the settings to install the app for all users.
                    for (int currentUserId : allUsers) {
                        ps.setInstalled(true, currentUserId);
                        if (!installRequest.isKeepApplicationEnabledSetting()) {
                        if (!installRequest.isApplicationEnabledSettingPersistent()) {
                            ps.setEnabled(COMPONENT_ENABLED_STATE_DEFAULT, currentUserId,
                                    installerPackageName);
                        }
Loading