History log of /frameworks/base/core/java/android/app/ActivityManagerNative.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
89927b3cd96472c478a988d6c731cd09d412a043 28-Jul-2016 Rubin Xu <rubinxu@google.com> Allow direct-boot aware activity to show before profile is unlocked

Work profile challenge is shown by intercepting normal activity launching and
replacing it with the confirm credential activity. For direct boot aware
activities, they should be able to be displayed when the work profile is
still locked, so add a conditional in the activity intercepting logic to bypass
work challenge in this case.

Also launching work profile activities from notification is handled specially
in order to avoid dismissing the notification if the work challenge is canceled,
so add similar logic there to allow direct boot aware activity to go through.

Bug: 30296144
Change-Id: Ib6395271cee2d4781009bb08d50351d73824de0c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
f6782ee1c87ba1f39f595d1facb8b13d851988b9 22-Jul-2016 Jorim Jaggi <jjaggi@google.com> Move SysUI to top app scheduling if panel expanded

Also fixes a bug which didn't set the correct renderThreadTid
when restarting an app (for example, when SystemUI gets killed).

Bug: 30292998
Change-Id: I420bee8a11d430b1e52ded050536e56a85a48800
/frameworks/base/core/java/android/app/ActivityManagerNative.java
33eb07f5759b85a5617f8057d8a335019c7d24dd 10-Jun-2016 Tim Murray <timmurray@google.com> Add new mode for SCHED_FIFO on UI and RenderThreads.

Add a new mode, controlled by sys.use_fifo_ui property, that enables the
top app's UI and RenderThread to be SCHED_FIFO. This eliminates almost
all jank due to scheduling competition with non-UI critical
threads. This mode may not be suitable for all devices.

bug 24503801

Change-Id: I7b8a31830ad80f7efa00236928d5476998ed4e00
/frameworks/base/core/java/android/app/ActivityManagerNative.java
5e261441d3a5920bf69b827d8a2491848b91b50e 30-Jun-2016 Tim Murray <timmurray@google.com> Merge "Add a new API to improve VR thread scheduling." into nyc-mr1-dev
e535a5827b7b7c7c70f4701d74051c9bb5eb0b98 28-Jun-2016 Srinath Sridharan <srinathsr@google.com> Add a new API to improve VR thread scheduling.

Adds a new API that enables device-specific scheduler optimizations for
latency-sensitive VR threads.

BUG: 29163534
Change-Id: I58d7be0eb266eca452c804cd07004784fb7daf2b
/frameworks/base/core/java/android/app/ActivityManagerNative.java
3362400aa5a22ded3ec256bc6bbff06d036fdc41 30-Jun-2016 Jeff Sharkey <jsharkey@android.com> Move getRecentTasks() to ParceledListSlice.
am: 479212cf50

Change-Id: Ic76f624396117d922aac60eac9c2caae4f1d7e27
479212cf500193db6f1cf109ee58d72885f60a74 30-Jun-2016 Jeff Sharkey <jsharkey@android.com> Move getRecentTasks() to ParceledListSlice.

In extreme cases the list of recent tasks can grow beyond the size
of a single Binder transaction. This change moves over to
ParceledListSlice which handles chunking any large results.

Bug: 29635557
Change-Id: Iaf1227234f5f8c9451f73a6a5c1dc89f2067f05f
/frameworks/base/core/java/android/app/ActivityManagerNative.java
38d7897690b61378d94cfe3553d083648aca8e43 23-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Print names of observers causing timeout" into nyc-mr1-dev
0b77ef9f5199b7cd0956f2bfe049cbd699ca03b4 21-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Print names of observers causing timeout

Pass and store name in registerUserSwitchObserver and later print names of
observers causing timeout.

Bug: 29039588
Change-Id: I09c4bcc986168a07f5e20ad0f38667b783332288
/frameworks/base/core/java/android/app/ActivityManagerNative.java
85f449eaba207d5d3a72bd091855a02ff019404c 23-Jun-2016 Jeff Sharkey <jsharkey@android.com> When uninstalling, only kill the requested user.

When an app is being uninstalled for a specific user, only kill the
app under that user; leave the app running under other users.

Bug: 28875343
Change-Id: Ie60753cfd22df10a2b17d8c3732b6f19d2fe1fb9
/frameworks/base/core/java/android/app/ActivityManagerNative.java
1c3be1a5b19b5f29eb8466d8b746a28d5a48e935 17-Jun-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of cffb19c to mnc-dev am: 3f9ea2d386 am: d6c1126fab am: e2c9b1af3e
am: d2a4e1b39c

Change-Id: I8e59a88278ba50ab7e3768031611065131ed6834
3f9ea2d386507fd814b33fd9fa6c2a2824f80416 17-Jun-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of cffb19c to mnc-dev

Change-Id: I4dba574de2678d851e3d82961a07de27d61f5940
cffb19c812dd6d619e292519ca5ede61310aeab6 17-Jun-2016 Christopher Tate <ctate@google.com> Don\\\'t trust callers to supply app info to bindBackupAgent() am: c58054f25f am: cd777e95a7
am: ec6c3f7a32

Change-Id: Idc2b6c712078493b4186edad750d8d5beab58adf
cd777e95a77ba0035566088a5432aa28a409e7d1 17-Jun-2016 Christopher Tate <ctate@google.com> Don\'t trust callers to supply app info to bindBackupAgent()
am: c58054f25f

Change-Id: I3b0bd91c38b5f13770f09f39c2eea78b63c29d7c
c58054f25fb8ad624a749ed48e3f5775de4bec14 14-Jun-2016 Christopher Tate <ctate@google.com> Don't trust callers to supply app info to bindBackupAgent()

Get the canonical identity and metadata about the package from the
Package Manager at time of usage rather than rely on the caller to
have gotten things right, even when the caller has the system uid.

Bug 28795098

Change-Id: I215786bc894dedf7ca28e9c80cefabd0e40ca877
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a1b79bfd7a15006a93da933695359765e0fee495 24-May-2016 Felipe Leme <felipeal@google.com> Allow apps to bypass Power Save restrictions when launched from a Notification's PendingIntent.

This scenario typically happens when the device is on Doze Mode and a
notification action is triggered from a Wear device.

In a nutshell, the workflow is:

- ProcessRecord has a flag telling whether a process has "whitelist
management" privileges.
- When NotificationManager binds a new NotificationListenerService, it
sets the BIND_ALLOW_WHITELIST_MANAGEMENT flag.
- On bind(), ActiveService asserts that only system apps can set that
flag.
- On computeOomAdjLocked(), ActivityManagerService sets the
ProcessRecord flag if necessary.
- Upon creating a notification, NotificationManager calls AM to mark its
PendingIntents as coming from a notification.
- When PendingIntentRecord sends it to the target, it checks if it's
from a notification and if so calls AM to do the temp whitelist.
- On unbind(), ActiveService removes the ProcessRecord flag if necessary.

Fixes: 28818704

Change-Id: I00d46036a2cbb73f7f733fd35bf0b743a02807a1
/frameworks/base/core/java/android/app/ActivityManagerNative.java
5035d29dcc418e7081cbfb7113d73bd4fd72cb25 23-May-2016 Dianne Hackborn <hackbod@google.com> Fix issue #28868955: CTS: PendingIntentTest failures; Regressed in NRD48x

Uh, yeah.

Change-Id: I452187fcdda634ebf00e5d6bcaa45433f348c17e
/frameworks/base/core/java/android/app/ActivityManagerNative.java
0c4e6a8da3405f742e5cef8afdf579d58b6f1246 14-May-2016 Dianne Hackborn <hackbod@google.com> Fix issue #27532364: Security Vulnerability in IIntentSender.send

We need to make IIntentSender oneway... but when the system is
calling that for itself, it needs to be able to return a result code.

Solution: instead of directly calling the interface, we have a new
IPC through the activity manager. If the thing being used is the
activity manager impl, it can do the synchronous send and return
the result directly in place. If not, you only get asynchronous
sending and thus never a failure result back (too bad for you!).

Change-Id: I4096e5b00063e8dba66230585a2dfe67e35e8092
/frameworks/base/core/java/android/app/ActivityManagerNative.java
4f128e4d968b376bb7c3fa209d27b0a30202e604 10-May-2016 Amith Yamasani <yamasani@google.com> Fix multi-window assiststructure trashing

When multiple activities within the same process
try to handle requests for AssistStructure, the
singleton mLastAssistStructure tends to trash
the old structure when a second window's request
comes in.

This change passes in a sessionId so that the
cache is only cleared if the session id changes.

Bug: 28348867
Change-Id: I07efcd933db7e48aefd25a1c95493b71bbcffe4b
/frameworks/base/core/java/android/app/ActivityManagerNative.java
058895407140de0e513b82150c3acb6131e971a2 06-May-2016 Chris Tate <ctate@android.com> Merge "Move the 'pretend idle jobs can run now' broadcast into AMS" into nyc-dev
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/core/java/android/app/ActivityManagerNative.java
99732940809058fae558618399323c36b8a0e856 06-May-2016 Wale Ogunwale <ogunwale@google.com> Dismiss docked stack if an activity is shown on top of the lock screen

It is risky/complicated to try to put the activity showing on-top of
the lock screen in the right fullscreen configuration with the current
architecture. So, we just dismiss for now.

Bug: 28195260
Change-Id: I29a0350993ce8fe548d4a465b06d877cde151c78
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a4d92a01521e560d00616b483143f2d07ebd755b 02-May-2016 Wale Ogunwale <ogunwale@google.com> Don’t relaunch activity in fullscreen stack when entering split screen mode

When entering split-screen mode by long pressing the recents button, the
top task in the fullscreen stack is moved to the docked stack and the new
top task is the fullscreen stack is considered visible for a short amount
of time until sys-ui launches the recents activity. This causes the new
top activity in the fullscreen stack to be relaunched due to configuration
change.
To fix this sys-ui now sends an hint to activity manager to move the home
stack forward so that it can be on-top of the fullscreen stack and makes
it invisible before recent is launched and animated in.

Bug: 28470261
Change-Id: Icfd85e932fe913dfb498752b5878cc7c690fd559
/frameworks/base/core/java/android/app/ActivityManagerNative.java
646fe9913e5f5dda3d03d54ed6c6e9463a4161d0 21-Apr-2016 Tony Mak <tonymak@google.com> Fix wrong app is launched after solving challenge from tapping notification

PendingIntent.FLAG_ONE_SHOT is needed to prevent the PendingIntent being
reused.

Also, flag and activity option of credential intent in BaseStatusBar
is not same as the one in ActivityStarter. Added a new
function startConfirmDeviceCredentialIntent in AM to centralize it.

Change-Id: I2d9e5923ad5d4d012f10057c409c666c8ca299a3
Fix: 28309964
/frameworks/base/core/java/android/app/ActivityManagerNative.java
67324c990c4fbad238119a4667341d5618b2bea2 18-Apr-2016 Dianne Hackborn <hackbod@google.com> Work on issue #28221912: Starting service as foreground might...

...kill previous notification.

Add new platform API to detach a notification from a service
without dismissing it.

Also, while I am here, add some more @IntDefs.

Change-Id: I3bb46d9cd3db7f73716c8ced19c20fea800eb30d
/frameworks/base/core/java/android/app/ActivityManagerNative.java
5981b8c2e8f6363d1f3bf09e7f1b3b5fb9a3846a 15-Apr-2016 Andrii Kulian <akulian@google.com> Merge "Remember task which is being locked" into nyc-dev
0f051f5abdb31024d862a954cc4c4716b1dde616 14-Apr-2016 Andrii Kulian <akulian@google.com> Remember task which is being locked

We need to remember task which requested to be locked
because we can accidentally lock another task after
user interacts with pinning request dialog.

Bug: 27876860
Change-Id: Ie8e607df4380dd33ea9b3474afc247b02e31de07
/frameworks/base/core/java/android/app/ActivityManagerNative.java
e8222e551f8abd2d82ca4f77ddb275e2e509751e 09-Apr-2016 Amith Yamasani <yamasani@google.com> Multi-window assist callback

Introducing a new callback in VoiceInteractionSession to
provide assist data for additional activities in the
foreground in a multiwindow setup.

PIP, docked windows and free-form windows (top-most)
will be queried for assist data and passed through the
new API to the Voice Interaction service.

Bug: 27718385

Change-Id: Ib4427c304611b75c2078dcb54f1f7e47ae7d9cfa
/frameworks/base/core/java/android/app/ActivityManagerNative.java
b5e89c6debca90be92bf5bc2e0e79d109de6d08f 02-Apr-2016 Jeff Sharkey <jsharkey@android.com> Support direct-boot tests.

Add shell commands to check on current FBE status and system ready
status. Mark variables without first-class locking as volatile.

Fix bug where UI automation would crash while device was locked by
marking it as forced direct-boot aware.

Bug: 26498834
Change-Id: Ib4dfb9350925e5413f93a09baacf84c62f2ba0ea
/frameworks/base/core/java/android/app/ActivityManagerNative.java
933076d80561751618f462b26309ce9e4c3ff3bf 30-Mar-2016 Andrii Kulian <akulian@google.com> Refactor usages of Picture In Picture and Multi Window (1/4)

Bug: 27365860
Change-Id: I1590e430a12ceb84cb83da295e0bf7e4378fea96
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
85941cff0c65bc023e4ca29c0eac8548c8f61be6 21-Mar-2016 Wale Ogunwale <ogunwale@google.com> Merge "Added support to specify animation duration when resizing stack" into nyc-dev
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/core/java/android/app/ActivityManagerNative.java
9c6e8ced9b6913657f48c38c208b1b594500c0e1 21-Mar-2016 Tony Mak <tonymak@google.com> Show launcher when profile is locked immediately

Previously, we show launcher when keyguard is dismissed.
It introduces these issues:
1. There can be no device lock
2. user could take a quick peek of the work app

Current behavior:
1. We now show launcher once the work profile is locked.
2. Lock profile immediately if there is no device lock
3. Add cancel "lockProfileLater" logic

Bug: 27241680
Bug: 27673460
Change-Id: I765aa22d4c8ae5017c1611f5a340a4b33d463b1e
/frameworks/base/core/java/android/app/ActivityManagerNative.java
d5c2db630fc816e2d9154a61ccbd6770bc57cff8 09-Mar-2016 Adrian Roos <roosa@google.com> Don't show wallpaper when backdrop is visible

Hides the wallpaper when it's not needed and fixes
the unlock animation to not unnecessairly show the
wallpaper if neither the Keyguard nor the underlying
app need it.

Also fixes a bug where the enter animation had a background
set, which led to uglyness when no wallpaper is involved.

Bug: 27533740
Change-Id: I667c6f7ca6c0e1ff7e9f793c6ddc13f6da8387b1
/frameworks/base/core/java/android/app/ActivityManagerNative.java
d47e7e1176dcf6961c7c9fce215f48f03a5098d1 01-Mar-2016 Jorim Jaggi <jjaggi@google.com> Add ability to swap docked/fullscreen stack

Adds tap affordance that moves all tasks of the docked
stack into the fullscreen stack as well as moves the top task
of the fullscreen stack into the docked stack.

Also make sure not to trigger focus switch when tapping the divider
handle. For that, add a method so SysUI can specify the touchable
region which then gets excludes for the focus switch touch region.

Bug: 27358134
Change-Id: I34f39c53cacc0b9c00f87a792b88c3f64a5f61e1
/frameworks/base/core/java/android/app/ActivityManagerNative.java
e24b9a6cfa4d565d7f49c9ae8f3aeca737d93312 17-Feb-2016 Ruben Brunk <rubenbrunk@google.com> Add a VR listener service.

Bug: 22855417
Bug: 26724891
Bug: 27364145

- Add an API for VrListenerService, which is bound/unbound
from the framework when the system VR mode changes.
- Allow only a single bound VrListenerService at a time.
- Monitor allowed VrListenerService implementations from
VrManagerService and evict services as needed when packages,
users, or settings change.
- Remove previous VR functionality in NotificationListenerService.
- Add component target to Activity#setVrMode to allow
explicit selection of the running VrListenerService from
the current VR activity.

Change-Id: I776335f4441be0e793d3126f2d16faf86a8c621a
/frameworks/base/core/java/android/app/ActivityManagerNative.java
adef831761017d6d84d7bd4a388714a04fb73d66 03-Mar-2016 Rob Carr <racarr@google.com> Merge "Reimplement PIP animation to not use drag resizing." into nyc-dev
0d00c2e25bf8816dbd99f4fcd5c8221e80826a95 01-Mar-2016 Robert Carr <racarr@google.com> Reimplement PIP animation to not use drag resizing.

When using drag resizing it is difficult to keep big surface
surfaces (e.g. main app windows) and child windows in sync
as we resize. Furthermore it's difficult to resize child windows
quick enough to achieve more than a few frames a second as we have
to propagate through the client UI thread. Our new implementation
uses window scaling.

Bug: 26454664

Change-Id: Iac96619cefc075b1412cfeba3d3c9bcd7ce22f52
/frameworks/base/core/java/android/app/ActivityManagerNative.java
5d9de3ab6f768c9b9d5c4fa627ce019f74370531 02-Mar-2016 Chong Zhang <chz@google.com> Merge "Don't change resize mode if AM didn't dock the task as requested" into nyc-dev
e4fbd328f83ea0ee086731f852cd6c56a3deb733 01-Mar-2016 Chong Zhang <chz@google.com> Don't change resize mode if AM didn't dock the task as requested

AM may not docked the task as requested if the task is not resizeable.
Setting resizing in this case would cause unnecessary drag-resizing,
and the resize mode will go out of sync.

bug: 27390258
Change-Id: I72d671ac015f93fde5aaa025fbade93acd9d9ca7
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
970510b9c5299d480b3ec7f8403afd8265456f87 25-Feb-2016 Dianne Hackborn <hackbod@google.com> Work on issue #26390161: Throttle syncs/jobs when system is low on RAM

We now have a fixed array of job service contexts, which doesn't
vary by build configuration. Instead, we keep track of the maximum
number of concurrent jobs we want to allow to run, and don't
make use of a context if it would put us over that limit.

The available contexts is now 8 (the largest used to be 6), although
the maximum we will normally schedule is still 6. We have the other
two around only for use by the current foreground app, to allow it
to schedule work while the user is in it, even if we have reached
our normal limit on the number of concurrent jobs.

The maximum number of concurrent jobs varies based on the memory
state of the device, from 6 (if memory is normal) down to 1
(if memory is critical). We aren't yet trying to stop all jobs
if memory gets lower than critical.

Instead of just keeping track of whether a uid is in the foreground,
we now track whether it is the top as well. Only the top uid
can schedule additional jobs above the current limit.

Also improved some of the dumpsys output.

Change-Id: Icc95e42231a806f0bfa3e2f99ccc2b85cefac320
/frameworks/base/core/java/android/app/ActivityManagerNative.java
b2117d15d196dc29e4fc50d70cd8a10a04492e9c 17-Feb-2016 Dianne Hackborn <hackbod@google.com> Implement lenient background check option.

Which really means, make background check much more
strict, with an option to revert to the more lenient
behavior.

In this strict version, an app can't have services
started or receive broadcasts at any point when it is
not foreground. Also, it doesn't matter the importance
of a caller trying to start a service, it only depends
on the state of the app whose service is being started.

A new activity shell command allows you to control
whether to use the strict or lenient behavior.

Change-Id: I7f5a50b52881b5c8f9d8b6c8c622d3652a769fd7
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
480dca0d1b08f8895f66f857e9bd341033fab2d9 06-Feb-2016 Wale Ogunwale <ogunwale@google.com> Reduce jank during pinned stack animation

- Don’t launch Pip overlay activities during pinned stack animation.
This causes extra CPU load and takes a way resources from the running
animation.
- Finish Pip overlay activities before starting pinned stack resize
animation. Reduces the amount of work the system needs to do to keep
the overlays in-sync with the other activities in the pinned stack.
- Use AM.resizeStack with null bounds to take Pip to fullscreen so that
we can animate the bounds changed.
- Also, fixed Activity.enterPictureInPicture API to animate the transition
if Pip is entered from the app instead of Pip manager.

Bug: 25672053
Change-Id: I82399c10f1b8c675ea3861ba973dc8ecfbfbe50f
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
3b93a4d351aeb154fba8a4b2fa66ca25a951993d 30-Jan-2016 Wale Ogunwale <ogunwale@google.com> Renamed Activity class multi-window APIs

As requested by API council.

Bug: 26507736
Change-Id: I2a87c5eb3c1b48d52703103c2a4f72c250a9a827
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
0af6fa7015cd9da08bf52c1efb13641d30fd6bd7 18-Jan-2016 Amith Yamasani <yamasani@google.com> Voice Interaction from within an Activity

This allows an app to show a voice search button
and invoke a voice interaction session for use
within the activity. Once the activity exits, the
session is stopped.

Test application has a new activity that
demonstrates it with the test voice interaction
service.

This initial version is functional enough for
an integration test, with some more tests
and improvements to come later.

Bug: 22791070
Change-Id: Ib1e5bc8cae1fde40570c999b9cf4bb29efe4916d
/frameworks/base/core/java/android/app/ActivityManagerNative.java
2fd3f122bfb3557f3324a480e09c8777eaf53b6f 15-Jan-2016 Wale Ogunwale <ogunwale@google.com> Merge "Allow AMS.moveTasksToFullscreenStack moving tasks onTop"
9101d2664388e234de1a2b3fd9e82fd777c1c407 15-Jan-2016 Wale Ogunwale <ogunwale@google.com> Allow AMS.moveTasksToFullscreenStack moving tasks onTop

Bug: 26573473
Change-Id: I4517ac2b3e803637971c329be2511ba66412d815
/frameworks/base/core/java/android/app/ActivityManagerNative.java
63fec3ef1adb6c447cd505679714a8e780d18263 12-Dec-2015 Christopher Tate <ctate@google.com> Don't full-data back up apps in foreground-equivalent state

We have to kill the app and bring it up in a controlled lifecycle mode
in order to do full-data backup, and if it's e.g. playing media, this
is hugely disruptive. Instead, we now check whether an app being
considered for full-data backup is in a user-observable state, and
defer its backup if so. We don't kick it all the way down the
daily-backup cycle in this situation -- we set it up to retry the
backup in just a few hours.

Bug 25960428

Change-Id: I576f25c6fb07545565f59bd685624c612b9c5ffd
/frameworks/base/core/java/android/app/ActivityManagerNative.java
42efc5860ffd130d28b780125e13c44a19848154 08-Jan-2016 Michal Karpinski <mkarpinski@google.com> Merge "Adjusting AMN#requestBugReport() to be able to invoke 3 types of bugreport services"
1a7d98b76c96a1214630b643c5519affe62badde 08-Jan-2016 Felipe Leme <felipeal@google.com> Merge "Added new API for URI permissions management."
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/core/java/android/app/ActivityManagerNative.java
411c06fbf9040f20778de1ae612e6ab5d6a5a3d4 07-Jan-2016 Filip Gruszczynski <gruszczy@google.com> Only allow activities to move to full screen stack.

We allowed activities to move to any stack, but that's too much
freedom. Instead we only allow them to move from freeform stack to a
fullscreen stack.

Change-Id: I04de9bbf18cf4431d7bd34d6c727de82802661ef
/frameworks/base/core/java/android/app/ActivityManagerNative.java
f3fa0f8fc689d644adc77e91c85e9311bc2f9c74 07-Jan-2016 Felipe Leme <felipeal@google.com> Added new API for URI permissions management.

The new methods are:

- getGrantedUriPermissions(String packageName)
- clearGrantedUriPermissions(String packageName)

These methods will be used by the Settings app to allow users to clear
the URI permissions granted to an application.

BUG: 26447975

Change-Id: I6867402e42b3d6fd03050ec57b73973ccd8a17af
/frameworks/base/core/java/android/app/ActivityManagerNative.java
fe89d122e5b6b129b25d5d5316f690bd4ab93fbb 22-Dec-2015 Jorim Jaggi <jjaggi@google.com> Add infrastructure to track activitiy relaunches

As a preparation to start synchronizing task size
with activity relaunches, we need a infrastructure
so we know in AM/WM when an activity is relaunching
and when it's done relaunching.

Bug: 26311778
Bug: 25015474
Change-Id: Ied3795eddbcd112f6329494afbf13178ca49a799
/frameworks/base/core/java/android/app/ActivityManagerNative.java
dc249c4ae7c7838928f53f151bfda8a6817b8784 15-Dec-2015 Jorim Jaggi <jjaggi@google.com> Change behavior when resizing docked stack

- Add an API resizeDockedStack to resize the docked stack
and supply temporary task bounds, which can be different from
the stack bounds.
- Use that API in SystemUI to only switch task bounds when
crossing thresholds, so we have less flickering and more
predictable resizing.

Bug: 25015474
Bug: 26311778
Change-Id: Id5c9277dd908ccc28f95dab023efc914757a50d0
/frameworks/base/core/java/android/app/ActivityManagerNative.java
854809c074aabebf5b6520c361d1d3c7c22066d2 28-Dec-2015 Wale Ogunwale <ogunwale@google.com> Added hidden API for specifying launch stack in ActivityOptions

Bug: 26273032
Change-Id: Ifb9c70e6783b0426613709693e11742d80ba2fc3
/frameworks/base/core/java/android/app/ActivityManagerNative.java
b23a757aa2f3088c9e9fd226e806aa5963b68d93 18-Dec-2015 Vladislav Kaznacheev <kaznacheev@google.com> Bind DropPermissions life cycle to Activity

Move requestDropPermissions from DragEvent to Activity.
Permissions will be granted using UriPermissionOwner
associated with this activity and revoked when the activity
is destroyed (if DropPermissions.release is not called before that).

Change-Id: Ic8f8fc3f56f57e83b9bc34ae8c96d82c2c9c4e1d
/frameworks/base/core/java/android/app/ActivityManagerNative.java
dd18a0b69537954d1cc34929a1386deb54f12b14 05-Dec-2015 Ruben Brunk <rubenbrunk@google.com> Add a framework service tracking VR mode state.

- Implement a "VR mode" that may be enabled by a focused Activity.
- Add a system service that tracks the current VR mode state and notifies
other core framework services of mode changes.
- Extend NotificationListenerService to allow the bind/unbind lifecycle
of specified listeners to be triggered by system events.

Bug: 22855417
Bug: 25479708

Change-Id: I1ac8692bbb5521bb6c7cfb9d2b56b98b720f8568
/frameworks/base/core/java/android/app/ActivityManagerNative.java
9c604c7c1db8f3dc5738b931805fc2d996135580 07-Dec-2015 Wale Ogunwale <ogunwale@google.com> API for an Activity to enter picture-in-picture mode.

Bug: 25580820
Change-Id: I5c1bf17dd5dd92622458a61517bc9941e4ee5277
/frameworks/base/core/java/android/app/ActivityManagerNative.java
88b3b57341e03fb4da2a798c547da40f2e1427c8 14-Dec-2015 Gustav Sennton <gsennton@google.com> Merge "Add functionality for changing WebView provider."
b3da834a914354741389e4dea16117b1d68c2ca4 11-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Move tasks to fullscreen stack when dismissing docked stack.

When we dismissing a docked stack we don't want to get rid of it,
but instead make it available in the full screen stack. We need to
make sure that it goes into the bottom of the stack and prevent it
from taking focus or running any animation, so the operation is
invisible to the user.

Bug: 25840497
Bug: 25823213
Change-Id: Ibd08d7b723a2847d98c435f79541d5eb43587064
/frameworks/base/core/java/android/app/ActivityManagerNative.java
6258dcd7ea5450726bc7bcb1fbd50e99f62f38fb 30-Oct-2015 Gustav Sennton <gsennton@google.com> Add functionality for changing WebView provider.

Make it possible to change WebView provider (through a Developer
setting) and kill all apps using the old provider.
This includes checking the signatures of the WebView providers to make
sure they are valid.

Now that we can change WebView provider through a setting it is possible
to change provider while some provider is being updated. Because of this
we now keep track of which provider should be in use in
WebViewUpdateService to make sure we use the correct provider at all
times.

We now also read WebView package meta data (name, package name, and
signature) from a separate xml file.

Main bug: crbug.com/546185

Bug: 25338573

Change-Id: I660fd1a40a5388f6569a06a7f0d029e8ff65945a
/frameworks/base/core/java/android/app/ActivityManagerNative.java
21d4b20f23c7fc7d88671375aea3c63d62780a10 07-Dec-2015 Felipe Leme <felipeal@google.com> Merge "Changed ActivityManager.requestBugreport() to take a 'progress' parameter."
5f986095bed776c119d2f5452e0afeac3a437ea2 05-Dec-2015 Wale Ogunwale <ogunwale@google.com> APIs for activity to know when its windowing/pip modes change

Added APIs that allow activities to ask the system if they are currently
in multi-window or picture-in-picture mode and also get notified when
their modes change.

Bug: 25509834
Bug: 25683717
Change-Id: I4b8c316a49940bd6a8b31a93b345f9fd725a4721
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
9ea2f7ba3155a455724f64e2d6a964ad4e99dfa5 24-Nov-2015 Jorim Jaggi <jjaggi@google.com> Add ability to supply initial bounds when docking task

Add an optional parameter in moveTaskToDockedStack to supply an
initial rect to be used when creating the dockeds tack. Pass in
the adjusted rect when dragging up from the navbar so it doesn't
flicker anymore.

Change-Id: Ieb3c8c73b9e2a769a2ec6270bd76a713201a2aed
/frameworks/base/core/java/android/app/ActivityManagerNative.java
030979c1e4ad269efa747eb3c03a4b0e3d820f55 21-Nov-2015 Jorim Jaggi <jjaggi@google.com> Don't play animation when docking stack with affordance

Change-Id: I1bb8ae4047e3de3a4ea159e7fad718914b9b5ba7
/frameworks/base/core/java/android/app/ActivityManagerNative.java
027bea555dc2d4fb76cec917d403765130db7668 19-Nov-2015 Jeff Sharkey <jsharkey@google.com> Merge "More file-based encryption work."
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/core/java/android/app/ActivityManagerNative.java
d93d481ea144bcf56f53b08fbedea2cd760463f4 19-Nov-2015 Suprabh Shukla <suprabh@google.com> Merge "Moving recent tasks information to a user directory"
2359314fd41801005993fc8416eeb4fb38dd75a0 04-Nov-2015 Suprabh Shukla <suprabh@google.com> Moving recent tasks information to a user directory

The directories recent_tasks and recent_images are moved from
/data/system/ to /data/system/users/<n>/

Bug: b/24569398
Change-Id: I538969d86ebf14fb2d44257be1e6c0a7ff61ed8d
/frameworks/base/core/java/android/app/ActivityManagerNative.java
bef28feba57be7fd6a4d14a85a8229154338b2ed 30-Oct-2015 Dianne Hackborn <hackbod@google.com> Initial stab at background check.

Actually, this implementation is more what we want for ephemeral
apps. I am realizing the two are not really the same thing. :(

For this implementation, we now keep track of how long a uid has
been in the background, and after a certain amount of time
(currently 1 minute) we mark it as "idle". Any packages associated
with that uid are then no longer allowed to run in the background.
This means, until the app next goes in the foreground:

- No manifest broadcast receivers in the app will execute.
- No services can be started (binding services is still okay,
as this is outside dependencies on the app that should still
be represented).
- All alarms for the app are cancelled and no more can be set.
- All jobs for the app are cancelled and no more can be scheduled.
- All syncs for the app are cancelled and no more can be requested.

Change-Id: If53714ca4beed35faf2e89f916ce9eaaabd9290d
/frameworks/base/core/java/android/app/ActivityManagerNative.java
54b5f25b85e4bf4df82cb7450114fb9849f1ae58 12-Nov-2015 Makoto Onuki <omakoto@google.com> Merge "Revert "Do not call into ActivityManager from DPMS within DPMS lock""
219bbafc3fa40dae163d652365cc4a97d613011f 12-Nov-2015 Makoto Onuki <omakoto@google.com> Revert "Do not call into ActivityManager from DPMS within DPMS lock"

Bug 25567963

This reverts commit 53de36f9c40c9a4ac1eb9cca8f458aa6c998c1fd.

Change-Id: I4faaa0b4c50d75e208f37b99bc1d6e2f0fff8127
/frameworks/base/core/java/android/app/ActivityManagerNative.java
246b5a0993978202b19a7c02d355fddfd9506798 10-Nov-2015 Makoto Onuki <omakoto@google.com> Merge "Do not call into ActivityManager from DPMS within DPMS lock"
53de36f9c40c9a4ac1eb9cca8f458aa6c998c1fd 07-Nov-2015 Makoto Onuki <omakoto@google.com> Do not call into ActivityManager from DPMS within DPMS lock

This will allow AMS to call into DPMS within the AMS lock instead,
which will help I1537bd57b34696768ee81a979d53bb396efbc12a.

- AM.clearApplicationUserData() will not be allowed for any DA
apps.

Bug 25567963

Change-Id: I9f0d071c815a011be4f4c85c502c39d0fe0fe5e8
/frameworks/base/core/java/android/app/ActivityManagerNative.java
e17ac1569793c333bb4dce86607a342e7c982ae7 07-Nov-2015 Jeff Sharkey <jsharkey@android.com> More APIs for encryption-aware apps.

Apps can mark manifest components as being encryption-aware, which
means they can safely be run before the credential encrypted storage
is available.

Start adding filtering logic so that we only return these components
when a user is running "with amnesia." That is to say, only device
encrypted storage is available, so the user is running but with only
partial knowledge of its data.

To avoid calling into ActivityManager with the PackageManager lock
held, we quickly determine user state and splice the state into the
flags for later per-component evaluation.

Bug: 22358539
Change-Id: Idc56ec29f1ef04da8963e004314d7f5e47400997
/frameworks/base/core/java/android/app/ActivityManagerNative.java
61f39a7b988f6a22681a3f9e0bf8121f72ff88c4 29-Oct-2015 Jorim Jaggi <jjaggi@google.com> Migrate docked divider drawing to SysUI

Move docked divider drawing to SysUI. This let's us have real
time shadows in the future. Keep DockedStackDividerController
for placing/visibility in window manager.

Change-Id: I82c10add626d30f2ba180ee2a21cdbe6ddfe0371
/frameworks/base/core/java/android/app/ActivityManagerNative.java
280d332bd4dbf13bb05102f86c70b7ee299e0704 04-Nov-2015 Chong Zhang <chz@google.com> Construct ActivityOptions near top level

This saves some duplicate constructions of the ActivityOptions
object from Bundle.

Bug: 23755120
Change-Id: Ie8be54a2e4e84a6a1f3c51e4f2966f7fb0bf1c28
/frameworks/base/core/java/android/app/ActivityManagerNative.java
bac13378ca2490e98e814908984bc9184ed1d42b 30-Oct-2015 Filip Gruszczynski <gruszczy@google.com> Merge "More granular reporting of size configurations."
14a7bb0d370fffdf902a4e2345f46754ed2d7684 01-Oct-2015 Christopher Tate <ctate@google.com> Introduce direct listener API for alarm delivery

The Alarm Manager now supports a set() variant that takes a listener
callback to invoke at alarm trigger time rather than a PendingIntent.
This is much lower overhead and has guaranteed low delivery latency
from the trigger time. The tradeoff is that the app must be running
*continuously* from the time the alarm is set to the time it is
delivered. If the app exits for any reason before the alarm fires,
the listener becomes invalid and the alarm will be dropped. This is
more or less equivalent to setting an alarm with a broadcast
PendingIntent that matches only a runtime-registered receiver.

The app's alarm listener can be any object that implements the new
AlarmManager.OnAlarmListener interface and implements its onAlarm()
method. There is no data delivered at alarm trigger time: whatever
state needs to be associated with the specific alarm instance should
simply be packaged inside the OnAlarmListener instance.

An alarm using OnAlarmListener can request that the onAlarm() method
be called on an arbitrary handler. If the program passes 'null' for
this parameter when setting the alarm, the callback occurs on the
application's main Looper thread.

Bug 20157436

Change-Id: I2eb030a24efdd466a2eee1666c5231201b43684b
/frameworks/base/core/java/android/app/ActivityManagerNative.java
20aa0aed8c9d5f5fc25f239c151529de86603509 30-Oct-2015 Filip Gruszczynski <gruszczy@google.com> More granular reporting of size configurations.

There are two improvements in reporting size configurations:
1) duplicates are removed;
2) smallest width is reported separately;

Change-Id: I8f8235c99e6eefcae178e8d61e79ad0c4d6f1144
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
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/core/java/android/app/ActivityManagerNative.java
57b6ccecc07274884b425839691fa04274b832bc 06-Oct-2015 Filip Gruszczynski <gruszczy@google.com> Dismissing of docked stack by dragging to the side.

Bug: 24623909
Change-Id: Ic93b169442de1eb4dca9f65a87ae2b813bcef043
/frameworks/base/core/java/android/app/ActivityManagerNative.java
7e8184b0ab2b04aa88eff84e5aad811b96536add 05-Oct-2015 Wale Ogunwale <ogunwale@google.com> Support for specifying stack to launch an activity from recents in.

Bug: 24668831
Change-Id: Iebd019d3a566a6d068253d8f566c1df88e9e64dd
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
59a73ca331a786f95e08a99bbd16fbdf59280ae0 14-Sep-2015 Wale Ogunwale <ogunwale@google.com> Support creating docked stack at top/left/bottom/right half of screen

Change-Id: Id8d6f639ed67baadb856ce84a20af8929e04cb2e
/frameworks/base/core/java/android/app/ActivityManagerNative.java
8e89b31a62fb9ec5ad33908c5e8e9c7ab2fd949f 10-Sep-2015 Chong Zhang <chz@google.com> Move window moving and resizing handling to WindowManager

- add a startMoving API to initiate a window move from app, once
the move starts WindowManager will take over the event handling.

- detect touch events along window's outside border and start
a resize if necessary

Change-Id: Ic7e8baba34e0aa27a43173e044ffb46e93e219e0
/frameworks/base/core/java/android/app/ActivityManagerNative.java
f36bb0ca99ce2041b68faf650d8c807cfaa2bf95 26-Aug-2015 Skuhne <skuhne@google.com> Bring an activity to the front upon click & drag

Clicking on the control area of a window should bring it to
the top and set the focus since it might be used as a drag
operation which would move / resize it.

Bug: 23179116
Change-Id: I672bfefa42dd85e962fe343aeb89167ce125f168
/frameworks/base/core/java/android/app/ActivityManagerNative.java
b34a7ad1af54132b6b046ab8f768e0ffb81cf581 14-Aug-2015 Wale Ogunwale <ogunwale@google.com> Added support for docked stack

Docked stacks occupy a dedicated region on a display.
When a docked stack is present all other static stacks bounds
are restricted to the region of the screen not occupied by
the docked stack.

Change-Id: I6aec3aa19c41a7e756375002f3a925977b5533b5
/frameworks/base/core/java/android/app/ActivityManagerNative.java
ce2faa5871e3bf5ec8407506df18bed209dd824c 11-Aug-2015 Skuhne <skuhne@google.com> Adding API to access / change the task bounds

Bug: 21738328
Change-Id: I3aabcbe1dcc5caa70f66554157f41fbfacf4c50f
/frameworks/base/core/java/android/app/ActivityManagerNative.java
2349332f9f69189d7889692b9aafd6f80070e352 30-Jul-2015 Filip Gruszczynski <gruszczy@google.com> Only relaunch activity on significant size configuration changes.

Currently if the configuration width/height/smallest width changes, we
relaunch the activity or invoke onConfigurationChanged callback. When it
comes to size based configuration changes it might not be necessary: if
the size change doesn't pass one of the threshold defined by the
resources, it means there is no need to relaunch the activity.

In this CL the ActivityManager will receive the thresholds from the
application and use them to decide, whether to relaunch the activity.
The application reads the thresholds from the resources, specifically
from resource qualifiers used by the app.

Change-Id: Ie3cf0a172dc1ba0b865cf30c2962e7cfd9ad8436
/frameworks/base/core/java/android/app/ActivityManagerNative.java
598b03d1008fb416a597ae4b2e037c4492bf696d 07-Aug-2015 Svetoslav Ganov <svetoslavganov@google.com> am 9bf912c1: am 5ed03384: am 1f514608: am 5a624aad: am 38d30dc5: Merge "Immediately kill a shared user process on a permission revocation." into mnc-dev

* commit '9bf912c1cf6941402dc0f8ef449f34787796875e':
Immediately kill a shared user process on a permission revocation.
aa41add33b8d7d318387cc74c34e3d347d245211 07-Aug-2015 Svetoslav <svetoslavganov@google.com> Immediately kill a shared user process on a permission revocation.

1. When a permission is revoked we kill the app immediately but do
not do an immediate kill for shared uid processes. This fixes it.

2. Remove system APIs that are used only by the package installer.

bug:22984670

Change-Id: I3d4ae52ea8679f894aa7c5972941263903479183
/frameworks/base/core/java/android/app/ActivityManagerNative.java
868a5e16c3f40a1c36bc2bd15891e930800e781a 03-Aug-2015 Wale Ogunwale <ogunwale@google.com> Support for an activity to change and/or query it's associated stack

Change-Id: I4fc1b47e5d6196a56a6e40f10fae97219554722c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
ba7881c89e7dd50aa537e70f0b96273e131dd08e 02-Aug-2015 Wale Ogunwale <ogunwale@google.com> Support finishing a task with any finishing activity in the task.

Change-Id: I8c6bb864de6dc135e0fedb16ee424d7816ee3cfa
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a371084e29f6ef3e926b4c51aa3b518b8cee3f0a 04-Aug-2015 Ian Pedowitz <ijpedowitz@google.com> resolved conflicts for merge of d4b8064e to master

Change-Id: I3d41b5bd0ecdd97f8e563b061fc8648d2206bc31
fb81d09d359480f9e43bbf300877b60de05f4816 04-Aug-2015 Dianne Hackborn <hackbod@google.com> Fix issue #22860466: viapi security bug - rubber stamping in nested VIs

Add new Activity.isVoiceInteractionRoot() API that an activity can use
to determine whether it is the root activity of a voice interaction
session started by the user's designated voice interaction service.

This is a special new API that apps must explicitly check, because as
with visual activities the model behind an activity should usually be
that it accomplishes its task by interacting with the user (implicitly
getting their approval) rather than trusting that whoever invoked it
is telling it to do what the user once. In the voice world, however,
there are some cases where quick interactions want to allow for immediate
execution without further user involvement, so this API allows for that
without opening up security holes from other applications.

Change-Id: Ie02d2458f16cb0b12af825641bcf8beaf086931b
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
e4a0c5722b1d8db95dfc842d716452dbbf02c86d 30-Jun-2015 Wale Ogunwale <ogunwale@google.com> Allow stacks to hold tasks on various sizes.

Tasks are now resizeable just like stacks. Adjusting the size
of a stack will also adjust the size of all it's containing
tasks. This model allows us to be more flexible
in using stacks as workspaces (like you would have in a
desktop environment) and tasks as the resizeable windows
within the workspace.

Also added "adb shell dumpsys window visible-apps" for
getting the list of visible app windows.

Bug: 22068114
Bug: 19182363

Change-Id: I5bf77063252a5abae4e327f6fc42e607091749f9
/frameworks/base/core/java/android/app/ActivityManagerNative.java
06e260b8dbe3fbc0456acd171e442b0c5930a7ea 21-Jul-2015 Qiwen Zhao <zhao@google.com> Merge commit '01fda527'

Change-Id: I08b5e7e8576f463c00be12879b465fa9c8cda8f5
17f693520da8977c4a60f5b4be3be035cba7146c 18-Jul-2015 Dianne Hackborn <hackbod@google.com> Fix issue #22531747: Assist info should declare if user has disabled...

...context and/or screenshot

Added new API to find out what contextual data has been globally disabled.

Also updated various documentation to make it clear what kind of contextual
data you will get (and when it will be null).

Also added a new Activity.showAssist() API because... well, I was already
in there, it was easy to do, it is safe, and maybe people will build cool
things with it.

Change-Id: Ia553d6bcdd098dc0fce4b9237fbfaca9652fc74b
/frameworks/base/core/java/android/app/ActivityManagerNative.java
6648b73cb9d5985b6401af604c7a91de23c88305 17-Jul-2015 Dianne Hackborn <hackbod@google.com> am ee924ded: am 587f0c58: am 61f0aec4: am 9236af43: am aaee5b53: Merge "Work on issue #22516282: ChooserTarget URI grants not forwarded" into mnc-dev

* commit 'ee924dedcc36d64a72652bb3e5fb64d5d5c4c6a4':
Work on issue #22516282: ChooserTarget URI grants not forwarded
a7cfbe0e548ac76f20915b65851b8bc9095aa541 16-Jul-2015 Dianne Hackborn <hackbod@google.com> Work on issue #22516282: ChooserTarget URI grants not forwarded

Add new option to startActivityAsCaller() which allows you to
specify that we should not do security checks on the target
activity being launched.

Change-Id: Ie6b28807b96fef35ccdff93b0a01066cfd8fa307
/frameworks/base/core/java/android/app/ActivityManagerNative.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
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/core/java/android/app/ActivityManagerNative.java
9ac5983c7b43676f748816381904d4c62a168a3e 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am 7aeb1a5c: am cf4617cf: am 1aeceef4: am fc4acfd9: am 4a817924: Merge "Revert "Allow array of required permissions in sendBroadcast"" into mnc-dev

* commit '7aeb1a5c19a1226f2b0ca7b498bdad941d206808':
Revert "Allow array of required permissions in sendBroadcast"
34ff2b04c9ffa36d11480336ff06935921b38984 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am 64e8aa18: am 7f006b52: am 70174794: am ef77c116: am d69a82c1: Merge "Allow array of required permissions in sendBroadcast" into mnc-dev

* commit '64e8aa18f8c089989113ecd8775d41bffe74b41d':
Allow array of required permissions in sendBroadcast
e37520b49da8fc2b7b7501c6dbbe1e6ac984dd9f 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Revert "Allow array of required permissions in sendBroadcast"

This reverts commit b4e7283c9afd9fb15ebd63f6ce9b75c9c1af658b.

Change-Id: Ie8390964bda5bdfa869cee8f46584043d8e7c664
/frameworks/base/core/java/android/app/ActivityManagerNative.java
b4e7283c9afd9fb15ebd63f6ce9b75c9c1af658b 14-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Allow array of required permissions in sendBroadcast

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

Bug: 21852542
Change-Id: I3b8ff258fa9f3249c344bb8093b820b24eef00c0
/frameworks/base/core/java/android/app/ActivityManagerNative.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.
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/core/java/android/app/ActivityManagerNative.java
94a20a2efd790cdff45e52d7c92b6cb525301787 29-Jun-2015 Benjamin Franz <bfranz@google.com> resolved conflicts for merge of 31706d99 to master

Change-Id: Ic3acad0d2d82ff8f0e5d31d3490c009d242d860b
c200f44c46b7d6ddb104c0f09f2a4c679e218d0b 25-Jun-2015 Benjamin Franz <bfranz@google.com> Block assist when screenshots are disabled by policy

When a device or profile owner disables screen capture, we also want to
block context data being collected for the assist structure.

Bug: 21797707
Change-Id: Ib8716c6dd71d538a027c04e1e907c87e2afa0ac8
/frameworks/base/core/java/android/app/ActivityManagerNative.java
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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
a3acdb33df7c7be7ff3d9f376ff833e4b0c1d897 09-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21621920: VI: need mechanism to get current request

Add new APIs to associate a Request with a name, get all active
requests, and get active request by name.

Also add a new Activity.onProvideReferrer() which will allow
applications to propagate referrer information to the assistant
(and other apps they launch) in a consistent way.

Change-Id: I4ef74b5ed07447da9303a74a1bdf42e4966df363
/frameworks/base/core/java/android/app/ActivityManagerNative.java
cedd53adc3875fe1b4275afa35ec5c3ede7b6c39 09-Jun-2015 Julia Reynolds <juliacr@google.com> Remove the ability to set a preferred setup activity.

Bug: 21557327
Change-Id: I8c1809d25c5f5fcd186dfc0636d8ac47ed5fc903
/frameworks/base/core/java/android/app/ActivityManagerNative.java
159f558a39d200e08e06245d64ec1df9a08e7d93 08-Jun-2015 Tim Kilbourn <tkilbourn@google.com> Merge "Pass an args bundle to launchAssistAction." into mnc-dev
5c6c06bf187e6e96d9db1398108d613f86f5a912 06-Jun-2015 Stefan Kuhne <skuhne@google.com> Merge "Adding am send-trim-memory command" into mnc-dev
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/core/java/android/app/ActivityManagerNative.java
0e5f110fc915a9b044eb04cd07ae7ac588eacc8f 06-Jun-2015 Tim Kilbourn <tkilbourn@google.com> Pass an args bundle to launchAssistAction.

In order to track the input device that was used to trigger assist, the
input device id is sent as an extra in the assist intent whenever it is
available. This is particularly useful on TVs, when an app may want to
know whether the input device has a microphone.

Bug: 21666123
Change-Id: I0f8c09e2f617606bef481bdff924cb6b9b47dd12
/frameworks/base/core/java/android/app/ActivityManagerNative.java
69c6adc96eecfde74ceb83cf9177428dc08b6067 02-Jun-2015 Dianne Hackborn <hackbod@google.com> More API changes.

Start moving Assist* stuff to android.app.assist.

Clean up some more of the VoiceInteractionSession APIs.

Clearly document that finish() is not the same as hide(),
always call hide() instead, and fix the finish() path to
also always do a hide to make sure everything is cleaned
up correctly.

Change-Id: I962d4069fcb34fe89547a95d395ae1b9fa3b4148
/frameworks/base/core/java/android/app/ActivityManagerNative.java
09d57fe9b357495b7bc62be39a8befa00d9d7ffb 28-May-2015 Dianne Hackborn <hackbod@google.com> Add new API to set URI on AssistContent.

Also rework how we transfer AssistContent and AssistStructure
to the assistant, so they are delivered as completely separate
objects rather than the kludgy bundling them in the assist
data thing.

Change-Id: Ib40cc3b152bafeb358fd3adec564a7dda3a0dd1d
/frameworks/base/core/java/android/app/ActivityManagerNative.java
db49fec8aaf78ffe091014bbfe04a9843f974986 22-May-2015 Craig Mautner <cmautner@google.com> For getHomeActivity() only return current user.

Previously getHomeActivity() returned the topmost home activity
independent of which user was currently running. That defeated the
purpose of the method. This fix returns the home activity of the
current user or null if one has not yet been created.

Also remove some cruft that accumulated.

Fixes bug 21055376.

Change-Id: Ic1d58129aedbe3624f8a9d12c05c84674687b0a4
/frameworks/base/core/java/android/app/ActivityManagerNative.java
8e3f29540db56d02a45966344133d6144c81e7c5 19-May-2015 Dianne Hackborn <hackbod@google.com> Merge "Update power manager to track uid state like netstats." into mnc-dev
d23e0d6901935588f9472bd7073fea0009581e9b 16-May-2015 Dianne Hackborn <hackbod@google.com> Update power manager to track uid state like netstats.

To follow the correct semantics for when restricts due to
device idle can be applied, power manager need to know about
uid process states like net policy so that it can allow
wake locks from apps that are in the foreground.

Since this is being added to a second place, I reworked things
so that the activity manager now keeps track of per-uid process
states and allows apps to register to listen to those, rather
than having to track lower-level process states and transform
them into an overall uid state. Both net policy and power
manager use this new facility.

Change-Id: I77359164c40d0f36fe1ef296dd9f9c3062431148
/frameworks/base/core/java/android/app/ActivityManagerNative.java
e88d1e5926d3f3e8a4ceaced7dad7bdc8bc61fa4 18-May-2015 Stefan Kuhne <skuhne@google.com> Revert "Backup/restore recents task list"

Reverts commits 92dd1abef4c0a22db40c5f7bbd100e6b471a1ad3,
18795a2299fefd88ee16393f22324b999ace6ce4, and
ac6a3a5e9d90edb533e5b377a4a14ef514be955a which make-up
changes required for backing-up and restoring recent
tasks from one device to another.

The implementation had too many unresolved issues including
the ordering of the restored recent tasks which was depending
on when the task package is installed on the new device that
puts the restored recents list out of order compared to the
old device.

Bug: 15986349
Bug: 19014377
Bug: 20763296

Change-Id: I06fd35a43036ef0b7260cf4db9c42890df63b95d
/frameworks/base/core/java/android/app/ActivityManagerNative.java
827e0facfefd0c0033dcfb1747b4fa6f80f9e0e2 07-May-2015 Jorim Jaggi <jjaggi@google.com> Make sure the app can draw a frame before unlocking

- The mechanism to stop windows drawing while window animator was
animating was somehow flaky. It relied on the fact that the client
would call relayout() whenever the animating state changed. This is
mostly the case, but not for lockscreen animations. Instead, we now
use a push model, where window manager tells the app that the state
has changed.
- In addition, it only stopped drawing if that window was animating,
but then only resumed drawing after all windows have finished
animating. Now, we do this per window, so we only stop drawing for
windows that are currently animating.
- We resume the top activity now at the very beginning of the
unlocking sequence. This gives the app a chance to draw a frame
before the user sees anything. If it's to slow, then we just use the
outdated framebuffer.

Bug: 19964562
Change-Id: Ifef8abd189a3146d854b81b9b948861e4d38c155
/frameworks/base/core/java/android/app/ActivityManagerNative.java
13c58bacc8f1ff35bb24ba19069bab8a41aabf68 20-Apr-2015 Julia Reynolds <juliacr@google.com> Allow device initializers to set a preferred setup activity.

This activity will launch by default on device reboot or user switch
during user initialization, even if there are higher priority 'home'
activities.

Bug: 20223050
Change-Id: I335aeb010a1ae5db07a4343d26e160c74bd299e1
/frameworks/base/core/java/android/app/ActivityManagerNative.java
015c5e57b58d26ae53849c02d3aebfcd52d85c3d 23-Apr-2015 Craig Mautner <cmautner@google.com> Disallow data clearing of DeviceOwner.

There are OEM provided apps that are able to clear the data of the
device owner. That creates a security hole that this fixes.

Fixes bug 20107015.

Change-Id: I4ef313b394bd8059d19d20aa6533396305d1357d
/frameworks/base/core/java/android/app/ActivityManagerNative.java
81786701b61f8295c8f7c9c1861642233910b056 22-Apr-2015 Craig Mautner <cmautner@google.com> Merge "Add API for putting up locktask pinning toast."
c21ae9ed221912b61306e075d3f22726ac04013c 15-Apr-2015 Craig Mautner <cmautner@google.com> Add API for putting up locktask pinning toast.

Fixes bug 18993662.

Change-Id: Ic1753285044857f8ea897784485fd1a9580acf25
/frameworks/base/core/java/android/app/ActivityManagerNative.java
16a16899505ec0a9ede5b76650bfb8817b3227c7 16-Apr-2015 Svet Ganov <svetoslavganov@google.com> Add OP_READ_PHONE_STATE app op - framework

The READ_PHONE_STATE permission protects PII information and
is in the Phone group. This change is adding the corrseponding
app op for gating access to the API guarded by READ_POHNE state
which will be used instead as an access control for legacy apps.

Change-Id: I2ff895a5a0e529f26ec0ad706266a30d829268ba
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
30b89849032eb57d1da93de40a6a9bd2a5f55a2e 07-Apr-2015 Craig Mautner <cmautner@google.com> Merge "No longer unlock activity manager to test whitelist"
e56007786ace2fe0615197d95317ccd7be4d1ca6 04-Apr-2015 Craig Mautner <cmautner@google.com> No longer unlock activity manager to test whitelist

In order to check the DevicePolicyManagerService locktask whitelist
the activity manager had to release its lock preserving internal
state. That is undesirable and not scalable now that we need to check
the whitelist at startup for bug 19995702.

This change causes DPMS to update activity manager with the whitelist
whenever it changes so that activity manager can check the whitelist
without releasing the acitivty manager lock.

Change-Id: I3ed6eb5ceae2cd7e7ae3280abd708d5ce43a2851
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
3d07c94c393831091958fe6a98811843db8973bd 14-Mar-2015 Dianne Hackborn <hackbod@google.com> Add new voice request for picking from a list.

Also add API for voice interaction service to control
whether the system should hold a wake lock while it is
working with an activity (and actually *do* hold a wake
lock while doing so, duh!).

And while in there, clean up the launching wake lock to
correctly give blame to the app that is launching.

Change-Id: I7cc4d566b80f59fe0a9ac51ae9bbb7188a01f433
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
43261140c3995dea77d87b587f882e651617f4b4 11-Feb-2015 Benjamin Franz <bfranz@google.com> Clean up the lock task APIs for COSU devices.

Clean up and increase readability of internal handling of lock task mode APIs.
Add a public API to query the lock task mode state with pinned and locked as
possible outcomes. Additionally, change wording in lock task toasts when in
locked mode and update the javadoc regarding onLockTaskModeEntering and
onLockTaskModeExiting to represent the actual behaviour.

Bug: 19377096
Change-Id: Ia563078ca6ef6d6fc7e75130e6b94ba18af69340
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
40f616b1f654822b3ac7c13853212c63d91312d5 17-Feb-2015 Craig Mautner <cmautner@google.com> Do not make ActivityContainer available to apps. DO NOT MERGE

A security leak was discovered whereby a malicious app could get the
IActivityContainer object from one app and use it to inject events
into another app. This fix removes the availability of the
IActivityContainer and replaces its one use with a method for
returning the information the IActivityContainer was used for.

Fixes bug 19394591.

Change-Id: Ib3cec25b25130cd8e098892c057742cfd575cfdd
/frameworks/base/core/java/android/app/ActivityManagerNative.java
2007a630d4767b4e90f8ed727acd574424c2183c 18-Feb-2015 Craig Mautner <cmautner@google.com> am 28de8edb: am ab8f60e4: am a94e4297: Merge "Do not make ActivityContainer available to apps. DO NOT MERGE" into lmp-mr1-dev

* commit '28de8edb7d72f938f47d7fdd8ce058c5c8933b8e':
Do not make ActivityContainer available to apps. DO NOT MERGE
ca0653a424f9d0f64ad15236c882af2b8ed2fe00 17-Feb-2015 Craig Mautner <cmautner@google.com> Do not make ActivityContainer available to apps. DO NOT MERGE

A security leak was discovered whereby a malicious app could get the
IActivityContainer object from one app and use it to inject events
into another app. This fix removes the availability of the
IActivityContainer and replaces its one use with a method for
returning the information the IActivityContainer was used for.

Fixes bug 19394591.

Change-Id: Ib3cec25b25130cd8e098892c057742cfd575cfdd
/frameworks/base/core/java/android/app/ActivityManagerNative.java
aa7e3ed94772be38a1f08a71551b9babdd625f46 17-Feb-2015 Craig Mautner <cmautner@google.com> Do not make ActivityContainer available to apps.

A security leak was discovered whereby a malicious app could get the
IActivityContainer object from one app and use it to inject events
into another app. This fix removes the availability of the
IActivityContainer and replaces its one use with a method for
returning the information the IActivityContainer was used for.

Fixes bug 19394591.

Change-Id: Ib3cec25b25130cd8e098892c057742cfd575cfdd
/frameworks/base/core/java/android/app/ActivityManagerNative.java
ae6688b09649447e57468b3e7935691bc09ec9b9 12-Feb-2015 Dianne Hackborn <hackbod@google.com> Update voice interaction layer for new UI design.

Can switch from a pure overlay at the top of the screen,
to interactive mode with the voice UI drawing at the bottom
and pushing its target activity up like an IME.

Add mechanism to get assist data to the voice interaction UI.

Add some basic visualization of the assist data, outlining
where on the screen we have text.

Add a test ACTION_ASSIST handler, which can propagate the
assist data it gets to the voice interaction session so
you can see what kind of data we are getting from different
apps.

Change-Id: I18312fe1601d7926d1fb96a817638d60f6263771
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
d16c565a607de754379fe699a4def21bd0e3de2f 27-Jan-2015 Winson Chung <winsonc@google.com> Adding some debug controls to test multi-window.

Adding some preliminary controls to mirror the currently exposed api
to create new activity stacks, resize stacks, and to move tasks
between stacks.

Change-Id: I3fb51c248f53a1d4c4eb23ca9fb3a76888def1de
/frameworks/base/core/java/android/app/ActivityManagerNative.java
e50c298cc2e616399dc9b20933d383e5343ced30 20-Jan-2015 Todd Kennedy <toddke@google.com> Merge "Don't read float from parcel"
e635f66842338fc7bf0817b5409b40b37be8bb3a 20-Jan-2015 Todd Kennedy <toddke@google.com> Don't read float from parcel

We were reading a float from a parcel, but, never writing the float. Also
opportunistically fix a couple warnings where we were using raw classes
instead of their templatized version.

Bug: 19001243
Change-Id: I6e2a72795cf12bfaf880f2f46c1d91b207aa327c
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
0ec9c29fb724eef676d2472f2e15904ff8f52cc0 16-Jan-2015 Jeff Sharkey <jsharkey@android.com> am c2ae6fb9: Merge commit \'605eb79c9519307147fc1795d0eb155638a7f542\' into manualmerge

* commit 'c2ae6fb9ada52e9c990542a6d1cae80085318f31':
Offer to detect non-SSL/TLS network traffic.
c2ae6fb9ada52e9c990542a6d1cae80085318f31 16-Jan-2015 Jeff Sharkey <jsharkey@android.com> Merge commit '605eb79c9519307147fc1795d0eb155638a7f542' into manualmerge

Change-Id: Id6db8cce3a477572478a1d50f624823200848896
8667eff6b82da054f35a0368b00864b2cb97a8f9 16-Jan-2015 Craig Mautner <cmautner@google.com> Merge "Remove unused method moveTaskToBack."
428ecf296694fa8c7214e068d36d47d1c74e5110 15-Jan-2015 Craig Mautner <cmautner@google.com> Remove unused method moveTaskToBack.

Everyone uses moveActivityTaskToBack() instead.

Fixes item #3 of bug 18088522.

Change-Id: I16028335fe1eef8a2aa47804f46536e395a16d8c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
605eb79c9519307147fc1795d0eb155638a7f542 04-Nov-2014 Jeff Sharkey <jsharkey@android.com> Offer to detect non-SSL/TLS network traffic.

Introduces new module that provides network-related features for
the StrictMode developer API. The first feature offers to detect
sockets sending data not wrapped inside a layer of SSL/TLS
encryption.

When a developer enables, we ask netd to watch all outgoing traffic
from our UID, and penalize us accordingly if cleartext sockets are
detected. When enabled, netd captures the offending packet and
passes it back to the owning process to aid investigations. When
death penalty is requested, all future traffic on the socket is
blocked, which usually results in a useful stacktrace before the
app is actually killed.

Bug: 18335678
Change-Id: I3adbc974efd8d3766b4b1a23257563bb82d53c29
/frameworks/base/core/java/android/app/ActivityManagerNative.java
28432f03600ee7e33cb030f2f113f1458531f608 16-Jan-2015 Todd Kennedy <toddke@google.com> Merge "Rename the binder call createActivityContainer"
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/core/java/android/app/ActivityManagerNative.java
0f8ecc84c8b86054bfd3275f942c3a705df01fbb 12-Jan-2015 Olawale Ogunwale <ogunwale@google.com> am 9d293911: am ebdfb6e8: Merge "[ActivityManager] Distinguish FG or BG receiver finished"

* commit '9d293911221cac930eb8edfef01362ea083eeaab':
[ActivityManager] Distinguish FG or BG receiver finished
1f5ac4d322d76ca76fdf5dee40fe9549aad7437e 03-Jan-2015 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Distinguish FG or BG receiver finished

Symptom:
Assume a foreground broadcast FG and a background BG.
If a recevier registers both FG and BG. When sending
BG and FG to the receiver, and the receiver BG receiver
completes first, its finishReceiver will trigger next FG
receiver rather than BG, and also deliver wrong result
code/data to the next.

More detail and sample:
https://code.google.com/p/android/issues/detail?id=92917

Root cause:
Due to BroadcastQueue:getMatchingOrderedReceiver will match
by receiver(IBinder), so the caller ActivityManagerService:
broadcastRecordForReceiverLocked will always match the first
queue(fg) if a receiver is both receiving fg and bg.

Solution:
Add a parameter flags to finishReceiver, then server side
could know the finished receiver should belong to which queue.

Another general solution but with bigger scope:
I60dce4a48e20c1002a61a979e4d78b9b0a8b94a0

Change-Id: I913ca6f101ac8ec6c7a8e42754e6781f80247b7f
/frameworks/base/core/java/android/app/ActivityManagerNative.java
18795a2299fefd88ee16393f22324b999ace6ce4 03-Dec-2014 Wale Ogunwale <ogunwale@google.com> Add support from restoring recent's backup.

Bug: 15986349
Change-Id: I899f81d317fcd5277a75db7ba50ecca14112df26
/frameworks/base/core/java/android/app/ActivityManagerNative.java
740c3ac782675d190941b2ab1905e56f246c1b11 13-Nov-2014 Winson Chung <winsonc@google.com> Initial changes to add callback on task stack changes. (Bug 17672056, Bug 18291345)

Add a listener to listen for changes in the Task stacks to preload thumbnails from the
system. In addition, reduce the amount of synchronous work done in activity creation
and first measure/layout passes.

Change-Id: I8bd9155d7a05e89c190a20429acff69a17808208
/frameworks/base/core/java/android/app/ActivityManagerNative.java
ff17024e583b170312d82089fd358d278ce16c9a 19-Nov-2014 Dianne Hackborn <hackbod@google.com> Fix issue with call backs from media process.

All but a few lines of this is for issue #16013164, which allowed
apps to do some operations as the media uid by having it call
back to them to open a file. The problem here is with the tempory
identity stuff in the activity manager, allowing us to make the open
call as the original caller... ideally we should figure out a way
to just get rid of all of that, but the solution here is actually
easier (even though it doesn't look it) -- we now hand a token over
to the openFile() call that it can use when doing permission checks
to say "yes I would like the check to be against whoever is responsible
for the open". This allows us to do the uid remapping for only this
one specific set of permission checks, and nothing else.

Also fix issue #17487348: Isolated services can access system services
they shouldn't be able to. Don't send any system service IBinder objects
down for the first initialization of an isolated process.

Change-Id: I3c70e16e0899d7eef0bae458e83958b41ed2b75e
/frameworks/base/core/java/android/app/ActivityManagerNative.java
044d52934e57a337665f707aa4be1d423ee3fb29 06-Nov-2014 Winson Chung <winsonc@google.com> Adding bounce animation for affiliated tasks. (Bug 16656169)

Change-Id: I39e4a57c4e6b707d15513dacde2d40c23bb05058
/frameworks/base/core/java/android/app/ActivityManagerNative.java
d54b578e47fb410c776bb3a4272c2c523153f657 24-Oct-2014 Wale Ogunwale <ogunwale@google.com> Fix issue #17305377: Don't kill process if it still has tasks.

We previously killed a process when one of its task was
swiped away in the recents UI. This had negative performance
implications for apps with multiple tasks in recents. Now we
will only kill the process if there are no more tasks associated
with it.

Changed also removes the need for the
ActivityManager.REMOVE_TASK_KILL_PROCESS since ActivityManager
will now only kill a task process if it process has no out
standing tasks.

Bug: 17305377
Change-Id: Ibc39bb328d13c7eab05c04798c2f14887923d9d4
/frameworks/base/core/java/android/app/ActivityManagerNative.java
9797880808320e3a7bae1f59bc7e0c5a13189e5f 14-Oct-2014 Jeff Sharkey <jsharkey@android.com> Start cross profile intents as caller.

The system should always be using new startActivityAsCaller() when
starting activities on behalf of someone else, to ensure that
security checks are enforced as the original caller.

Bug: 17983737
Change-Id: Ic40816a797cfdb13c0adb48b86ed4ed7d6aae8eb
/frameworks/base/core/java/android/app/ActivityManagerNative.java
fdf5b35ab46639759d6389a4e2a4d5799cb6814b 09-Oct-2014 Dianne Hackborn <hackbod@google.com> Implement issue #17906468: Allow search request to fall back to global search

Change-Id: I04834b2a9f1ec4a68c6a3fed14da2f8dd93b3be7
/frameworks/base/core/java/android/app/ActivityManagerNative.java
648f69b95ce7fc95f551f6e08a2408d6e57dbab9 18-Sep-2014 Craig Mautner <cmautner@google.com> Remove activity icon bitmaps from system process.

When a TaskDescription is sent up to the system process, the Bitmap
contained in the mIcon member is immediately flushed to disk and the
name of the file replaces it in the TaskDescription. Thereby saving
mucho RAM for better uses.

Fixes bug 17527308.

Change-Id: Ifac63ea5d12ed091d1eb03e178b8b847a827f940
/frameworks/base/core/java/android/app/ActivityManagerNative.java
6e2f395a86d557d2de4b52dda419a5f3eee00c84 09-Sep-2014 Craig Mautner <cmautner@google.com> Wait for animation complete before completing boot

Defer the boot process in ActivityManagerService,
WindowManagerService and PowerManagerService until the boot
animation has completed.

Fixes bug 16309312.

Change-Id: Ic5e0d627ca4ded3e211c5d2afece89da40d34642
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a4e102ee580282dc7abeb22f4a025813e53b9431 05-Sep-2014 Dianne Hackborn <hackbod@google.com> Work on issue #17357238: Recents is often slow if not used in a while

Add a new activity attribute, resumeWhilePausing, that allows an
activity specifying it to immediately start running without waiting
for the previous activity to pause. The recents activity is updated
to use this.

The implementation of this is ultimately fairly simple -- if we are
in the path of resuming such an activity, and find that we first need
to pause the existing activity, then within the activity manager we
do the regular pause flow but act like it has immediately finished
pausing right then so that we can immediately go on to the resume.
To make this clean, we tell the activity when asking it to pause that
it should not come back and tell us it is done, because we aren't in
any way waiting for it.

One potentially important change I needed to make here is the pause
callback no longer provides the saved persistent state, because we
now can't count on that callback happening. I don't think there was
really any utility in this anyway -- all modern apps will have their
save state flow happen as part of stopping, not pausing, so we'll
only capture that saved state when the stop is reported back anyway.
And since we do send the saved state back when stopping, it would
always blow away whatever we had gotten at the pause.

Finally, update the documentation for AppTask.startActivity(), and
fix the implementation handling that to be cleaner -- we need to
deal with inTask first before getting in to "oh noes add NEW_TASK
if this isn't coming from a calling activity" flow.

Change-Id: Ia1da0fac90d7bdbaafdda2e34850d795ce17a39f
/frameworks/base/core/java/android/app/ActivityManagerNative.java
5232271a41323594ae406be7476b6ca2f08af3d8 27-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17146552: system anr

Add a safe path for Slog.wtf that doesn't acquire an activity manager
lock or block in any way.

Change-Id: I8fef8251a0cb85081442cae55d85063944248d15
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
89ad456ea49cb62615ebdcac83a2515743bbe5fa 25-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #16311398: Limit number of documents a process can open

In application processes, monitor for when we start getting close
to the Dalvik heap limit, and ask the activity manager to try to
prune old activity instances in that case.

Add an explicit API for apps to ask that they have their own
activity instances cleaned up, if they want.

Fix some bugs in launching activities that were not correctly
applying the "multi task" behavior in the appropriate situations
of document-centric recents.

Clean up the activity manager's process removal code to all share
a common path.

Add a new "Spam" option to ActivityTests, which continually creates
new tasks, checking that the activity manager will now prune old
tasks rather than letting the app run out of RAM.

And while I was was doing this, I found problems with the path
for bringing an empty task to the foreground -- it could make
a new task instead of re-starting the root activity in the
existing task. This is fixed, and some code in the recents
UI for working around the bug is removed.

And as long as I am doing that, we now have nice hooks in to
the activity manager for AppTask to give some APIs for better
managing the task, so add those along with more tests for these
APIs in ActivityTests.

We should look at also having the activity manager try to prune
old tasks when it sees app processes being killed, to better balance
memory use across multiple processes when some processes may host
many documents. That however is for another CL...

Change-Id: I2bb81c3f92819350c868c7a7470b35817eb9bea9
/frameworks/base/core/java/android/app/ActivityManagerNative.java
4cce1de9fe95ffc3b968de87579a543a461f96bb 26-Aug-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #16366571: UIDs for work and normal Chrome processes are the same" into lmp-dev
885fbe5c070cf1579c96ab8e150449af00e16501 24-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #16366571: UIDs for work and normal Chrome processes are the same

Use uid as main key for determining which app tasks a caller has
access to.

Change-Id: Ibbe3f0f64197671d279c3fc519edfc720d442938
/frameworks/base/core/java/android/app/ActivityManagerNative.java
6f4d61ff2e3143bea37bbc1a7a2a0ab415b2c88a 22-Aug-2014 Dianne Hackborn <hackbod@google.com> Work on issue #17011123: Hit Back/Recents button when in Recents...

...without interacting with any of the Recents items should not bring
Home back to top

Up navigation needs to be smarter about multi-document and in the case
of being at the root of a document know to re-construct a task for
the app.

Change-Id: Ief874e46e9a9897379dda1010bcce4c5b03d82f1
/frameworks/base/core/java/android/app/ActivityManagerNative.java
aec68bb89fe614181a20eb97340149406218ce2f 21-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17038762: Add API to add entries to the recents list

New API Added to ActivityManager for adding an entry. See docs
there.

Repercussions:

- I hit a bug in system UI where if the thumbnail has alpha, it tries
to modify it, but thumbnails are loading immutable so crashes. Fixed
this by loading the bitmaps to be mutable.
- Improved dump output of recents; there was a lot of stuff missing.
Also split the recents dump output from the rest of the activity
output, since it can be really large.
- Added tests to the lovely ActivityTest app.

Bonus: new method on AppTask to control the exclude from recents flag.

Change-Id: I01e543db4d15320ee1701e95872fef73c116526c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
028ceeb472801bcfa5844fc89ed0da8463098824 18-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #14617210: Apps can gain access to any ContentProvider...

...with grantUriPermissions (no user interaction required)

Add a new path in to the activity manager to start an activity as
if it was directy started by the original calling activity. This
is specifically for the resolver activity and chooser activity to
be able to safely launch its data after serving as an intermediary.

Access to the new method is highly restricted -- it can only be
called by an activity that is declared in the framework apk itself,
and the execute-as-the-caller behavior will only happen if the
code is running under the system uid. (This means we could still
have these run in the client's process in some cases and still work
correctly.)

Note there is some commented out code here half-done about trying
to propagate security exceptions back to the original calling
activity. This would be really nice, especially now with the
chooser activity running in a system process so any errors made
by the app (bad permission grants, bad intents, etc) no longer
actually appear in the app so are essentially invisible. I'd
really like to figure out a way to propagate these exceptions back
to the app, but this is hard since the app's process may no
longer even be running at this point.

Also tweak activity manager dump output to split the recents
dump out from activities, since recents can now be super large.

Change-Id: I50410c4783faf9302c69290589a068a846e0973a
/frameworks/base/core/java/android/app/ActivityManagerNative.java
4b6c6697da5a20c08b2f9f2ca40c94008477e914 13-Aug-2014 Jose Lima <joselima@google.com> Renamed "media playing" APIs to "visible behind"

- Request from API Review: rename the media playing APIs to a more
generic name, reflecting the background visibility feature these
methods actually control.
- Made the new isActivityVisibleBehind().
- Changed convertFromTranslucent() and convertToTranslucent() to be
SystemApi.

Bug: 16959028
Change-Id: I526eac22f44273b3254dd6201f89194d13e597e2
/frameworks/base/core/java/android/app/ActivityManagerNative.java
8de4311c51229efbe2f2d0afbf298982c5cadd96 11-Aug-2014 Jorim Jaggi <jjaggi@google.com> Lockscreen launch animations

- Get rid of ActivityManager.dismissKeyguardOnNextActivity, which was
used for two different things: Dismiss keyguard from somewhere else
(not really necessary anymore), wait to actually dismiss keyguard
after the window behind is drawn. Instead, introduce
keyguardWaitingForActivityDrawn(), and change the semantics where
necessary.
- Make wallpaper_close_enter consistent with task_open_enter and the
Keyguard launch animation.
- Close the panel even on lockscreen when launching a notification.
- Block notification shade updates during the collapsing motion so
notification don't play the disappear animation immediately after
having launched a notification.

Bug: 15991916

Change-Id: I133c177b84e926c87c1a404ba93d633593fec3ab
/frameworks/base/core/java/android/app/ActivityManagerNative.java
8746a478abcfb3b0d73b156232051af1e8d21ce2 25-Jul-2014 Craig Mautner <cmautner@google.com> Create end of animation callback for Activity

Activities cannot draw while their entering animations are active.
This change introduces a callback, onEnterAnimationComplete() so
that activities can know when their draws will be effective.

Fixes bug 13658460.

Change-Id: Ic48540cd4c7e37538f10cb2dc0852aa3f55d11e1
/frameworks/base/core/java/android/app/ActivityManagerNative.java
f1939901d2ed0480069f0b23be64f122fce93995 25-Jun-2014 Nicolas Prevot <nprevot@google.com> Making the clipboard work across users.

When copying from the parent: the ClipData can be pasted in the managed profile.
When copying from a managed profile: it can be pasted in the parent,
unless the policies says it's disabled. In which case, the clipboard of the parent becomes empty.
Supporting content uris.

BUG: 15186236

Change-Id: I522564a7c07ff21df137adcda980bb52e5739964
/frameworks/base/core/java/android/app/ActivityManagerNative.java
dc00cbe2c15eef5141656311a6d05c753d7c6db6 21-Jul-2014 Craig Mautner <cmautner@google.com> Create API for launching from recents

Relaunch apps from recents using the same uid and package as was used
in the original launch.

Fixes bug 16358208.

Change-Id: I340800bfee79926b197929360d69f1d570bbf1eb
/frameworks/base/core/java/android/app/ActivityManagerNative.java
fee756ff91ab4d8f0e09ddb050d22d88ebb66ae7 17-Jul-2014 Dianne Hackborn <hackbod@google.com> Implement issue #16330060: Inform ActivityManager about WebView...

...state changes.

Add a new API to tell the activity manager about a new dependency
one process has on another package. Start using it already for
when apps is Context.createPackageContext() to load code from another
app.

Also do some work on getting the monitoring of proc/uid states
in shape so it can be used by unundled code, along with an
AppImportanceMonitor class for doing so.

Some small fixes and additions to VoiceInteractionService.

Improve handling of unaccounted/overcounted battery use so that
they aren't shown to the user unless they are significant.

Change-Id: I22dd79a73f4e70103d3f8964494aebc8a31f971c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
bb742462781a73bb25516067c8fe6311c1c8a93e 08-Jul-2014 Craig Mautner <cmautner@google.com> Launch activity behind launching task.

Use ActivityOptions.makeLaunchTaskBehindAnimation() to launch tasks
behind the current task. Includes animations for launching and
launched tasks.

Fixes bug 16157517.

Change-Id: I0a94af70b4748592e94673b958ee824cfb3d7ec0
/frameworks/base/core/java/android/app/ActivityManagerNative.java
ee2e45acbff28986c2ced636b7550d0afbb0eeb7 27-Jun-2014 Craig Mautner <cmautner@google.com> Add Media Playing API

These methods permit an activity to play or continue playing media
behind a translucent activity above it. Particularly the home
activity in Android TV. Methods exist to notify the upper activity
when playing starts or stops and for notifying the playing activity
when to stop playing and release its resources.

Methods are called when either activity's state changes or new
activities are launched.

Fixes bug 14469711.

Change-Id: I7ba10c5a4683504931cffa228488f5281e5bbf86
/frameworks/base/core/java/android/app/ActivityManagerNative.java
d61dc20de10452dcc6905dcf0654f30c64762a1d 07-Jul-2014 Craig Mautner <cmautner@google.com> Add Activity.isTopOfTask() method

Used by scene transition to determine if an activity has launched the
next activity into its own task or into another task.

Fixes bug 15771895.

Change-Id: I6d350350dcf27509296d55d7b75be90a01694ac9
/frameworks/base/core/java/android/app/ActivityManagerNative.java
6ea0d0a2592395b8980c24304733daec628e947e 03-Jul-2014 Dianne Hackborn <hackbod@google.com> Fix cleanup of voice sessions.

They would leave active voice activities lingering around.

Change-Id: I5b6716ab303636ebdf2f13c3172552a73dae3bb1
/frameworks/base/core/java/android/app/ActivityManagerNative.java
c0ffce5ddd6446f1d46a49cdfaeda4a2ce408e1d 01-Jul-2014 Craig Mautner <cmautner@google.com> Use cached thumbnails in Recent tasks.

The thumbnail returned from ActivityManager.getTaskThumbnail() now
contains either a Bitmap or a ParcelFileDescriptor that points to
a file containing a compressed Bitmap. The Recent tasks list is
now responsible for all thumbnail Bitmap caching as the activity
manager keeps only the most recent 5. This also permits low memory
devices to have many more tasks in the Recent tasks list.

As part of this CL the concept of subtasks is removed eliminating
code supporting the TaskAccessInfo and IThumbnailRetriever classes.

Fixes bug 15828934.

Change-Id: I0fd0320a1a04e3c78d79357899b83a2fff97abf2
/frameworks/base/core/java/android/app/ActivityManagerNative.java
62515beee67307d8859beec521b7baedfa54b2b5 21-May-2014 Jason Monk <jmonk@google.com> Add lock-to-app mode

Added a dialog that shows when app has not been authorized by
DevicePolicyManager.isLockTaskAuthorized. This allows any app
to trigger lock-to-app mode. This same dialog is used when
startLockTaskOnCurrent is triggered by the recents long-press.

Can exit the mode by long-pressing recents again.

Keyguard is disabled when lock-to-app is active.

This CL also prevents apps from finishing when they are the root
task in a lock task TaskRecord.

Change-Id: Ib54d858e570cccf6bfd986958868e15f49bcef75
/frameworks/base/core/java/android/app/ActivityManagerNative.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.
a449dc033b79775b8945d9cc5a035a6deb145065 16-May-2014 Winson Chung <winsonc@google.com> Refactoring RecentsActivityValues into TaskDescription, and ensuring they are resolved when set. (Bug 14995928, 14832629)

Change-Id: I582221468e63a96a5dfd132a31b09e72099b170f
/frameworks/base/core/java/android/app/ActivityManagerNative.java
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/core/java/android/app/ActivityManagerNative.java
1147c406515bbfbcb7dbd750f81c7a5de928c5c6 14-May-2014 Winson Chung <winsonc@google.com> Adding method for applications to query their own tasks. (Bug 14627210)

Change-Id: I33299bf59784849171b19af4a5be2ab7665581c5
/frameworks/base/core/java/android/app/ActivityManagerNative.java
7fd239cf0a1ddc0500b51d97e0e6c3539b42639f 14-May-2014 Craig Mautner <cmautner@google.com> Merge "Pass ActivityOptions back from finishing activity."
202259785972be771075dce8d3e43c29b8d8f1f1 13-May-2014 Nicolas Prevot <nprevot@google.com> Merge "Resolving resources across users."
233ceeebab7efe6ad4783371003c4cf29b896436 10-May-2014 Craig Mautner <cmautner@google.com> Pass ActivityOptions back from finishing activity.

Adding an ActivityOptions parameter to convertToTranslucent provides
a mechanism for delivering these options to the activity that
launched the one that is returning.

Fixes bug 13032208.
Fixes bug 14469460.
Fixes bug 14597427.

Change-Id: I4115dd3c69de9d175f6df0498a6e964fca5eca29
/frameworks/base/core/java/android/app/ActivityManagerNative.java
d85fc72fb810858f7502e7e7f1bad53e1bf03edd 16-Apr-2014 Nicolas Prevot <nprevot@google.com> Resolving resources across users.

When an intent is sent to another profile:
For content uris contained in this intent:
The userId of the source user is added to the userInfo part.
The ActivityManagerService has been modified to resolve resources in the user specified by the uri.
The user id to which the uri belongs to is stored in the UriPermission.

Change-Id: I43dc76895aba692bf148d276253aeaf9c75fce34
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a002604af0c9b1204556610537b85685d7055996 23-Apr-2014 Craig Mautner <cmautner@google.com> Introduce persistent forms of Activity lifecycle calls.

When an Activity is created with R.attr.persistable true different
forms of activity lifecycle methods including PersistableBundle will
be used.

Fixes bug 13736007.

Change-Id: I7e92917b300b76964257cfcc26c24e76aa19bd16
/frameworks/base/core/java/android/app/ActivityManagerNative.java
03a9baedc9b933bb6a550c0cb84649b1b45b872c 02-May-2014 Winson Chung <winsonc@google.com> Refactoring activity method to update recents values.

Change-Id: Ic525be207714d34abe0c2d26091c3e46abcd9bad
/frameworks/base/core/java/android/app/ActivityManagerNative.java
09233289624a85093b1d99e4a6a149bf09059d8d 30-Apr-2014 Dianne Hackborn <hackbod@google.com> Make GET_TASKS signature|system.

Normal apps can't hold it now. If they try to use
getRecentTasks() or getRunningTasks() without the permission,
they will only see their own tasks and home in the list.

Also took this opportunity to eradicate all of the old pending
thumbnail stuff.

Change-Id: I6dc52a06221c78097162e4a8b482027b798bf3ee
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
3b3f464445d1d369c8e87f526deba606ca62f76c 22-Apr-2014 Winson Chung <winsonc@google.com> Piping through ability for an Activity to remove its own task. (Bug 13735914)

Change-Id: Iefcd4fbe68748195de8ee37ee2b6edef55276603
/frameworks/base/core/java/android/app/ActivityManagerNative.java
934ef05799532b75d349338c4300671cec1ab162 16-Apr-2014 Craig Mautner <cmautner@google.com> am 4b81e89d: am 2fd3cb95: Merge "Fix ActivityContainer callback parcelling." into klp-modular-dev

* commit '4b81e89d9b7a2cf3ed5aacd9c647aed47f4c4675':
Fix ActivityContainer callback parcelling.
e3a00d745fad479f560e96cec23e957f37d1c043 16-Apr-2014 Craig Mautner <cmautner@google.com> Fix ActivityContainer callback parcelling.

The Binder interface for passing a callback was not implemented
properly. Also the callback for ActivityContainer now has a new
API.

Change-Id: I6b719be0cb57542f022a3cc14e8f4efde60b1a50
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a981e3b01ae6af2b67e582f0d1cbb95560d05626 09-Apr-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 7289f3ab to klp-modular-dev-plus-aosp

Change-Id: I788ca17503e2fd225e205a76d3e7062f71d58316
13014b5fe5967b3c7e232ffaf81581ed178e6df6 08-Apr-2014 Jeff Brown <jeffbrown@google.com> Move certain internal activity manager methods to new class.

This is a little bit of refactoring in preparation for changing how
the power manager notifies system components about changes in power
state.

Deleted the startRunning method since it is no longer useful.

Bug: 13133142
Change-Id: I7f845c61ecc7ee890154ed0cbd90795de609b7ea
/frameworks/base/core/java/android/app/ActivityManagerNative.java
688b5105d665a56e6f2f040f3ca89ca3006801df 28-Mar-2014 Craig Mautner <cmautner@google.com> Implement setActivityLabelAndIcon().

Replaces Activity.setRecentsLabel and Activity.setRecentsIcon.
Simple top-down traversal to find the highest activity with a
specified label and icon. Adds the Intent of that activity to
RecentTaskInfo as well so that Recents can get the launcher
icon if UX desires it.

Fixes bug 13675322.

Change-Id: I62d7d8f4df4dc81012f451e0cdea8a2943aedeec
/frameworks/base/core/java/android/app/ActivityManagerNative.java
2fbd7541804f816171849413b095fcfc70e06c1e 21-Mar-2014 Craig Mautner <cmautner@google.com> Add Activity methods for icons and labels.

New Activity methods setRecentsLabel(CharSequence) and
setRecentsIcon(Bitmap) have been added. The topmost
activity with either of these set will be returned in
RecentTaskInfo members activityLabel and activityIcon.

Fixes bug 13562992.

Change-Id: Ic15d1d27b733b892a2a940063b105ac48f1ffee5
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
303e1ff1fec8b240b587bb18b981247a99833aa8 08-Mar-2014 Winson Chung <winsonc@google.com> Initial changes for recents.

Change-Id: Ide2c202b4a5b25410f0f32bd0a81ccf817ede38f
/frameworks/base/core/java/android/app/ActivityManagerNative.java
08488bf3fe6f4b1fadf59821feaf07b4c2ae52ae 21-Feb-2014 Kenny Guy <kennyguy@google.com> Allow user to be started in background.

Change-Id: I2adeb258cd33765a559c1f952c47088abbc4336c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a1f1a3c573acd91024fda0ceb3b921c73b186963 25-Feb-2014 Dianne Hackborn <hackbod@google.com> More battery stats.

- Add events for sync.
- Add more descriptive tags for wake events.
- Fix battery reset.
- Fix tracking of wifi data.

Change-Id: Ic07f2a86a5ed33e7da57eb1108c31c777ecd801f
/frameworks/base/core/java/android/app/ActivityManagerNative.java
b5abedbd5cef473574884a7453cdf4d412af26af 25-Feb-2014 Craig Mautner <cmautner@google.com> am c407ace3: am d4c819c0: am dd9ce628: Merge "Clean up activities and displays when done" into klp-modular-dev

* commit 'c407ace3019c4e542654cf17fd04d9436d3f3436':
Clean up activities and displays when done
95da1087ed3c7b9983b571bc5409827ae390f15f 25-Feb-2014 Craig Mautner <cmautner@google.com> Clean up activities and displays when done

More maintenance fixes.

Fix bug 13157352.

Change-Id: Ic86d39a84452a1cf1dc1762cec517b419ad0a852
/frameworks/base/core/java/android/app/ActivityManagerNative.java
099bc627c463d9941e23e480f25a78a154429c55 22-Jan-2014 Dianne Hackborn <hackbod@google.com> Battery stats improvements.

- Adjust total power use when there is unaccounted power so that our
percentages don't end up > 100%.
- Fix accounting of isolated uids to be against the owning real app
uids.
- Rework how we put cpu use into the battery stats to no longer need
this uid name cache that can confuse the uid it is associated with.
- Finish implementing events in the history, adding a string pool and
reading/writing/dumping them.
- Add first two events: processes starting and finishing.
- Fix alarm manager reporting of wakeup alarms to be adjusted by the
WorkSource associated with the alarm, so they are blamed on the
correct app.
- New "--history" dump option allows you to perform a checkin of
only the history data.
- Fixed BitDescription bug that would cause incorrect printing of
changes in some states.

Change-Id: Ifbdd0740132ed178033851c58f165adc0d50f716
/frameworks/base/core/java/android/app/ActivityManagerNative.java
bd503a4e3a1c897695f0edcf6e4aaac3a7e962c5 10-Jan-2014 Craig Mautner <cmautner@google.com> Allow for the possibility of null ActivityContainer

When BinderProxy is passed in as the IBinder for
getEnclosingActivityContainer the activity manager cannot turn it into
an ActivityRecord. This causes NPE in ActivityThread which is Not Good
(tm).

Allowing null to be returned when requesting an ActivityContainer and
handling it appropriately fixes this bug.

Fixes bug 12473669.

Change-Id: I6937636042f8853b3ddc2df40be010e7391e41a5
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
bcaac0adecc8f9d7e66548df39e0f5c9f759e38c 09-Oct-2013 Jeff Sharkey <jsharkey@android.com> Surface outgoing Uri permission grants.

This enables apps to discover and clean up persisted Uri grants when
the underlying Uri becomes invalid, such as when an account is
removed.

Bug: 11142566
Change-Id: Ieeb36cb1155acf226327ebe91cdd30b822d69d1b
/frameworks/base/core/java/android/app/ActivityManagerNative.java
7aa7601c09ab5d87cc15a0ed9a8f511d494a4cbc 30-Sep-2013 Jeff Sharkey <jsharkey@android.com> Detect wedged ContentProviders, treat as ANR.

All ContentProvider calls are currently blocking, making it hard for
an app to recover when a remote provider is wedged. This change adds
hidden support to ContentProviderClient to timeout remote calls,
treating them as ANRs. This behavior is disabled by default.

Update DocumentsUI to use a 20 second timeout whenever interacting
with a storage provider.

Bug: 10993301, 10819461, 10852518
Change-Id: I10fa3c425c6a7225fff9cb7a0a07659028230cd3
/frameworks/base/core/java/android/app/ActivityManagerNative.java
e66c1778f80f4b18e29e018eca3a338f125f23b9 20-Sep-2013 Jeff Sharkey <jsharkey@android.com> Require that persistable Uri permissions be taken.

Change our Intent flag to indicate that a Uri permission grant is
persistable, but don't actually persist it until explicitly taken by
the receiving app. This prevents apps from spamming each other if
persisted permissions aren't really required.

Remember the last time a persisted grant was taken by an app, and
use this to prune away the oldest grants when the number of grants
grows too large. Allow apps to query persisted grants they are
holding, and allow them to release previously persisted grants. Add
public UriPermission class to return grant details and timestamp.

Track various permission strengths separately, and combine together
after each mutation pass. Persistable grants are currently treated
like global grants, but they could be moved to have owners in the
future. Require that grant holders trying to extend a persistable
permission actually hold a persistable permission themselves.

Bug: 10835779
Change-Id: I95b2f797c04ce7fd2612f9a644685dbd44e03759
/frameworks/base/core/java/android/app/ActivityManagerNative.java
c2be0d61830dd867f3092923e149e0cc251cdfc5 23-Sep-2013 Amith Yamasani <yamasani@google.com> Unmarshall PFDs properly when hand-crafting interface stubs

ParcelFileDescriptors now carry an optional socket fd to communicate
close events. So, make sure that the correct creator is called when
reconstructing parceled PFDs.

Bug: 10759966
Change-Id: Ic6b9ffb8cb7af5f3a12440def595f74682231866
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
86d9c457de3285f01552d4046a8a260c7a75147f 11-Sep-2013 Adam Skory <skory@google.com> Merge "Revert services assist context in KitKat" into klp-dev
7140a25f0135f473b66d01eb042471b2f0ebc836 11-Sep-2013 Adam Skory <skory@google.com> Revert services assist context in KitKat

Reverts extension to assist context API to query
foreground services for assist context data.

Also hides Intent.ACTION_VOICE_ASSIST because
nobody's actually using it yet.

Bug: 10461702
Change-Id: Idf6836adc659b434e11ebb2b98e8b814c94a7227
/frameworks/base/core/java/android/app/ActivityManagerNative.java
dc6fd0a20a095ac0fb544184d8a4258e80b4a14d 11-Sep-2013 Jeff Brown <jeffbrown@google.com> Merge "Propagate input ANR reason to activity manager log." into klp-dev
bd181bb83282571eb793d2e4a48b4d19585de7f2 11-Sep-2013 Jeff Brown <jeffbrown@google.com> Propagate input ANR reason to activity manager log.

Make it a little easier to diagnose input dispatch timeouts by
providing the detailed reason as the ANR annotation in the log.

Bug: 10689184
Change-Id: Ie18fd9ad066b0673d1f57c030e027ad0085f4650
/frameworks/base/core/java/android/app/ActivityManagerNative.java
31b65f9aa193c26d54c55783edcaa9a09ce65c81 09-Sep-2013 Christopher Tate <ctate@google.com> Fix clearApplicationUserData() to allow a null observer

The services themselves already handle 'null' to mean "no observer";
it was just the non-AIDL marshalling code that wasn't doing the
right thing.

Bug 9588299

Change-Id: I99e26cd207f91e8060d9fc113aef90a106640b64
/frameworks/base/core/java/android/app/ActivityManagerNative.java
bc57cd1b248bf23e443581f9fe44167c94699ce8 20-Aug-2013 Craig Mautner <cmautner@google.com> Notify ViewRootImpl when it's safe to modify Canvas.

When Activity.convert{To|From}Translucent() is called the
ViewRootImpl is now notified when it is safe to convert the Canvas
from translucent to opaque and back to translucent. This will make
it possible to save resources when compositing opaque layers.

Fixes bug 10349536.

Change-Id: I7282aee1d54601fb00611d20be204bf164d873f6
/frameworks/base/core/java/android/app/ActivityManagerNative.java
08da7a1143b0c9cfb703971d882e0886bbd7d9de 12-Aug-2013 Jeff Sharkey <jsharkey@android.com> API to discover granted Uri permissions.

Now that granted Uri permissions can be persisted across reboots,
offer APIs to discover them. Returns incoming or outgoing grants
matching the requested flags and mask. Add helper method to discover
"open" documents using this new API and filtering for non-documents.

Require that callers own at least of the filtering packages to avoid
exposing all grants. Switch internal grant tracking to use ArrayMap.

Change-Id: I0a755f221d0d160b411f8d3cfc48279b64345733
/frameworks/base/core/java/android/app/ActivityManagerNative.java
dfc7fd7818cda46b914c8a9d69d1ba00443ffe5b 06-Aug-2013 Adam Skory <skory@google.com> Extend assist context to foreground services

Add Service.onProvideAssistData(Bundle) which will be
called on foreground Services that have the new attr
in their manifest of provideAssistData = true;

Rename private reference to e.g. "getTopActivityExtras"
as "getAssistContextExtras" - do not rename the relevant
permission, since it is already public.

In ActivityManagerService, request extras both from the
top activity and from any foreground services with the
above attribute. Extend PendingActivityExtras as
PendingAssistExtras with a list of Services from which
extras are expected.

Reduce the timeout to or reporting extras from 4 sec to
just 500 ms.

Bug: 9526331
Change-Id: Ia03b96e8189033a68ae9c514c8cea0199a19bce8
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
5eda9b330120f75964cd78b29f6101cc273c2a7e 02-Jul-2013 Craig Mautner <cmautner@google.com> Add convertToTranslucent to API.

Rename convertToOpaque to convertFromTranslucent. Add the
counterpart to Activity.convertFromTranslucent() for returning from
opaque to a translucent Activity. The caller should wait until
TranslucentConversionListener.onTranslucentConversionComplete() is
called before actually changing the background to translucent.

Change-Id: Id04b026bcc4dd8bad9a33a7af126e1bb28fb9c03
/frameworks/base/core/java/android/app/ActivityManagerNative.java
2286cdc0cab77e61b75e6fe9a45b91f6e57cd46d 02-Jul-2013 Dianne Hackborn <hackbod@google.com> Misc memory stuff.

- New Activity.reportFullyDrawn() method that applicatins can call
when they know they are fully drawn, allowing us to have better
app launch time info. This data is also included in usage stats.
- Added total and free memory data "dumpsys meminfo".
- Tuned the moderate memory levels to be more aggressive about
considering the device getting low on RAM, and thus starting
to prune RAM from processes.
- Fixed issues in processstats when reading old data as well as
resetting and other various fixes.

Change-Id: I20efe7451afb4edfa1aeec448328ba601c24d869
/frameworks/base/core/java/android/app/ActivityManagerNative.java
4addfc5f3998e3d7fc0a2ed9a9051c034da2ea3d 25-Jun-2013 Craig Mautner <cmautner@google.com> Add API to convert translucent Activity to opaque.

Fixes bug 9298778.

Change-Id: If6198f42bdea8aa727a2abc672eb0062aaf63ca3
/frameworks/base/core/java/android/app/ActivityManagerNative.java
fd1ce8d5a7aa1ec6c7324b171f7e7a15a95f8759 18-Jun-2013 Craig Mautner <cmautner@google.com> Add new API getStackBoxInfo

Change-Id: Ie2861e5e31bb3876cfe2d5c3d04ff58bb3955634
/frameworks/base/core/java/android/app/ActivityManagerNative.java
21d9b5669257ca931da2d383f12db4865479752a 29-May-2013 Dianne Hackborn <hackbod@google.com> Add more details about why a force stop is happening.

Change-Id: Ia938cf6fc37ad22fc7447dc538968c7bd234be7d
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
1d69bad411123913d32342864454b09ae39dab2c 07-May-2013 Kenny Root <kroot@google.com> resolved conflicts for merge of a98b0ff8 to master

Change-Id: I1f4a952d360c48426e22a7772726b6867cc19771
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/core/java/android/app/ActivityManagerNative.java
cf910b0c714b2ca90ea0013e5695850506a1d36f 23-Apr-2013 Craig Mautner <cmautner@google.com> Add tap detector for switching stack focus.

- New InputEventReceiver for detecting taps outside of focused stack
boundaries.
- Fixed bug that wasn't pausing the non-focused window when returning
home.

Change-Id: Ia51d312a7c029abc01eb5df1102814cc29d33b47
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
14210466bfde0ed83b423b20cdc0af82eb02e273 13-Apr-2013 Svetoslav <svetoslavganov@google.com> resolved conflicts for merge of dd03b6dc to master

Change-Id: Ie6628e26d8a033bdce54f9d20156b0358a0956c3
8f6f1f43eeb0d7263b626978ee2c21d4053bf610 10-Apr-2013 Adam Momtaz <amomtaz@google.com> Allow for setting test type as a monkey.

1. This allows UiAutomation type tests to run as if an
android monkey test is running. This allows applications
that recognize that they are drive by a test framework and
avoid performing certain actions such as calling 911.

2. Fixed a bug where the UiAutomation#disconnect() was not
called when the instrumentation is shutdown.

bug: 8588857

Change-Id: I9e3624dfbe2b8f81f27805711de1098ea2edd03d
/frameworks/base/core/java/android/app/ActivityManagerNative.java
875422153dc3c20f5f840a800e9a4ae345a871e8 09-Apr-2013 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of e9b4ee69 to master

Change-Id: Id752ae94f63a66b2ec200f68c73bf0d7b04b249f
f1b782427fa5bc878ac0d5356ff8332143d3798b 09-Apr-2013 Dianne Hackborn <hackbod@google.com> Kill processes when permissions are revoked.

Some permissions are associated with gids, so we need to
kill any running processes if their permission is revoked.
We will do this for any permission being revoked, since
the association between gids and permissions can change
over time.

Change-Id: Ieb7408e032539c4f21eb089d65a7a7e6c289f010
/frameworks/base/core/java/android/app/ActivityManagerNative.java
c00204b4d14d49a0417b44ca21aee4f0d4c466e0 06-Mar-2013 Craig Mautner <cmautner@google.com> Start moving Tasks from DisplayContent to TaskStack

- Create new classes for Stacks on WindowManager.
- Stop using DisplayContent methods and members:
addAppToken(),
removeAppToken(),
setAppTaskId(),
removeTask(),
mTaskIdToDisplayContents,
mTaskIdToTask.
- Start using WindowManagerService.createTask().
- Establish hierarchy of references: AppWindowToken=>Task=>
TaskStack=>StackBox=>DisplayContent.
- Clean up StackBox, TaskStack, and Task.

Change-Id: I798990aa7966784d22f4a43822087d8bb0404dd6
/frameworks/base/core/java/android/app/ActivityManagerNative.java
8f1496980e1b062cb97af57a841284142c05ee96 07-Feb-2013 Jeffrey Brown <jeffbrown@android.com> am a3f82b1b: am e4ce2517: am b314f433: Merge "add reply.writeNoException() for quick response"

# By Sungmin Choi
# Via Android Git Automerger (2) and others
* commit 'a3f82b1b2dca74e7f287912cd85069dd74b8bf4d':
add reply.writeNoException() for quick response
e4ce25177bdf7720c6b3dd5ea7b48f6b03b06469 07-Feb-2013 Jeffrey Brown <jeffbrown@android.com> am b314f433: Merge "add reply.writeNoException() for quick response"

# By Sungmin Choi
# Via Gerrit Code Review (1) and Sungmin Choi (1)
* commit 'b314f433905ea2cbc62bd5af658f05261a752e5a':
add reply.writeNoException() for quick response
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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
d0fd54648ca6249f56cf469c57181b5a7bbb71d0 29-Jan-2013 Svetoslav Ganov <svetoslavganov@google.com> Merge "Adding UI test automation APIs."
f9c5e0fe837a3090820da502ecaabc5accc00ace 23-Jan-2013 Dianne Hackborn <hackbod@google.com> Add new API to propagate contextual data to the assist action

When launching an assist, we have a new API allowing the
current foreground activity/application to provide additional
arbitrary contextual information that is stuffed in the
assist intent before it is launched.

Change-Id: I0b2a6f5a266dc42cc0175327fa76774f814af3b4
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
cdb86bb15707d18004f22d761a0f9d2623769e4a 20-Dec-2012 Sungmin Choi <sungmin.choi@lge.com> add reply.writeNoException() for quick response

In case of SET_ACTIVITY_CONTROLLER_TRANSACTION, there is no reply transaction.
So makes same to other transactions.

Change-Id: I3b9527682662a12f78cc96b6084904f18178fee7
/frameworks/base/core/java/android/app/ActivityManagerNative.java
8103890a59de6ed4abaedaad80e66666ea59f9b5 27-Nov-2012 Dianne Hackborn <hackbod@google.com> Improve debugging for issue #7586414: AlarmManager wakelocks held

In alarm manager, print a summary of the top 10 alarms by time
being executed. Keep track of execution time (and wake count) of
each type of alarm for each application so this can be printed in
the summary (and used to compute the top 10 alarms). Rework how
the alarm summary stats are tracked so that we don't need to hold
on to the full Intent for each stat and can get the Intent information
at the time the alarm is sent rather than waiting for whatever Intent
comes back in the result.

Also in the battery stats: sort the kernel wake locks by time, add
a new section showing all partial wake locks across all applications
sorted by time.

Finally a new LocalLog class that is used by AlarmManager to log
important warning messages, so these can also be later found in
its dumpsys output.

Change-Id: Icc07810053e60fb623a49937e696819cb8352b06
/frameworks/base/core/java/android/app/ActivityManagerNative.java
346acb123dd87396726941b484be6fdd5cd4ea44 16-Oct-2012 Christopher Tate <ctate@google.com> Sanity-check erroneous backup agent instantiations

Two distinct changes:

Fix a bug seen in the wild where a newly-launched application will be
spuriously asked to instantiate a backup agent. What was happening
there is that some Activity Manager state was being left stale in certain
circumstances, and then in combination with app uninstall / install, there
could be a case where uid reuse wound up looking like an app identity
match.

We now positively verify before instantiating the agent that the intended
backup target package is uid-compatible with the app process that the
instantiation was requested of. The incomplete bookkeeping in the
Activity Manager has also been tightened up, and the Backup Manager is
more aggressive about cleaning up pending operations pertaining to
apps being uninstalled.

Bug 5874010

Change-Id: Ic389f4a96c9dcd0ba6b3962b579084033d8ae9f8
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a8a9bd65bf5865d83ef44f54552ca39522bfbcf0 10-Oct-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7311376: Add API to allow apps to know if they are...

...running as the foreground user

Add UserManager.isUserRunning() which is the public version of the
existing method on ActivityManager.

Also add UserManager.isUserRunningOrStopping() since that seems like
it will be useful.

And fix the internal function that returns the array of currently
running users to not include stopped users.

Change-Id: I84672fa8748fc027fd402729586b5603f640e498
/frameworks/base/core/java/android/app/ActivityManagerNative.java
5fe7e2a3043d6a8ca933c77ccf95c791b57b221a 04-Oct-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6968859: home not exiting an ANR'd dream

Add a new call to the activity manager for the input dispatcher
to report about any pid having an ANR. This has a new feature
where it can also tell the activity manager that it is above the
system alert layer, so the activity manager can pop its ANR dialog
on top of everything if it needs to. (Normally we don't want
these dialogs appearing on top of the lock screen.)

Also fixed some debugging stuff here and there that was useful
as I was working on this -- windows now very clearly include
their uid, various system dialogs now have titles so you know
what they are in the window manager, etc.

Change-Id: Ib8f5d29a5572542cc506e6d338599ab64088ce4e
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
ea7e91514ee1968d15713e82a5cca745e2c46a05 25-Sep-2012 Amith Yamasani <yamasani@google.com> AppInfo from Notifications for secondary users

Required wiring up startActivitiesAsUser()

Bug: 7224950

Also fix a bug in navigateUp in secondary user

Change-Id: I114ae2de0457362d62e899fdb94b12239a3eb778
/frameworks/base/core/java/android/app/ActivityManagerNative.java
6d51571835737c7502a2e111ee9dc2527ebad984 21-Sep-2012 Jeff Sharkey <jsharkey@android.com> Allow acquiring ContentProviders across users.

Otherwise services like SystemUI will always open content://-style
Uris as USER_OWNER. Surfaces through createPackageContextAsUser()
which points all ContentResolver operations towards a given user.

Start using in RemoteViews, so that Notifications correctly resolve
image Uris to the sending user. Also add user support for "content"
shell tool.

Bug: 7202982
Change-Id: I8cb7fb8a812e825bb0b5833799dba87055ff8699
/frameworks/base/core/java/android/app/ActivityManagerNative.java
c72fc674a33b8d17585764d09d3bb6c77d7d947e 20-Sep-2012 Dianne Hackborn <hackbod@google.com> Implement multi-user PackageMonitor.

New APIs let you indicate what user(s) to monitor, and tell you
what user is changing when receiving a callback.

Fix package manager to only deliver package brpadcasts to the
running users. (This isn't really a change in behavior, since
the activity manager would not deliver to stopped users anyway).
Make sure all broadcasts that package monitor receives also include
user information for it to use.

Update wallpaper service to (hopefully) now Really Correctly
monitor package changes per user.

Change-Id: Idd952dd274abcaeab452277d9160d1ae62919aa0
/frameworks/base/core/java/android/app/ActivityManagerNative.java
15491c6a728131e322c45bc440500a8a78e4a410 19-Sep-2012 Dianne Hackborn <hackbod@google.com> Switch to showing top-most thumbnail of recent apps.

The way it should have been, and with the new recents enter animation
the way it must be.

Added a new method to retrieve this thumbnail, since it would be less
efficient to use the existing API (which always returns the "base"
thumbnail). Probably at some point that existing API should be tweaked
to always return the top thumbnail instead, but that is for a later time.

Also removed code that would clear the thumbnail associated with an
activity when it is resumed. I don't think there should ever be a
reason to clear a thumbnail -- it's much better to have *something*
for the task, even if it is a little out of date.

Change-Id: I83e6ca6403eb2df5e4de3009dfe8c210e8cf8d5b
/frameworks/base/core/java/android/app/ActivityManagerNative.java
ad9b32115bf8c84a93ab30e6f30f8c46e86d7244 18-Sep-2012 Dianne Hackborn <hackbod@google.com> Try again to fix issue #6912004:tap on gmail notification sends me to home screen

Add a new call to the activity manager to tell it when the activity
is resumed, so it can mark its state as dirty then instead of when
it first tries to create it.

Also tweak things to update the LRU list for the upcoming activity
at the point we start pausing the current activity, to avoid an
inefficiency where we may decide to kill the process of the upcoming
activity if it is at the end of the LRU list.

Change-Id: Ia6dc8c34dc6d4b085a1efbe3a5d5f47721d55078
/frameworks/base/core/java/android/app/ActivityManagerNative.java
5dc5a00e7ebadc085ded7e29feacd17e53698486 16-Sep-2012 Dianne Hackborn <hackbod@google.com> More multi-user stuff.

- New public APIs to find out when a user goes to the foreground,
background, and is first initializing.
- New activity manager callback to be involved in the user switch
process, allowing other services to let it know when it is safe
to stop freezing the screen.
- Wallpaper service now implements this to handle its user switch,
telling the activity manager when it is done. (Currently this is
only handling the old wallpaper going away, we need a little more
work to correctly wait for the new wallpaper to get added.)
- Lock screen now implements the callback to do its user switch. It
also now locks itself when this happens, instead of relying on
some other entity making sure it is locked.
- Pre-boot broadcasts now go to all users.
- WallpaperManager now has an API to find out if a named wallpaper is
in use by any users.

Change-Id: I27877aef1d82126c0a1428c3d1861619ee5f8653
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
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/core/java/android/app/ActivityManagerNative.java
20e809870d8ac1e5b848f2daf51b2272ef89bdfc 01-Sep-2012 Dianne Hackborn <hackbod@google.com> Add registering for explicit users.

New API to register as an explicit user, which allows you to
also select ALL to see broadcasts for all users.

New BroadcastReceiver API to find out which user the broadcast
was sent to.

Use this in app widget service to handle per-user package broadcasts
and boot completed broadcasts correctly.

Change-Id: Ibbe28993bd4aa93900c79e412026c27863019eb8
/frameworks/base/core/java/android/app/ActivityManagerNative.java
4120375d46091df8527bb701882e056fbb0e6b06 31-Aug-2012 Dianne Hackborn <hackbod@google.com> Remove Binder.getOrigCallingUid().

Replaced all remaining places that used it with explicit user
specification.

While doing this, I ran into stuff that was creating PendingIntent
objects (that now need to specify the explicit user they are for),
which are also posting notifications... but have no way to specify
the user for the notification.

So the notification manager in the system process now also gets a
formal concept of a user associated with the notification, which
is passed in to all the necessary aidl calls. I also removed the
old deprecated aidl interface for posting/cancelling notifications,
since we now always need a user supplied.

There is more work that needs to be done here, though. For example
I think we need to be able to specify USER_ALL for a notification that
should be shown to all users (such as low storage or low battery).
Along with that, the PendingIntent creation needs to be tweaked to
be able to handle USER_CURRENT by evaluating the user at the point the
pending intent is sent.

That's for another change, however.

Change-Id: I468e14dce8def0e13e0870571e7c31ed32b6310c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
5ac72a29593ab9a20337a2225df52bdf4754be02 30-Aug-2012 Dianne Hackborn <hackbod@google.com> Improve multi-user broadcasts.

You can now use ALL and CURRENT when sending broadcasts, to specify
where the broadcast goes.

Sticky broadcasts are now correctly separated per user, and registered
receivers are filtered based on the requested target user.

New Context APIs for more kinds of sending broadcasts as users.

Updating a bunch of system code that sends broadcasts to explicitly
specify which user the broadcast goes to.

Made a single version of the code for interpreting the requested
target user ID that all entries to activity manager (start activity,
send broadcast, start service) use.

Change-Id: Ie29f02dd5242ef8c8fa56c54593a315cd2574e1c
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
f02b60aa4f367516f40cf3d60fffae0c6fe3e1b8 16-Aug-2012 Dianne Hackborn <hackbod@google.com> Rename UserId to UserHandle.

This is the start of turning this into a formal public API.

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
/frameworks/base/core/java/android/app/ActivityManagerNative.java
8264408f5995534f8e3147b001664ea0df52aaa5 03-Aug-2012 Amith Yamasani <yamasani@google.com> Start the correct settings from the status bar.

Added a new method to Context: startActivityAsUser() requiring the
INTERACT_ACROSS_USERS_FULL permission.

Show the correct Recents list, based on current user.
Added a getRecentTasksForUser() in ActivityManager. Hidden and requires
the INTERACT_ACROSS_USERS_FULL permission.

Change-Id: If5b56465efdd3ead36601a3b51ed4af157bbf35c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
1927ae8a56a010919a7535231fa0f7db70f7e152 23-Jun-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6717667: expanded notification actions don't work on the lock screen

FLAG_ACTIVITY_CLOSE_SYSTEM_DIALOGS was a mistake.

Instead, and the infrastructure for the status bar to take care
of closing and hiding things itself when you press these buttons,
just like it does for the main Intent of the notification.

Bug: 6717667
Change-Id: I1b22186e0cedc05f46a1a3ec78053a72afaf61b1
/frameworks/base/core/java/android/app/ActivityManagerNative.java
6ae8d1821822296df0606c9cd1c46708cc21cb58 23-May-2012 Dianne Hackborn <hackbod@google.com> Fix (mostly) issue #5109947: Race condition between retrieving a...

...content provider and updating its oom adj

This introduces the concept of an "unstable" reference on a content
provider. When holding such a reference (and no normal stable ref),
the content provider dying will not cause the client process to be
killed.

This is used in ContentResolver.query(), .openAssetFileDescriptor(),
and .openTypedAssetFileDescriptor() to first access the provider
with an unstable reference, and if at the point of calling into the
provider we find it is dead then acquiring a new stable reference
and doing the operation again. Thus if the provider process dies
at any point until we get the result back, our own process will not
be killed and we can safely retry the operation.

Arguably there is still the potential for a race -- if somehow the
provider is killed way late by the OOM killer after the query or
open has returned -- but this should now be *extremely* unlikely.
We also continue to have the issue with the other calls, but these
are much less critical, and the same model can't be used there (we
wouldn't want to execute two insert operations for example).

The implementation of this required some significant changes to the
underlying plumbing of content providers, now keeping track of the
two different reference counts, and managing them appropriately. To
facilitate this, the activity manager now has a formal connection
object for a client reference on a content provider, which hands to
the application when opening the provider.

These changes have allowed a lot of the code to be cleaned up and
subtle issues closed. For example, when a process is crashing, we
now have a much better idea of the state of content provider clients
(olding a stable ref, unstable ref, or waiting for it to launch), so
that we can correctly handle each of these.

The client side code is also a fair amount cleaner, though in the
future there is more than should be done. In particular, the two
ProviderClientRecord and ProviderRefCount classes should be combined
into one, part of which is exposed to the ContentResolver internal
API as a reference on a content provider with methods for updating
reference counts and such. Some day we'll do that.

Change-Id: I87b10d1b67573ab899e09ca428f1b556fd669c8c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
5320eb8938098c9824093f7f842a0a97bbc190a4 18-May-2012 Dianne Hackborn <hackbod@google.com> Fix activity resolver, issues #6519130 and #6507239

6519130: Starting ResolverActivity with no arguments crashes system_server
6507239: ResolverActivity may bypass signature permissions

Change-Id: I64534f781bc6b7eb45e85dbe3a55d351ee28e85c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
ecc5a9cca000b62d2a649b795460fd791a206a89 27-Apr-2012 Dianne Hackborn <hackbod@google.com> Add new Activity.finishAffinity() method.

It's cool!

Change-Id: I9fdcd9535b7f1ca2b311d3a1b23e5d058977b095
/frameworks/base/core/java/android/app/ActivityManagerNative.java
ff5b158f69bf453cf1fdedd175a09482c65f2bf2 13-Apr-2012 Dianne Hackborn <hackbod@google.com> Keep activities stopped while the lock screen is up.

Tell the activity manager when the lock screen is shown, so it
can keep itself (mostly) in sleep mode during this time, having
the foreground actvities remain in their stopped state.

Change-Id: I71c86d3298f23a98014d7ae36fd540c9df9a64e6
/frameworks/base/core/java/android/app/ActivityManagerNative.java
c4a07d1caa9befd4fa8165ff05fa5e92480d8e27 06-Apr-2012 Christopher Tate <ctate@google.com> Attribute alarm broadcast wakelocks to the sender

Wakelock usage for the purpose of sending an alarm broadcast is now
attributed to the application which posted the alarm, not to the OS.

Bug 5911317

Change-Id: I8cb79c3bd5db467388716ab68285f4ab0bfe468b
/frameworks/base/core/java/android/app/ActivityManagerNative.java
dd8fab2629131b09367df747afd9a61e42dd1992 23-Mar-2012 Adam Powell <adamp@google.com> TaskStackBuilder and Activity navigation features for framework

Promote navigation helpers from the support library to the core
platform.

The support library's meta-data element has been replaced with a
first-class parentActivityName attribute. This attribute is valid
on both activity and activity-alias elements. An activity-alias
will inherit the target activity's parentActivityName if one is
not explicitly specified.

Automatic Up navigation for Activities

Add the public method onNavigateUp() to Activity. The default
implementation will use the metadata supplied in the manifest about an
activity's hierarchical parent (parentActivityName) to do the right
thing.

If any activities in the parent chain require special Intent
arguments, the Activity subclass should override onNavigateUp() to
properly implement Up navigation for the app, supplying such arguments
as needed.

If automatic Up navigation within the same task can't find an activity
matching the supplied intent in the current task stack, it will act as
an in-app "home" and return to the root activity (presumably the app's
front page) in that task. (From this state, pressing "back" with
default behavior will return to the launcher.)

Change-Id: If163e27e59587f7af36975a09c986cb117ec3bc6
/frameworks/base/core/java/android/app/ActivityManagerNative.java
52f1d752f90579c9b57e3350393a029cf72138d0 29-Mar-2012 Amith Yamasani <yamasani@google.com> Show the current user in power menu

Shows a little indicator next to the current user in the power menu
when multi-user is enabled.

Fixed a bug where Settings was sometimes being launched in the wrong
process when there are 2 instances running.

Change-Id: Iaf2a00f6d1871fd2a88d8982439e445423bb2896
/frameworks/base/core/java/android/app/ActivityManagerNative.java
69f819b397e5e4b50b1931da6ef1caba0229640a 23-Mar-2012 Jeff Sharkey <jsharkey@android.com> Merge "Include GIDs for unenforced permissions."
8078d8c8a282ca81344febe7256f63b1e805e3aa 20-Mar-2012 Dianne Hackborn <hackbod@google.com> Add new thumbnail animation.

Use it for recent tasks switching.

Not perfect yet by far, but something.

Also fix issue #6186758: Twitter crashes after tapping on a tweet on JRM75D

Change-Id: I49bf6c94aafde875ac652dedaf96d6c08cc9e7d2
/frameworks/base/core/java/android/app/ActivityManagerNative.java
b9a070189c2280a6356a8abb9483b517a41e14c3 23-Mar-2012 Jeff Sharkey <jsharkey@android.com> Include GIDs for unenforced permissions.

When READ_EXTERNAL_STORAGE isn't enforced, grant its GID to all
launched processes. When changing enforcement, kill all processes
below foreground adjustment, causing them to be relaunched with
update GIDs.

Bug: 6131916
Change-Id: I6d83efc937919f13a1a7d9caac902e572869406a
/frameworks/base/core/java/android/app/ActivityManagerNative.java
7a2195cdd33f27c79eda343defc1f7ccf59cc8ac 20-Mar-2012 Dianne Hackborn <hackbod@google.com> Start using the new activity options argument.

New class lets you make an options bundle defining a custom animation,
as an alternative to Activity.overridePendingTransition().

Change-Id: I8e209bf52398a98ab9f1bcafa1ec0a580dae57c0
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
27ff913d56de8400083a13fc572e2812b32c890c 06-Mar-2012 Dianne Hackborn <hackbod@google.com> Work on more low memory reporting to apps.

There are now some new trim memory levels that are sent to
non-background applications as RAM becomes low.

There is a new API for an application to retrieve information
about memory trimming and such on demand.

Fixed various checks against the memory trim level to be
robust (not compare against exact values).

Change-Id: Ifd1c6151124350168aef20a94e517166fd2e03eb
/frameworks/base/core/java/android/app/ActivityManagerNative.java
25872aa3ef189ae5506a923398af11ce5eb1a9b9 04-Feb-2012 Svetoslav Ganov <svetoslavganov@google.com> Adding shell commands for modifying content.

1. Added methods to the ActivityManagerService remote interface
that allow accessing content providers outside of an application.
These methods are guarded by an internal signature protected
permission which is given to the shell user. This enables a
shell program to access content providers.

2. Implemented a shell command that takes as input as standart
fagls with values and manipulates content via the content provider
mechanism.

Change-Id: I2943f8b59fbab33eb623458fa01ea61a077b9845
/frameworks/base/core/java/android/app/ActivityManagerNative.java
37ce3a8af6faab675319d0803b288ab1dddc76be 06-Feb-2012 Amith Yamasani <yamasani@google.com> Multi-user - wallpaper service

- Allow each user to have their own wallpaper (live or static).
- Migrate old wallpaper on upgrade.
- Update SystemBackupAgent to backup/restore from primary user's
new wallpaper directory.

Reduce dependency on Binder.getOrigCallingUser() by passing the
userId for bindService.

Change-Id: I19c8c3296d3d2efa7f28f951d4b84407489e2166
/frameworks/base/core/java/android/app/ActivityManagerNative.java
21fbd1f7da53dc044737803dccddf8099f1fc1e9 10-Feb-2012 Dianne Hackborn <hackbod@google.com> Some cruft removal.

Change-Id: If4a94bfd4a033748eb13e8f3ff25e24382746778
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
90c52de28691ca0bbbf7c039ef20f85ce46882cc 23-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5173952: Opening a Notification From Lock Screen...

...Should Skip Unsecure Lockscreen (ICS)

Also while I am in there, clean up logging of intent objects to include
even less sensitive information, while showing the true Intent in dump
output (since apps can't get to that).

Change-Id: I35fed714645b21e4304ba38a11ebb9c4c963538e
/frameworks/base/core/java/android/app/ActivityManagerNative.java
661cd52e0e1d527132eb1cae604d3e64da7ec0cb 22-Aug-2011 Dianne Hackborn <hackbod@google.com> Add progress dialog for booting after an upgrade.

This introduces a new facility for code during the boot process
to display messages to the user through a progress dialog. This
is only for use when performing longer-than-usual post-upgrade
operations such as running dexopt on applications or upgrading
databases.

Change-Id: I0e78439ccec3850fb67872c22f235bf12a158dae
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
b437e090ec03a2bab10bdfcb9484577a7f34e157 06-Aug-2011 Dianne Hackborn <hackbod@google.com> Improved memory use reporting.

Change-Id: I38e53e6228bba92a142bafeedb5af8df4e4e5724
/frameworks/base/core/java/android/app/ActivityManagerNative.java
9a8c5cefcab3d5dec6ff63f0e99553e1aa9a4af8 22-Jul-2011 Romain Guy <romainguy@google.com> Ouput looper traces as traceview traces

Change-Id: I96c8e85fd7497d970febbf6f5aefc4ab903add8e
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
31ca854cdba31ec6ab089af743a8701a6192e07e 19-Jul-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4976176: Font size setting does not persist

Change-Id: Id58caf990bdd3aac5ea97aaba45652ffad1f678a
/frameworks/base/core/java/android/app/ActivityManagerNative.java
6c418d585e0a91054b168fde3130188afd006c98 29-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4902856: Don't let apps register non-explicit PendingIntents

Location manager now checks for such intents, and logs a warning when
they are given to it. Nothing thrown yet, it needs to check the
targetSdkVersion of the caller somehow.

When sending the pending intent, we require that the recipient hold the
appropriate permission. This should pretty much close the security hole.

Includes a bunch of infrastructure in the activity manager needed to
support all this.

Change-Id: I4dba7a98a7b8bbb9e347666451aa9cb1efad1848
/frameworks/base/core/java/android/app/ActivityManagerNative.java
36f80f3a5a3de42d4e7ca4b53d4aa3e567f4df6f 01-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 590ec479 to master

Change-Id: I30503da6a73b9cb15eee66a67c75d50ccdc4b9f0
36cd41f8efa6f6a683d3353d309ff548295af9e9 26-May-2011 Dianne Hackborn <hackbod@google.com> Spiffy new compatibility mode UI.

Change-Id: I1207eaafae59a434fcc979ad60a83e2d685288af
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a4620793038b9a9163b26c6ece882cb454fcbf87 21-May-2011 Jeff Sharkey <jsharkey@android.com> Observe screen on/off events in NetworkPolicy.

The POLICY_REJECT_BACKGROUND policy requires that network traffic be
blocked when a UID goes into the background. Even if the UID has an
activity in the foreground, it's considered "background" if the screen
is turned off.

This changes watches for SCREEN_ON/OFF broadcasts, and rule generation
now observes screen state. It also introduces an observer pattern so
that ActivityManager doesn't directly know about NetworkPolicy, and
moves the service management into SystemServer.

Change-Id: Ie7a84929d3ca60ae4578d47e19d5a8da10fd8d58
/frameworks/base/core/java/android/app/ActivityManagerNative.java
3d0724dc220a2e027b9e38f61c39c84c28a505d5 13-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 0e59729b to master

Change-Id: I2d3a6bddf66b1df0c101c45ea2fec1cf65caf01b
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/core/java/android/app/ActivityManagerNative.java
aa9d84c37e05f696ec158dac98ce38cf41e18314 10-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 05be6d6f to master

Change-Id: Ic6a6c5bb300f6f1d43f9ed550b284282b4f16212
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/core/java/android/app/ActivityManagerNative.java
0c5001d776d56bae02a5cc2663286a125d99bc5e 13-Apr-2011 Dianne Hackborn <hackbod@google.com> Add APIs to remove tasks.

You can remove sub-tasks inside of a task, or an entire task.

When removing an entire task, you can have its process killed
as well.

When the process is killed, any running services will get an
onTaskRemoved() callback for them to do cleanup before their
process is killed (and the service possibly restarted).

Or they can set a new android:stopWithTask attribute to just
have the service automatically (cleanly) stopped at this point.

Change-Id: I1891bc2da006fa53b99c52f9040f1145650e6808
/frameworks/base/core/java/android/app/ActivityManagerNative.java
beb182a4945b9b762fac77edd1183897bcac5b32 11-Apr-2011 Amith Yamasani <yamasani@google.com> Merge "Package manager changes to store and update user information."
4b2e934928a2eb65927bd39197198c28c49efb94 31-Mar-2011 Amith Yamasani <yamasani@google.com> Package manager changes to store and update user information.

Some API stubs for managing users and storing their details.
List of users is stored in an xml file.
Each user's properties are stored in a separate xml file.

Some unit tests for modifying the XML files.

Change-Id: If2ce2420723111bd426f6762def3c2afc19a0ae5
/frameworks/base/core/java/android/app/ActivityManagerNative.java
bcbab3684349353ee8cab30b556001824d0e7ccf 09-Apr-2011 Dianne Hackborn <hackbod@google.com> Merge "Rework thumbnails in activity manager."
f26fd99a7c2f554b0297760bb66336473c7db61f 09-Apr-2011 Dianne Hackborn <hackbod@google.com> Rework thumbnails in activity manager.

We now only keep a thumbnail for the task, not for each
activity. However if you use FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET,
we will make a new secondary thumbnail for that series of
activities. There is a new API for the app to get these
secondary thumbnails.

Also set a default thumbnail size for non-xlarge screens
so we have thumbnails on phones. (We need some smarter
code in the platform for computing the actual thumbnail
dimensions of the current device). And add a test app
to show recent tasks + thumbnails.

Change-Id: Ic36759f6635522118a2cb7f156662229a610c492
/frameworks/base/core/java/android/app/ActivityManagerNative.java
43a17654cf4bfe7f1ec22bd8b7b32daccdf27c09 07-Apr-2011 Joe Onorato <joeo@google.com> Remove the deprecated things from Config.java. These haven't been working since before 1.0.

Change-Id: Ic2e8fa68797ea9d486f4117f3d82c98233cdab1e
/frameworks/base/core/java/android/app/ActivityManagerNative.java
648251710162cdaf7371012a1cbb79b9bc5bc0e4 03-Mar-2011 Dianne Hackborn <hackbod@google.com> Fix issue #3485923: Gmail crash

Allow application to try to recover if a surface OOM error
happens on the client side.

Change-Id: I0308bd99647a35e4bcac448340b7fc6330a828f6
/frameworks/base/core/java/android/app/ActivityManagerNative.java
d94df45b3d1ab4004ef517acfc56a9310330f8d8 17-Feb-2011 Dianne Hackborn <hackbod@google.com> Rework thumbnail API to not suffer from IPC failures.

Thumbnails are now requested separately, so we don't exceed the
IPC buffer size limit.

Also implement issue #3349553: Please provide a hook to intercept
fragment-breadcrumb clicks

And maybe fix issue #3439199: Music Notification does not turn on
when app switching out of Music app

Change-Id: Ie939e78cc8ded07b18112760e053185947549f61
/frameworks/base/core/java/android/app/ActivityManagerNative.java
4eba96bb314d8ff773ea33d6cb3179f25751ecce 21-Jan-2011 Dianne Hackborn <hackbod@google.com> Fix issue #3377999: Activities need to be stopped when sleeping

This is a band-aid over the existing kludgy stopping mechanism
where the semantics of stop are different in the activity manager
than in the clients.

This change is intended to be as unobtrusive as possible, only
impacting the sleep case. I have a different change that
completely reworks how we stop activities to simply this all
a lot by unifying the semantics between the server and client.
However, it is too late in HC for such an extensive change. Later
I'll revert this one and put in the better solution.

Change-Id: Id77f2db1ec83469cdd888acb8fbc4679daa7766e
/frameworks/base/core/java/android/app/ActivityManagerNative.java
0aae2d4e0075fd699cf40b26dca0eb2c3b3e37d2 08-Dec-2010 Dianne Hackborn <hackbod@google.com> Rework activity lifecycle so onSaveInstanceState() is after onPause().

The goal is to fix a bunch of fragment-related bugs caused by various
things trying to do fragment transactions after onPause()... which
currently throws an exception, since this is after the activity's state
has been saved so the new fragment state can be lost.

The basic change is relatively simple -- we now consider processes
hosting paused or stopping activities to be unkillable, and the client
code now does the onSaveInstanceState() as part of stopping the
activity.

For compatibility, if an app's targetSdkVersion is < HONEYCOMB, the
client side will still call onSaveInstanceState() prior to onPause()
and just hold on to that state until it needs to report it in once
being stopped.

Also included here is a change to generate thumbnails by taking
screenshots. The code for generating thumbnails by re-rendering
the view hierarchy is thus removed.

Change-Id: Iac1191646bd3cadbfe65779297795f22edf7e74a
/frameworks/base/core/java/android/app/ActivityManagerNative.java
663f4f33e23551ef4047e39d0c3d645269e32c2a 24-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Misc ActivityManagerNative cleanup.

Change-Id: Ib1fba1a72d074a12b44cce64741071815cb680f3
/frameworks/base/core/java/android/app/ActivityManagerNative.java
621e17de87f18003aba2dedb719a2941020a7902 23-Nov-2010 Dianne Hackborn <hackbod@google.com> Implement issue #3221502: New APIs to support new back stack / task navigation

What this adds:

- A new Intent activity flag to completely replace an existing task.
- A new Intent activity flag to bring the current home task up behind
a new task being started/brought to the foreground.
- New versions of startActivity() that take an array of Intents to be
started, allowing applications to start a task in a specific state.
- A public moveTaskToFront() method on ActivityManager, with a new flag
that allows the caller to have the task moved to the front with the
current home task immediately behind it.

Change-Id: Ie8028d09acffb5349d98043c67676daba09f75c8
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a1b0d6966e45e847aa47cc35eac8ea4e624d6a99 08-Oct-2010 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of efa4f7f8 to master

Change-Id: I00dff76594326a6f6e69515a9cba673602ed269d
3c4c2b7e6f0674068d13b42d4dcf0fd009df0c49 06-Oct-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3001368: API REVIEW: android.app.Activity

Bye bye, lots of junk.

Change-Id: Idd72fc525851277362b2a1ff3bb0f7865fe655fd
/frameworks/base/core/java/android/app/ActivityManagerNative.java
90f4aafa336d9f2f07281ead3c846d323a710015 27-Sep-2010 Dianne Hackborn <hackbod@google.com> Implement permission granting in clipboard.

Change-Id: I9a7a949d1aaf4b3beabceaf807fb7d3b040e4ea8
/frameworks/base/core/java/android/app/ActivityManagerNative.java
cca1f0e3476edd09cdd81b075a6b7780a2959b46 27-Sep-2010 Dianne Hackborn <hackbod@google.com> Allow all apps to call ContentResolver.getType().

I can't find the bug number for this, but it is needed for some things
we are doing where the app building an intent may not have access to the
URI in the data field. This is for HC, but doing in GB to avoid introducing
integration issues.

Change-Id: I0cac971854198b18775d2a73deb80f23431bfbe2
/frameworks/base/core/java/android/app/ActivityManagerNative.java
8313fc7e94e46e5cc09f457a15a771a325b9f74f 27-Sep-2010 Dianne Hackborn <hackbod@google.com> Allow all apps to call ContentResolver.getType().

I can't find the bug number for this, but it is needed for some things
we are doing where the app building an intent may not have access to the
URI in the data field. This is for HC, but doing in GB to avoid introducing
integration issues.

Change-Id: I0cac971854198b18775d2a73deb80f23431bfbe2
/frameworks/base/core/java/android/app/ActivityManagerNative.java
d02bdaab495641ab50e2123fdfd99a819cc40540 26-Aug-2010 Daniel Sandler <dsandler@android.com> Remove experimental immersive mode support. DO NOT MERGE

Bug: 2949215

Change-Id: I7d998ef571ef7e149bb96261430e92150b80b77d
/frameworks/base/core/java/android/app/ActivityManagerNative.java
c8f8497b9cac63a923dbdb1c08e247ba32c19e5e 26-Aug-2010 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 66d633d2 to master

Change-Id: I6c38d7c4d127954dfca17082215c587a3cd4a586
7e269644fcc319835f1e7f762f3cbd8087e3e22f 26-Aug-2010 Dianne Hackborn <hackbod@google.com> Don't retain global ref to last inflated context.

Also rework URI permission granting to support upcoming
clipboard use.

Change-Id: I9842920350955531c5a511c2ecc5215e8c783343
/frameworks/base/core/java/android/app/ActivityManagerNative.java
86dde2d64c7eadc06a17aeb486c669ce4b53d13c 31-Jul-2010 Brad Fitzpatrick <bradfitz@android.com> am e2d33bbc: am d2165cfc: Merge "StrictMode: time violations in Binder calls" into gingerbread

Merge commit 'e2d33bbc496192d49c1e48baad446d8d0720d301'

* commit 'e2d33bbc496192d49c1e48baad446d8d0720d301':
StrictMode: time violations in Binder calls
cb9ceb1029036363a81952d8ed5dfcbc83e6ff72 29-Jul-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: time violations in Binder calls

Change-Id: I5796993dce98be722cf679b78acaf0c9de0ba461
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
c27181c7f3e11170ec82807cfa416f0a906ff574 30-Jun-2010 Christopher Tate <ctate@google.com> Remove memory monitoring from the system watchdog

This was originally written as an in-case-we-need-it facility, but was
never actually used in production. It also soaked up a surprising amount
of cpu on occasion, as well as doing sketchy things like demoting the
system_server's primary looper thread to the background cgroup at times.

Change-Id: I9a81a8d1e9caea9e0a1277d97785fe96add438d7
/frameworks/base/core/java/android/app/ActivityManagerNative.java
9d39d0cb361c5d3bba04a6bacf299be2162a6e92 25-Jun-2010 Dianne Hackborn <hackbod@google.com> Make bad notifications crash their application.

Implement notification manager handling of bad notifications, to
call a new activity manager to have the owner's process crashed
(if there is one).

Change-Id: Ib15e8d0c598756f3b39c99cc2045c18e054daf6b
/frameworks/base/core/java/android/app/ActivityManagerNative.java
69a4817e3e1e368e758ff8c238deb5ee26963c04 23-Jun-2010 Daniel Sandler <dsandler@android.com> Immersive activity API.

An Activity can declare itself to be "immersive" either by
setting android:immersive="true" in AndroidManifest or by
calling setImmersive(true).

Immersive activities "should" not be interrupted, for
example by Notifications with an associated
fullScreenIntent. (In the future we may even prevent any
non-system application from successfully calling
startActivity() if the foreground activity is immersive.)
Notifications with FLAG_HIGH_PRIORITY set will be shown to
the user in some less-obtrusive way if the frontmost
activity is immersive.

Change-Id: I8d0c25cc4e22371c27cbf2bb6372d2c95d57b2d7
/frameworks/base/core/java/android/app/ActivityManagerNative.java
46d42387464a651268648659e91d022566d4844c 11-Jun-2010 Brad Fitzpatrick <bradfitz@android.com> More StrictMode work, handling violations in ActivityManagerService.

Also starts to do duplicate-suppression.

Change-Id: I0502f6ab6c45fa319298de4874ecfe44b7829d21
/frameworks/base/core/java/android/app/ActivityManagerNative.java
438d0595121a7a2cdf19741e76e3c0e21a5c173d 10-Jun-2010 Brad Fitzpatrick <bradfitz@android.com> Introduce "StrictMode"

This is a new public API for developers to opt-in to strict rules
about what they're allowed to do on certain threads. (this is the
public face of the @hide dalvik.system.BlockGuard, added recently...)

In practice this will be used for developers to opt-in to declaring
that they don't want to be allowed to do various operations (such as
disk I/O or network operations) on their main UI threads. (these
operations are often accidental, or even when they are fast come with
a good chance of being slow or very slow in some cases....)

Implementation wise, this is just a thread-local integer that has a
bitmask of the things that aren't allowed, and more bits for saying
what the violation penalty is. The penalties, of which multiple can
be chosen, include:

* logging
* dropbox uploading for analysis/reporting
* annoying dialog
* full-on crashing

These are all only very roughly implemented at this point, but all
parts now minimally work end-to-end now, so this is a good checkpoint
commit before this gets too large.

Future CLs will polish all the above 4 penalties, including
checksumming of stacktraces and minimizing penalties for duplicate
violations.

Change-Id: Icbe61a2e950119519e7364030b10c3c28d243abe
/frameworks/base/core/java/android/app/ActivityManagerNative.java
860755faa6bdd3c2aeae49c05b87b5bc080ae60c 04-Jun-2010 Dianne Hackborn <hackbod@google.com> Add support for heavy-weight applications.

Only one can be running at a time, their process can not be killed,
and a notification is posted while it is running.

Change-Id: I843015723947e0c934ae63a1aeee139327c0bc01
/frameworks/base/core/java/android/app/ActivityManagerNative.java
f7f5dda5e54da53b98f1504672a422a484496531 23-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> Add new activity manager method to get list of running applications installed on sdcard.
Use new method in UsbStorageActivity.
Fix moving dex files.
moveDex should be suffixed with LI since it uses Installer

Change-Id: Id5ef0254578e84b9aae2c2ac44f722eb5a0fda1c
/frameworks/base/core/java/android/app/ActivityManagerNative.java
2ccda4dc8d800c3592b4bd4d1d70a064d98dd4fe 23-Mar-2010 Dianne Hackborn <hackbod@google.com> Improve switching to car mode, retain night mode option.

Fiddle with how we go into car mode to try to ensure we get a clean
transition. Also have the system take care of remembering the night
mode setting so it will stay at what you want.

Change-Id: Icb94fdd961c7a192f7707ec71544485a1ea12455
/frameworks/base/core/java/android/app/ActivityManagerNative.java
e99bb5f10b90736d10cee9729b56cba156fc0921 19-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> Add new method call back in MountService.
PackageManager invokes this call back when its done handling
the media status update.
Add new uid check for updateExternalMediaStatus
Change killPids method in ActivityManager.
Remove mountsd command in Pm.java We cannot arbitrarily enable/disable
packages in PackageManager now.

Change-Id: I28dcba4afd2b4486f68abdaa1628a31b66544c91
/frameworks/base/core/java/android/app/ActivityManagerNative.java
061d58a10122b2ef56d4c2ed46090add16fb5b17 13-Mar-2010 Dianne Hackborn <hackbod@google.com> Fix problem with starting a translucent activity in onCreate().

Fixes issue #2437252: Starting activity by means of startActivityForResult
causes 5 seconds delay if "android:windowIsTranslucent" is true

The optimization to avoid showing an activity window when a new
activity is being started was a little too aggressive. Now it
avoids doing this if there is not actually a fullscreen activity
on top to cover it.

Change-Id: I630e37a1f1d3b874b5a25572cbf887cebc2e3e91
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
9327f4f671de3cbb795612bf4f314ceff88de865 29-Jan-2010 Dianne Hackborn <hackbod@google.com> More device policy work: clarify password modes, monkeying.

Clarifies what the password modes mean, renaming them to "quality"
and updating their documentation and the implementation to follow.

Also adds a facility to find out if a monkey is running, which I
need for the api demo to avoid letting it wipe the device.
/frameworks/base/core/java/android/app/ActivityManagerNative.java
03abb8179f0d912e6dabfc0e2b0f129d85066d17 05-Jan-2010 Dianne Hackborn <hackbod@google.com> Kill the task killers.

The ActivityManager.restartPackage() API is now deprecated, and no longer
allows applications to mess up the state of other applications. This was
being abused by task killers, causing users to think their other applications
had bugs.

A new API is introduced for task killers,
ActivityManager.killBackgroundProcesses(), which allows these applications
to kill processes but only the same amount that the out of memory
killer does, thus causing no permanent damage. The old restartPackage()
API is now a wrapper for calling this new API.

There is also a new private forceStopPackage() API that is used for the
system's force stop UI which does what the old restartPackage() API did.
/frameworks/base/core/java/android/app/ActivityManagerNative.java
60d8762413e8daba5f73559786312a9ec5e3b827 17-Dec-2009 Dan Egnor <egnor@google.com> DropBox logging of app & system server crashes.

The crashes are also reported to the event log (and of course the
main logcat, like they always have been). Ordinary Log.e(t,m,e) isn't dropboxed
but there's a new Log.wtf() which always is. (Still @pending in this change.)

Add a hook to IPowerManager to crash the system server on demand
(only for apps with REBOOT permission, since it's basically a restart).
This is not exposed in PowerManager, must be invoked directly -- mostly
this is there so "Bad Behavior" in dev tools can do it.
/frameworks/base/core/java/android/app/ActivityManagerNative.java
b7f0367cec1c744aa66ef397b0244e25d507491c 10-Dec-2009 Dan Egnor <egnor@google.com> Eliminate CrashData and friends.

(CrashData was a custom-marshalled crash-info class used for a server crash
reporting system I am deprecating). Use ApplicationErrorReport.CrashInfo
instead to report crash details (mostly the stack trace) from RuntimeInfo to
ActivityManagerService, since we're likely to need the crash information in
that form anyway.

Remove the (long-disabled) flags and support for the "Debug" button
in the crash dialog.

Further gut the ICheckinService interface by removing the crash-reporting
APIs (and everything that calls them), plus the synchronous checkin()
method (which has been stubbed out for a while now).

A new dropbox-based crash reporting system is in the works, but not part
of this change.
/frameworks/base/core/java/android/app/ActivityManagerNative.java
e88846eeaf70f9f4299af9e3d54ba5dacede42b6 01-Oct-2009 Dianne Hackborn <hackbod@google.com> Semi-workaround for #2027266: app drawer showing up on the side of the screen

(when booted while docked)

This isn't really a fix, but we now have the activity report the configuration
it actually launched in, so the activity manager will later adjust it if
needed. Should help us recover from hitting the race in this particular case.

Change-Id: I3bb83a48c2d692b4cb1822d8ae7d924cfa9187b2
/frameworks/base/core/java/android/app/ActivityManagerNative.java
3b3e145d3c41fd68974e08f799b1fd1f8f060cf0 25-Sep-2009 Dianne Hackborn <hackbod@google.com> A variety of work on animations.

- The lock screen now fades in and out.
- Fixed a bug where we would accidentally freeze the screen when switching
to an activity with a different orientation than the current (but
the screen itself is in the current orientation). This would mess up
the animations on the car dock.
- New API to force a particular animation for an activity transition
(untested).
- New wallpaper animations.
- Resources now uses the next API version when in a development build,
to help applications being developed against such builds.

Change-Id: I2d9998f8400967ff09a04d693dc4ce55f0dbef5b
/frameworks/base/core/java/android/app/ActivityManagerNative.java
fa82f22f1d8c4c828bdf9b670006be4f4fec772e 18-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2093608: Calendar widget takes a few seconds to launch

Avert your eyes!

The key change here is that RemoteViews can now call a Context API to
start its pending intent, which inside of the activity manager we can
use to determine to cancel the timeout delay for external entities
to disrupt the home screen.

Change-Id: If097cf7478cbed7a3c04a304050bd7fd5703d197
/frameworks/base/core/java/android/app/ActivityManagerNative.java
4f21c4cf077cfee5b35a56703618115614bc40f2 17-Sep-2009 Dianne Hackborn <hackbod@google.com> Add API to retrieve memory used by running processes.

Change-Id: I9c1935c2ef3c78bd67ec4dfd811a1caaab4514c3
/frameworks/base/core/java/android/app/ActivityManagerNative.java
bcbcaa7edd32ba67c6290d79f7e7821c4b5b39ac 10-Sep-2009 Dianne Hackborn <hackbod@google.com> Wallpapers, animations, pending intent.

Some more tweaks and fixes to wallpapers. Make sure wallpapers are
told they are not visible when the screen is off. Add some new animations
for transitions across tasks, and fiddle with many of the existing
animations. Clean up the relationship between translucent activities
and animations. Add new API to start a PendingIntent from an
activity.

Change-Id: Ie0bf45fe44081bb6982c75361257a55d9cd9d863
/frameworks/base/core/java/android/app/ActivityManagerNative.java
dd9b82c283815747b75fe4434c65e4b6c9c9b54f 03-Sep-2009 Dianne Hackborn <hackbod@google.com> Add better service reporting.

This will be used elsewhere.

Change-Id: Id561fa7fed5eb65446312cb697813483903d33a6
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a34f1ad7c3a68d971e6332aa2fb1c16d083920b3 02-Sep-2009 Dianne Hackborn <hackbod@google.com> Fiddle system boot ordering.

This makes the system a little more careful to not start third party
code until it is ready to.

Also fix a little bug in SyncManager that would cause it to crash
during boot if sync was in a failure state.

Change-Id: Ib2d287d8441d155d393fe740a5f98690895fd358
/frameworks/base/core/java/android/app/ActivityManagerNative.java
5e1ab335e6e8fbfa19c64d53880a22f472010953 02-Sep-2009 Christopher Tate <ctate@android.com> Expand apps' control over the settings restore process

Applications can now specify two more aspects of the restore process: whether
they need to run with their own custom Application subclass rather than being
launched in the usual restricted mode during restore, and whether it's okay for
the backup manager to kill the app process once restore has completed. The new
manifest attributes for these are, respectively, android:restoreNeedsApplication
and android:killAfterRestore.

If unspecified in the manifest, restoreNeedsApplication is false, and
killAfterRestore is true.

In order to support kill-after-restore cleanly, this change also adds a new
system-process-only interface to the Activity Manager, which will schedule a
"commit suicide" event on the target app's main thread looper.

The framework backup agents have been given the appropriate new backup
attributes as well.
/frameworks/base/core/java/android/app/ActivityManagerNative.java
3025ef332c29e255388f74b2afefe05f64bce07c 01-Sep-2009 Dianne Hackborn <hackbod@google.com> Various infrastructure to support a running services UI.

Some of this is temporary (in particular the two approaches for getting
process memory, one working but horrible, the other not working but
preferred) until I figure out the best way to do it.

Change-Id: I8c8f25062d481fcea22a47d459b083d2fd8a5040
/frameworks/base/core/java/android/app/ActivityManagerNative.java
f6f9f2d0256930ce0bb4913b2260b8480914edc2 22-Aug-2009 Dianne Hackborn <hackbod@google.com> Add more control over a service's start state.

One of the problems I have been noticing is background services
sitting around running and using resources. Some times this is
due to the app developer doing this when they shouldn't, but there
are also a number of issues with the current Service interaction
model that make it very difficult (or impossible) to avoid
getting services stuck in the started state. This is a
change/enhancement to the Service API to try to address this.

The main change is that Service.onStart() has been deprecated,
replaced with a new Service.onStartCommand() that allows the
service to better control how the system should manage it. The
key part here is a new result code returned by the function, telling
the system what it should do with the service afterwards:

- START_STICKY is basically the same as the previous behavior,
where we usually leave the service running. The only difference
is that it if it gets restarted because its process is killed,
onStartCommand() will be called on the new service with a null
Intent instead of not being called at all.

- START_NOT_STICKY says that, upon returning to the system, if
its process is killed with no remaining start commands to
deliver, then the service will be stopped instead of restarted.
This makes a lot more sense for services that are intended to
only run while executing commands sent to them.

- START_REDELIVER_INTENT is like START_NOT_STICKY, except if
the service's process is killed before it calls stopSelf()
for a given intent, that intent will be re-delivered to it
until it completes (unless after 4 or more tries it still
can't complete, at which point we give up).

Change-Id: I978f5ca420d70023d1b5e7f97de639d09381f8ad
/frameworks/base/core/java/android/app/ActivityManagerNative.java
d8a43f61680bacf0d4b52a03ff3c7a07307377fc 18-Aug-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2047139: Remove Service.setForeground()

This API is becoming seriously abused, so now it is deprecated and has
become a no-op.

As an alternative, there is now a new API that allows you to make a service
be in the foreground but requires providing a persistent notification to
go along with this state, allowing the user to know about and control it.
/frameworks/base/core/java/android/app/ActivityManagerNative.java
a6ddc8af22af6bce879c5bf906aad16c0b3d6b01 29-Jul-2009 Dianne Hackborn <hackbod@google.com> Fix issue #1999179: search -> click result -> press home = search dialog is shown then hidden

Re-arrange various things to ensure that the search dialog is told about system windows being
closed before it is told about the navigation back to home.
/frameworks/base/core/java/android/app/ActivityManagerNative.java
261e66acd1963d9c404fd2d3ddc6ef99ccd745cf 28-Jul-2009 Suchi Amalapurapu <asuchitra@google.com> Fix resource code and version attributes
Create a new package setting object for updated system apps rather than moving
around the same setting. This updates the resource, code and version correctly.
For updating system packages, disable the package first which removes the entry
from internal structures, create a new package setting, add it to list of user id's
then rest of installation steps, kill the process if needed via ActivityManager
then add this setting if everything was successful. This also fixes issues with
updating values prematurely.

When a new version of system package is available via OTA, just physically remove
entries for pkg. Note that the component and other info will be eventually updated
later on when scanning the package.
Also move certificate verification slightly ahead before scanning packages.

Some null checks

New api's in ActivityManager to kill an application pkg before finishing installation
/frameworks/base/core/java/android/app/ActivityManagerNative.java
2d91af06082d10759793a79d17afdfbdc65a37ed 16-Jul-2009 Dianne Hackborn <hackbod@google.com> Issue #1969025: need api for launching intent as if it were coming from another component

And now there is.
/frameworks/base/core/java/android/app/ActivityManagerNative.java
b06ea706530e6d19eb2a1a9a7ae6c5dd77d80af0 13-Jul-2009 Dianne Hackborn <hackbod@google.com> Add reporting of activity movement for search manager.

This adds a new API with the activity manager to find out about movement between
activities. For my sanity, the old IActivityWatcher is now renamed to
IActivityController, and the new activity movement interface is named
IActivityWatcher.

This changes the search manager itself to use the new API to manage its state.
Note that there are still problems when going back to the search dialog after
it was hidden -- the suggestions window no longer appears until you explicitly
dismiss and re-show it.
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
1ccac75e1f1b97eccb916a8de04fc1012b30f6e5 12-Jun-2009 Suchi Amalapurapu <asuchitra@google.com> Remove circular dependency in PackageManager. api freeStorage uses PendingIntent from android.app
Create a new public IntentSender class that can be used by PackageManager instead.
This new class uses IIntentSender internally and can only be created by PendingIntent for now.
Provide a new getIntentSender api in PendingIntent to create an instance of this class.
Move IIntentSender and IIntentReceiver from android.app to android.content
Change imports of IIntentSender and IIntentReceiver to reflect the new package name
The PackageManager api has been named as freeStorageWithIntent and will be renamed as freeStorage
once the older api(which has been deprecated) will be removed shortly.
/frameworks/base/core/java/android/app/ActivityManagerNative.java
181fafaf48208978b8ba2022683ffa78aaeddde1 14-May-2009 Christopher Tate <ctate@google.com> Retool the backup process to use a new 'BackupAgent' class

Backups will be handled by launching the application in a special
mode under which no activities or services will be started, only
the BackupAgent subclass named in the app's android:backupAgent
manifest property. This takes the place of the BackupService class
used earlier during development.

In the cases of *full* backup or restore, an application that does
not supply its own BackupAgent will be launched in a restricted
manner; in particular, it will be using the default Application
class rather than any manifest-declared one. This ensures that the
app is not running any code that may try to manipulate its data
while the backup system reads/writes its data set.
/frameworks/base/core/java/android/app/ActivityManagerNative.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/core/java/android/app/ActivityManagerNative.java
55280a91884b9256e8db6af6a09f28b3feeaa9d8 08-May-2009 Dianne Hackborn <hackbod@google.com> Improve shutdown process to send broadcast for applications.

This introduces a new class in the base platform for performing a clean
shutdown (which was copied from the classes in the policies). It
includes new features to send a shutdown broadcast for applications
to do cleanup, and ot have the activity manager pause the current
activity before proceeding with the shutdown. These facilities are
also use to write at the most recent stat files for sync, battery
and user activity.
/frameworks/base/core/java/android/app/ActivityManagerNative.java
f5b4b98fada53d91c4c2ebeb5a1d33ccc95c94d2 06-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@136745
/frameworks/base/core/java/android/app/ActivityManagerNative.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/app/ActivityManagerNative.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/app/ActivityManagerNative.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/core/java/android/app/ActivityManagerNative.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/android/app/ActivityManagerNative.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/app/ActivityManagerNative.java