summaryrefslogtreecommitdiffstats
path: root/cmds/am
Commit message (Collapse)AuthorAgeFilesLines
* Further work on issue #7307399: Framework needs a new pre-user-shutdown...Dianne Hackborn2012-10-091-0/+4
| | | | | | | | | | | | | | | ...phase & callback API I realized there were a few things wrong with what was there. The new ACTION_USER_STARTING was not being sent for the first user at boot, and there was an existing problem where ACTION_USER_STARTED was sent every time there was a user switch. Also improved some debug output of broadcasts to make it easier to see what is going on in this stuff, and better reporting of why a service couldn't be started. Change-Id: Id8a536defbbad1f73d94a37d13762436b822fbe3
* Fix issue #7211769 and #7244492, thrash around on #7226656.Dianne Hackborn2012-09-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #7211769: Crash dialog from background user has non-working "report" The report button now launches the issue reporter for the correct user. Also for crashes on background users, either disable the report button, or simply don't show the dialog depending on the build config. Issue #7244492: Bugreport button in Quick Settings doesn't actually do anything Now they do. Issue #7226656: second user seeing primary user's apps I haven't had any success at reproducing this. I have tried to tighten up the path where we create the user to ensure nothing could cause the user's applications to be accessed before the user it fully created and thus make them installed... but I can't convince myself that is the actual problem. Also tightened up the user switch code to use forground broadcasts for all of the updates about the switch (since this is really a foreground operation), added a facility to have BOOT_COMPELTED broadcasts not get launched for secondary users and use that on a few key system receivers, fixed some debug output. Change-Id: Iadf8f8e4878a86def2e495e9d0dc40c4fb347021
* Maybe fix issue #7211766: bindService() to User u0 While u10 is...Dianne Hackborn2012-09-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | ...Forground Sometimes Doesn't Take The main change here is a one-liner in ActiveServices to check the uid when deciding whether to remove an item from mPendingServices. This could cause the problem being seen -- if the same service for two users is starting at the same time, the second one would blow away the pending start of the first one. Unfortunately I have had trouble reproducing the bug, so I don't know if this is actually fixing it. It's a bug, anyway. The reason so much has changed here is because I spread around logging and printing of the user ID associated with operations and objects to make it easier to debug these kind of multi-user things. Also includes some tweaks to the oom manager to allow more background processes (I have seen many times in logs where we thrash through processes because the LRU list is too short), plus to compensate an additional time-based metric for when to get rid of background processes, plus some new logic to try to help things like Chrome keep around their service processes. Change-Id: Icda77fb2a1dd349969e3ff2c8fff0f19b40b31d3
* Allow adb shell am display-size to use bigger sizes.Jeff Brown2012-09-101-15/+9
| | | | | | | | | | We now support scaling the logical display to fit the physical display, whatever size it is. So we can allow adb shell am display-size to use more or less arbitrary sizes although we do enforce an upper and lower bound to protect the user. Change-Id: I5fe6ba32ad1f9e4fbcd6915f7d36850b987bbcc0
* Flesh out multi-user in am commands.Dianne Hackborn2012-09-101-35/+116
| | | | | | | | | | | | Now we default to the current user instead of user 0 for most commands (except where we can do the command for all users). Many more commands take a user argument: force-stop, kill, profile, dumpheap. Improved help text. Change-Id: I719a13b4d31b668f57ca21e51d7043ac3e0d4e1b
* Merge "More multi-user stuff:" into jb-mr1-devDianne Hackborn2012-09-071-7/+40
|\
| * More multi-user stuff:Dianne Hackborn2012-09-071-7/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New (hidden) isUserRunning() API. - Maintain LRU list of visited users. - New FLAG_IS_DATA_ONLY for ApplicationInfo. - Clean up pending intent records when force-stopping a user (or package). (Also fixes bug #6880627: PendingIntent.getService() returns stale intent of force stopped app) - Fix force-stopping when installing an app to do the force-stop across all users for that app. - When selecting which processes to kill during a force stop, do this based on the actual packages loaded in the process, not just process name matching. - You can now use --user option in am when starting activities, services, and instrumentation. - The am --user option accepts "current" and "all" as arguments. - The pm uninstall command now uninstalls for all users, so it matches the semantics of the install command. - PhoneWindowManager now explicitly says to start home in the current user. - Activity manager call to retrieve the MIME type from a content provider now takes a user argument, so it will direct this to the proper user. - The package manager uninstall paths are now implemented around PackageSetting, not PackageParser.Package. This allows them to work even if the application's apk has been removed (in which case it only exists as a PackageSetting, not the PackageParser.Package parsed from the apk). Change-Id: I3522f6fcf32603090bd6e01cc90ce70b6c5aae40
* | Wrapped call to notifyAll() in a synchronized blockFelipe Leme2012-09-061-2/+4
|/ | | | | Change-Id: I452caa56bef4541b53917bdd6f22034161255dd1 Bug: 7118468
* Fix my fix.Dianne Hackborn2012-09-041-2/+2
| | | | Change-Id: I35fce760f8d91fceb554d372e7423749a4ac6d2d
* Fix build.Dianne Hackborn2012-09-041-3/+3
| | | | Change-Id: I15592889b8679d946e402dcfdeb124df349cbd4d
* Start implementing concept of "running" users.Dianne Hackborn2012-08-281-13/+26
| | | | | | | | | | | | | | | | | | | | | | The activity manager now keeps track of which users are running. Initially, only user 0 is running. When you switch to another user, that user is started so it is running. It is only at this point that BOOT_COMPLETED is sent for that user and it is allowed to execute anything. You can stop any user except user 0, which brings it back to the same state as when you first boot the device. This is also used to be able to more cleaning delete a user, by first stopping it before removing its data. There is a new broadcast ACTION_USER_STOPPED sent when a user is stopped; system services need to handle this like they currently handle ACTION_PACKAGE_RESTARTED when individual packages are restarted. Change-Id: I89adbd7cbaf4a0bb72ea201385f93477f40a4119
* Restore man page entries.Dianne Hackborn2012-08-271-0/+1
| | | | Change-Id: I002808037ec117c039aeb71f425c1f43d4cac6d8
* Keep track of whether an app is installed for each user.Dianne Hackborn2012-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This add a new per-user state for an app, indicating whether it is installed for that user. All system apps are always installed for all users (we still use disable to "uninstall" them). Now when you call into the package manager to install an app, it will only install the app for that user unless you supply a flag saying to install for all users. Only being installed for the user is just the normal install state, but all other users have marked in their state for that app that it is not installed. When you call the package manager APIs for information about apps, uninstalled apps are treated as really being not visible (somewhat more-so than disabled apps), unless you use the GET_UNINSTALLED_PACKAGES flag. If another user calls to install an app that is already installed, just not for them, then the normal install process takes place but in addition that user's installed state is toggled on. The package manager will not send PACKAGE_ADDED, PACKAGE_REMOVED, PACKAGE_REPLACED etc broadcasts to users who don't have a package installed or not being involved in a change in the install state. There are a few things that are not quite right with this -- for example if you go through a full install (with a new apk) of an app for one user who doesn't have it already installed, you will still get the PACKAGED_REPLACED messages even though this is technically the first install for your user. I'm not sure how much of an issue this is. When you call the existing API to uninstall an app, this toggles the installed state of the app for that user to be off. Only if that is the last user user that has the app uinstalled will it actually be removed from the device. Again there is a new flag you can pass in to force the app to be uninstalled for all users. Also fixed issues with cleaning external storage of apps, which was not dealing with multiple users. We now keep track of cleaning each user for each package. Change-Id: I00e66452b149defc08c5e0183fa673f532465ed5
* We can now (kind-of) change screen density on the fly.Dianne Hackborn2012-08-031-0/+43
| | | | | | | | | | | | | | | | | | | | | Preloaded drawables now have a density associated with them, so we can load the correct drawable if we are using a different density. Window manager now formally keeps track of the density for each screen, allowing it to be overridden like you can already do with size, and relies on this density to drive itself internally and the configurations it reports. There are a new set of Bitmap constructors where you provide a DisplayMetrics so they can be constructed with the correct density. (This will be for when you can have different windows in the same app running at different densities.) ActivityThread now watches for density changes, and pushes them to the DENSITY_DEVICE and Bitmap global density values for that process. A new am command allows you to change the density.
* Introduce multiple displays with DisplayContent.Craig Mautner2012-08-021-2/+4
| | | | | | | | Fix a couple of bugs that turned up. Remove touch/focus from display. Add iterators for access. Respond to comments. Remove TODOs, and some deviceId parameters. Change-Id: Idcdb4f1979aa7b14634d450fd0333d6eff26994d
* Remove some unnecessary man page entriesAmith Yamasani2012-05-301-1/+0
| | | | Change-Id: I1ceda3f5efac83b80ab4b6e7cae4086aeed5062a
* Remove unused, obsolete debug codeRomain Guy2012-05-211-6/+2
| | | | | | | All these features have either been abandonned and left un-maintained for years or can be replaced by systrace. Change-Id: I42e4579a8078744047e5fe08a7a15254970b09bc
* Fix issue #4499996: LiveWallpaperPreview activity intent filterDianne Hackborn2012-04-191-0/+7
| | | | Change-Id: I5fc71503d2c59c907da954dbda3587394e6405bf
* Package restrictions per userAmith Yamasani2012-03-221-3/+9
| | | | | | | | | | | | | | | | | | | Packages can be enabled/disabled per user. This requires maintaining stopped/launched states and enabled / disabled components and packages per user. Refactored pm.Settings and PackageSettingsBase to keep track of states per user. Migrated the stopped-packages.xml to users/<u>/package-restrictions.xml Changed intent resolution to handle individual user restrictions. Bunch of IPackageManager calls now have a userId argument. Make AppWidgetService handle removals of packages. Added some tests for pm.Settings and PackageManager. Change-Id: Ia83b529e1df88dbcb3bd55ebfc952a6e9b20e861
* Add new "options" argument to all startActivity APIs.Dianne Hackborn2012-03-141-25/+17
| | | | | | | | This will be used to allow new features to be requested... such as, say, a special kind of animation. Right now there are no options defined. Change-Id: I4eb6f27275cdd4bf186f6da316ab93a2372ad4b7
* ActivityManager: add option to allow OpenGL trace.Siva Velusamy2012-03-121-4/+12
| | | | | | | | | This patch adds an option to enable tracing of OpenGL functions. OpenGL tracing can be enabled by passing "--opengl-trace" option to am start. This option requires either a device in debug mode, or that the application itself has debug permission set. Change-Id: I77788bfe97c9108943b1f947ce81afe8293d78a0
* Add the ability to pass float extras to AM.Mike J. Chen2012-02-101-0/+18
| | | | | | | | | | | | | | | | | commit 43a2825a283e29c0f70100146394957af0598b0e Author: John Grossman <johngro@google.com> Date: Wed Apr 27 09:03:53 2011 -0700 Add the ability to pass float extras to AM. Change-Id: I970ad3f76a65bd781099204019095c73ed8c09db Signed-off-by: Mike J. Chen <mjchen@google.com> Signed-off-by: John Grossman <johngro@google.com> Conflicts: cmds/am/src/com/android/commands/am/Am.java
* Multi-user - 1st major checkinAmith Yamasani2012-02-031-1/+13
| | | | | | | | | | | | | | | Switching activity stacks Cache ContentProvider per user Long-press power to switch users (on phone) Added ServiceMap for separating services by user Launch PendingIntents on the correct user's uid Fix task switching from Recents list AppWidgetService is mostly working. Commands added to pm and am to allow creating and switching profiles. Change-Id: I15810e8cfbe50a04bd3323a7ef5a8ff4230870ed
* Fix issue #5714517: App shortcuts can result in bad task intentsDianne Hackborn2011-12-051-29/+68
| | | | | | | | New API to let you build an Intent whose base configuration is correct, but has an additional "selector" to pick out the specific app that you would like launched. Change-Id: Ide9db6dc60e2844b7696cfe09b28337fe7dd63db
* Improve low memory dropbox reporting.Dianne Hackborn2011-11-151-0/+37
| | | | | | | | | | | | | | | The msg is now constructed to try to bin these reports in interesting ways. We'll see. Also change the tag name from watchdog to lowmem, since sharkey is kindly taking care of the back-end to handle this. Improve how we put processes into low memory states to better poke things like home and the previous app. Also clean up some debug output, and add a few new am comment options for controlling the current debug app. Change-Id: I562a931a95244a2727bb7a6e1fd80dec259cdae2
* Add drop box reports of low memory.Dianne Hackborn2011-11-081-0/+20
| | | | | | | | | | We are tagging these as "watchdog" to make them visible in the reporting tools. Also new am command to kill all background processes, mostly to make it easier to test this stuff. Change-Id: Ib9dc4747cd8bd44156fdf11d6a087cd4272203eb
* Various performance and other work.Dianne Hackborn2011-10-311-123/+137
| | | | | | | | | | | | | | | | | | - IME service now switches between visible and perceptible depending on whether it is being showm, allowing us to more aggressively free its memory when not shown. - The activity display time is no longer delayed by the activity transition animation. - New -R (repeat) option for launching activities with the am command. - Improved some documentation on Loader to be clear about some methods that apps should not normally call. - FrameworkPerf test now allows you to select individual tests to run. Change-Id: Id1f73de66dc93d63212183958a72119ad174318b
* Small improvements to am command.Dianne Hackborn2011-08-161-22/+84
| | | | | | | | The start command can now take a package name or component name for easier starting. New -S option allows you to force stop an app before starting it. Change-Id: I5c55b34dd794783f0f5f51851dc811b8c1b39b76
* Add new am option to profile the launching of an activity.Dianne Hackborn2011-08-151-6/+35
| | | | Change-Id: Ie71a8043eafe41f53a0b3dbb5170276d87acbc9b
* Add looper profiling to adb shell amRomain Guy2011-07-211-3/+9
| | | | | | | | | To profile the looper, run the following command: adb shell am profile looper start <process> <file> adb shell am profile looper stop <process> Change-Id: I781f156e473d7bdbb6d13aaffeeaae88bc01a69f
* allow Uri as intent extra in am commandGuang Zhu2011-07-071-0/+6
| | | | | | | | | | When composing an intent using am command line, certain extra fields need to be added as a Uri (a Parceable in fact). This patch adds a "--eu" parameter so that the provided value is parsed as a Uri then added into intent's extra bundle. Change-Id: I7110829554962d314aa58fd25083dd5041680a73
* Small cleanup of am/pm commands.Dianne Hackborn2011-06-241-53/+120
| | | | Change-Id: I5af730bc177635821a82d4dd3ec9130a5dcd525a
* Add force-stop subcommand for 'am'.Xianzhu Wang2011-05-271-1/+9
| | | | | | | | | It's useful for some testing and debugging, to ensure all processes are stopped before testing. 'kill' doesn't always work because sometimes the system will restart the process immediately (e.g. if an app is running in background). Change-Id: I2c0caa38f74ee65ad6c35172fbf505227be7e7c3
* Add new command line option to change global screen size.Dianne Hackborn2011-05-161-0/+52
| | | | | | | | For example: adb shell am display-size 1024x600 Change-Id: I5df462acd3323bdaaaefa3126faea7dd8595b726
* New compat mode front end: UI and persistence.Dianne Hackborn2011-05-121-1/+4
| | | | | | | | | | Adds a really crappy UI for toggling compat mode. Persists compat mode selection across boots. Turns on compat mode by default for newly installed apps. Change-Id: Idc83494397bd17c41450bc9e9a05e4386c509399
* Better compat mode part one: start scaling windows.Dianne Hackborn2011-05-091-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First step of improving app screen size compatibility mode. When running in compat mode, an application's windows are scaled up on the screen rather than being small with 1:1 pixels. Currently we scale the application to fill the entire screen, so don't use an even pixel scaling. Though this may have some negative impact on the appearance (it looks okay to me), it has a big benefit of allowing us to now treat these apps as normal full-screens apps and do the normal transition animations as you move in and out and around in them. This introduces fun stuff in the input system to take care of modifying pointer coordinates to account for the app window surface scaling. The input dispatcher is told about the scale that is being applied to each window and, when there is one, adjusts pointer events appropriately as they are being sent to the transport. Also modified is CompatibilityInfo, which has been greatly simplified to not be so insane and incomprehendible. It is now simple -- when constructed it determines if the given app is compatible with the current screen size and density, and that is that. There are new APIs on ActivityManagerService to put applications that we would traditionally consider compatible with larger screens in compatibility mode. This is the start of a facility to have a UI affordance for a user to switch apps in and out of compatibility. To test switching of modes, there is a new variation of the "am" command to do this: am screen-compat [on|off] [package] This mode switching has the fundamentals of restarting activities when it is changed, though the state still needs to be persisted and the overall mode switch cleaned up. For the few small apps I have tested, things mostly seem to be working well. I know of one problem with the text selection handles being drawn at the wrong position because at some point the window offset is being scaled incorrectly. There are probably other similar issues around the interaction between two windows because the different window coordinate spaces are done in a hacky way instead of being formally integrated into the window manager layout process. Change-Id: Ie038e3746b448135117bd860859d74e360938557
* Add missing NOTICE entries.David Deephanphongs2010-10-191-0/+17
| | | | | | | | Add missing NOTICE block for TagSoup in general NOTICE file. Add comment in Android.mk to help reviewers locate the NOTICE for apache-http. Modify build rule for 'am' command to pull in the NOTICE file. Change-Id: I43c6c1468395b70d0942b3620f12e4b6f3d9a66b
* am deaa8ff1: am a7ef18fc: Merge "Some debugging support." into gingerbreadDianne Hackborn2010-09-241-8/+100
|\ | | | | | | | | | | | | Merge commit 'deaa8ff1b10d38add4f7c276e7be2ffc19359a14' * commit 'deaa8ff1b10d38add4f7c276e7be2ffc19359a14': Some debugging support.
| * Some debugging support.Dianne Hackborn2010-09-241-8/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | - New feature to "am monitor" to have it automatically launch gdbserv for you when a crash/ANR happens, and tell you how to run the client. - Update dumpstate to match new location of binder debug logs - Various commented out logs that are being used to track down issues. Change-Id: Ia5dd0cd2df983a1fc6be697642a4590aa02a26a5
* | resolved conflicts for merge of 8952a448 to masterDianne Hackborn2010-09-231-0/+215
|\ \ | |/ | | | | Change-Id: I9c752a5d10ae8d8e5ead1243b6abd4795204fc0b
| * Fix issue #3022508: Crash during media scanDianne Hackborn2010-09-231-0/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't kill processes for excessive wake lock use, even if they are in the background, as long as they have running services. Also fix some problems with this, such as not noting the kill in battery stats. And add killing of processes for cpu usage as well, along with some optimizations to computing CPU usage. And fix BatteryWaster to be better behaving for testing these cases. Add new "monitor" command to am to watch as the activity manager does stuff (so we can catch things at the point of ANR). Finally some miscellaneous debug output for the stuff here, as well as in progress debugging of an ANR. Change-Id: Ib32f55ca50fb7486b4be4eb5e695f8f60c882cd1
* | Add support for giving arrays of ints and longs to the "am" command.Jack Veenstra2010-09-081-1/+22
| | | | | | | | Change-Id: Ibc4ae63fb5f8025a847bec7d37a1fce5abd81b39
* | Doc Change:ActivityManager usage doc:running test packageJoe Malin2010-08-301-1/+6
| | | | | | | | Change-Id: I9a0c28e59f87e30c81d18162bee082b851d07a94
* | Add --el option to am for long extras.Makoto Onuki2010-08-241-0/+6
| | | | | | | | Change-Id: I13b92284fa4e0765620552b7d9b08d7441254389
* | Fix incorrect usage text for am.Daniel Sandler2010-08-201-1/+1
| | | | | | | | Change-Id: I95afb3bd02ce23bb8d0797ec4c33e27a9530988e
* | Allow "am" to initiate heap dumps.Andy McFadden2010-07-121-0/+26
|/ | | | | | | | | | | | | | | | | | | | | | This was mostly cloned from the "am profile" implementation. It's intended to replace the old "kill -10" approach used by "runhat". We could really use a native heap dump, so I pass a "managed" flag through that indicates whether we want to dump the native or managed heap. We don't currently have a native heap dump-to-file function, so it currently just logs a warning. (android.ddm.DdmHandleNativeHeap.getLeakInfo is a good start -- it copies /proc/maps and then calls get_malloc_leak_info to get some goodies. Needs some formatting to make it human-readable. I didn't want to cram all that into this change.) It would be useful if "am" didn't exit until the heap dump operation completed, but I'm not sure how to do that. Bug 2759474. Change-Id: I46bc98067738d8c72ac0fc10002ca67bb4929271
* merge from open-source masterThe Android Open Source Project2010-05-191-1/+1
|\ | | | | | | Change-Id: I0598edad283a177a5ddcc30e20d2284503e6038e
| * Removed Calls to deprecated APIsChristian Mehlmauer2010-05-171-1/+1
| | | | | | | | Change-Id: I3f9b6a8d3c8a050156a6cc7ea0eb9de33b82f79a
| * Unify am startservice commands.Jean-Baptiste Queru2010-04-161-14/+12
| | | | | | | | | | | | This replaces the implementation with an equivalent one. Change-Id: I1343ddee9414a67906cd426b8381ddbace873894
| * Allow Am to start servicesAnthony Newnam2010-04-141-0/+15
| | | | | | | | Change-Id: I31d066ae2c980cc293e55034446a63a0f42088ad