summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authornarayan <narayan@google.com>2014-05-21 20:14:56 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-21 20:14:56 +0000
commit838b1e2215cbc27e77530f4c79124c088353e0e7 (patch)
treeaf123444a41213fe72a15cf1ddf0f4b31e88f904 /services/java
parentbc06158a78297747605981702c8e41956ea1aa2d (diff)
parent0cfe875ac51b1efd8119eb8d4d66429776ae9764 (diff)
downloadframeworks_base-838b1e2215cbc27e77530f4c79124c088353e0e7.zip
frameworks_base-838b1e2215cbc27e77530f4c79124c088353e0e7.tar.gz
frameworks_base-838b1e2215cbc27e77530f4c79124c088353e0e7.tar.bz2
Merge "Fix NPE in PackageManagerService."
Diffstat (limited to 'services/java')
-rwxr-xr-xservices/java/com/android/server/pm/PackageManagerService.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index ca58da0..5d69ba3 100755
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -5676,21 +5676,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 (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 (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());
+ }
}
}
}