Merge "clear calling identity to dexopt" into mnc-dev

This commit is contained in:
Todd Kennedy
2015-07-17 14:39:57 +00:00
committed by Android (Google) Code Review

View File

@@ -6172,12 +6172,16 @@ public class PackageManagerService extends IPackageManager.Stub {
return false;
}
}
synchronized (mInstallLock) {
final String[] instructionSets = new String[] { targetInstructionSet };
int result = mPackageDexOptimizer.performDexOpt(p, instructionSets,
false /* forceDex */, false /* defer */, true /* inclDependencies */);
return result == PackageDexOptimizer.DEX_OPT_PERFORMED;
long callingId = Binder.clearCallingIdentity();
try {
synchronized (mInstallLock) {
final String[] instructionSets = new String[] { targetInstructionSet };
int result = mPackageDexOptimizer.performDexOpt(p, instructionSets,
false /* forceDex */, false /* defer */, true /* inclDependencies */);
return result == PackageDexOptimizer.DEX_OPT_PERFORMED;
}
} finally {
Binder.restoreCallingIdentity(callingId);
}
}