diff options
| author | Dianne Hackborn <hackbod@google.com> | 2015-11-11 12:45:44 -0800 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2015-11-11 12:45:44 -0800 |
| commit | 3cdb56efea044112bfe1b97b3ed78ee05e0dba46 (patch) | |
| tree | 7ce08b219efec3083b9d7399ac5e795c06068724 /core/java/android/os/ShellCommand.java | |
| parent | 609b5b8c8e22ab0ea1caca1fed42cdf891c853c6 (diff) | |
Some debugging improvements.
- Fix dumping of package manager intent filters so the option
to print the filter detail works again.
- Extend dump resolvers to allow you to specify the specific
types of resolvers you'd like to dump.
- Add new package manager commands for querying activities,
services, receivers.
- Move the code for parsing a command line into an intent to
the framework, so it can be used by the new package manager
commands and later elsewhere.
Change-Id: I56ea2bb8c3dd0e5198ee333be8f41ad9dcdb626f
Diffstat (limited to 'core/java/android/os/ShellCommand.java')
| -rw-r--r-- | core/java/android/os/ShellCommand.java | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/core/java/android/os/ShellCommand.java b/core/java/android/os/ShellCommand.java index cad482b6bab9..6f12b625318f 100644 --- a/core/java/android/os/ShellCommand.java +++ b/core/java/android/os/ShellCommand.java @@ -48,19 +48,35 @@ public abstract class ShellCommand { private FastPrintWriter mErrPrintWriter; private InputStream mInputStream; - public int exec(Binder target, FileDescriptor in, FileDescriptor out, FileDescriptor err, - String[] args, ResultReceiver resultReceiver) { + public void init(Binder target, FileDescriptor in, FileDescriptor out, FileDescriptor err, + String[] args, int firstArgPos) { mTarget = target; mIn = in; mOut = out; mErr = err; mArgs = args; - mResultReceiver = resultReceiver; - mCmd = args != null && args.length > 0 ? args[0] : null; - mArgPos = 1; + mResultReceiver = null; + mCmd = null; + mArgPos = firstArgPos; mCurArgData = null; mOutPrintWriter = null; mErrPrintWriter = null; + } + + public int exec(Binder target, FileDescriptor in, FileDescriptor out, FileDescriptor err, + String[] args, ResultReceiver resultReceiver) { + String cmd; + int start; + if (args != null && args.length > 0) { + cmd = args[0]; + start = 1; + } else { + cmd = null; + start = 0; + } + init(target, in, out, err, args, start); + mCmd = cmd; + mResultReceiver = resultReceiver; if (DEBUG) Slog.d(TAG, "Starting command " + mCmd + " on " + mTarget); int res = -1; |
