History log of /frameworks/base/core/java/android/app/IActivityManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
36ebab675cba49e5201c5c228a524e6e1bb7dcea 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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.java
810c052d9b117217152c2a609ccec056a2a61d1e 25-Jul-2014 Primiano Tucci <primiano@google.com> Cherry pick Introduce startIsolatedProcess private API in ActivityManager DO NOT MERGE

The new API spawns a isolated process, using a custom uid, entrypoint and
abi. Such API is used by the WebViewFactory to spawn its unpriviledged
but trusted process (hence the fixed uid) which rewrites the rerlo file
on boot / when an update occurs.
Since both the ActivityManager service and the WebViewUpdate service
live in the SystemServer their calls be dispatched locally and no
binder interface needs to be exposed for the new startIsolatedProcess API.

Original BUG:16403706
Original Change-Id: I327b59735c12698595e0dbcc4da5d759c9103b0a

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

Change-Id: Ide2c202b4a5b25410f0f32bd0a81ccf817ede38f
/frameworks/base/core/java/android/app/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.java
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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.java
fd1ce8d5a7aa1ec6c7324b171f7e7a15a95f8759 18-Jun-2013 Craig Mautner <cmautner@google.com> Add new API getStackBoxInfo

Change-Id: Ie2861e5e31bb3876cfe2d5c3d04ff58bb3955634
/frameworks/base/core/java/android/app/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.java
f51f61269aacdfcf737b2c32b6b216c48ab61e65 05-Feb-2013 Dianne Hackborn <hackbod@google.com> App ops: new operations for SMS.

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

Change-Id: I4ff41a52f7ad4ee8fd80cbf7b394f04d6c4315b3
/frameworks/base/core/java/android/app/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.java
21fbd1f7da53dc044737803dccddf8099f1fc1e9 10-Feb-2012 Dianne Hackborn <hackbod@google.com> Some cruft removal.

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

Change-Id: I38e53e6228bba92a142bafeedb5af8df4e4e5724
/frameworks/base/core/java/android/app/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.java
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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.java
90f4aafa336d9f2f07281ead3c846d323a710015 27-Sep-2010 Dianne Hackborn <hackbod@google.com> Implement permission granting in clipboard.

Change-Id: I9a7a949d1aaf4b3beabceaf807fb7d3b040e4ea8
/frameworks/base/core/java/android/app/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.java
37444f4239b26944d24f039c537d411ac7004243 21-Aug-2010 Dianne Hackborn <hackbod@google.com> am d172594e: am cf6d2a1d: Merge "Fix issue #2845673: android:exported="false" is not obeyed" into gingerbread

Merge commit 'd172594e3a1e25f1f2c190e99421cb7d4963389b'

* commit 'd172594e3a1e25f1f2c190e99421cb7d4963389b':
Fix issue #2845673: android:exported="false" is not obeyed
b424b633bb3664bed924d2ea89036290a57eb2bd 19-Aug-2010 Dianne Hackborn <hackbod@google.com> Fix issue #2845673: android:exported="false" is not obeyed

Thou shall obey.

Change-Id: I09f163a0db7cc9189c8d7f5116cc8ca9d4f7a76c
/frameworks/base/core/java/android/app/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.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/IActivityManager.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/app/IActivityManager.java