summaryrefslogtreecommitdiffstats
path: root/cmds/am
Commit message (Collapse)AuthorAgeFilesLines
* use findProcess instead of getProcessJohn Reck2015-07-241-1/+1
| | | | | Bug: 22701182 Change-Id: I2ec56c55c49401f2f213bbd318e867fd73b37672
* Support waiting for adb shell am stop-user to complete.Kenny Guy2015-07-211-3/+43
| | | | | | | | Use stop user callback to wait for AM.stopUser to complete if -w flag is passed to adb shell am stop-user bug: 22599411 Change-Id: I8adbfdbb1ba69a88a67431da65f0a85035587c2d
* Added sendBroadcastMultiplePermissions methodFyodor Kupolov2015-07-141-1/+3
| | | | | | | | | Added Context.sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) method, which allows an array of required permissions to be enforced. Bug: 21852542 Change-Id: I27c9130e8f004b428452501ebc8a36aabde1f343
* Grant installer and verifier install permissions robustlySvetoslav2015-07-071-1/+4
| | | | | | bug:22248271 Change-Id: I3a47ae9a112ba7d88b421fcb5f9651d1168ba7a5
* Teach receivers, activities, providers, and services app ops.Svet Ganov2015-07-011-1/+1
| | | | | | | | | | | | | Perform app op check in addition to the permisison check for all four paltform components - activities, content providers, broadcast receivers, services - if they are guarded by a permssion that has an associated app op. This ensures that legacy apps will behave correctly if the permission of the caller has been revoked, i.e. the app op for that permission was disabled. bug:22199666 Change-Id: Ia22d1c38d58b3cd6aabdc655cb7c7bddd85da7a2
* Allow callers holding PACKAGE_USAGE_STATS permission to call ↵Adam Lesinski2015-06-241-1/+1
| | | | | | | ActivityManager#getPackageImportance() Bug:22055550 Change-Id: I1e732e95698daf44bcb223cafde3d3c22746d232
* Fix issue #21814207 and issue #21814212 (alarm manager)Dianne Hackborn2015-06-171-2/+2
| | | | | | | | | | | | | | | | | Issue #21814207: AlarmManager.setAndAllowWhileIdle should also allow wake locks. Introduce a whole new infrastructure for providing options when sending broadcasts, much like ActivityOptions. There is a single option right now, asking the activity manager to apply a tempory whitelist to each receiver of the broadcast. Issue #21814212: Need to allow configuration of alarm manager parameters The various alarm manager timing configurations are not modifiable through settings, much like DeviceIdleController. Also did a few tweaks in the existing DeviceIdleController impl. Change-Id: Ifd01013185acc4de668617b1e46e78e30ebed041
* Added new options (--eial, --elal, --efal, and --esal) to pass multiple ↵Felipe Leme2015-06-101-2/+56
| | | | | | | | | | | extras as ArrayList instead of Array. BUG: 21757911 Change-Id: I7e2a9c81ad4606a8aba90ea4820ba0732a1c8749 modified: src/com/android/commands/am/Am.java On branch handles_array_list Changes to be committed: modified: src/com/android/commands/am/Am.java
* Adding am send-trim-memory commandStefan Kuhne2015-06-051-5/+62
| | | | | | | | | | | | | | This patch adds a send-trim-memory command to the ActivityManager to allow for better debugging&testing. The command is adb shell am send-trim-memory [--user <USER_ID>] <PROCESS> <LEVEL> whereas LEVEL can be one of the following: [HIDDEN|RUNNING_MODERATE|BACKGROUND|RUNNING_LOW|MODERATE| RUNNING_CRITICAL|COMPLETE] Bug: 21633189 Change-Id: I7a41ce02c3c9043ffd3e5aaa791f7b7306a9de49
* Rename *AppIdle to *AppInactive per api-councilAmith Yamasani2015-05-081-12/+12
| | | | | | | Change to setAppInactive and isAppInactive in a few places. Bug: 20823737 Change-Id: Ie57dbc0dd2842e771bb5fd9f69b8041aacaa005c
* Add ability to get and set idle state of appsAmith Yamasani2015-04-241-0/+51
| | | | | | | | | Add am shell command to set and get idle Add public API to check if an app is idle Bug: 20534955 Bug: 20493806 Change-Id: Ib48b3fe847c71f05ef3905563f6e903cf060c498
* Fail early when starting a background user activity.Wale Ogunwale2015-04-171-0/+5
| | | | | | | If it shouldn't be displayed for all users. Bug: 13507605 Change-Id: I8fe8e5a98759c1ca058cc7d222817f6d580ffa11
* Fixes to idle alarm scheduling, package importance.Dianne Hackborn2015-04-141-0/+15
| | | | | | | | | | | - Add new API to ask the activity manager what the current importance of a particular package name is (along with a few new useful importance levels). - Fix my last alarm manager change to actually execute the alarms we have now decided should run even while we are idle. Change-Id: I1f14712b4e390770d53b185c96a1b36f6aadd687
* Various fixes and improvements...Dianne Hackborn2015-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #19912529: VI: VoiceInteractor callback ClassCastException Fix to use correct argument. Issue #19912636: VI: Documentation for VoiceInteractionSession.onBackPressed Added documentation. Issue #19912703: VI: VoiceInteractionSession NPE on Abort Request Maybe fix this -- don't crash if there is no active session. Issue #19953731: VI: Add value index to... ...android.app.VoiceInteractor.PickOptionRequest.Option There is now an optional index integer that can be associated with every Option object. Issue #19912635: VI: Behavior of startActivity when in voice... ...interaction is unexpected We now forcibly finish the current voice interaction task whenever another activity takes focus from it. Issue #20066569: Add API to request heap dumps New ActivityManager API to set the pss limit to generate heap dumps. Also added app ops for assist receiving structure and screenshot data, so that we can track when it does these things. Change-Id: I688d4ff8f0bd0b8b9e3390a32375b4bb7875c1a1
* Add --sampling to am profile startJohn Reck2015-03-261-2/+5
| | | | Change-Id: I00dfdef6a7ac61ab4ce16fefe1ddc5554ace0c88
* Add new debug feature to automatically create heap dumps.Dianne Hackborn2015-03-061-0/+22
| | | | | | | | | | | | | | | | | Not yet working, unless you turn off SELinux enforcing. We need to update SElinux to allow the system process to give apps access to /data/system/heapdump/javaheap.bin. Currently watching can only be enabled through the shell, such as: adb shell am set-watch-heap com.android.systemui 1024 The last number is the process pss size in bytes, so this is asking us to warn if it goes about 1K which will be all the time. Change-Id: I2089e5db2927afca0bf01a363c6247ee5dcb26e8
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-1/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* Added ActivityManager API and AM command to resize a task.Wale Ogunwale2015-02-241-28/+58
| | | | | | | Also fixed issue with ActivityStackSupervisor.moveTaskToStackLocked() functionality not working correctly. Change-Id: Ia13f1e92a7c59ce6543c226533ac8ea623488290
* Fixed bug in 'am stack split' command.Wale Ogunwale2015-02-121-2/+4
| | | | Change-Id: Id3efb65a3f9cbf3c223ea08d51e2028180bd5479
* Am command to split a stack.Wale Ogunwale2015-02-111-1/+67
| | | | Change-Id: Idf3a364fc3826f6fe92f55b5c83b16b380d62ff4
* Support for activity to opt-in/out of resizeable/multi-window support.Wale Ogunwale2015-02-021-6/+35
| | | | | Bug: 19178148 Change-Id: I5819a71cdc48e0af4add11a6d4a503ec5cbe5d63
* Show stacks underneath a resized stackTodd Kennedy2015-01-301-0/+16
| | | | | | | | | When a stack is resized, make sure any non-fullscreen stack beneath it becomes visible. This may mean additional activities are resumed in the process. Bug: 19083171 Change-Id: I5e7a3f82d76932ea2b9dbf0324ea183c42ee5496
* Expose new binder call createStackOnDisplay()Todd Kennedy2015-01-201-5/+4
| | | | | | | | Creates a new, empty ActivityStack on a display. Use the binder call to launch an activity on said stack. Bug: 19001243 Change-Id: I0f04e8f2703bcc706f58e75333869fb35f6b1ee9
* Rename the binder call createActivityContainerTodd Kennedy2015-01-151-1/+2
| | | | | | | Change the call to createVirtualActivityContainer to better describe what's actually being created with the call. Change-Id: Id3a32df19a5bb6740cbabcd65897349e9f2f2946
* Better am error when SELinux blocking access.Jeff Sharkey2014-11-241-3/+21
| | | | | Bug: 18479882 Change-Id: I0732e54838c4e04d9d727e7c5fd9d7e7bacbaa1f
* Fix issue #15828903: Intent.parseUri allows call to FLAG_GRANT_*_URI_PERMISSIONDianne Hackborn2014-11-201-4/+1
| | | | | | You now need to set a flag if you want this unsafe behavior. Change-Id: I185e9a04e005e42a887c3d58a2818616790b060a
* Add Activity API to get referrer information.Dianne Hackborn2014-11-111-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This expands the use of EXTRA_REFERRER to be relevant anywhere, allowing apps to supply referrer information if they want. However, if they don't explicitly supply it, then the platform now keeps track of package names that go with Intents when delivering them to apps, which it can be returned as the default value. The new method Activity.getReferrer() is used to retrieve this referrer information. It knows about EXTRA_REFERRER, it can return the default package name tracked internally, and it also can return a new EXTRA_REFERRER_NAME if that exists. The latter is needed because we can't use EXTRA_REFERRER in some cases since it is a Uri, and things like #Intent; URI extras can only generate primitive type extras. We really need to support this syntax for referrers, so we need to have this additional extra field as an option. When a referrer is to a native app, we are adopting the android-app scheme. Since we are doing this, Intent's URI creation and parsing now supports this scheme, and we improve its syntax to be able to build intents with custom actions and stuff, instead of being all hung up on custom schemes. While doing this, fixed a problem when parsing both intent: and new android-app: schemes with a selector portion, where we were not respecting any scheme that was specified. Change-Id: I06e55221e21a8156c1d6ac755a254fea386917a2
* More flexible intent extra parsing.Daniel Sandler2014-10-291-4/+19
| | | | | | | | | | | | | | | Specifically, --ei (int extras) and --eia (int[] extras) now use Integer.decode(), which means they accept negative integers, base-16 integers formatted as #NNN and 0xNNN, and base-8 integers formatted as 0NNN. Additionally, --ez (boolean extras) can now be specified as "true", "false", "t", "f", or an integer (any nonzero treated as true). The previous behavior, based on Boolean.valueOf(), would silently assign false if you managed to get the spelling of "true" wrong. Change-Id: I058254e907308006d403b5b7866c86bcaa03d8d3
* Improve some docs, fix some debugging.Dianne Hackborn2014-10-091-5/+3
| | | | | | | | | | | | | | | | | | - Add docs to Binder, Messenger, ResultReceier to explain their relation (or lack there-of) to process lifecycle. - Clarify some aspects of process lifecycle for services. - Fix help text of am command. - Fix per-package dumping of battery stats to not include history. - Fix per-package dumping of proc stats to only include aggregated and current stats and fix some formatting. - Fix per-process dumping of meminfo to have an option to interpret the input as a package, so including all processes that are running code of that package. - Fix top-level per-package debug output to correctly include all of these improvements and give them a little more time (10s) to complete for timing out. Change-Id: I2a04c0f862bd47b08329443d722345a13ad9b6e2
* Adds the ability to start a user in backgroundAlexandra Gherghina2014-09-291-1/+17
| | | | | Bug: 15900074 Change-Id: I03b278f8e7a4618ea56a5f1935cfba34beb45981
* Fix issue #17536024: The am start's wait option doesn't...Dianne Hackborn2014-09-171-0/+4
| | | | | | | | | | | | | | | | | | | ...give time in some cases This switch to multiple stacks broke the check to determine if it should actually wait for a new activity to be shown. The new check now also requires that the top activity be resumed, which means we may get some false positives where we decide to wait and shouldn't, but that is better than consistently not deciding to wait in some cases when we should. (And we will always finish waiting then next time something becomes visible). Also add another time, which is how long it took from the startActivity call to return with the result. And fix when we decide to report that we are done so that, in the case where we are bringing an existing activity to the foreground, we don't wait until its animation is complete. Change-Id: Id38ca0070f04e7bf8c73e131fb055808553a0e2f
* Merge "Apply cross-user restrictions to Shell" into lmp-devAmith Yamasani2014-09-111-1/+1
|\
| * Apply cross-user restrictions to ShellAmith Yamasani2014-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though Shell user is allowed to perform cross-user actions, lock that path down if the target user has restrictions imposed by the profile owner device admin that prevents access via adb. If the profile owner has imposed DISALLOW_DEBUGGING_FEATURES, don't allow the shell user to make the following types of calls: start activities, make service calls, access content providers, send broadcasts, block/unblock packages, clear user data, etc. Bug: 15086577 Change-Id: I9669fc165953076f786ed51cbc17d20d6fa995c3
* | Output recent configs in am get-config commandAdam Lesinski2014-09-101-0/+77
|/ | | | Change-Id: Ic516e73d2e72ac0dc3136f7226cedd851fe22b85
* Add sample profiling option to am.Jeff Hao2014-08-261-10/+23
| | | | | | | Also bundles all profiling options into a class. Bug: 17040932 Change-Id: I85d675ee1494bdc7308caffdf94145d27c996e9d
* Turn on debugging override of idle timeChristopher Tate2014-07-251-1/+1
| | | | | | | | | | | 'adb shell am idle-maintenance' has traditionally been used to force the system to consider itself to be in an "idle" state. Unfortunately the new Job Manager hadn't yet been aware of this. Rectify the situation. Also fixes a bug in debug logging that would cause a system server crash under certain race circumstances. Change-Id: I8a29bd7757924f8e464865235c344233fc03d8c3
* Change am get-config command to use ABI string arrayAdam Lesinski2014-06-171-5/+2
| | | | | | | | There is a list of supported ABIs in android.os.Build which is ordered by preference. This is a more flexible list to use instead of 2 fixed ABIs. Change-Id: I6aa3b39b5ffa888ed83a870b937e18328dd6de39
* New command to get device configAdam Lesinski2014-06-161-2/+29
| | | | Change-Id: I7172a3a150fd83e2382ca3e4e4a0188758189f14
* am f7871c31: am b9b31f4b: am bd4d3203: Merge "Support an ABI flag for ↵Narayan Kamath2014-05-301-2/+29
|\ | | | | | | | | | | | | instrumentation." * commit 'f7871c31469c6245c1b232a15104704f7481103c': Support an ABI flag for instrumentation.
| * am b9b31f4b: am bd4d3203: Merge "Support an ABI flag for instrumentation."Narayan Kamath2014-05-301-2/+29
| |\ | | | | | | | | | | | | * commit 'b9b31f4b8eda123e7b544d1a0fa886576064adca': Support an ABI flag for instrumentation.
| | * Support an ABI flag for instrumentation.Narayan Kamath2014-05-161-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows us to choose what ABI a process uses when launching it with "adb shell am instrument", for eg. adb shell am instrument --abi arm64-v8a component/runner Note that we only perform very basic validation of the ABI. In general, there is no guarantee that the app will launch with the instruction set we choose, for eg. if it has native libraries that are for a different ABI. bug: 14453227 Change-Id: Ifb7e89b53675080dc87941091ee5ac360f218d7f
* | | Initial implementation of new voice interaction API.Dianne Hackborn2014-04-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives a basic working implementation of a persist running service that can start a voice interaction when it wants, with the target activity(s) able to go through the protocol to interact with it. It may even work when the screen is off by putting the activity manager in the correct state to act like the screen is on. Includes a sample app that is a voice interation service and also has an activity it can launch. Now that I have this initial implementation, I think I want to rework some aspects of the API. Change-Id: I7646d0af8fb4ac768c63a18fe3de43f8091f60e9
* | | Allow prefix-based Uri permission grants.Jeff Sharkey2014-04-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define new FLAG_GRANT_PREFIX_URI_PERMISSION which indicates that a Uri permission grant should also apply to any other Uris that have matching scheme, authority, and path segments. For example, a prefix grant for /foo/ would allow /foo/bar/ but not /foo2/. Allow persistable and prefix grants to be issued directly through grantUriPermission(). Relaxing persistable is fine, since it still requires the receiver to actively take the permission. Since exact- and prefix-match grants for the same Uri can coexist, we track them separately using a new UriGrant key. (Consider the case where an app separately extends READ|PREFIX and WRITE for the same Uri: we can't let that become READ|WRITE|PREFIX.) Fix revoke to always take away persisted permissions. Move prefix matching logic to Uri and add tests. Add new flags to "am" tool, and various internal uses around Intent and Context. Switch some lagging users to ArraySet. Bug: 10607375 Change-Id: Ia8ce2b88421ff9f2fe5a979a27a026fc445d46f1
* | | Add Lock Task Mode.Craig Mautner2014-03-131-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | When in lock task mode only the specified task may run. All attempts to switch to another task are ignored until the task finishes or a call to stopLockTaskMode() is made. Change-Id: I6cfe92fe1bcf22cd47b5398c08e23c52a4092dda
* | | Adds support for array string extra.Dale Hawkins2014-02-261-0/+11
|/ / | | | | | | | | | | | | | | Adds support for setting an array string extra on an intent when launching an activity/service. Allows inclusion of commas using an escape character. Change-Id: I8857f7d28d60b75ddc65dc47f345a77230d00467
* | Extend stack management to other displays.Craig Mautner2014-01-061-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Abandon ActivityContainer.startActivity() in favor of IActivityManager.startActivityAsUserInContainer(). - Modify Am to test starting an activity on a container. - Create a DisplayContext as the base context if the activity token is on a different display. - Test for home display in more cases when manipulating home stack. - Rename mDisplayInfos => mActivityDisplays. - Create new method for moving task to front of stack regardless of which display it is on. Change-Id: I4fcb83ae844c5839ee3e2722229623d1a80ed921
* | Pair ActivityStacks with DisplaysCraig Mautner2013-12-181-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | - Introduce concept of ActivityStacks residing on Displays and able to be decoupled and moved around. - Add a new interface, IActivityContainer for clients to handle ActivityStacks. - Abandon ordering of stacks based on mStackState and instead use ActivityDisplayInfo.stacks<ActivityStack> ordering. Progress towards closing bug 12078972. Change-Id: I7785b61c26dc17f432a4803eebee07c7415fcc1f
* | DO NOT MERGE: Eliminate StackBox.Craig Mautner2013-12-091-43/+36
|/ | | | | | | | StackBox is too constraining. Adding size and position to TaskStacks directly makes stack positioning and management more flexible and prepares for ActivityView. Change-Id: I33c6b4e1c23a5a8069fd507c160bcb34e4d287b2
* Fix am argument ordering documentation.Jeff Sharkey2013-11-141-1/+1
| | | | | Bug: 11690520 Change-Id: I84b10a6eb6e6404212ab9737e7cee1f1ad4d5309
* Implement issue #10691359: Kill long-running processesDianne Hackborn2013-09-161-0/+19
| | | | | | | | | | | | | | | | | | | | | We now have the activity manager kill long-running processes during idle maintanence. This involved adding some more information to the activity manager about the current memory state, so that it could know if it really should bother killing anything. While doing this, I also improved how we determine when memory is getting low by better ignoring cases where processes are going away for other reasons (such as now idle maintenance). We now won't raise our memory state if either a process is going away because we wanted it gone for another reason or the total number of processes is not decreasing. The idle maintanence killing also uses new per-process information about whether the process has ever gone into the cached state since the last idle maintenance, and the initial pss and current pss size over its run time. Change-Id: Iceaa7ffb2ad2015c33a64133a72a272b56dbad53