History log of /frameworks/base/cmds/am/src/com/android/commands/am/Am.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a561b1f9c0b02fab5a77f80b0ea0cfa368af0053 05-Jan-2017 Felipe Leme <felipeal@google.com> Added BUGREPORT_OPTION_TELEPHONY.

This option takes a lightweight version of bugreport that only includes a few,
urgent sections used to report telephony bugs.

BUG: 32589463
BUG: 26849505
Test: manual
Merged-In: I6f90c02779a1e8aead690428626e3b9f06aa04df
Change-Id: I6f90c02779a1e8aead690428626e3b9f06aa04df
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
77ad3429a62953a8ded5dda1b4af3f099023260c 03-Nov-2016 Michael Kwan <mkwan@google.com> DO NOT MERGE ANYWHERE Add supports-multiwindow command to am.

The supports-multiwindow command allows the ability to
check if the device has multiwindow support in the shell.

Bug: 30120559
Change-Id: I466e28d8a794fa457826a6526ef9ef660cd3856c
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
2fde939272dbb99cb3a3e4fcaaa73658b42c3963 29-Jun-2016 Chong Zhang <chz@google.com> Fix off-by-one in am start -R (repeat)

bug: 26028552
Change-Id: I075b378b6f126d124d867282d76a78d865b54178
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
27d92e4e397728d56f4f951dd4ce99668c7c447b 06-May-2016 Christopher Tate <ctate@google.com> Move the 'pretend idle jobs can run now' broadcast into AMS

It's a protected broadcast, so sending it directly from 'am' is
no longer an option. This is needed for CTS as well as being
generally useful during app development.

Bug 28406044

Change-Id: I101915a8c6f19454330a8db2079a75023c112582
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
435ce5ff1ca368056675e06f3f2416240613fbdd 26-Apr-2016 Andrii Kulian <akulian@google.com> Allow setting fullscreen stack as target via adb shell

Bug: 27906038
Change-Id: Ie6feede3f7c412bc51550626a008cb0729e5e0e0
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
a09b4d2a611a7606e8fc8c73a24bd941b6fc173f 15-Apr-2016 Narayan Kamath <narayan@google.com> Remove unnecessary allocation+unboxing of objects.

Transforming String->int can be done with 0 allocations
using Integer.parseInt.

bug: 28078871
Change-Id: I8d9f322d7154728849dde61ef282046032858d60
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
01ee1b7eb6debec3d422bc798df3bc180dc979ae 05-Apr-2016 Philip P. Moltmann <moltmann@google.com> Allow to provide only a component name prefix to 'am instrument'

Bug: 27831862
Change-Id: I1d57e416c47fc7d9ea212f0002986932663081b8
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
bd91e2f3f6aca512a02be645b2515b5e3331e177 22-Mar-2016 Jeff Sharkey <jsharkey@android.com> Update PRE_BOOT_COMPLETED for FBE.

Now that CE data isn't available until after a user is unlocked, we
need to delay the PRE_BOOT_COMPLETED broadcasts. This is done by
adding a new RUNNING_UNLOCKING user state to the UserController
lifecycle.

We now track the last fingerprint a user was logged in under, and we
dispatch PRE_BOOT receivers when that fingerprint changes. To work
around battery pull issues, we only persist the updated fingerprint
once all PRE_BOOT receivers have finished. This is less granular
than the original solution, but it's still correct. We only consider
a user as "logged in" once it transitions into the RUNNING_UNLOCKED
state.

When starting a process, track if the user was "unlocked" when
started, so that we only spin up unaware providers in processes
started before user unlock.

Add generic IProgressListener to communicate PRE_BOOT progress and
strings up to lock screen. For now, LockSettingsService just blocks
until finished, but it could display these strings in the future.

Bug: 27220885
Change-Id: I349439776b885acd32f6a578d8951ffd95640be2
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
e75a9adfbd37f9ec1a9324caceb9d5d7ceed217c 19-Mar-2016 Wale Ogunwale <ogunwale@google.com> Added support to specify animation duration when resizing stack

Needed for sys-ui to control the duration of various Pip transitions.

Bug: 27674339
Change-Id: I7bad27aaa19755a73c594e88b88b56db033e1a45
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
d5896630f6a2f21da107031cab216dc93bdcd851 05-Mar-2016 Jeff Sharkey <jsharkey@android.com> Move more PM calls to ParceledListSlice.

Since the data returned by these calls can grow unbounded based on
various GET flags, we need to switch 'em over.

Bug: 27391893
Change-Id: Ie849ca30dbaaa91158da4c83675657715629a0ee
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
bb8b4814df6123b9a411ff7224a35761def9ece7 04-Mar-2016 Nick Kralevich <nnk@google.com> Am.java: Use write-only file descriptors

Use write only file descriptors for am commands. Having read-write
file descriptors isn't needed, and not all SELinux app domains have
read access to /data/local/tmp file descriptors.

Addresses the following denial:

avc: denied { read } for path="/data/local/tmp/foo" dev="dm-2"
ino=654084 scontext=u:r:system_app:s0
tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0

Steps to reproduce:

adb shell ps | grep settings
adb shell am dumpheap PID_FROM_ABOVE /data/local/tmp/settings.hat

Expected:
1) command works

Actual:
1) SELinux denial and no settings.hat output.

Bug: 27472701
Change-Id: Id8df0c5a41046b405444e14c70075c986d9936c3
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
4a18c26609df2c4230885acb64e92fb51aba70df 27-Feb-2016 Dianne Hackborn <hackbod@google.com> Fix issue #27385109: control activity behavior without triggering...

...isUserAMonkey for testing purpose

Add an argument for the caller to specify if they are a poo flinging
monkey.

Change-Id: I0e149a8d78776abaf07517bd4ae886047b7f4252
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
06e8ee0c8ad2527add3db3dd1a1d4eee9d8631f8 12-Feb-2016 Wale Ogunwale <ogunwale@google.com> Added AM API to remove a stack

Use the new API when closing Pip.

Bug: 26982752
Change-Id: I074d23b5535a4534626183ab77142d3932a803f0
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
faeb3eb0ba190e6d6cfe2b82ce20af587848de57 08-Feb-2016 Paul Crowley <paulcrowley@google.com> Password security for FBE disk encryption keys

Add the means to protect FBE keys with a combination of an auth token
from Gatekeeper, and a hash of the password. Both of these must be
passed to unlock_user_key. Keys are created unprotected, and
change_user_key changes the way they are protected.

Bug: 22950892
Change-Id: Ie13bc6f82059ce941b0e664a5b60355e52b45f30
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
25222f55f28221d49a984db465f94e9716635ad8 06-Feb-2016 Tamas Berghammer <tberghammer@google.com> Merge "Add flag to "am start" to enable native debugging"
c17d8b79afd02133b021d89b536c812578308329 04-Feb-2016 Filip Gruszczynski <gruszczy@google.com> Infrastructure for animating of maximizing pip activity.

Bug: 25672053
Change-Id: Ie8a83c626680e01ff7115f40731ab9e6c13769c0
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
debd9a5ed57dce70b77fdee107b870d1a037c8c9 03-Feb-2016 Filip Gruszczynski <gruszczy@google.com> Allow specifying stack when starting activity in AM command.

Change-Id: I42032bdebf16b6cd2c0c87fd9aa5c261bc9fe25d
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
df6cb282937e5f804686ebbc952ae9f2290d93c7 29-Jan-2016 Tamas Berghammer <tberghammer@google.com> Add flag to "am start" to enable native debugging

Specifying the new flag will enable several features in the runtime
required by the native debugger to debug Java and C++ code at the same
time.

The enabled features:
* Force JIT (never use the interpreter)
* Debug info generation
* Disbale some optimizations

Change-Id: Iaf5ab649715a0c274bd1b0fc64e483705da53cd0
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
b1faf60b896afe235175354ffd90290ff93a54b4 27-Jan-2016 Wale Ogunwale <ogunwale@google.com> Use resizeMode integer instead of resizeable boolean.

Changes activity manager and window manager to use resizeMode
as defined by ActivityInfo#resizeMode instead of a boolean.

Bug: 26774816
Change-Id: I8cef46d9fba6bfdd21df7da63ed5d5330ad03d4b
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
84fa3351a21b37d02fafd634a8de65cf6cd04c4d 26-Jan-2016 Filip Gruszczynski <gruszczy@google.com> Animate pinned stack resizing.

This introduces animating of stack bounds within window manager
module. It also uses this type of animation when moving an activity from
fullscreen stack to pinned stack.

Bug: 25672053
Change-Id: I75914a685d10021f8a7535b47ef12b6920b3fd5e
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
3da5c97460d859ec6d9e5fffb3902a3242d32bf4 11-Dec-2015 Michal Karpinski <mkarpinski@google.com> Adjusting AMN#requestBugReport() to be able to invoke 3 types
of bugreport services

ActivityManagerNative#requestBugReport() now can accept 3 types:
FULL, INTERACTIVE AND REMOTE.

Bug: 26152603
Change-Id: Ife9bbef4691e172fb56b72b256880f0d4ad4d198
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
52641bc309ed1a4e767692586b3fb8e3f3031fb0 29-Dec-2015 Jorim Jaggi <jjaggi@google.com> Add am command for CTS tests for resizedDockedStack (1/2)

Bug: 25015474
Bug: 26311778
Change-Id: Ia2b1f8ffc5c777d8199409041090a0106503c2e4
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
4cc863338d5e43b6189e05498d7cb53ebba135e1 05-Dec-2015 Felipe Leme <felipeal@google.com> Changed ActivityManager.requestBugreport() to take a 'progress' parameter.

When progress is set to 'true', it calls the new, enhanced
'bugreportplus' service, while when 'false' it calls the regular
'bugreport' service.

'bugreportplus' is more user-friendly (it shows a system notification
with the progress, allow user to cancel, etc...), at the cost of
consuming more resources. As such, the "Take Bug Report" UI will be
changed to offer the user a combo with these 2 options, but for now it's
always going to be 'bugreportplus'

BUG: 26034608
Change-Id: I21a6b5b092a85614e91d523b8f4df1fb00e49b3b
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
9cbfc9e212151e84910a22387365644916dde446 08-Oct-2015 Fyodor Kupolov <fkupolov@google.com> Added DISALLOW_RUN_IN_BACKGROUND user restriction

It forces the user to stop instead of going into the background. Also
changed behavior of stopUser method. Now it also attempts to stop related
users along with the specified userId.

Based on ag/807976, with the only difference that it's now a user restriction.

Bug: 24579258
Bug: 24708668
Change-Id: I357298908816fc58feeed83b7e9979fc33d25da6
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
ba51235ef5c598d845b77fcf14491329493da34f 13-Nov-2015 Jeff Sharkey <jsharkey@android.com> More file-based encryption work.

Add new "am unlock-user" command so we can trigger changes from the
command line.

Move FBE check to static method so it can safely be called early
during boot before the mount service is ready. Move FBE emulation
to persisted system property, and start reading/writing that value.

Change default permission grants to ignore current encryption-aware
flags, since many of the target apps aren't crypto aware.

Always prepare package data directories, which is how we create the
new "user_de" paths during boot.

Bug: 22358539
Change-Id: I6f58ea2d34b3a466d3775d614f8a13de92272621
/frameworks/base/cmds/am/src/com/android/commands/am/Am.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/cmds/am/src/com/android/commands/am/Am.java
3797c22ea16e932329ebffdc7e7ce09f9ecd9545 27-Oct-2015 Wale Ogunwale <ogunwale@google.com> Added StackId object for checking what features a stack supports

Helps make the code easier to follow since we are no longer checking
multiple stack ids at various decision points.

Bug: 25282299
Change-Id: Ifa6864a1ef56ce2eca4c94f87a4e0b993de987cd
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
079a0044a366b5a6ab8026aca452676a6e1e7215 24-Oct-2015 Wale Ogunwale <ogunwale@google.com> API for moving top activity in a stack to pinned stack.

* AMS.moveTopStackActivityToPinnedStack can be used to move the top
activity in a stack to the pinned stack and also specify the bounds
the pinned stack should be sized to.
* 'am stack move-top-activity-to-pinned-stack' command for testing
AMS.moveTopStackActivityToPinnedStack API

Bug: 25006507
Change-Id: I8392b4c39d8542153e691be7a627b7f35fd44884
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
63afb863815a80b05c6f1acd6b0e99a3508540f4 19-Oct-2015 Pablo Ceballos <pceballos@google.com> Merge "Remove GLTrace support"
ffc11bb712343b634901fe2d0e0022e7e578dd5c 10-Oct-2015 Wale Ogunwale <ogunwale@google.com> Don't set incorrect stack bounds when rotating screen in docked mode

Both window manager and activity manager could decide what the bounds
of other stacks should be when the docked stack exist which can get
out of sync. Now window manager does the bounds calculation and
activity manager asks window manager what the bounds should be when
it needs to resize the stack.

Bug: 24738105
Change-Id: I97356f008b676d2f58a8b54fdb08735ab51394af
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
a4d4e82927ceadc23863e74b7e1160e4497504a7 05-Oct-2015 Pablo Ceballos <pceballos@google.com> Remove GLTrace support

GLTrace is defunct, it does not support newer GL features, breaks
security requirements, and has no supported tooling now that Eclipse
is at end of life.

Bug 22329852

Change-Id: I64c58464f8c2c7ae6125f5d5c7884e3fd34d68ea
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
0df68cd13b8121aa4e582d8fb59c7589079d6ff9 01-Oct-2015 Fyodor Kupolov <fkupolov@google.com> Do now allow current user to be removed

It was possible to remove a foreground user using pm remove-user command.
The system ends up in the inconsistent state, because switch does not happen
and the removed user stays in the foreground, but its state is removed.

Also added am get-current-user command.

Change-Id: Ida2dce8f99bac55e106cdd44c93e96cc9142d7fb
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
83301a933ff28eed978b16b54bc569fbe76ef499 25-Sep-2015 Wale Ogunwale <ogunwale@google.com> Added am command to suppress config. changes during task resize.

This command is useful for testing during development, but at some
point we will decide if allowing configuration changes during resizing
is okay or merge in http://ag/759766 to suppress configuration changes
during resizing and deliver the new config. to the app.

This functionality will be reverted once we decide.

Bug: 24380097
Change-Id: I223c08bc939e564a78e70994b599770be9d4730d
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
87b21722c2336490ecf8b66f6acfc46ce8cc6f46 22-Sep-2015 Chong Zhang <chz@google.com> Change resizeTask's parameter resizedByUser to constants

to indicate who initiated the resize, or if the resize should be forced.

Change-Id: Ic7021f76bec677027cbf27deeb63f92ea911a75c
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
a59ac9cd645d25f03e4e488100bd99f92e83a3a7 11-Sep-2015 Filip Gruszczynski <gruszczy@google.com> Preserve window during resize triggered relaunches.

This changes application code behavior when the activity relaunches due
to configuration change. It only applies to scenarios, where the
configuration change was triggered by a user generated resize of an
activity (i.e. user drags a corner of an activity and thus changes its
size).

Preserving a window means that we will keep the decor view and non
client decor view around, but remove all children views when the
activity gets destroyed. When the activity gets created again, it will
attach its new content to the preserved view hierarchy. Mind, we
actually recreate application side Window object, since some of its
features might changed, but we retain its elevation (to not trigger
relayout with new layout params).

Preserving the window also means that we don't call the window manager
service to remove and later add the window. Instead, we continue using a
single window state throughout the resize operation.

Change-Id: Ie3d2878ed09c99ff343044bfe7a29a0ba07a265e
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
fc4662c185822b493f6655af0ace2f2a50573a5f 16-Aug-2015 Wale Ogunwale <ogunwale@google.com> Added am command for test docked stack resizing.

Change-Id: I79f88d4dea4ed87336f9859b9d655cbf5466dbe0
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
fc0ac9bdcb2736bddac1695d780eb8ce14a627a8 08-Aug-2015 Wale Ogunwale <ogunwale@google.com> Added am commands for testing task positioning/resizing

Change-Id: Id506ea740029fd6faee4fc311a97c034c883a3fc
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
2ccf49e7f465dc0fb2b78c28cf7a38f7e4bbe140 04-Aug-2015 Xiaohui Chen <xiaohuic@google.com> Clean up USER_OWNER references in am/pm commands.

Bug: 19913735
Change-Id: I9cd27dc037048f4e5e312c769fc59669a4abf3e3
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
ddc1cb2c15549ed23dce9d416680a009fa6ae23c 26-Jul-2015 Wale Ogunwale <ogunwale@google.com> Added support for static vs. dynamic stacks

Now that stacks represent workspaces we can define static
stacks which help shape the characteristics of the tasks
they contain. For example, fullscreen tasks/activities will
normally be launched in the stack with id
FULLSCREEN_WORKSPACE_STACK_ID, while freeform tasks/activities
will normally be launched in the stack with id
FREEFORM_WORKSPACE_STACK_ID.

Also, added ability to position a task at any index in a stack.

Bug: 22068114
Change-Id: Ib6c62a84b5f204fbf072755264c5c5eda6184f97
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
66a36750135789aa952f2543842aa2481aa2da03 24-Jul-2015 John Reck <jreck@google.com> am 0e5a5161: am d79117c4: am 9ba771bb: am c2db381e: am 6b66a4a8: use findProcess instead of getProcess

* commit '0e5a5161e6999a58a86acd404ee1a229e180647d':
use findProcess instead of getProcess
0e5a5161e6999a58a86acd404ee1a229e180647d 24-Jul-2015 John Reck <jreck@google.com> am d79117c4: am 9ba771bb: am c2db381e: am 6b66a4a8: use findProcess instead of getProcess

* commit 'd79117c405fab2c7a64d7307a941df05a713814d':
use findProcess instead of getProcess
6b66a4a8a342b8156f73d83771caa1db2f866529 24-Jul-2015 John Reck <jreck@google.com> use findProcess instead of getProcess

Bug: 22701182
Change-Id: I2ec56c55c49401f2f213bbd318e867fd73b37672
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
273639f7ad379cb35a53ed9266e14b0b49ef5bcc 24-Jul-2015 Kenny Guy <kennyguy@google.com> am e6b1e0e1: am 72be5067: am af52ae07: am 2adcb40d: am 2ba3fec6: Merge "Support waiting for adb shell am stop-user to complete." into mnc-dev

* commit 'e6b1e0e1c22d57b8c3f70e780fdc672175780086':
Support waiting for adb shell am stop-user to complete.
e6b1e0e1c22d57b8c3f70e780fdc672175780086 23-Jul-2015 Kenny Guy <kennyguy@google.com> am 72be5067: am af52ae07: am 2adcb40d: am 2ba3fec6: Merge "Support waiting for adb shell am stop-user to complete." into mnc-dev

* commit '72be506795c4b7260612458c183282b9c59717ef':
Support waiting for adb shell am stop-user to complete.
2c7836befce222e501299520bb2b15a63e5a7503 20-Jul-2015 Kenny Guy <kennyguy@google.com> Support waiting for adb shell am stop-user to complete.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
b5143ecfeebfcf1424e599882e97c46881bb8c48 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am 1fa2a088: am 1281575c: am 41fac5e8: am 189f3136: am 98724126: Merge "Added sendBroadcastMultiplePermissions method" into mnc-dev

* commit '1fa2a0888284ae00c905dce7a3003b995815467a':
Added sendBroadcastMultiplePermissions method
1fa2a0888284ae00c905dce7a3003b995815467a 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am 1281575c: am 41fac5e8: am 189f3136: am 98724126: Merge "Added sendBroadcastMultiplePermissions method" into mnc-dev

* commit '1281575c257d52f256f4a08559611e6ec0b6190e':
Added sendBroadcastMultiplePermissions method
d4fd8c766da8a70e3359bbc7efbbc79496efe71a 14-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Added sendBroadcastMultiplePermissions method

Added Context.sendBroadcastMultiplePermissions(Intent intent, String[]
receiverPermissions) method, which allows an array of required permissions
to be enforced.

Bug: 21852542
Change-Id: I27c9130e8f004b428452501ebc8a36aabde1f343
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
19b4ef6622164e9528f0af0bdadca301cbad1526 10-Jul-2015 Jarkko Pöyry <jpoyry@google.com> Merge "Don't NPE on command line parse failure."
4e5dac3d6ef6f28aecb116b8dfd92ff31d49c926 08-Jul-2015 Svetoslav <svetoslavganov@google.com> am 3fd5ebfd: am 7cc8de60: am 0ce19f8e: am 240f8e5f: am 3e07ee07: Merge "Grant installer and verifier install permissions robustly" into mnc-dev

* commit '3fd5ebfd778e540276fb5205a8ba3185e620647d':
Grant installer and verifier install permissions robustly
3fd5ebfd778e540276fb5205a8ba3185e620647d 08-Jul-2015 Svetoslav <svetoslavganov@google.com> am 7cc8de60: am 0ce19f8e: am 240f8e5f: am 3e07ee07: Merge "Grant installer and verifier install permissions robustly" into mnc-dev

* commit '7cc8de60682b1ed22be1b452809b36a5ceaae02a':
Grant installer and verifier install permissions robustly
3e7d977ff7c743713f0ad6336a039d7760ba47d1 07-Jul-2015 Svetoslav <svetoslavganov@google.com> Grant installer and verifier install permissions robustly

bug:22248271

Change-Id: I3a47ae9a112ba7d88b421fcb5f9651d1168ba7a5
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
e8ce8368fc65c3f5c54c44384be62cf228ceb10e 04-Jul-2015 Svet Ganov <svetoslavganov@google.com> am 55cd6f44: am 6fe87a56: am 68ffcf88: Merge "Teach receivers, activities, providers, and services app ops." into mnc-dev

* commit '55cd6f44fd1e49164a999e948bb91a03a3b9daf6':
Teach receivers, activities, providers, and services app ops.
b582c67039a6184b5ab4222e5a7d983dfb8c1b9d 04-Jul-2015 Jarkko Pöyry <jpoyry@google.com> Don't NPE on command line parse failure.

Bug: 21202826
Change-Id: I3cbc12eaef920905c8abc6532376827ccff132f4
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
55cd6f44fd1e49164a999e948bb91a03a3b9daf6 02-Jul-2015 Svet Ganov <svetoslavganov@google.com> am 6fe87a56: am 68ffcf88: Merge "Teach receivers, activities, providers, and services app ops." into mnc-dev

* commit '6fe87a565be345c9455f610bbf26d5eaee593683':
Teach receivers, activities, providers, and services app ops.
99b6043dad9d215cf15810b885b6b8c215dd5b5a 27-Jun-2015 Svet Ganov <svetoslavganov@google.com> Teach receivers, activities, providers, and services app ops.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
80bea9cde179e37def61748ff0e68b4155b5360c 25-Jun-2015 Man Cao <manc@google.com> resolved conflicts for merge of 8fb82074 to master

Change-Id: I27c7ddeead5a589ae8824f87bf6b42998dc081eb
8fb8207412905d034305b4b1be6eac07bdac833f 25-Jun-2015 Mathieu Chartier <mathieuc@google.com> resolved conflicts for merge of 0f14548c to mnc-dev-plus-aosp

Change-Id: I2f79840f82150eddebfbd549afd1eca28075eb43
87344583e18113b6cb93271d9eac902456e76c78 25-Jun-2015 Adam Lesinski <adamlesinski@google.com> am 0ebba0e1: am 53d0d065: am b21a77fe: Merge "Allow callers holding PACKAGE_USAGE_STATS permission to call ActivityManager#getPackageImportance()" into mnc-dev

* commit '0ebba0e1a66ddf912b9fb7c43727054cb2d63556':
Allow callers holding PACKAGE_USAGE_STATS permission to call ActivityManager#getPackageImportance()
c30454c10457fe034a861b4bf19fd1fc240bd893 24-Jun-2015 Adam Lesinski <adamlesinski@google.com> Allow callers holding PACKAGE_USAGE_STATS permission to call ActivityManager#getPackageImportance()

Bug:22055550
Change-Id: I1e732e95698daf44bcb223cafde3d3c22746d232
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
cfa78b2080e590ca3b28dbf59e6d6f6e7ece7764 12-Jun-2015 Man Cao <manc@google.com> Add an AM option to start with allocation tracking

The new option "--track-allocation" is to work with the new
allocation tracker in ART.

Bug:20037135
Change-Id: Ic5f8945ab4c1f167c27b05ad0d11d04bac680c1f
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
8ee0c2cf24cc4de0abe7114c189051277568f7f1 23-Jun-2015 Rahul Chaturvedi <rkc@google.com> Merge "Add binder transaction tracking."
52613f9084f40100021fbf21173bda329a2d5cc3 18-Jun-2015 Rahul Chaturvedi <rkc@google.com> Add binder transaction tracking.

Add the ability to am to be able to track binder transact calls. This
will help us diagnose excessive IPC calls.

This CL adds the trace-ip command to am. The usage is,

To start binder transaction tracking,
am trace-ipc start
To stop tracking and dump the data to a file,
am trace-ipc stop --dump-file <FILE>

Bug: 21398706
Change-Id: Ic0c9b3be757dd0662a2750a0d8447e2a5ef1fa90
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
a750a63d639f6936af456df904fa6b9ba941885e 17-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21814207 and issue #21814212 (alarm manager)

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
f36a0f5d178786d07ab2d674003cf865c9e7a35f 10-Jun-2015 Felipe Leme <felipeal@google.com> Added new options (--eial, --elal, --efal, and --esal) to pass multiple 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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
16045c24fe10cc92329ede099923f1223f49b17d 05-Jun-2015 Stefan Kuhne <skuhne@google.com> Adding am send-trim-memory command

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
e5f330456bdf5e138485ee117929fc4337866132 08-May-2015 Amith Yamasani <yamasani@google.com> Rename *AppIdle to *AppInactive per api-council

Change to setAppInactive and isAppInactive in a few places.

Bug: 20823737
Change-Id: Ie57dbc0dd2842e771bb5fd9f69b8041aacaa005c
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
cf76872a62075abf9008e99ca08413fb70761dc2 24-Apr-2015 Amith Yamasani <yamasani@google.com> Add ability to get and set idle state of apps

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
0bd2aa760346edd096f7c27283f394631f246f30 16-Apr-2015 Wale Ogunwale <ogunwale@google.com> Fail early when starting a background user activity.

If it shouldn't be displayed for all users.

Bug: 13507605
Change-Id: I8fe8e5a98759c1ca058cc7d222817f6d580ffa11
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
1e38382b542f5cef9957a89692b02c55a3dd351c 10-Apr-2015 Dianne Hackborn <hackbod@google.com> Fixes to idle alarm scheduling, package importance.

- 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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
d59a5d59df920d743723521a2afed9de1da3373b 04-Apr-2015 Dianne Hackborn <hackbod@google.com> Various fixes and improvements...

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
34faab5a54b9415c340dfeb29af6886f00bb5d9e 26-Mar-2015 John Reck <jreck@google.com> Add --sampling to am profile start

Change-Id: I00dfdef6a7ac61ab4ce16fefe1ddc5554ace0c88
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
b9a5e4ad30c9add140fd13491419ae66e947809d 04-Mar-2015 Dianne Hackborn <hackbod@google.com> Add new debug feature to automatically create heap dumps.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
08c7116ab9cd04ad6dd3c04aa1017237e7f409ac 28-Feb-2015 John Spurlock <jspurlock@google.com> Remove unused imports in frameworks/base.

Change-Id: I031443de83f93eb57a98863001826671b18f3b17
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
53a29a90f35f72462c0d6ad650921d5566c1f8f0 24-Feb-2015 Wale Ogunwale <ogunwale@google.com> Added ActivityManager API and AM command to resize a task.

Also fixed issue with ActivityStackSupervisor.moveTaskToStackLocked()
functionality not working correctly.

Change-Id: Ia13f1e92a7c59ce6543c226533ac8ea623488290
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
5e789f03b2bd018ab44cb4d1018f3682f27fd510 11-Feb-2015 Wale Ogunwale <ogunwale@google.com> Fixed bug in 'am stack split' command.

Change-Id: Id3efb65a3f9cbf3c223ea08d51e2028180bd5479
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
2c5763ae5d04ebd67eae2f86f840e6e68304e821 11-Feb-2015 Wale Ogunwale <ogunwale@google.com> Am command to split a stack.

Change-Id: Idf3a364fc3826f6fe92f55b5c83b16b380d62ff4
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
9d3de4cfb42519fefe9d8b03c38ba440bd6bc886 02-Feb-2015 Wale Ogunwale <ogunwale@google.com> Support for activity to opt-in/out of resizeable/multi-window support.

Bug: 19178148
Change-Id: I5819a71cdc48e0af4add11a6d4a503ec5cbe5d63
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
aab56dbc1ef5c91afad1e61d633305bb3aa3cb1b 30-Jan-2015 Todd Kennedy <toddke@google.com> Show stacks underneath a resized stack

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
4900bf9d82c4905fadc43d8e2dd9a7f896da2d81 17-Jan-2015 Todd Kennedy <toddke@google.com> Expose new binder call createStackOnDisplay()

Creates a new, empty ActivityStack on a display. Use the binder call to
launch an activity on said stack.

Bug: 19001243
Change-Id: I0f04e8f2703bcc706f58e75333869fb35f6b1ee9
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
ca4d842205ce256aab53825920a791c7ab9d62f1 16-Jan-2015 Todd Kennedy <toddke@google.com> Rename the binder call createActivityContainer

Change the call to createVirtualActivityContainer to better describe what's
actually being created with the call.

Change-Id: Id3a32df19a5bb6740cbabcd65897349e9f2f2946
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
dbea3cd118fe4eeb9b43ea50727987fa790a2edd 24-Nov-2014 Jeff Sharkey <jsharkey@android.com> Better am error when SELinux blocking access.

Bug: 18479882
Change-Id: I0732e54838c4e04d9d727e7c5fd9d7e7bacbaa1f
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
24b1c23c62b3d8ca1d762a76b2f1ef6360fc683e 21-Nov-2014 Dianne Hackborn <hackbod@google.com> Fix issue #15828903: Intent.parseUri allows call to FLAG_GRANT_*_URI_PERMISSION

You now need to set a flag if you want this unsafe behavior.

Change-Id: I185e9a04e005e42a887c3d58a2818616790b060a
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
85d558cd486d195aabfc4b43cff8f338126f60a5 04-Nov-2014 Dianne Hackborn <hackbod@google.com> Add Activity API to get referrer information.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
795893eb6ff0c02c30a5765e06807ce1ee43978f 29-Oct-2014 Daniel Sandler <dsandler@android.com> More flexible intent extra parsing.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
ab4a81b3c625e33d04ae8070fcce6b6baee6522c 10-Oct-2014 Dianne Hackborn <hackbod@google.com> Improve some docs, fix some debugging.

- 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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
979e40e9ba02b74226d9833b2f8156aa89a39053 25-Sep-2014 Alexandra Gherghina <alexgherghina@google.com> Adds the ability to start a user in background

Bug: 15900074
Change-Id: I03b278f8e7a4618ea56a5f1935cfba34beb45981
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
6cfbb718905210d146fbe8fb18c8e124f24845ec 17-Sep-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17536024: The am start's wait option doesn't...

...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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
f58e532e015ef31d879ee51aeeb251349784717c 11-Sep-2014 Amith Yamasani <yamasani@google.com> Merge "Apply cross-user restrictions to Shell" into lmp-dev
8cd28b57ed732656d002d97879e15c5695b54fff 09-Jun-2014 Amith Yamasani <yamasani@google.com> Apply cross-user restrictions to Shell

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
65e76d1200395a9c67893378ddb64c47ede400b4 10-Sep-2014 Adam Lesinski <adamlesinski@google.com> Output recent configs in am get-config command

Change-Id: Ic516e73d2e72ac0dc3136f7226cedd851fe22b85
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
1b012d302b56b4adf950035136d1d191a1936d5a 20-Aug-2014 Jeff Hao <jeffhao@google.com> Add sample profiling option to am.

Also bundles all profiling options into a class.

Bug: 17040932
Change-Id: I85d675ee1494bdc7308caffdf94145d27c996e9d
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
b9583c9d93bd1d2c9d506dffae87a5ca2b7f7307 25-Jul-2014 Christopher Tate <ctate@google.com> Turn on debugging override of idle time

'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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
afc00e1c81a2ae00dc01bb980bc617f382441102 17-Jun-2014 Adam Lesinski <adamlesinski@google.com> Change am get-config command to use ABI string array

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
2c749d242759ea36c0229ea933f22b6363337b19 04-Jun-2014 Adam Lesinski <adamlesinski@google.com> New command to get device config

Change-Id: I7172a3a150fd83e2382ca3e4e4a0188758189f14
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
dfed4bc99f9f3d48ee7bf9e8ea051a8d5bc4f299 30-May-2014 Narayan Kamath <narayan@google.com> am f7871c31: am b9b31f4b: am bd4d3203: Merge "Support an ABI flag for instrumentation."

* commit 'f7871c31469c6245c1b232a15104704f7481103c':
Support an ABI flag for instrumentation.
f7871c31469c6245c1b232a15104704f7481103c 30-May-2014 Narayan Kamath <narayan@google.com> am b9b31f4b: am bd4d3203: Merge "Support an ABI flag for instrumentation."

* commit 'b9b31f4b8eda123e7b544d1a0fa886576064adca':
Support an ABI flag for instrumentation.
8dcfefd652fa2c5612b3acbc4bf842d2dfb1cf21 15-May-2014 Narayan Kamath <narayan@google.com> Support an ABI flag for instrumentation.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
91097de49b0f683b00e26a75dbc0ac6082344137 05-Apr-2014 Dianne Hackborn <hackbod@google.com> Initial implementation of new voice interaction API.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
846318a3250fa95f47a9decfbffb05a31dbd0006 04-Apr-2014 Jeff Sharkey <jsharkey@android.com> Allow prefix-based Uri permission grants.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
aea74a5977ca9f1054926eb24f247562c3a4a6ba 08-Mar-2014 Craig Mautner <cmautner@google.com> Add Lock Task Mode.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
28600e261c088eddcd0201820ed93730c77af282 27-Feb-2014 Dale Hawkins <dkhawk@google.com> Adds support for array string extra.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
e0a3884cb627efc650e19fbe76b1b3343468cf57 17-Dec-2013 Craig Mautner <cmautner@google.com> Extend stack management to other displays.

- 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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
4a1cb22056112f7ffd5f4fad8b7a092b96e7cc7b 05-Dec-2013 Craig Mautner <cmautner@google.com> Pair ActivityStacks with Displays

- 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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
bdc748af8ce62778d2ad15040ecdfada6e4635fd 02-Dec-2013 Craig Mautner <cmautner@google.com> DO NOT MERGE: Eliminate StackBox.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
7625c8404553fae274a1074388ca0458df32dce4 14-Nov-2013 Jeff Sharkey <jsharkey@android.com> Fix am argument ordering documentation.

Bug: 11690520
Change-Id: I84b10a6eb6e6404212ab9737e7cee1f1ad4d5309
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
35f72be50b8a2d11bce591dcdac5dc3fa336dac0 16-Sep-2013 Dianne Hackborn <hackbod@google.com> Implement issue #10691359: Kill long-running processes

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
57a7f5954cf1f9cbe99c70133863049a4be2e983 23-Jul-2013 Dianne Hackborn <hackbod@google.com> Add "adb shell am restart" command.

So you can restart the system without being root.

Change-Id: I89770f497833ecbe2b69e3a0cfafae7ef472a9f5
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
f2ca6e271758e6f2b476ca909821e63e30c1c09b 11-Jul-2013 Marco Nelissen <marcone@google.com> Add stopservice command to am

Change-Id: I639ad418750c0e1825b330b3bd56e5628926e7f1
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
4d7dc1a2b1c70ba1837b22e01c5f468d1ad0adc2 25-Jun-2013 Evan Charlton <evanc@google.com> Fix a typo

s/will/while/ for the --no-window-animation explanation.

Change-Id: Ia068809d385cc4f54f9603a8713a581fd4f59440
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
fd1ce8d5a7aa1ec6c7324b171f7e7a15a95f8759 18-Jun-2013 Craig Mautner <cmautner@google.com> Add new API getStackBoxInfo

Change-Id: Ie2861e5e31bb3876cfe2d5c3d04ff58bb3955634
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
5a449154d1795abe8e44b7bfe821d640b145e2c6 25-May-2013 Craig Mautner <cmautner@google.com> Convert API refs to StackBox from ActivityStack.

- Removed IActivityManager.getStacks() since getStackBoxes() is better.
- Made createStacks operate relative to StackBox instead of TaskStack.
- Made resizeStack into resizeStackBox.

Change-Id: I7a0e1f4e34f399b4fd1180c60cc3989f9c2433f3
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
5ff12101722874f5e7b0cadf06f4c53f4ec4b917 24-May-2013 Craig Mautner <cmautner@google.com> Add retrieval of StackBox info for more flexibility

First step in permitting StackBoxes to be manipulated by user.
Necessary for Configuration changes coming down.

Change-Id: I4029926a35e4fdc59a5759fd9e4bae10bb308413
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
1602ec21883f73c5eb2304cf69d2278f70b145ab 12-May-2013 Craig Mautner <cmautner@google.com> Log stack issues and start resize effort.

- Modify Am.java to accept 'stack resize' command.

- Add logging for assigning home stack to non-home task to track down
bug. And maybe fix bug.

- Add template parameter to ArrayList.

Change-Id: Ia73182afc20e9e4430ddadebae034cecb3798eec
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
befa8b5553046bf46ae59b5d7f9980f513db5d0c 13-May-2013 Guang Zhu <guangzhu@google.com> Revert "Log stack issues and start resize effort."

Bug: 8935057

This reverts commit b0245edae86b5811ea743c0f4cea095488304b1a.
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
b0245edae86b5811ea743c0f4cea095488304b1a 12-May-2013 Craig Mautner <cmautner@google.com> Log stack issues and start resize effort.

- Modify Am.java to accept 'stack resize' command.

- Add logging for assigning home stack to non-home task to track down
bug. And maybe fix bug.

- Add template parameter to ArrayList.

Change-Id: If904c3ead623464ff5863b7241c68c1b7573bcf4
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
1d69bad411123913d32342864454b09ae39dab2c 07-May-2013 Kenny Root <kroot@google.com> resolved conflicts for merge of a98b0ff8 to master

Change-Id: I1f4a952d360c48426e22a7772726b6867cc19771
add582122dcec5aeb20d9e8f8c49348e00a5fe76 07-May-2013 Kenny Root <kroot@google.com> resolved conflicts for merge of 485d7a31 to master

Change-Id: I058e19af8732df44457bdc614ee810a642dc25e4
8bd64df2adb26fe9547ae3961a58631e241b613e 07-May-2013 Dianne Hackborn <hackbod@google.com> Help for the debugging help for issue #8734824.

Add a new "hang" am command that lets you hang the system
process. Useful for testing.

Change-Id: Ice0fc52b49d80e5189f016108b03f9fd549b58a7
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
5b88a2fd7b77880f6e09ae4a1de509bebe28bc3a 04-May-2013 Dianne Hackborn <hackbod@google.com> Debugging help for issue #8734824: WATCHDOG KILLING SYSTEM PROCESS

IActivityController has a new callback which the Watchdog calls
when it detects that the system process is hung. This may be
use full monkey. All hail the monkey!

Also add a new private feature to Binder to be able to turn off
all incoming dump() calls to a process. The watchdog uses this
when it reports it is hung, so that if someone, say, wants to
collect a bug report at this point they won't get stuck waiting
for things that are all busted.

Change-Id: Ib514d97451cf3b93f29e194c1954e29f948c13b1
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
4cd0c13f8f765118a24e31548c058b5029481bea 17-Apr-2013 Craig Mautner <cmautner@google.com> Incremental repairs to side by side stacks.

- Add taskId parameter to createStack() so stacks are pre-populated
with a task.
- Keep track of stack access order in DisplayContent so getTasks
returns in MRU order.
- Set touchableRegion in InputMonitor so modal touching does not
extend beyond stack boundary.
- Fix stack merging so that deleting a stack results in a new
stack the size of the two children.

Change-Id: I62a6ba0a34f34dd7ec866b440bf04595379e19e8
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
967212cb542e6eeb308678367b53381bff984c31 14-Apr-2013 Craig Mautner <cmautner@google.com> Implement stack splitting and task movement.

Split stacks and move tasks between them. Layout the windows
according to the new stack split.

After layout content rectangles are known split the available area
between all stack boxes. Then use those values for future layout.

Provide stack contents to ActivityManager.

Change-Id: I9746e6185445633810d506be514d0b7b540a7f99
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
79f7ec70ebd5758ce54fd5b6fcd60fd27457cba6 05-Apr-2013 Dianne Hackborn <hackbod@google.com> Have audio service clean up new receivers in crashing processes.

The new media button receiver with only a pending intent (no
component name) could be left hanging if the process that
registered it went away. These semantically need to be tied
to the calling process's lifetime; we now clean them up when
the calling process goes away.

Also added some additional cleanup of media button receivers
when packages change (updated, cleared).

And on top of that, a new "media" command for doing media
things. Currently lets you send media keys and monitor
remote display data.

Oh and finally added a new BaseCommand base class for
implementing these command line utilities.

Change-Id: Iba1d56f10bab1eec4a94a7bb1d1c2ae614c8bcf5
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
02ffba940ca96988ed3e7774c606b43c58373b5e 09-Mar-2013 Jeff Sharkey <jsharkey@android.com> Handle finished bugreports, share from private.

Show notification when a bugreport is finished, letting the user
launch a SEND_MULTIPLE intent to share them. Add dialog that warns
user about contents before sharing. Since bugreports are now stored
in private app data of the Shell app, use FileProvider to build Uris
that we can grant others access to.

Define BUGREPORT_FINISHED as being a protected broadcast. Delete
older bugreports automatically to reclaim disk space. Migrate any
Intent extras to ClipData when building PendingIntents.

Add --receiver-permission support to am shell command.

Bug: 7005318
Change-Id: If6c607dbcf137362d5887eac482ff7391563890f
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
c652de8141f5b8e3c6bcf8916842b6e106413b1a 16-Feb-2013 Dianne Hackborn <hackbod@google.com> Implement display overscan support.

The window manager now keeps track of the overscan of
each display, with an API to set it. The overscan impacts
how it positions windows in the display. There is a new set
of APIs for windows to say they would like to go into the
overscan region. There is a call into the window manager to
set the overscan region for a display, and it now has a
concept of display settings that it stores presistently.

Also added a new "wm" command, moving the window manager
specific commands from the "am" command to there and adding
a new now to set the overscan region.

Change-Id: Id2c8092db64fd0a982274fedac7658d82f30f9ff
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
f51f61269aacdfcf737b2c32b6b216c48ab61e65 05-Feb-2013 Dianne Hackborn <hackbod@google.com> App ops: new operations for SMS.

Implementation required a new framework feature
to associate an app op with a broadcast.

Change-Id: I4ff41a52f7ad4ee8fd80cbf7b394f04d6c4315b3
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
f265ea9d8307282ff1da3915978625a94fc2859e 01-Feb-2013 Dianne Hackborn <hackbod@google.com> App ops: vibration, neighboring cells, dialing, etc.

Improve handling of vibration op, so that apps are
better blamed (there is now a hidden vibrator API that
supplies the app to blame, and the system now uses this
when vibrating on behalf of an app).

Add operation for retrieving neighboring cell information.

Add a new op for calling a phone number. This required
plumbing information about the launching package name through
the activity manager, which required changing the internal
startActivity class, which required hitting a ton of code that
uses those internal APIs.

Change-Id: I3f8015634fdb296558f07fe654fb8d53e5c94d07
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
80943d8daa6ab31ab5c486d57aea406aa0730d58 02-Jan-2013 Svetoslav Ganov <svetoslavganov@google.com> Adding UI test automation APIs.

This change adds APIs support for implementing UI tests. Such tests do
not rely on internal application structure and can span across application
boundaries. UI automation APIs are encapsulated in the UiAutomation object
that is provided by an Instrumentation object. It is initialized by the
system and can be used for both introspecting the screen and performing
interactions simulating a user. UI test are normal instrumentation tests
and are executed on the device.

UiAutomation uses the accessibility APIs to introspect the screen and
a special delegate object to perform privileged operations such as
injecting input events. Since instrumentation tests are invoked by a shell
command, the shell program launching the tests creates a delegate object and
passes it as an argument to started instrumentation. This delegate
allows the APK that runs the tests to access some privileged operations
protected by a signature level permissions which are explicitly granted
to the shell user.

The UiAutomation object also supports running tests in the legacy way
where the tests are run as a Java shell program. This enables existing
UiAutomator tests to keep working while the new ones should be implemented
using the new APIs. The UiAutomation object exposes lower level APIs which
allow simulation of arbitrary user interactions and writing complete UI test
cases. Clients, such as UiAutomator, are encouraged to implement higher-
level APIs which minimize development effort and can be used as a helper
library by the test developer.

The benefit of this change is decoupling UiAutomator from the system
since the former was calling hidden APIs which required that it is
bundled in the system image. This prevented UiAutomator from being
evolved separately from the system. Also UiAutomator was creating
additional API surface in the system image. Another benefit of the new
design is that now test cases have access to a context and can use
public platform APIs in addition to the UiAutomator ones. Further,
third-parties can develop their own higher level test APIs on top
of the lower level ones exposes by UiAutomation.

bug:8028258

Also this change adds the fully qualified resource name of the view's
id in the emitted AccessibilityNodeInfo if a special flag is set while
configuring the accessibility service. Also added is API for looking
up node infos by this id. The id resource name is relatively more stable
compared to the generaed id number which may change from one build to
another. This API facilitate reuing the already defined ids for UI
automation.

bug:7678973

Change-Id: I589ad14790320dec8a33095953926c2a2dd0228b
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
c0bd747b0605af251ff136277f14220a5a4c9818 09-Oct-2012 Dianne Hackborn <hackbod@google.com> Further work on issue #7307399: Framework needs a new pre-user-shutdown...

...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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1 28-Sep-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7211769 and #7244492, thrash around on #7226656.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
b12e1354f25f04e9c9a71da76c6fca858b7d39d0 26-Sep-2012 Dianne Hackborn <hackbod@google.com> Maybe fix issue #7211766: bindService() to User u0 While u10 is...

...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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
43aa15912891930833edfc101615a9c881de54a1 11-Sep-2012 Jeff Brown <jeffbrown@google.com> Allow adb shell am display-size to use bigger sizes.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
1676c856d61b97c871dc2be0cb1f1fb1e12e24e9 10-Sep-2012 Dianne Hackborn <hackbod@google.com> Flesh out multi-user in am commands.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
649d0d71b245d88746b78399ffa1f75da7c80974 07-Sep-2012 Dianne Hackborn <hackbod@google.com> Merge "More multi-user stuff:" into jb-mr1-dev
5e03e2ca7d25b899b129baad2dd5eca6bf99d88a 06-Sep-2012 Dianne Hackborn <hackbod@google.com> More multi-user stuff:

- 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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
3065963f817f9a0f032ec7992c4154cfdeed443d 06-Sep-2012 Felipe Leme <felipeal@google.com> Wrapped call to notifyAll() in a synchronized block

Change-Id: I452caa56bef4541b53917bdd6f22034161255dd1
Bug: 7118468
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
e2bdca5c4330b6bc9cc26480ae4c1eefe5ee9ce9 04-Sep-2012 Dianne Hackborn <hackbod@google.com> Fix my fix.

Change-Id: I35fce760f8d91fceb554d372e7423749a4ac6d2d
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
52fba38f7d155e22e7487fc173243b4df2a9e76a 04-Sep-2012 Dianne Hackborn <hackbod@google.com> Fix build.

Change-Id: I15592889b8679d946e402dcfdeb124df349cbd4d
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
80a4af2bbc6af42ae605e454bf89558e564f5244 28-Aug-2012 Dianne Hackborn <hackbod@google.com> Start implementing concept of "running" users.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
7e0e19d4201374d72b7082492bd269dbdb17d972 27-Aug-2012 Dianne Hackborn <hackbod@google.com> Restore man page entries.

Change-Id: I002808037ec117c039aeb71f425c1f43d4cac6d8
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
7767eac3232ba2fb9828766813cdb481d6a97584 24-Aug-2012 Dianne Hackborn <hackbod@google.com> Keep track of whether an app is installed for each user.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
dde331cebd87982faded6818ad5f9927ff994c96 03-Aug-2012 Dianne Hackborn <hackbod@google.com> We can now (kind-of) change screen density on the fly.

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.
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
59c009776dae5ccbdfb93d7151ff2065ca049dc3 30-Jul-2012 Craig Mautner <cmautner@google.com> Introduce multiple displays with DisplayContent.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
fd3d009dde21d7670d42d26f197f67c4c8e59184 31-May-2012 Amith Yamasani <yamasani@google.com> Remove some unnecessary man page entries

Change-Id: I1ceda3f5efac83b80ab4b6e7cae4086aeed5062a
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
13b907353f18215b52b5ceda24bbf520d91d72a1 21-May-2012 Romain Guy <romainguy@google.com> Remove unused, obsolete debug code

All these features have either been abandonned and left un-maintained
for years or can be replaced by systrace.

Change-Id: I42e4579a8078744047e5fe08a7a15254970b09bc
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
7df7d2022d9bebc21a13dcb7ddacaa61f9c2e38e 20-Apr-2012 Dianne Hackborn <hackbod@google.com> Fix issue #4499996: LiveWallpaperPreview activity intent filter

Change-Id: I5fc71503d2c59c907da954dbda3587394e6405bf
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
483f3b06ea84440a082e21b68ec2c2e54046f5a6 14-Mar-2012 Amith Yamasani <yamasani@google.com> Package restrictions per user

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
a4972e951bf2bdb7afdafee95b3ab0c15b8bacae 14-Mar-2012 Dianne Hackborn <hackbod@google.com> Add new "options" argument to all startActivity APIs.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
92a8b22e7410e74e1cba1b856333116652af8a5c 10-Mar-2012 Siva Velusamy <vsiva@google.com> ActivityManager: add option to allow OpenGL trace.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
3a2ce935b94383141d1c8a7878fa9308ce718fe5 15-Aug-2011 Mike J. Chen <mjchen@google.com> Add the ability to pass float extras to AM.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
742a67127366c376fdf188ff99ba30b27d3bf90c 04-May-2011 Amith Yamasani <yamasani@google.com> Multi-user - 1st major checkin

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
f5b8671c340f189c50b41c53622f979b6d5e0a57 06-Dec-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5714517: App shortcuts can result in bad task intents

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
d8c98fee02b5498270344727d1289004d98c0e73 15-Nov-2011 Dianne Hackborn <hackbod@google.com> Improve low memory dropbox reporting.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
e4d4fbc8c0257a79d9c6091cea2c264415bd2733 08-Nov-2011 Dianne Hackborn <hackbod@google.com> Add drop box reports of low memory.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
2c84cfc001fb92a71811bf7384b7f865ff31ff9d 31-Oct-2011 Dianne Hackborn <hackbod@google.com> Various performance and other work.

- 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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
0bb1e9139e30aa954f46b0b6fdec2595fac33b80 16-Aug-2011 Dianne Hackborn <hackbod@google.com> Small improvements to am command.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
62f20ecf492d2b29881bba307c79ff55e68760e6 16-Aug-2011 Dianne Hackborn <hackbod@google.com> Add new am option to profile the launching of an activity.

Change-Id: Ie71a8043eafe41f53a0b3dbb5170276d87acbc9b
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
7eabe55db6b113f83c2cefcd06812648927de877 21-Jul-2011 Romain Guy <romainguy@google.com> Add looper profiling to adb shell am

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
8ffb0c0210857210a51d7a9a0f1afb73afbf8677 08-Jul-2011 Guang Zhu <guangzhu@google.com> allow Uri as intent extra in am command

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
46d110329e659cc9cb9514e220ce273701eb151d 24-Jun-2011 Dianne Hackborn <hackbod@google.com> Small cleanup of am/pm commands.

Change-Id: I5af730bc177635821a82d4dd3ec9130a5dcd525a
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
351f32270a489577e040bbeccc423b0bac1637dc 13-May-2011 Xianzhu Wang <wangxianzhu@google.com> Add force-stop subcommand for 'am'.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
7916ac65dc492e4e1431879875c77d7121fbf82e 17-May-2011 Dianne Hackborn <hackbod@google.com> Add new command line option to change global screen size.

For example:

adb shell am display-size 1024x600

Change-Id: I5df462acd3323bdaaaefa3126faea7dd8595b726
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
0f1de9adde0b52d2a385a76232bd7ac30c3eeea2 12-May-2011 Dianne Hackborn <hackbod@google.com> New compat mode front end: UI and persistence.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
e2515eebf42c763c0a2d9f873a153711778cfc17 28-Apr-2011 Dianne Hackborn <hackbod@google.com> Better compat mode part one: start scaling windows.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
405e012681aa563b1d7b66c671c90ed2deb26e41 25-Sep-2010 Dianne Hackborn <hackbod@google.com> am deaa8ff1: am a7ef18fc: Merge "Some debugging support." into gingerbread

Merge commit 'deaa8ff1b10d38add4f7c276e7be2ffc19359a14'

* commit 'deaa8ff1b10d38add4f7c276e7be2ffc19359a14':
Some debugging support.
f123e49bf0708719b51a7064ae134c097abe4a54 24-Sep-2010 Dianne Hackborn <hackbod@google.com> Some debugging support.

- 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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
846df9f5171c4ef32f038cca651b6b9c0b6c3083 24-Sep-2010 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 8952a448 to master

Change-Id: I9c752a5d10ae8d8e5ead1243b6abd4795204fc0b
287952c35e148811c106bc0f5036eabf20f71562 23-Sep-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3022508: Crash during media scan

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
2d1b7a22390a355aa079473810e2b9914af88274 08-Sep-2010 Jack Veenstra <veenstra@google.com> Add support for giving arrays of ints and longs to the "am" command.

Change-Id: Ibc4ae63fb5f8025a847bec7d37a1fce5abd81b39
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
f9b5eed81d690ab8f336cb3345b46a36e278f180 30-Aug-2010 Joe Malin <jmalin@google.com> Doc Change:ActivityManager usage doc:running test package

Change-Id: I9a0c28e59f87e30c81d18162bee082b851d07a94
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
6a69b4fbaee9a8251401453cd2d3509d52f5b91c 25-Aug-2010 Makoto Onuki <omakoto@google.com> Add --el option to am for long extras.

Change-Id: I13b92284fa4e0765620552b7d9b08d7441254389
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
7b750542d68773c0df12ec747af292d458b59f45 13-Aug-2010 Daniel Sandler <dsandler@google.com> Fix incorrect usage text for am.

Change-Id: I95afb3bd02ce23bb8d0797ec4c33e27a9530988e
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
824c510752fd6a30cdba5ed7324cb80a5043ce26 10-Jul-2010 Andy McFadden <fadden@android.com> Allow "am" to initiate heap dumps.

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
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
d6c0bb0f0f3827f1c336db20ac9dc0eb90cd46fa 19-May-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I0598edad283a177a5ddcc30e20d2284503e6038e
746a95ab7145a1c7583d1f2d6004a508cd7a31dc 17-May-2010 Christian Mehlmauer <FireFart@gmail.com> Removed Calls to deprecated APIs

Change-Id: I3f9b6a8d3c8a050156a6cc7ea0eb9de33b82f79a
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
69acb6b746c82f88607b3365795ebb3279188eed 16-Apr-2010 Jean-Baptiste Queru <jbq@google.com> Unify am startservice commands.

This replaces the implementation with an equivalent one.

Change-Id: I1343ddee9414a67906cd426b8381ddbace873894
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
d4dd85d532dcd383a2f6b421e747b5ab07246d19 14-Apr-2010 Anthony Newnam <anthony.newnam@garmin.com> Allow Am to start services

Change-Id: I31d066ae2c980cc293e55034446a63a0f42088ad
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
5ef402baafc4818ccdf2aaec5da9cf25dd1c0e12 27-Mar-2010 Dianne Hackborn <hackbod@google.com> Fix issue #2538228: Intents targeting browsers constantly nagging

Some applications are setting the MIME type field for an http:
intent, which is technically wrong because the recipient opening
the URI will get the MIME type from the header. This was hitting
a bug when we compute the intent filter when setting the
preferred activity, where we have to set both the MIME type and
data URI for the intent filter. (For file: and content: URIs
only the MIME type is needed, since these can be opened directly
through ContentResolver so everyone is presumed to be able to
handle them.)

Change-Id: Ia7025e6859e9c90997bf56c2c80f225fca7a2007
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
8f7f35e0ccd91c964b9d3eeef81ff829622dfa74 26-Feb-2010 Dianne Hackborn <hackbod@google.com> Add new -W option to Am to wait for the start to complete.
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
6fb35fe1accfbdcbf0252e55cf7ef823c12f4c05 24-Feb-2010 Doug Zongker <dougz@android.com> add "startservice" option to am command-line utility

Allows starting Services in addition to Activities.

Change-Id: Ib078115f6200faa8907b35909af2f64b0c563b38
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
305e1b8fe926430e63d167ebed0c1f4d191ebcdc 01-Dec-2009 Doug Zongker <dougz@android.com> add --esn option to am to allow adding extra with a null value
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
68d881cf2d2b252f6f795cd64d43e316a1d736e5 05-Oct-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2166755: BroadcastReceiver trying to return result during a non-ordered broadcast

Tell the broadcast receiver whether it is getting an initial sticky value,
so it will be quiet about attempts to do ordered broadcast stuff.

Note that the original bug being reported was not actually a crash, just
an error log. So all we are doing here is making the log quieter.

Change-Id: Iaf1b718d82093ec1197142410a64feff47eb3859
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
9f4af53561daae8ffe77157068d67ab10d9e2a4d 22-Jul-2009 Dan Egnor <egnor@google.com> Make intent broadcasts in "am" synchronous (they wait until exit).
Clean up error handling and reporting in "am".
Make the usage message for "am" more informative.

Make it easier to turn on logging in GoogleHttpClient.
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
9c8dd55a9d829c29a3feee9469d8c2f27a9f5516 24-Jun-2009 Dianne Hackborn <hackbod@google.com> Fix bug 1829561 ("am profile" with bad filename kills process).

The am command is now the one that takes care of opening the target file,
handling the opened file descriptor to the process that will be profiled.
This allows you to send profile data to anywhere the shell can access, and
avoids any problems coming up from the target process trying to open the
file.
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
c62a216a2bb877b3b8c968cc90ab6c1f10605edc 04-Jun-2009 Marco Nelissen <marcone@google.com> The '-D' option for the 'am' command appears to be optional, so reflect that in the usage.
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
95fc68f24a2a93e5664e2234abcfe479d385cc05 20-May-2009 Dianne Hackborn <hackbod@google.com> Fix issue where apps could prevent the user from going home.

Now we have a 5-second time after home is pressed, during which
only the home app (and the status bar) can switch to another app.
After that time, any start activity requests that occurred will
be executed, to allow things like alarms to be displayed. Also
if during that time the user launches another app, the pending
starts will be executed without resuming their activities and
the one they started placed at the top and executed.
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
f5b4b98fada53d91c4c2ebeb5a1d33ccc95c94d2 06-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@136745
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/cmds/am/src/com/android/commands/am/Am.java