History log of /frameworks/base/core/java/android/os/ShellCommand.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1704e3cf0c445512f0a9644485dd3449e874556b 31-Oct-2017 Dianne Hackborn <hackbod@google.com> The pm command is no more.

It is now just a shell of itself. :)

Also brings in a few fixes to never try to open files from the system
process.

Test: manual
Change-Id: Ia8187196af597046fd2e7092dbf19ce1dc1ea457
/frameworks/base/core/java/android/os/ShellCommand.java
ca3872ce36c94090ae18519dc7fe0cf39d834c4a 30-Oct-2017 Dianne Hackborn <hackbod@google.com> Fully implement "install" and "install-write" in PackageManagerShellCommand.

We can use the new mechanism to ask the calling shell to open
a file in order to implement the rest of these commands, allowing
you to give the path to an apk to install. That API is thus
extended to allow you to open readable files, not just opening
file for writing.

Doing this however means we no longer can pass a file path to
AssetManager for the apk to parse, we only have an already open
fd for that. Extending AssetManager to allow adding apks from
fds is not that hard, however, since the underlying zip library
already supports this.

This main thing this changes is in AssetManager.cpp where we
retrieve the open zip file for a particular apk that has been
added. This used to look up the zip file by path every time
it was needed, but that won't work anymore now that we can have
things added by fd. Instead, we keep track of each opened zip
in the AssetManager, so we can just directly retrieve it from
the asset_path representing the item that was added. As a
side-effect, this means for normal paths we no longer need to
look up by name, but just have the opened zip file directly
accessible. (This is probably good, but it does mean that we
no longer run the logic of seeing if the zip file's timestamp
has changed and re-opening it if it has. We probably shouldn't
be relying on that for an active AssetManager anyway, and maybe
it is even good that we don't allow the zip file to change
under it?)

A follow-up change will finally remove the Pm.java implementation
and turn the pm "command" into a simple shell script that runs
cmd package.

Test: manual

Change-Id: Ie103e3bdaa5b706796cc329254f2638151a3924f
/frameworks/base/core/java/android/os/ShellCommand.java
c81983a0c3d7bfe8384dbf48909f4bcf300e36d2 21-Oct-2017 Dianne Hackborn <hackbod@google.com> Start removing remaining pm code to package manager

Everything is now moved out of the pm command except for
the various install commands. I am going to hold of on
those since they require doing some resolution with the
current implementations in the package manager to make
sure they match and behave identically to the implementations
currently in the pm command. But other than that, everything
in pm is now just redirecting over to "cmd package".

Also fix up some of the dumpsys output of a few other sevices
when asking to print the data for a particular package, so
the "pm dump" command gives a little more sane result.

Test: manual

Change-Id: I139e06e560203b72243d7eea9543c2240db0f8f8
/frameworks/base/core/java/android/os/ShellCommand.java
f3409ceee59a006155915010b11af81a822225aa 07-Oct-2016 Leonard Mosescu <mosescu@google.com> Adding "attach-agent" to ActivityManagerShellCommand

This new command is used to attach runtime agents to a running application:

attach-agent <PROCESS> <FILE>
Attach an agent to the specified <PROCESS>,
which may be either a process name or a PID.

Test: m test-art-host, manual testing:
. invalid syntax, missing arguments
. invalid syntax, extra arguments
. invalid numeric PID
. invalid process name
. valid process, not debuggable
. valid process, missing agent
. valid process, valid agent

Bug: 31682382

Change-Id: Ife88dbf23991dde7945d9208e54cd014bb7ecdc6
/frameworks/base/core/java/android/os/ShellCommand.java
331084dca66ec2dc0b32f689c7a5c5252e0c7d3f 08-Oct-2016 Dianne Hackborn <hackbod@google.com> Move the remaining am commands to ActivityManagerShellCommand.

The only thing not removed is the "instrument" command, which
really needs to run Java code in the shell. We'll deal with
that later.

Test: manual
Change-Id: I9df0cdf831ac280cb0eb85c857d27166bc00604d
/frameworks/base/core/java/android/os/ShellCommand.java
354736e196ff79962b3ddb52619a674044d773e2 23-Aug-2016 Dianne Hackborn <hackbod@google.com> New infrastructure to switch remaining commands to "cmd" calls.

This introduces a new feature of the IBinder command protocol
to allow the shell command implementation to call back into
its caller to ask it to open files in the calling context. This
is needed so that commands that have arguments specifying files
can open those files as the calling shell, not the system (or
whatever) process.

To test this all out, move the "am start" implementation over
to ActivityManagerShellCommand, in particular along with its
option to specify a file in which to write profiling data.

Test: Manual

Change-Id: I0c1e3857defefbd19a2ac29413aafbb34b1e48a3
/frameworks/base/core/java/android/os/ShellCommand.java
c17d8b79afd02133b021d89b536c812578308329 04-Feb-2016 Filip Gruszczynski <gruszczy@google.com> Infrastructure for animating of maximizing pip activity.

Bug: 25672053
Change-Id: Ie8a83c626680e01ff7115f40731ab9e6c13769c0
/frameworks/base/core/java/android/os/ShellCommand.java
2e931f56c77cf53df9daf99d5afdd7bc4c109a54 28-Jan-2016 Dianne Hackborn <hackbod@google.com> Some small binder shell command improvements.

- Improve documentation.
- Add low-level access to input/output streams.

Change-Id: I3892be222d6fd919b164fa4e4882185940947f70
/frameworks/base/core/java/android/os/ShellCommand.java
3cdb56efea044112bfe1b97b3ed78ee05e0dba46 11-Nov-2015 Dianne Hackborn <hackbod@google.com> 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
/frameworks/base/core/java/android/os/ShellCommand.java
72cfcd02b89838264b018e9b9417d2829c87b7e2 04-Nov-2015 Todd Kennedy <toddke@google.com> Move 'un/install' to cmd

Move the implementation of the install variants and uninstall to the cmd
command. Additionally, make two other important changes: 1) replace calls
to the legacy PackageManager#installPackageAsUser with the PackageInstaller
2) allow streaming package bits for 'pm install'

Change-Id: I5680f57208d377daadb69b2cc09c233c02fe5016
/frameworks/base/core/java/android/os/ShellCommand.java
18bc3305e43a040018add48c97cfbc7b3d9ecf7c 09-Nov-2015 Todd Kennedy <toddke@google.com> Revert "Move 'un/install' to cmd"

This reverts commit ec059d839de6d061085dcfd85ce6565dcf4d5b69.

Change-Id: Ieaa1373e96fb4cc20aa41c3159518bd9e86c572b
/frameworks/base/core/java/android/os/ShellCommand.java
ec059d839de6d061085dcfd85ce6565dcf4d5b69 04-Nov-2015 Todd Kennedy <toddke@google.com> Move 'un/install' to cmd

Move the implementation of the install variants and uninstall to the cmd
command. Additionally, make two other important changes: 1) replace calls
to the legacy PackageManager#installPackageAsUser with the PackageInstaller
2) allow streaming package bits for 'pm install'

Change-Id: Ia49dac0ccd6470f9d1c1964bdeb3c0b22b856075
/frameworks/base/core/java/android/os/ShellCommand.java
2e44107bf7d9ad97833933422ccd241bf53ff50c 29-Oct-2015 Dianne Hackborn <hackbod@google.com> Implement shell commands for battery and activity services.

The battery service just implements the existing commands that
are available through dump.

The activity service implements the small set of commands that
are available through dump (not the rest of the dump commands),
and also introduces some of the simple "am" shell commands as
a proof-of-concept of moving those into the service implementation.

Change-Id: If5ff80930dde787703e2682e43c36ce1dab05d69
/frameworks/base/core/java/android/os/ShellCommand.java
9461b6f91f37fd32207da1bd734d9ea9629eb8e5 08-Oct-2015 Dianne Hackborn <hackbod@google.com> Add new "shell command" feature to Binder objects.

IBinder has a new common interface for sending shell commands
to it. This can be implemented by system services to provide
a shell interface to the service, without needing to have separate
shell java code.

This includes changes to DeviceIdleController to implement the
shell interface for all of the commands it has been providing
through dumpsys.

Change-Id: I76518ea6719d1d08a8ad8722a059c7f5fd86813a
/frameworks/base/core/java/android/os/ShellCommand.java