}
public void createAppData(String uuid, String pkgname, int userid, int flags, int appid,
- String seinfo) throws InstallerException {
- mInstaller.execute("create_app_data", uuid, pkgname, userid, flags, appid, seinfo);
+ String seinfo, int targetSdkVersion) throws InstallerException {
+ mInstaller.execute("create_app_data", uuid, pkgname, userid, flags, appid, seinfo,
+ targetSdkVersion);
}
public void restoreconAppData(String uuid, String pkgname, int userid, int flags, int appid,
}
public void moveCompleteApp(String from_uuid, String to_uuid, String package_name,
- String data_app_name, int appid, String seinfo) throws InstallerException {
+ String data_app_name, int appid, String seinfo, int targetSdkVersion)
+ throws InstallerException {
mInstaller.execute("move_complete_app", from_uuid, to_uuid, package_name,
- data_app_name, appid, seinfo);
+ data_app_name, appid, seinfo, targetSdkVersion);
}
public void getAppSize(String uuid, String pkgname, int userid, int flags, String apkPath,
final String dataAppName;
final int appId;
final String seinfo;
+ final int targetSdkVersion;
public MoveInfo(int moveId, String fromUuid, String toUuid, String packageName,
- String dataAppName, int appId, String seinfo) {
+ String dataAppName, int appId, String seinfo, int targetSdkVersion) {
this.moveId = moveId;
this.fromUuid = fromUuid;
this.toUuid = toUuid;
this.dataAppName = dataAppName;
this.appId = appId;
this.seinfo = seinfo;
+ this.targetSdkVersion = targetSdkVersion;
}
}
synchronized (mInstaller) {
try {
mInstaller.moveCompleteApp(move.fromUuid, move.toUuid, move.packageName,
- move.dataAppName, move.appId, move.seinfo);
+ move.dataAppName, move.appId, move.seinfo, move.targetSdkVersion);
} catch (InstallerException e) {
Slog.w(TAG, "Failed to move app", e);
return PackageManager.INSTALL_FAILED_INTERNAL_ERROR;
synchronized (mInstallLock) {
try {
mInstaller.createAppData(volumeUuid, packageName, userId, flags,
- appId, app.seinfo);
+ appId, app.seinfo, app.targetSdkVersion);
} catch (InstallerException e) {
if (app.isSystemApp()) {
logCriticalInfo(Log.ERROR, "Failed to create app data for " + packageName
destroyAppDataLI(volumeUuid, packageName, userId, flags);
try {
mInstaller.createAppData(volumeUuid, packageName, userId, flags,
- appId, app.seinfo);
+ appId, app.seinfo, app.targetSdkVersion);
logCriticalInfo(Log.DEBUG, "Recovery succeeded!");
} catch (InstallerException e2) {
logCriticalInfo(Log.DEBUG, "Recovery failed!");
final int appId;
final String seinfo;
final String label;
+ final int targetSdkVersion;
// reader
synchronized (mPackages) {
appId = UserHandle.getAppId(pkg.applicationInfo.uid);
seinfo = pkg.applicationInfo.seinfo;
label = String.valueOf(pm.getApplicationLabel(pkg.applicationInfo));
+ targetSdkVersion = pkg.applicationInfo.targetSdkVersion;
}
// Now that we're guarded by frozen state, kill app during move
final String dataAppName = codeFile.getName();
move = new MoveInfo(moveId, currentVolumeUuid, volumeUuid, packageName,
- dataAppName, appId, seinfo);
+ dataAppName, appId, seinfo, targetSdkVersion);
} else {
move = null;
}
String[] names;
int[] appIds;
String[] seinfos;
+ int[] targetSdkVersions;
int packagesCount;
synchronized (mPackages) {
Collection<PackageSetting> packages = mPackages.values();
names = new String[packagesCount];
appIds = new int[packagesCount];
seinfos = new String[packagesCount];
+ targetSdkVersions = new int[packagesCount];
Iterator<PackageSetting> packagesIterator = packages.iterator();
for (int i = 0; i < packagesCount; i++) {
PackageSetting ps = packagesIterator.next();
names[i] = ps.name;
appIds[i] = ps.appId;
seinfos[i] = ps.pkg.applicationInfo.seinfo;
+ targetSdkVersions[i] = ps.pkg.applicationInfo.targetSdkVersion;
}
}
for (int i = 0; i < packagesCount; i++) {
final int flags = Installer.FLAG_CE_STORAGE | Installer.FLAG_DE_STORAGE;
try {
installer.createAppData(volumeUuids[i], names[i], userHandle, flags, appIds[i],
- seinfos[i]);
+ seinfos[i], targetSdkVersions[i]);
} catch (InstallerException e) {
Slog.w(TAG, "Failed to prepare app data", e);
}