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

Commit 48e08e97 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Automerger Merge Worker
Browse files

Merge "Always restart apps if base.apk gets updated." into tm-dev am: 6d000540

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17011524

Change-Id: Ic8af8292416d6b91af56ed501a28674925590813
parents 8498b2c0 6d000540
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,4 +57,5 @@ interface IPackageInstallerSession {
    int getParentSessionId();

    boolean isStaged();
    int getInstallFlags();
}
+12 −0
Original line number Diff line number Diff line
@@ -1585,6 +1585,18 @@ public class PackageInstaller {
            }
        }

        /**
         * @return Session's {@link SessionParams#installFlags}.
         * @hide
         */
        public int getInstallFlags() {
            try {
                return mSession.getInstallFlags();
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        }

        /**
         * @return the session ID of the multi-package session that this belongs to or
         * {@link SessionInfo#INVALID_ID} if it does not belong to a multi-package session.
+8 −0
Original line number Diff line number Diff line
@@ -2859,6 +2859,9 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
                inheritFileLocked(mResolvedBaseFile);
                // Collect the requiredSplitTypes from base
                CollectionUtils.addAll(requiredSplitTypes, existing.getBaseRequiredSplitTypes());
            } else {
                // Installing base.apk. Make sure the app is restarted.
                params.setDontKillApp(false);
            }

            // Inherit splits if not overridden.
@@ -3554,6 +3557,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
        return params.isStaged;
    }

    @Override
    public int getInstallFlags() {
        return params.installFlags;
    }

    @Override
    public DataLoaderParamsParcel getDataLoaderParams() {
        mContext.enforceCallingOrSelfPermission(Manifest.permission.USE_INSTALLER_V2, null);