am 3bec87c9: Merge "Pass vmSafeMode (manifest attribute) to installd."

* commit '3bec87c9fab49fc2cc7ad1909331f3978803bdd6':
  Pass vmSafeMode (manifest attribute) to installd.
This commit is contained in:
Calin Juravle
2014-08-27 15:58:39 +00:00
committed by Android Git Automerger
2 changed files with 7 additions and 3 deletions

View File

@@ -240,11 +240,12 @@ public final class Installer {
builder.append(" *"); // No pkgName arg present
builder.append(' ');
builder.append(instructionSet);
builder.append(" 0"); // vmSafeMode=false
return execute(builder.toString());
}
public int dexopt(String apkPath, int uid, boolean isPublic, String pkgName,
String instructionSet) {
String instructionSet, boolean vmSafeMode) {
StringBuilder builder = new StringBuilder("dexopt");
builder.append(' ');
builder.append(apkPath);
@@ -255,6 +256,7 @@ public final class Installer {
builder.append(pkgName);
builder.append(' ');
builder.append(instructionSet);
builder.append(vmSafeMode ? " 1" : " 0");
return execute(builder.toString());
}

View File

@@ -4293,6 +4293,7 @@ public class PackageManagerService extends IPackageManager.Stub {
}
}
final boolean vmSafeMode = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0;
boolean performed = false;
if ((pkg.applicationInfo.flags&ApplicationInfo.FLAG_HAS_CODE) != 0) {
String path = pkg.mScanPath;
@@ -4309,10 +4310,11 @@ public class PackageManagerService extends IPackageManager.Stub {
// 2.) we are defering a needed dexopt
// 3.) we are skipping an unneeded dexopt
if (forceDex || (!defer && isDexOptNeededInternal == DexFile.DEXOPT_NEEDED)) {
Log.i(TAG, "Running dexopt on: " + pkg.applicationInfo.packageName);
Log.i(TAG, "Running dexopt on: " + pkg.applicationInfo.packageName
+ " vmSafeMode=" + vmSafeMode);
final int sharedGid = UserHandle.getSharedAppGid(pkg.applicationInfo.uid);
int ret = mInstaller.dexopt(path, sharedGid, !isForwardLocked(pkg),
pkg.packageName, dexCodeInstructionSet);
pkg.packageName, dexCodeInstructionSet, vmSafeMode);
// Note that we ran dexopt, since rerunning will
// probably just result in an error again.
pkg.mDexOptNeeded = false;