summaryrefslogtreecommitdiff
path: root/packages/PrintSpooler/src
diff options
context:
space:
mode:
authorPhilip P. Moltmann <moltmann@google.com>2018-01-17 09:33:14 -0800
committerPhilip P. Moltmann <moltmann@google.com>2018-01-17 09:33:14 -0800
commitbd62e9ae145c638845e41286156eca6e2d44a8ea (patch)
tree8915d0bb16167d39332e9a609dd3e538ff9d304e /packages/PrintSpooler/src
parent99dbbf937cda5b497abb8a289dc6080938c03754 (diff)
Follow up I1f0c56651eaa59f0ce90cdb08c71e89a96c48dd4
Beside addressing the comments on this change, this adds a check that the token in end( is correct and prints a message if not. This is useful when creating new dumping methods. Test: adb shell dumpsys print Change-Id: Ic2e6152cbd82f98d9d305a15edffc69c55fd1fd3
Diffstat (limited to 'packages/PrintSpooler/src')
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/model/PrintSpoolerService.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/model/PrintSpoolerService.java b/packages/PrintSpooler/src/com/android/printspooler/model/PrintSpoolerService.java
index 074f9ef56100..6c7441802d63 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/model/PrintSpoolerService.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/model/PrintSpoolerService.java
@@ -161,11 +161,11 @@ public final class PrintSpoolerService extends Service {
return new PrintSpooler();
}
- private void dumpLocked(@NonNull DualDumpOutputStream proto) {
+ private void dumpLocked(@NonNull DualDumpOutputStream dumpStream) {
int numPrintJobs = mPrintJobs.size();
for (int i = 0; i < numPrintJobs; i++) {
- writePrintJobInfo(this, proto, "print_jobs", PrintSpoolerInternalStateProto.PRINT_JOBS,
- mPrintJobs.get(i));
+ writePrintJobInfo(this, dumpStream, "print_jobs",
+ PrintSpoolerInternalStateProto.PRINT_JOBS, mPrintJobs.get(i));
}
File[] files = getFilesDir().listFiles();
@@ -173,8 +173,8 @@ public final class PrintSpoolerService extends Service {
for (int i = 0; i < files.length; i++) {
File file = files[i];
if (file.isFile() && file.getName().startsWith(PRINT_JOB_FILE_PREFIX)) {
- proto.write("print_job_files", PrintSpoolerInternalStateProto.PRINT_JOB_FILES,
- file.getName());
+ dumpStream.write("print_job_files",
+ PrintSpoolerInternalStateProto.PRINT_JOB_FILES, file.getName());
}
}
}
@@ -184,13 +184,13 @@ public final class PrintSpoolerService extends Service {
for (String approvedService : approvedPrintServices) {
ComponentName componentName = ComponentName.unflattenFromString(approvedService);
if (componentName != null) {
- writeComponentName(proto, "approved_services",
+ writeComponentName(dumpStream, "approved_services",
PrintSpoolerInternalStateProto.APPROVED_SERVICES, componentName);
}
}
}
- proto.flush();
+ dumpStream.flush();
}
@Override