Fix usagestats DUMP OF SERVICE

DUMP OF SERVICE Usagestats was empty in bugreports
because an unexpected -a argument was being passed.
adb shell pm dump <package> had a similar issue with --packages

Change-Id: Ic67c723b8edc74ec7c9c48582b08896ca3430a4a
Fix: 70777338
Test: adb shell pm dump <package> and bugreports now contain usage stats
This commit is contained in:
Esteban Talavera
2017-12-19 11:48:43 +00:00
parent 5826e469e9
commit 838ea24493
2 changed files with 3 additions and 3 deletions

View File

@@ -3835,7 +3835,7 @@ public class ActivityManager {
pw.println();
dumpService(pw, fd, ProcessStats.SERVICE_NAME, new String[] { packageName });
pw.println();
dumpService(pw, fd, "usagestats", new String[] { "--packages", packageName });
dumpService(pw, fd, "usagestats", new String[] { packageName });
pw.println();
dumpService(pw, fd, BatteryStats.SERVICE_NAME, new String[] { packageName });
pw.flush();

View File

@@ -492,8 +492,8 @@ public class UsageStatsService extends SystemService implements
flushToDiskLocked();
pw.println("Flushed stats to disk");
return;
} else {
// Anything else is a pkg to filter
} else if (arg != null && !arg.startsWith("-")) {
// Anything else that doesn't start with '-' is a pkg to filter
pkg = arg;
break;
}