am ab3d85ab: am 838b1e22: Merge "Fix NPE in PackageManagerService."

* commit 'ab3d85ab1a0ae58add5df6efc30607624475405b':
  Fix NPE in PackageManagerService.
This commit is contained in:
narayan
2014-05-21 20:22:03 +00:00
committed by Android Git Automerger

View File

@ -5715,21 +5715,23 @@ public class PackageManagerService extends IPackageManager.Stub {
}
for (PackageSetting ps : packagesForUser) {
if (scannedPackage == null || ! scannedPackage.packageName.equals(ps.name)) {
if (scannedPackage == null || !scannedPackage.packageName.equals(ps.name)) {
if (ps.cpuAbiString != null) {
continue;
}
ps.cpuAbiString = adjustedAbi;
ps.pkg.applicationInfo.cpuAbi = adjustedAbi;
Slog.i(TAG, "Adjusting ABI for : " + ps.name + " to " + adjustedAbi);
if (ps.pkg != null && ps.pkg.applicationInfo != null) {
ps.pkg.applicationInfo.cpuAbi = adjustedAbi;
Slog.i(TAG, "Adjusting ABI for : " + ps.name + " to " + adjustedAbi);
if (performDexOptLI(ps.pkg, forceDexOpt, deferDexOpt, true) == DEX_OPT_FAILED) {
ps.cpuAbiString = null;
ps.pkg.applicationInfo.cpuAbi = null;
return false;
} else {
mInstaller.rmdex(ps.codePathString, getPreferredInstructionSet());
if (performDexOptLI(ps.pkg, forceDexOpt, deferDexOpt, true) == DEX_OPT_FAILED) {
ps.cpuAbiString = null;
ps.pkg.applicationInfo.cpuAbi = null;
return false;
} else {
mInstaller.rmdex(ps.codePathString, getPreferredInstructionSet());
}
}
}
}