diff options
| author | 2013-10-02 12:40:14 -0700 | |
|---|---|---|
| committer | 2013-10-02 12:40:18 -0700 | |
| commit | b67a637e60c356ab520050b2bd09a95ae47f3017 (patch) | |
| tree | 87c8eb4593a3f25a88e58faa48a6055b1b7bddf9 | |
| parent | 93cb8f6b78079f10836377e825c7f7b63b8e7c21 (diff) | |
IndexOutOfBoundsException in the PrintSpoolerService dump.
The dump code in PrintSpoolerService was relying on being
called only as a result of "adb shell dumpsys print" which
is apparently wrong. As a result the code was making wrong
assumption about the input arguments.
bug:11046234
Change-Id: Ie38f3cc5f17cac98b808fef6d6bbeaca22a62ef0
| -rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java b/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java index 87181f74ed0e..d1d71cd03176 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java +++ b/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java @@ -236,7 +236,7 @@ public final class PrintSpoolerService extends Service { @Override protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { synchronized (mLock) { - String prefix = args[0]; + String prefix = (args.length > 0) ? args[0] : ""; String tab = " "; pw.append(prefix).append("print jobs:").println(); |