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

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

Merge "Always restart apps if base.apk gets updated." into rvc-dev

parents 12448ab3 52a4337a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -51,4 +51,5 @@ interface IPackageInstallerSession {
    int getParentSessionId();

    boolean isStaged();
    int getInstallFlags();
}
+12 −0
Original line number Diff line number Diff line
@@ -1359,6 +1359,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.
+11 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ import android.system.OsConstants;
import android.system.StructStat;
import android.text.TextUtils;
import android.util.ArraySet;
import android.util.EventLog;
import android.util.ExceptionUtils;
import android.util.MathUtils;
import android.util.Slog;
@@ -2195,6 +2196,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
                    resolveInheritedFile(baseDexMetadataFile);
                }
                baseApk = existingBase;
            } else if ((params.installFlags & PackageManager.INSTALL_DONT_KILL_APP) != 0) {
                EventLog.writeEvent(0x534e4554, "219044664");

                // Installing base.apk. Make sure the app is restarted.
                params.setDontKillApp(false);
            }

            // Inherit splits if not overridden
@@ -2648,6 +2654,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);