summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-10-22 10:07:11 -0700
committerKenny Root <kroot@google.com>2010-11-05 11:59:45 -0700
commit70fc04c84db8f99ac2ac60fd9719b91057aacc9b (patch)
tree5a32634a0597a9b247dcb6e0830b18d171758ccf /services/java
parent47e43febdd8ba83c333c9c98ca6a8c0bda421305 (diff)
downloadframeworks_base-70fc04c84db8f99ac2ac60fd9719b91057aacc9b.zip
frameworks_base-70fc04c84db8f99ac2ac60fd9719b91057aacc9b.tar.gz
frameworks_base-70fc04c84db8f99ac2ac60fd9719b91057aacc9b.tar.bz2
Reorganize PackageManager dump to avoid NPE
versionCode and mVersionName were added recently but ps.pkg can be null in some situations. Move them to where it will check before dereferencing it. Bug: 3152896 Change-Id: If992a1f29ac7b8f595f847b7743fd2374662bb6e
Diffstat (limited to 'services/java')
-rw-r--r--services/java/com/android/server/PackageManagerService.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index d324c2b..4520f18 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -7166,7 +7166,9 @@ class PackageManagerService extends IPackageManager.Stub {
pw.print(" resourcePath="); pw.println(ps.resourcePathString);
pw.print(" nativeLibraryPath="); pw.println(ps.nativeLibraryPathString);
pw.print(" obbPath="); pw.println(ps.obbPathString);
+ pw.print(" versionCode="); pw.println(ps.versionCode);
if (ps.pkg != null) {
+ pw.print(" versionName="); pw.println(ps.pkg.mVersionName);
pw.print(" dataDir="); pw.println(ps.pkg.applicationInfo.dataDir);
pw.print(" targetSdk="); pw.println(ps.pkg.applicationInfo.targetSdkVersion);
if (ps.pkg.mOperationPending) {
@@ -7224,8 +7226,6 @@ class PackageManagerService extends IPackageManager.Stub {
pw.print(" pkgFlags=0x"); pw.print(Integer.toHexString(ps.pkgFlags));
pw.print(" installStatus="); pw.print(ps.installStatus);
pw.print(" enabled="); pw.println(ps.enabled);
- pw.print(" versionCode="); pw.print(ps.versionCode);
- pw.print(" versionName="); pw.println(ps.pkg.mVersionName);
if (ps.disabledComponents.size() > 0) {
pw.println(" disabledComponents:");
for (String s : ps.disabledComponents) {