From f1317857cdf815b95822db16621a566fb12baf20 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Mon, 15 Sep 2014 16:40:07 -0700 Subject: [PATCH] Quick fix issue #17514851: dumpsys package includes... ...irrelevant install state at the end Quick and dirty impl just doesn't print any of that data when filtering by package name. In the future that part of the dump should be smarter to know how to filter by package name. (Probably also moved to a place earlier in the dump, so the key information -- the overall package data -- is still at the end.) Change-Id: I094f7c2f25401438a68a6aa00d10b19c19eb7c7d --- .../java/com/android/server/pm/PackageManagerService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 0d276695007a9..d87fc2ebc572e 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -12118,14 +12118,14 @@ public class PackageManagerService extends IPackageManager.Stub { dumpState.setDump(DumpState.DUMP_VERSION); } else if ("k".equals(cmd) || "keysets".equals(cmd)) { dumpState.setDump(DumpState.DUMP_KEYSETS); + } else if ("installs".equals(cmd)) { + dumpState.setDump(DumpState.DUMP_INSTALLS); } else if ("write".equals(cmd)) { synchronized (mPackages) { mSettings.writeLPr(); pw.println("Settings written."); return; } - } else if ("installs".equals(cmd)) { - dumpState.setDump(DumpState.DUMP_INSTALLS); } } @@ -12357,7 +12357,9 @@ public class PackageManagerService extends IPackageManager.Stub { mSettings.dumpSharedUsersLPr(pw, packageName, dumpState); } - if (!checkin && dumpState.isDumping(DumpState.DUMP_INSTALLS)) { + if (!checkin && dumpState.isDumping(DumpState.DUMP_INSTALLS) && packageName == null) { + // XXX should handle packageName != null by dumping only install data that + // the given package is involved with. if (dumpState.onTitlePrinted()) pw.println(); mInstallerService.dump(new IndentingPrintWriter(pw, " ", 120)); }