summaryrefslogtreecommitdiff
path: root/core/java/android/os/ShellCommand.java
Commit message (Collapse)AuthorAgeFilesLines
* Move BasicShellCommandHandler to frameworks/lib/modules-utilsChiachang Wang2020-11-181-7/+1
| | | | | | | | | | | | BasicShellCommandHandler is used by mainline modules and the framwork. There is a new repo that was created for putting this kind of utility class. Move BasicShellCommandHandler for the incoming ConnectivityService mainline and updating the related usage. Bug: 170598012 Test: m ; verify with adb shell cmd Change-Id: Ida30c877116090616d4bf3f87fdad835446dac84
* Revert "Move BasicShellCommandHandler to frameworks/lib/modules-..."Dan Shi2020-11-121-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Revert "Update import path of BasicShellCommandHandler" Revert "Update path for BasicShellCommandHandler" Revert "Update path for BasicShellCommandHandler" Revert "Update rule for BasicShellCommandHandler" Revert submission 12975279-move_BSCH Reason for revert: b/173120275 Reverted Changes: Ib750f4774:Move BasicShellCommandHandler I43c0dc327:Update import path of BasicShellCommandHandler I73d58c07c:Update path for BasicShellCommandHandler I21f103949:Update path for BasicShellCommandHandler I8a2873df6:Move BasicShellCommandHandler to frameworks/lib/mo... I91df774a3:Update rule for BasicShellCommandHandler Exempt-From-Owner-Approval: to fix b/173120275 Change-Id: Iaa44f9aa4c1621f331275dc76ecb7505100fe9c5
* Move BasicShellCommandHandler to frameworks/lib/modules-utilsChiachang Wang2020-11-101-7/+1
| | | | | | | | | | | | BasicShellCommandHandler is used by mainline modules and the framwork. There is a new repo that was created for putting this kind of utility class. Move BasicShellCommandHandler for the incoming ConnectivityService mainline and updating the related usage. Bug: 170598012 Test: m ; verify with adb shell cmd Change-Id: I8a2873df6e7d8342b7a8b466bda155f74c807ee3
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-1/+1
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-1/+1
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-1/+1
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I534e3fd1305e2f4af076986770033478448a665c
* Bidner shell command API proposalMakoto Onuki2019-11-051-280/+15
| | | | | | | | Bug: 142751512 Test: "adb shell cmd jobschduler help" Test: "adb shell cmd activity help" Change-Id: I9174040cae72172e82d260d0ceb9ca5a69b72940
* Add @UnsupportedAppUsage annotationsAndrei Onea2019-03-151-0/+2
| | | | | | | | | | | | | | | | For packages: android.os This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I4ece0a3f37f88fc2508cb965092aed7cabc61819
* Merge "Don't suggest writing to /tmp if we already are"Robin Lee2018-04-271-1/+5
|\
| * Don't suggest writing to /tmp if we already areRobin Lee2017-12-181-1/+5
| | | | | | | | | | | | | | | | | | | | Small fix to not write the suggestion line about saving to /data/local/tmp/ if that's what we're already trying to do but the actual problem is file permissions (eg from adb unroot) Test: adb shell am dumpheap com.android.systemui /data/local/tmp/systemui.hprof Test: adb shell am dumpheap com.android.systemui /tmp/systemui.hprof Change-Id: I201456a4a72e3d5c988a14590374b2dd559b97d2
* | The pm command is no more.Dianne Hackborn2017-11-211-1/+11
| | | | | | | | | | | | | | | | | | | | 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
* | Fully implement "install" and "install-write" in PackageManagerShellCommand.Dianne Hackborn2017-10-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Start removing remaining pm code to package managerDianne Hackborn2017-10-251-1/+36
|/ | | | | | | | | | | | | | | | | | 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
* Adding "attach-agent" to ActivityManagerShellCommandLeonard Mosescu2016-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Move the remaining am commands to ActivityManagerShellCommand.Dianne Hackborn2016-10-101-0/+19
| | | | | | | | | 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
* New infrastructure to switch remaining commands to "cmd" calls.Dianne Hackborn2016-09-291-4/+13
| | | | | | | | | | | | | | | | | 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
* Infrastructure for animating of maximizing pip activity.Filip Gruszczynski2016-02-041-0/+10
| | | | | Bug: 25672053 Change-Id: Ie8a83c626680e01ff7115f40731ab9e6c13769c0
* Some small binder shell command improvements.Dianne Hackborn2016-01-281-6/+74
| | | | | | | - Improve documentation. - Add low-level access to input/output streams. Change-Id: I3892be222d6fd919b164fa4e4882185940947f70
* Some debugging improvements.Dianne Hackborn2015-11-111-5/+21
| | | | | | | | | | | | | | - 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
* Move 'un/install' to cmdTodd Kennedy2015-11-091-0/+11
| | | | | | | | | 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
* Revert "Move 'un/install' to cmd"Todd Kennedy2015-11-091-11/+0
| | | | | | This reverts commit ec059d839de6d061085dcfd85ce6565dcf4d5b69. Change-Id: Ieaa1373e96fb4cc20aa41c3159518bd9e86c572b
* Move 'un/install' to cmdTodd Kennedy2015-11-061-0/+11
| | | | | | | | | 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
* Implement shell commands for battery and activity services.Dianne Hackborn2015-10-291-1/+2
| | | | | | | | | | | | 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
* Add new "shell command" feature to Binder objects.Dianne Hackborn2015-10-121-0/+192
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