Merge "Always restart apps if base.apk gets updated." into rvc-dev am: fe30ac3f0a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17112304 Change-Id: I4cca0da70a5f0bc9bd9d60b863d6b4bcbd601ab2
This commit is contained in:
@@ -51,4 +51,5 @@ interface IPackageInstallerSession {
|
|||||||
int getParentSessionId();
|
int getParentSessionId();
|
||||||
|
|
||||||
boolean isStaged();
|
boolean isStaged();
|
||||||
|
int getInstallFlags();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1358,6 +1358,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
|
* @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.
|
* {@link SessionInfo#INVALID_ID} if it does not belong to a multi-package session.
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ import android.system.OsConstants;
|
|||||||
import android.system.StructStat;
|
import android.system.StructStat;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
|
import android.util.EventLog;
|
||||||
import android.util.ExceptionUtils;
|
import android.util.ExceptionUtils;
|
||||||
import android.util.MathUtils;
|
import android.util.MathUtils;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
@@ -2223,6 +2224,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
|
|||||||
resolveInheritedFile(baseDexMetadataFile);
|
resolveInheritedFile(baseDexMetadataFile);
|
||||||
}
|
}
|
||||||
baseApk = existingBase;
|
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
|
// Inherit splits if not overridden
|
||||||
@@ -2676,6 +2682,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
|
|||||||
return params.isStaged;
|
return params.isStaged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getInstallFlags() {
|
||||||
|
return params.installFlags;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataLoaderParamsParcel getDataLoaderParams() {
|
public DataLoaderParamsParcel getDataLoaderParams() {
|
||||||
mContext.enforceCallingOrSelfPermission(Manifest.permission.USE_INSTALLER_V2, null);
|
mContext.enforceCallingOrSelfPermission(Manifest.permission.USE_INSTALLER_V2, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user