History log of /frameworks/base/core/java/android/app/ActivityManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9536c809dda20bd01c3d5c30df046b271ba2ec4f 30-Jun-2016 Jeff Sharkey <jsharkey@android.com> Move getRecentTasks() to ParceledListSlice.

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

Bug: 29635557
Change-Id: Iaf1227234f5f8c9451f73a6a5c1dc89f2067f05f
/frameworks/base/core/java/android/app/ActivityManager.java
bc9edc7ccb4d876bfc5c706fbb64dab9a2768b52 18-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixes for ending PiP animation." into nyc-dev
c7294607fc0debc54e92abac18bec2601a21ce27 13-May-2016 Robert Carr <racarr@google.com> Fixes for ending PiP animation.

During the PiP animation, we have two basic requirements:
1. We need to scale windows to the pinned stack bounds.
2. We need to halt resize and movement notifications to the client.
As we end the animation, we need to disable these states at differing
times. First we need to deliver a final resize and movement notification
to the client for it's new position. However, Surfaces may not
immediately resize (in particular in the case of child windows,
it may be some time!), furthermore Surfaces may resize at different
times so we need to persist scaling on a Surface by Surface
basis after reenabling resize notifications.

Bug: 28559097
Change-Id: I6d52a3e213e08a34f4c0eea892b2a84cd4c20e18
/frameworks/base/core/java/android/app/ActivityManager.java
529c8e4cf24375ca21b5d61fb6b34e7010d6edad 17-May-2016 Winson <winsonc@google.com> Mark occluded home stack as invisible.

- The home stack is still visible when a translucent activity (like
dialer) is on top, which caused us to use the logic path that just
tries to launch the next task. However, that path does not reload
the stack state (since the activity stack generally doesn’t change
while Recents is visible) so it was always launching the already top
activity. The new check ensures that we start the activity anew
as if it was coming from an occluding app.

Bug: 28767764
Change-Id: Iec0fdc0957e5070cec532c5de5cba3454c906a3b
/frameworks/base/core/java/android/app/ActivityManager.java
7c40291b0a105a8dfefda76c4ad8c42bf04a4f55 10-May-2016 Winson <winsonc@google.com> Reducing the number of recent tasks we keep.

- This should decrease the time it takes to fetch the recent task list,
and also reduce the number of tasks we store on-disk.
- Since a user can still open a fair number of tasks within the
time-window, and this list includes tasks that are excluded from the
UI, we are just reducing it to about half for the time being.

Bug: 28318359
Change-Id: Ie21b3d3d09a567007015fbbecaf914123c71cc06
/frameworks/base/core/java/android/app/ActivityManager.java
ce18c8167766f92856f94a8e88e19de4698960e6 28-Apr-2016 Jeff Sharkey <jsharkey@android.com> Introduce "unlocking" vs "unlocked" nuance.

There is a narrow window of time during user unlock where we're
reconciling user storage and dispatching the "unlock" status to
various internal system services. While in this "unlocking" state,
apps need to be told that the user still isn't actually "unlocked"
so they don't try making calls to AccountManager, etc.

The majority of internal services are interested in merging together
both the "unlocking" and "unlocked" state, so update them.

Clarify naming in AccountManagerService to make it clear that a local
list is being used, which mirrors the naming in MountService.

To match UX/PM requested behavior, move PRE_BOOT_COMPLETED dispatch
after the user is unlocked, but block BOOT_COMPLETED dispatch until
after all PRE_BOOT receivers are finished to avoid ANRs.

Bug: 28040947, 28164677
Change-Id: I57af2351633d9159f4483f19657ce0b62118d1ce
/frameworks/base/core/java/android/app/ActivityManager.java
ae0e03a9e03de34e37b768b971d7596d7220a053 26-Feb-2016 Svet Ganov <svetoslavganov@google.com> Cleanup of the PackageInstaller API - Frameworks

The PackageInstaller app manages side-loading apps as well
as permission management. It should be updatable, hence
should rely on system APIs to talk to the platform. This
is the first step of defining an API boundary.

Change-Id: I9814eafd0b22ae03b4b847a7007cdbf14c9e5466
/frameworks/base/core/java/android/app/ActivityManager.java
e67960ecae2ba008a7d1d364b5fdb1b95a179e52 22-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Force pinned windows to always be scaleable." into nyc-dev
d46b72788e8811d2e423ea1e5b2ff104ecb7f721 20-Apr-2016 Winson <winsonc@google.com> Removing legacy calculation of Recents visibility.

- This was causing us to try and launch the Recents activity again after
docking because the running task was the newly docked task and not
Recents.

Bug: 28177001
Change-Id: I222e50f6de00a9d7881da2182eebc61564fd3266
/frameworks/base/core/java/android/app/ActivityManager.java
1b5ea72b3cd946ae27e92743339f1fcb117a0520 20-Apr-2016 Robert Carr <racarr@google.com> Force pinned windows to always be scaleable.

Otherwise we have a race when switching it off at the end
of the animation when we don't move to fullscreen. Ensure
SCALE_TO_WINDOW is always enabled for windows while they
are in the pinned stack.

Bug: 27793381
Change-Id: Ia92465fd0d854f799caa8ed31edb4621af9fdecd
/frameworks/base/core/java/android/app/ActivityManager.java
42449786211591d097d0fbac72296534c4ab23b6 19-Apr-2016 Amith Yamasani <yamasani@google.com> Throw better exception when startVoiceActivity fails

Introduced new error codes so that Instrumentation can
include the correct message in the exception.

Bug: 28216630
Change-Id: I93ee77153cdad11fa208c74c28c6790db27c9753
/frameworks/base/core/java/android/app/ActivityManager.java
43896cffe69ffb70ed4d8248c81c9c25f69a7540 16-Apr-2016 Wale Ogunwale <ogunwale@google.com> Don't allow pinned activities to request visible behind

Also, release visible behind when pinning a visible behind activity.

Bug: 28042883
Change-Id: I1162d7639626f669f648ff82f5c367cb7b3fe6e6
/frameworks/base/core/java/android/app/ActivityManager.java
29379ec859bf7118dec9f3248c63ee369218ad6b 12-Apr-2016 Jorim Jaggi <jjaggi@google.com> TRON refinements for multi-window

Bug: 26013430
Change-Id: I89b139b4ca3e7b6a06d8b5b351d67ffac240f73f
/frameworks/base/core/java/android/app/ActivityManager.java
05c9ecc08a770e887d2c3d5da7153e252fdd8655 31-Mar-2016 Joe Onorato <joeo@google.com> Include process state in association tracking

Bug: 26165863
Change-Id: Ic1f3237d85dd9f9b55a412bc8609e60e6c2f3fd2
/frameworks/base/core/java/android/app/ActivityManager.java
0caf007b3f0b4cd21be285820c270c51a8e502b7 28-Mar-2016 Joe Onorato <joeo@google.com> Merge "Refactor ProcessStats." into nyc-dev
64ae08aa16fdf7ee33073979400afa40692342f1 28-Mar-2016 Wale Ogunwale <ogunwale@google.com> Show non-top tasks in the docked stack in recents.

Allows the user to access the task through recents since
it isn't currently visible on screen.

Also, changed recents to launch task currently in the docked
stack in the fullscreen stack when selected from recents list.

Bug: 27864383
Change-Id: I58549023920d064a30b6355367c3193ce3207bbd
/frameworks/base/core/java/android/app/ActivityManager.java
217009356efa2b854ab3981dff8d315a0d679c73 25-Mar-2016 Winson <winsonc@google.com> Don’t scale task thumbnails.

- Changing task view thumbnail layout. In portrait, scale the thumbnail
to width for portrait screenshots, and apply the same scale to
landscape screenshots. In landscape, scale screenshots up to 1:1, and
tweak the app transition to clip the sides instead of scaling.
In both orientations, fill with the background color in the remaining
space.
- Moving some resources related to the title bar to be calculated
programmatically so that we can have different header bar sizes which
completely overlap the action bar in the screenshot in each
orientation.
- Constraining the task stack width in landscape to portrait

Bug: 27504677
Change-Id: Ic9b6fdde6dd728d9f2d20a8b89c05b3a350edfbf
/frameworks/base/core/java/android/app/ActivityManager.java
4eb64fdbcf899a81d0a6a04dc3658d03d9df8247 21-Mar-2016 Joe Onorato <joeo@google.com> Refactor ProcessStats.

- Pull most of the inner classes out into their own files.
- Move everything to a new android.app.procstats package.
- Move all of the code that was manipulating the big list
of longs to use the new SparseMappingTable class rather
than doing everything by hand. The logic is unchanged.
- Add a sequence number check to SparseMappingTable so
when the big list of longs and the individual tables are
reset, which happens somewhat independently, we can
assert when one of them doesn't get reset.
/frameworks/base/core/java/android/app/ActivityManager.java
b5690bc3086af1d1f064a080c728090de24d6f96 03-Mar-2016 Fyodor Kupolov <fkupolov@google.com> Added logoutCurrentUser method

Bug: 27299227
Change-Id: I01bad3ec364061236c6a76044062144462336910
/frameworks/base/core/java/android/app/ActivityManager.java
aa6c574411e8e5fd1244808381e7abd45bf3744f 01-Mar-2016 Jorim Jaggi <jjaggi@google.com> Don't dock tasks that are non-dockable

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

Bug: 22855417
Bug: 26724891
Bug: 27364145

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

Change-Id: I776335f4441be0e793d3126f2d16faf86a8c621a
/frameworks/base/core/java/android/app/ActivityManager.java
acd7a22cd7fe1c2d1a1ba6ed8e97e4e21dd31a1d 03-Mar-2016 Rob Carr <racarr@google.com> Merge "Fix pinned stack frame computation." into nyc-dev
e627558feffa4ffe6435d7d13eda3d89f7c08095 01-Mar-2016 Robert Carr <racarr@google.com> Fix pinned stack frame computation.

We want to compute the frames for pinned like we do for freeform
as we are not constraining layout to the suggested display area by the
PhoneWindowManager. Also update applyGravityAndUpdateFrame
to not clip frames to the display for child windows. In the case
of computeFrameLw this would not be a problem as we would then
go on to overwrite mFrame anyway, but in the case of repositionChild
it could create issues (where we have applyGravityAndUpdateframe without
compute frame).

Bug: 26454664
Change-Id: I6fd4c9f37060d51003d041566368edd2b9eb7afd
/frameworks/base/core/java/android/app/ActivityManager.java
fb1c86439c7991237594760a957e7eba1d86df52 02-Mar-2016 Wale Ogunwale <ogunwale@google.com> config_supportsMultiWindow for device to specify multi-window support

Devices that have the config set to false will not allow any multi-window
operation.

Also, added ActivityManager.supportsMultiWindow that checks the new config
and also returns false if the device is a low RAM device.

Bug: 27419483
Change-Id: I8dd85c17d290a5a752de3253beb3b34c17d7736d
/frameworks/base/core/java/android/app/ActivityManager.java
f8880561e67e1da246970b49b14285efd4164ab1 26-Feb-2016 Jeff Sharkey <jsharkey@android.com> When system server goes down, crash apps more.

Similar to first patch, but now using new "rethrowFromSystemServer()"
method which internally translates DeadObjectException into
DeadSystemException. New logic over in Log.printlns() now
suppresses the DeadSystemException stack traces, since they're
misleading and just added pressure to the precious log buffer space.

Add some extra RuntimeInit checks to suppress logging-about-logging
when the system server is dead.

Bug: 27364859
Change-Id: I05316b3e8e42416b30a56a76c09cd3113a018123
/frameworks/base/core/java/android/app/ActivityManager.java
27b2e6978716f9886db40f4fcf2e060b50637ac5 26-Feb-2016 Jeff Sharkey <jsharkey@android.com> When system server goes down, crash apps.

Apps making calls into the system server may end up persisting
internal state or making security decisions based on the perceived
success or failure of a call, or the default values returned.

The reality is that if the system process just died, init will be
along shortly to kill all running apps, so we should have no problem
rethrowing the RemoteException as a RuntimeException.

Bug: 27364859
Change-Id: If632cc36f68cd399a34de513b2d979abaa36fcaa
/frameworks/base/core/java/android/app/ActivityManager.java
b6403150af708e1a2b3e426e24005478ace0ab24 23-Feb-2016 Winson <winsonc@google.com> Updating task description when activity is visible.

Bug: 27275448
Change-Id: If92221d30c84c58b5d36db1b254d264a0ff3ec25
/frameworks/base/core/java/android/app/ActivityManager.java
8a5c64062f78b96c05638171a78331a2f8d422b5 13-Feb-2016 Jorim Jaggi <jjaggi@google.com> Fix recents transitions

- Also animate when there is no thumbnail, which can frequently
happen after exiting multi-window.
- Also animate when the target stack id is INVALID, because we
currently don't persist stack id's in the tasks.

Change-Id: I280c85e62f55d712408a3e77c43f665acb19bc4c
/frameworks/base/core/java/android/app/ActivityManager.java
e26334ba1a5c7880c67b931a6ca73941167712e9 12-Feb-2016 Jorim Jaggi <jjaggi@google.com> Merge "Handle light status bar for split-screen" into nyc-dev
86905582411c5c77a3e7641589cf206c6e5770f5 10-Feb-2016 Jorim Jaggi <jjaggi@google.com> Handle light status bar for split-screen

In split-screen the light status bar flag for one side of the
status bar can be different from the other side.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR is now reported for both
the fullscreen stack and docked stack, but not anymore in the
"default" SysUI visibility field when reporting a visibility
change to SystemUI. The change also reports the docked stack
and the fullscreen stack bounds, so SystemUI can guard tinting
the icons on whether the icon is one of the areas.

When calculating the light status bar flag in PWM, we keep track
of the top fullscreen opaque window state for the docked and
fullscreen stack separately.

Bug: 24365214
Change-Id: Id2240a86d75bf96e0138ec7652a4793859f56e3c
/frameworks/base/core/java/android/app/ActivityManager.java
1af8eda6ea1c89d44123b2bfd5fa0293bb9d68cb 05-Feb-2016 Winson Chung <winsonc@google.com> Drawing thumbnail background color for empty space in view.

Change-Id: I2e8dfbe9c11a61876956658eff0674adb26d855d

Signed-off-by: Winson <winsonc@google.com>
/frameworks/base/core/java/android/app/ActivityManager.java
25222f55f28221d49a984db465f94e9716635ad8 06-Feb-2016 Tamas Berghammer <tberghammer@google.com> Merge "Add flag to "am start" to enable native debugging"
e909802b4136b2377612d5ecdf92fb3a00504b95 28-Jan-2016 Jorim Jaggi <jjaggi@google.com> Fix flicker and other weirdness

- When moving tasks to/from fullscreen <-> docked stack, don't
replace windows, but preserve them.
- Fix a bug where we didn't called prepareFreezingBounds which
caused the clip rect to be set to (0, 0, 0, 0) for one frame

Bug: 26070457
Change-Id: I439c9b6612367babfbf31899022209eeee3e1be1
/frameworks/base/core/java/android/app/ActivityManager.java
df6cb282937e5f804686ebbc952ae9f2290d93c7 29-Jan-2016 Tamas Berghammer <tberghammer@google.com> Add flag to "am start" to enable native debugging

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

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

Change-Id: Iaf5ab649715a0c274bd1b0fc64e483705da53cd0
/frameworks/base/core/java/android/app/ActivityManager.java
21b6058fff4fb2448394b4b4ea3ae28e44c0f69d 27-Jan-2016 Wale Ogunwale <ogunwale@google.com> Added isDockable field to RunningTaskInfo

Allows the caller to know if the task can go in the docked stack.

Bug: 26774816
Change-Id: I96fdf9b4df0ac87d84492e1504baac3ca0767d37
/frameworks/base/core/java/android/app/ActivityManager.java
84fa3351a21b37d02fafd634a8de65cf6cd04c4d 26-Jan-2016 Filip Gruszczynski <gruszczy@google.com> Animate pinned stack resizing.

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

Bug: 25672053
Change-Id: I75914a685d10021f8a7535b47ef12b6920b3fd5e
/frameworks/base/core/java/android/app/ActivityManager.java
2ced3d531c6c5d82db59db79bf8f890fb7acf200 25-Jan-2016 Wale Ogunwale <ogunwale@google.com> Merge "Don't keep visible windows in pinned stack on screen when app dies"
3fd20fe8d8ff269b9253999dc8fc95a7a5269aef 24-Jan-2016 Wale Ogunwale <ogunwale@google.com> Don't keep visible windows in pinned stack on screen when app dies

We previously introduced logic that keeps an apps visible windows on
screen when the app dies. This was to help with the situation where
freeform apps might be killed by the low memory killer and we want
to preserve the space on screen and relaunch the app when the user
interacts with the window again.
However, this doesn't work for windows in the pinned stack since
they an normally not focusable/interactable.
We no longer do this for windows in the pinned stack.

Bug: 24913379
Bug: 26609941
Change-Id: Ie2e7f7d7c7a8c0ef6c1662517f558c385201c433
/frameworks/base/core/java/android/app/ActivityManager.java
dc7af96141bfce7db3e19bc7cd9e5667474631e1 23-Jan-2016 Felipe Leme <felipeal@google.com> Fixed javadoc so @hide annotations don't show up in the API.

BUG: 26082535

Change-Id: Ifb5ddedddc87bc65dc5158286503c64581b5a4f3
/frameworks/base/core/java/android/app/ActivityManager.java
cacfaa216a599522190545b27c54e44ec9533f05 15-Jan-2016 Wale Ogunwale <ogunwale@google.com> Resize pinned stack with bounds in ActivityOptions.

If an activity is been launched into the pinned stack and
there is a bounds specified in the ActivityOptions, use it to
resize the pinned stack.

Bug: 26574470
Change-Id: I43c15069b8512ce54cfde6cc16f5caa2a70bd06a
/frameworks/base/core/java/android/app/ActivityManager.java
f81c1d164ab5999ec554c9cb2659e1b2ed93a8d5 12-Jan-2016 Wale Ogunwale <ogunwale@google.com> Fixed some activity visiblility issues in picture-in-picutre mode

- Previously when don't re-launch an activity due to configuration
change if the activity is currently pausing. And, once the pause is
complete we destroy the activity. This logic is based on the assumption
that all activities are fullscreen and pausing is the same as stopping
which means the activity is no longer visible and can be destoried.
This assumption is not true in multi-window mode where you can have
visible activities in the paused state.
We now relaunch the activity once it is done pausing.

- Previously we set the return type of the top task in a stack to home
if the previously focused stack is home while add the task to the stack.
This logic is based on the assumption that the focus stack is the front
stack which isn't true for pinned stack. This causes an activity behind
the top translucent activity in the pinned stack to be marked as invisible
and stopped since the top task is over the home task so we should be
showing the home task behind it and not other tasks in the stack.
We now set the return to task type to application type for task added to
the pinned stack.

Bug: 26273032
Change-Id: I0ffac81f46c57e2d0d900db3417381f059aee7ea
/frameworks/base/core/java/android/app/ActivityManager.java
42efc5860ffd130d28b780125e13c44a19848154 08-Jan-2016 Michal Karpinski <mkarpinski@google.com> Merge "Adjusting AMN#requestBugReport() to be able to invoke 3 types of bugreport services"
3da5c97460d859ec6d9e5fffb3902a3242d32bf4 11-Dec-2015 Michal Karpinski <mkarpinski@google.com> Adjusting AMN#requestBugReport() to be able to invoke 3 types
of bugreport services

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

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

The new methods are:

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

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

BUG: 26447975

Change-Id: I6867402e42b3d6fd03050ec57b73973ccd8a17af
/frameworks/base/core/java/android/app/ActivityManager.java
0583d3d18812d31d50228a6f29cb15b3219c9e94 18-Dec-2015 Winson Chung <winsonc@google.com> Hiding pinned stack tasks from overview

Bug: 25381158
Change-Id: Iad442b7f5dc49109529cb5dab2168b19837af6e3
/frameworks/base/core/java/android/app/ActivityManager.java
92e432c30e2304272c2f5b1b33366f32c3d763cf 16-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Refactor and improve window layering.

This CL moves layer calculation into a separate class, so the whole
logic can be encapsulated. It also extracts special cases from the
general loop and instead applies them at the end. This simplifies the
logic in the main algorithm and makes it clearer what needs to happen
for special cases.

Bug: 26144888

Change-Id: I87347bf0198bd0d3cd09e4231b4652ab979f2456
/frameworks/base/core/java/android/app/ActivityManager.java
807d8826b1dfe937733d830df7263615c4eb3427 16-Dec-2015 Wale Ogunwale <ogunwale@google.com> Only persist task bounds for freeform tasks.

Bug: 26216628
Change-Id: Ibe28d7f988675086e233da371baf526eb7254fa7
/frameworks/base/core/java/android/app/ActivityManager.java
f34a04cca9b7f34eff533866ec11233777876ebf 08-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Fix freeform to recents animating window being cuttoff.

The window will appear cutoff during the animation if the window was
cropped due to stack or decor bounds before the animation started. We
need to disable the cropping (both from decor and from stack bounds)
for the duration of the animation.

Unfortunately, by disabling cropping of a freeform window to the stack
bounds, we will make it appear above the docked window during the
animation (because the animation will lift the layer). To fix this, we
need to treat the docked stack like the pinned stack and assume it's
always on top for the layering purposes.

CL also includes refactoring of mSystemDecorRect and
mLastSystemDecorRect which can be moved from WindowState to
WindowStateAnimator and made private there.

Bug: 24913782
Change-Id: Idbea99ba04e9449d0563d0c02636f8b4b63087f7
/frameworks/base/core/java/android/app/ActivityManager.java
75b3720c50752d988d361a57b2d32f8baaee3e28 04-Dec-2015 Chong Zhang <chz@google.com> Fix app over lockscreen being cropped by docked stack

When secure apps are launched over lockscreen, the bounds should always
be fullscreen. Also docked stack and divider shouldn't be visible while
lockscreen is shown.

bug: 25837786
Change-Id: I0bc681cdb46404fb79e9332d1f82fee51f338da9
/frameworks/base/core/java/android/app/ActivityManager.java
8294f82562afee6be176c986ff24156aacd32080 04-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Merge "Put PIP windows above transition animations."
114d5ca711775a632b1d2d4ec6c00eddff1bc776 04-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Put PIP windows above transition animations.

PIP activities are already on top of everything else, but during
animation we increase the layer of the animated window for the duration
of the animation and it may cover the PIP. By forcing the same
adjustment on PIP windows we will keep them above animating windows.

Bug: 26015827
Change-Id: I8f7a87f41fed24b3e520fb599a94cf24cc2eeb50
/frameworks/base/core/java/android/app/ActivityManager.java
0534ac90e5b9c91388532b705dafd727bd00418a 04-Dec-2015 Jeff Sharkey <jsharkey@google.com> Merge "Handle non-encryption-aware accounts and sync."
9d8a1048bb666c68402dce031bebfa07c92a42db 04-Dec-2015 Jeff Sharkey <jsharkey@android.com> Handle non-encryption-aware accounts and sync.

The system can now boot in a "locked" state where only encryption
aware (EA) components can be safely started. When in this state,
PackageManager already filters away non-EA components, but system
services like AccountManager and SyncManager need to carefully handle
these temporarily "missing" components.

As a guiding principle, all known Accounts are still present when
the device is locked, but communication with underlying non-EA
authenticators is blocked.

To keep things simple for now, all SyncManager requests are kept
dormant until the user enters the unlocked state.

The core of this logic is that RegisteredServicesCache now works
with all components regardless of EA status, which prevents us from
accidentally thinking a service was removed when the user is locked.

Bug: 25945136
Change-Id: I8714121f6236b00821769023c4df7de1c8a99944
/frameworks/base/core/java/android/app/ActivityManager.java
21199bd9a7f2d4a23a0272698b2671e9f8503141 02-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Run activity visibility adjustment even if there is no top running.

Ensuring visibility is triggered in unpredictable fashion, e.g. it can
be triggered by attachment of application. It can happen between an
activity stopping due to change of user, but before that operation is
finished and as a result the stopped activity will get marked as
visible even if we mark it as invisible in stop. Instead of trying the
activity as invisbile during stopping, we adjust the visibility ensuring
method to go through stack contents even if there is no top running
activity (because the top running activity is run by a different user)
and force the correct visibility.

Bug: 25958227

Change-Id: I4662667e8151fa25d947bacf33ba915389dd32e8
/frameworks/base/core/java/android/app/ActivityManager.java
568f4de11a87308cbcb888083f02818a8290a7d7 03-Dec-2015 Neil Fuller <nfuller@google.com> Merge "Fix @code escapes"
f23b5d3d6d6d6d72876603c8f72b82d5de022735 02-Dec-2015 Jeff Sharkey <jsharkey@google.com> Merge "API to determine user locked/unlocked state."
0825ab284c01402d030a24471ac5a6491d79d28b 02-Dec-2015 Jeff Sharkey <jsharkey@android.com> API to determine user locked/unlocked state.

Bug: 25946804
Change-Id: I2b8c8c75fda161a446d79fac811fdd446aa3a4db
/frameworks/base/core/java/android/app/ActivityManager.java
298a4dc8dd60700684f98dd6e959b854ea70faec 02-Dec-2015 Wale Ogunwale <ogunwale@google.com> Merge "Prevent windows in pinned stack from gaining window focus."
d045c829a470b7c95daaa4786f7164ee8130546c 02-Dec-2015 Wale Ogunwale <ogunwale@google.com> Prevent windows in pinned stack from gaining window focus.

Windows in the pinned stack shouldn't receive input keys, so we prevent
they from gaining window focus so the focus/input keys goes to the stack
below the pinned stack.

Also, cleaned up some code.

Bug: 25580816
Change-Id: Iea1f944d167310233c3dbaea140a4ada568bb815
/frameworks/base/core/java/android/app/ActivityManager.java
9cbfc9e212151e84910a22387365644916dde446 08-Oct-2015 Fyodor Kupolov <fkupolov@google.com> Added DISALLOW_RUN_IN_BACKGROUND user restriction

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

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

Bug: 24579258
Bug: 24708668
Change-Id: I357298908816fc58feeed83b7e9979fc33d25da6
/frameworks/base/core/java/android/app/ActivityManager.java
71fbb81b14958b80fe55738607740c6630e4e9da 30-Nov-2015 Neil Fuller <nfuller@google.com> Fix @code escapes

The body of {@code} must not be HTML escaped. This is one of
several changes that fix the source in conjunction with a
doclava fix.

Bug: 25757239
Change-Id: Ib38a0fa2dd2a3d68e467f78a812071e763d7e881
/frameworks/base/core/java/android/app/ActivityManager.java
8924e8759f9a8cffb5ad538ca40a7826793aac07 30-Nov-2015 Jeff Sharkey <jsharkey@android.com> Wire up lifecycle, send unlocked broadcast.

When the correct lock pattern is presented, ask the system to also
unlock credential-encrypted storage, if enabled. The token passed
along is empty for now, but can be wired up to gatekeeper in the
future.

During each system boot, ask vold to lock all users keys to give us
a known starting state. This also has the effect of chmod'ing away
any CE data when in emulation mode.

Define and send a new foreground broadcast when the CE storage is
unlocked for the first time. Add stronger last-ditch checking for
encryption-awareness before starting an app.

Bug: 22358539
Change-Id: Id1f1bece96a2b4e6f061214d565d51c7396ab521
/frameworks/base/core/java/android/app/ActivityManager.java
49c0ea0c8342f543fbea0a8492ac1c4293d9eb16 19-Nov-2015 Filip Gruszczynski <gruszczy@google.com> Merge "Fix crash when docking from recents."
96daf32e4ed40619419ddef1cf96a870a3c0f193 19-Nov-2015 Filip Gruszczynski <gruszczy@google.com> Fix crash when docking from recents.

The crash was happening because we were sending a future from sysui, but
that future would always return null animation specs when docking. This
makes it returns proper specs in that case. However, we need to still
protect ourselves from null specs when executing the future.

Bug: 25765339
Change-Id: I02d842ea31503169f6e053a1695d8896d2e4d97c
/frameworks/base/core/java/android/app/ActivityManager.java
d93d481ea144bcf56f53b08fbedea2cd760463f4 19-Nov-2015 Suprabh Shukla <suprabh@google.com> Merge "Moving recent tasks information to a user directory"
2359314fd41801005993fc8416eeb4fb38dd75a0 04-Nov-2015 Suprabh Shukla <suprabh@google.com> Moving recent tasks information to a user directory

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

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

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

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

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

Change-Id: If53714ca4beed35faf2e89f916ce9eaaabd9290d
/frameworks/base/core/java/android/app/ActivityManager.java
c6a2da07bf6334818c184fed486cecf39976f089 12-Nov-2015 Winson <winsonc@google.com> Fixing crash when trying to set thumbnail info.

- The TaskThumbnailInfo can have the same lifecycle as the TaskRecord, and
we should just reset it instead of setting it to null when the thumbnail
is disposed.

Bug: 25652261
Change-Id: I54384e208b19e60d469bf3471dd555f78f04290c
/frameworks/base/core/java/android/app/ActivityManager.java
974f55fa13358cd3f4ffebaf4d9fddbb4c9a3431 10-Nov-2015 Winson Chung <winsonc@google.com> Merge "Saving additional context when taking task screenshots."
c809cbb92692cf5140fd5a452fc24214a098d937 02-Nov-2015 Winson <winsonc@google.com> Saving additional context when taking task screenshots.

- Save the original task size and screen orientation. This ensures that
we will be able to display the screenshots in the right orientation if
we start taking non-square thumbnails.

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

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

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

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

Bug: 22358539
Change-Id: Idc56ec29f1ef04da8963e004314d7f5e47400997
/frameworks/base/core/java/android/app/ActivityManager.java
02a5a6bb9ba05bdf7517de90ede49fb535ea06ca 02-Nov-2015 Wale Ogunwale <ogunwale@google.com> Merge "Added StackId object for checking what features a stack supports"
3797c22ea16e932329ebffdc7e7ce09f9ecd9545 27-Oct-2015 Wale Ogunwale <ogunwale@google.com> Added StackId object for checking what features a stack supports

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

Bug: 25282299
Change-Id: Ifa6864a1ef56ce2eca4c94f87a4e0b993de987cd
/frameworks/base/core/java/android/app/ActivityManager.java
2dd7694681b7256e136d7f4d060be2858c48e835 02-Nov-2015 Winson <winsonc@google.com> Reporting task bounds in RecentTaskInfo.

Change-Id: I8e88d1aca5fa0ee316e93afe4fb63264e2d338f0
/frameworks/base/core/java/android/app/ActivityManager.java
0f6cb2d7d14b980e2d820a40d3c4849a808d0da5 27-Oct-2015 Winson Chung <winsonc@google.com> Merge "Passing stack id with RunningTaskInfo."
5510f6c1b9c20483e1507147eed7b24ac8bb6363 27-Oct-2015 Winson <winsonc@google.com> Passing stack id with RunningTaskInfo.

- This allows us to remove an extraneous system call when starting
overview, and also allows us to easily check for freeform windows.

Change-Id: I4449dad7bf870f528f671f6e7cb1f9b5f1bc9c1c
/frameworks/base/core/java/android/app/ActivityManager.java
99db1863a84364339fc5dc9142f15910cdd96ed8 24-Oct-2015 Wale Ogunwale <ogunwale@google.com> Added support for pinned stack.

Used to support picture-in-picture use case for multi-window

Bug: 25006507
Change-Id: I3bef3f75e0c003f5974274294f1250171d424625
/frameworks/base/core/java/android/app/ActivityManager.java
a4d4e82927ceadc23863e74b7e1160e4497504a7 05-Oct-2015 Pablo Ceballos <pceballos@google.com> Remove GLTrace support

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

Bug 22329852

Change-Id: I64c58464f8c2c7ae6125f5d5c7884e3fd34d68ea
/frameworks/base/core/java/android/app/ActivityManager.java
6de2ae81ce0988625bcffc37475810a015e76ff9 01-Oct-2015 Chong Zhang <chz@google.com> Do not change task's stack in resizeTaskLocked

Move the task to the right stack before calling resizeTaskLocked
and let resizeTaskLocked only handle the resize.

Bug: 24462900
Change-Id: I3401c92f1893eaefde2909a9b20b00b5ea6cdf01
/frameworks/base/core/java/android/app/ActivityManager.java
1ed0d89e7e9a28a5dd52fdc40425466efd8d08ef 28-Sep-2015 Wale Ogunwale <ogunwale@google.com> Inform activity manager of stack/task rotation bounds changes in WM

Change-Id: I342093d8af1d397ab4894146f9b288bdfdc464f0
/frameworks/base/core/java/android/app/ActivityManager.java
87b21722c2336490ecf8b66f6acfc46ce8cc6f46 22-Sep-2015 Chong Zhang <chz@google.com> Change resizeTask's parameter resizedByUser to constants

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

Change-Id: Ic7021f76bec677027cbf27deeb63f92ea911a75c
/frameworks/base/core/java/android/app/ActivityManager.java
59a73ca331a786f95e08a99bbd16fbdf59280ae0 14-Sep-2015 Wale Ogunwale <ogunwale@google.com> Support creating docked stack at top/left/bottom/right half of screen

Change-Id: Id8d6f639ed67baadb856ce84a20af8929e04cb2e
/frameworks/base/core/java/android/app/ActivityManager.java
3560575009291245fcf106d1e45a722a968d0494 31-Aug-2015 Vadim Tryshev <vadimt@google.com> Implementing app-centric Shelf.

We finally get a UX decision for the Shelf.
Shelf won't have 2 parts - pinned and recents; it will have only 1 list where
all pinned and recent activities of the same kind are grouped under a single icon.
Clicking at that icon activates the latest running activity if it's present, or
starts a new one otherwise.

The above part is implemented in this CL. I removed stuff related to the separate
Recents pane, and moved surviving code to NavigationBarApps.

Later, we'll have menus popping up from the icon, which will allow pinning and unpinning,
and choosing a concrete activity to activate.

Bug: 20024603
Change-Id: Ia08fe62939f92c7ee4f102c07a31e7168a11f010
/frameworks/base/core/java/android/app/ActivityManager.java
aa1fd4e6d3725777a122b151026dd8cd934b7aa9 19-Aug-2015 Chong Zhang <chz@google.com> Merge "Restore recent task to freeform space when resizing"
5dcb275cc1f181d57fc1e1b115008be1ed9cff58 18-Aug-2015 Chong Zhang <chz@google.com> Restore recent task to freeform space when resizing

bug: 22984782
Change-Id: I95b7b7b4871865102a279e529f068479e9b5df34
/frameworks/base/core/java/android/app/ActivityManager.java
b34a7ad1af54132b6b046ab8f768e0ffb81cf581 14-Aug-2015 Wale Ogunwale <ogunwale@google.com> Added support for docked stack

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

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

* commit '9bf912c1cf6941402dc0f8ef449f34787796875e':
Immediately kill a shared user process on a permission revocation.
9bf912c1cf6941402dc0f8ef449f34787796875e 07-Aug-2015 Svetoslav Ganov <svetoslavganov@google.com> am 5ed03384: am 1f514608: am 5a624aad: am 38d30dc5: Merge "Immediately kill a shared user process on a permission revocation." into mnc-dev

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

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

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

bug:22984670

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

Change-Id: I4fc1b47e5d6196a56a6e40f10fae97219554722c
/frameworks/base/core/java/android/app/ActivityManager.java
ddc1cb2c15549ed23dce9d416680a009fa6ae23c 26-Jul-2015 Wale Ogunwale <ogunwale@google.com> Added support for static vs. dynamic stacks

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

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

Bug: 22068114
Change-Id: Ib6c62a84b5f204fbf072755264c5c5eda6184f97
/frameworks/base/core/java/android/app/ActivityManager.java
e4a0c5722b1d8db95dfc842d716452dbbf02c86d 30-Jun-2015 Wale Ogunwale <ogunwale@google.com> Allow stacks to hold tasks on various sizes.

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

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

Bug: 22068114
Bug: 19182363

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

Change-Id: I08b5e7e8576f463c00be12879b465fa9c8cda8f5
01fda52778ef3b2a8a3d7ea76e65fea2705ab3e5 20-Jul-2015 Dianne Hackborn <hackbod@google.com> am ed3b4253: am 5cdc7f04: am 3aefa438: am 78ead58d: Merge "Fix issue #22531747: Assist info should declare if user has disabled..." into mnc-dev

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

...context and/or screenshot

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

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

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

Change-Id: Ia553d6bcdd098dc0fce4b9237fbfaca9652fc74b
/frameworks/base/core/java/android/app/ActivityManager.java
4d0ef042d387f20e7046692743ce7fd870e764b0 09-Jul-2015 James Cook <jamescook@google.com> Fix SysUI crash when launching Chrome from app shelf

* Store entire ActivityManager.RecentTaskInfo for each icon,
not just the ComponentName.
* Use RecentTaskInfo.persistentId to check if an icon already
exists.
* Extend RecentTaskInfo to include the actual activity that
started the task.
* On dragging an icon to the pinned area, use the RecentTaskInfo
to pin the primary launch intent of the app.

Bug: 22117860
Change-Id: Ia4412ea8e259e53cd7b5babcb79a292b92629db0
/frameworks/base/core/java/android/app/ActivityManager.java
8fb8207412905d034305b4b1be6eac07bdac833f 25-Jun-2015 Mathieu Chartier <mathieuc@google.com> resolved conflicts for merge of 0f14548c to mnc-dev-plus-aosp

Change-Id: I2f79840f82150eddebfbd549afd1eca28075eb43
c30454c10457fe034a861b4bf19fd1fc240bd893 24-Jun-2015 Adam Lesinski <adamlesinski@google.com> Allow callers holding PACKAGE_USAGE_STATS permission to call ActivityManager#getPackageImportance()

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

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

Bug:20037135
Change-Id: Ic5f8945ab4c1f167c27b05ad0d11d04bac680c1f
/frameworks/base/core/java/android/app/ActivityManager.java
ece0f4f5198e9e9cb60e96f036baf22c73411bec 11-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix APIs.

Issue #21039494: API Review: android.os.PowerManager.isDeviceIdleMode()
Issue #21347000: API Review: android.content.IntentFilter
Issue #20654534: API Review: android.app.assist

Also allow use of ActivityManager.setWatchHeapLimit on any platform
build as long as the calling app is debuggable.

Change-Id: Ic597e596fa772fcdf2553b64f444b3d9269e8b92
/frameworks/base/core/java/android/app/ActivityManager.java
ab4bb9d1fec685dab0fce9232c9a3477fab356b3 06-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21571700: Need to be smarter about how foreground...

...services get out of app idle

Introduce a new process state to even better distinguish foreground
services from other states. Rework the INTERACTION reporting to
usage stats to do it less when the screen is off -- require that
an app sit in the foreground service or top activity state for
at least 30 minutes before we consider it an interaction.

Also eradicate a bunch of logging in package manager.

Change-Id: I94249e67f9a9c62e9a92ae104710e6747b16327e
/frameworks/base/core/java/android/app/ActivityManager.java
16045c24fe10cc92329ede099923f1223f49b17d 05-Jun-2015 Stefan Kuhne <skuhne@google.com> Adding am send-trim-memory command

This patch adds a send-trim-memory command to the ActivityManager to allow
for better debugging&testing.

The command is
adb shell am send-trim-memory [--user <USER_ID>] <PROCESS> <LEVEL>
whereas LEVEL can be one of the following:
[HIDDEN|RUNNING_MODERATE|BACKGROUND|RUNNING_LOW|MODERATE|
RUNNING_CRITICAL|COMPLETE]

Bug: 21633189
Change-Id: I7a41ce02c3c9043ffd3e5aaa791f7b7306a9de49
/frameworks/base/core/java/android/app/ActivityManager.java
b725894d05e8272677112e84bf8da7d75ddab506 14-May-2015 Dianne Hackborn <hackbod@google.com> Hide getPackageProcessState(), it is not ready yet.

Change-Id: I188c647573207e89510174e3ad56ca0c19e5ece3
/frameworks/base/core/java/android/app/ActivityManager.java
f85ac77f0c2b923ff8d93a731d2a0107c4c57744 13-May-2015 Jeff Sharkey <jsharkey@android.com> Hide API not ready for prime time.

Bug: 20642684
Change-Id: I133f023ba7d1d9572175a8f6a3e3c8314c5a897d
/frameworks/base/core/java/android/app/ActivityManager.java
019d2304998f3ed77c0a608df6cf4bea1138f8dc 04-May-2015 Svet Ganov <svetoslavganov@google.com> Permission UI - legacy apps support

Change-Id: Id3f98c138422d33868363d587dd196898b42a0d4
/frameworks/base/core/java/android/app/ActivityManager.java
0bd2aa760346edd096f7c27283f394631f246f30 16-Apr-2015 Wale Ogunwale <ogunwale@google.com> Fail early when starting a background user activity.

If it shouldn't be displayed for all users.

Bug: 13507605
Change-Id: I8fe8e5a98759c1ca058cc7d222817f6d580ffa11
/frameworks/base/core/java/android/app/ActivityManager.java
6035e0198ba510654b5d1f6b6a265a15b08576f8 15-Apr-2015 Wale Ogunwale <ogunwale@google.com> Return more information when getAppTasks#getTaskInfo is called.

The RecentTaskInfo object returned when getAppTasks#getTaskInfo
is called now contains baseActivity, topActivity, and numActivities.

Bug: 18723935
Change-Id: Ifc0cd68a57ed2c0823c23ac8d27e3b6ea6bc95e2
/frameworks/base/core/java/android/app/ActivityManager.java
1e38382b542f5cef9957a89692b02c55a3dd351c 10-Apr-2015 Dianne Hackborn <hackbod@google.com> Fixes to idle alarm scheduling, package importance.

- Add new API to ask the activity manager what the current
importance of a particular package name is (along with a few
new useful importance levels).

- Fix my last alarm manager change to actually execute the
alarms we have now decided should run even while we are idle.

Change-Id: I1f14712b4e390770d53b185c96a1b36f6aadd687
/frameworks/base/core/java/android/app/ActivityManager.java
4870e9d5eba59fb257a87f97f1adf0b734cf48d3 09-Apr-2015 Dianne Hackborn <hackbod@google.com> More work on device idle mode and other power stuff.

Add idle mode support to the alarm manager. Introduce
a new concept of flags associated with alarms to tell
the alarm manager how to treat the alarm -- they allow
everything from the alarm that will bring us out of idle
mode, to alarms that are allowed when idle or should
also bring us out of idle. The standalone boolean is
now also a flag.

(Note there is currently no protection from user space
setting the flags however it wants; I will be working
on that in a follow-up change.)

When in idle mode, the alarm manager pushes all alarms
that shouldn't execute during that time over to a
separate list that is not executed until out of idle.
To help with this, I reworked a bit how Alarm objects
are managed, so that when rebatching or moving between
lists we don't have to allocated new objects but can
just use the same existing instance.

Also tweaked the sync manager to deal with idle mode,
which currently just means doing the same thing as when
low on storage -- turning off sync.

Add new ACTION_CHARGING and ACTION_DISCHARGING broadcasts
that apps can listen for to know when the device is actively
charging and discharging. These are better than the old
POWER_CONNECTED and POWER_DISCONNECTED ones because we only
report charging when we actually see that there is enough
power being provided to charge the battery (and will report
discharging if there is not enough power).

The job controller uses these new actions for scheduling
jobs that want to run while plugged in. Removed the
"stable charging" stuff while doing so, since the new
charging state serves as an even better signal for that.

Introduced two new process states: FOREGROUND_SERVICE and
TOP_SLEEPING. This will allow us to treat foreground services
specially (such as still allowing network access to them for
background music playback) while not mixing them together with
whatever happens to be the top activity while the device is
asleep.

Also some other small cleanup here and there.

Change-Id: I7a9808b578bad6f50deb8e1baf919298512a0d3a
/frameworks/base/core/java/android/app/ActivityManager.java
d59a5d59df920d743723521a2afed9de1da3373b 04-Apr-2015 Dianne Hackborn <hackbod@google.com> Various fixes and improvements...

Issue #19912529: VI: VoiceInteractor callback ClassCastException

Fix to use correct argument.

Issue #19912636: VI: Documentation for VoiceInteractionSession.onBackPressed

Added documentation.

Issue #19912703: VI: VoiceInteractionSession NPE on Abort Request

Maybe fix this -- don't crash if there is no active session.

Issue #19953731: VI: Add value index to...
...android.app.VoiceInteractor.PickOptionRequest.Option

There is now an optional index integer that can be associated with
every Option object.

Issue #19912635: VI: Behavior of startActivity when in voice...
...interaction is unexpected

We now forcibly finish the current voice interaction task whenever
another activity takes focus from it.

Issue #20066569: Add API to request heap dumps

New ActivityManager API to set the pss limit to generate heap
dumps.

Also added app ops for assist receiving structure and screenshot
data, so that we can track when it does these things.

Change-Id: I688d4ff8f0bd0b8b9e3390a32375b4bb7875c1a1
/frameworks/base/core/java/android/app/ActivityManager.java
e1e1969c96db98545033456111c0da6ff8a0699f 29-Jan-2015 Ruben Brunk <rubenbrunk@google.com> Add ProcessInfoService to activity manager.

- Adds a new AIDL interface for querying process
information from activity manager.

Bug: 19186859
Change-Id: Ic08858f346d6b66e7bfc9da6faa2c6e38d9b2e82
/frameworks/base/core/java/android/app/ActivityManager.java
c6d1c345f41cf817bf2c07c97b97107d94296064 26-Feb-2015 Svetoslav <svetoslavganov@google.com> Runtime permissions: per user permission tracking.

Before all permissions were granted at install time at once, so the user
was persented with an all or nothing choice. In the new runtime permissions
model all dangarous permissions (nomal are always granted and signature
one are granted if signatures match) are not granted at install time and
the app can request them as necessary at runtime.

Before, all granted permission to an app were identical for all users as
granting is performed at install time. However, the new runtime model
allows the same app running under two different users to have different
runtime permission grants. This change refactors the permissions book
keeping in the package manager to enable per user permission tracking.

The change also adds the app facing APIs for requesting runtime permissions.

Change-Id: Icbf2fc2ced15c42ca206c335996206bd1a4a4be5
/frameworks/base/core/java/android/app/ActivityManager.java
a83ce1dd2ad3a6b71e90ff4845afc1299fe17b9d 11-Mar-2015 Dianne Hackborn <hackbod@google.com> More work on collecting assist data.

Optimize parceling of AssistData (which is now renamed to
AssistStructure) by pooling duplicated class name strings.

Change text associated with a view node to a CharSequence,
so styling information comes along.

Include global text attributes -- size, colors, etc.

Introduce a new AssistContent structure, which allows us
to propagate information about the intent and data the
activity is looking at. This further allows us to propagate
permission grants, so the assistant can dig in to that data.
The default implementation propagates the base intent of an
activity, so if for example you bring up the assistant while
doing a share the assistant itself has the same information
and access that was given to the share activity (so it could
for example share it in another way if it wanted to).

Did some optimization of loading PersistableBundle from xml,
to avoid duplicating hash maps and such.

Changed how we dispatch ACTION_ASSIST to no longer include
the more detailed AssistStructure (and new AssistContent)
data when launching; now the example code that intercepts
that needs to be sure to ask for assist data when it starts
its session. This is more like it will finally be, and allows
us to get to the UI more quickly.

Change-Id: I88420a55761bf48d34ce3013e81bd96a0e087637
/frameworks/base/core/java/android/app/ActivityManager.java
43261140c3995dea77d87b587f882e651617f4b4 11-Feb-2015 Benjamin Franz <bfranz@google.com> Clean up the lock task APIs for COSU devices.

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

Bug: 19377096
Change-Id: Ia563078ca6ef6d6fc7e75130e6b94ba18af69340
/frameworks/base/core/java/android/app/ActivityManager.java
a27eef432a4aa94c0eb8a5f73a6435afaac160fe 29-Jan-2015 Ruben Brunk <rubenbrunk@google.com> Add ProcessInfoService to activity manager.

- Adds a new AIDL interface for querying process
information from activity manager.

Bug: 19186859
Change-Id: Ic08858f346d6b66e7bfc9da6faa2c6e38d9b2e82
/frameworks/base/core/java/android/app/ActivityManager.java
83b6ef01a07d2e7f06dfee7fd698b27bd62ca9a0 08-Nov-2014 Amith Yamasani <yamasani@google.com> Inform PendingIntent sender if broadcast was not queued.

If the broadcast could not be queued due to a stopped user, the
party trying to send a PendingIntent should be notified right away.
Otherwise, for instance, AlarmManager could be waiting forever to
be called back after the broadcast is delivered.

This is a potential fix for:
Bug: 18290018

Change-Id: I07c0751e80f11e69dfa2be5c96a033aecb298b81
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
ab4a81b3c625e33d04ae8070fcce6b6baee6522c 10-Oct-2014 Dianne Hackborn <hackbod@google.com> Improve some docs, fix some debugging.

- Add docs to Binder, Messenger, ResultReceier to explain their
relation (or lack there-of) to process lifecycle.
- Clarify some aspects of process lifecycle for services.
- Fix help text of am command.
- Fix per-package dumping of battery stats to not include history.
- Fix per-package dumping of proc stats to only include aggregated
and current stats and fix some formatting.
- Fix per-process dumping of meminfo to have an option to interpret
the input as a package, so including all processes that are
running code of that package.
- Fix top-level per-package debug output to correctly include all
of these improvements and give them a little more time (10s) to
complete for timing out.

Change-Id: I2a04c0f862bd47b08329443d722345a13ad9b6e2
/frameworks/base/core/java/android/app/ActivityManager.java
955d8d69ea6caabce1461dc25b339b9bf9dc61a6 08-Oct-2014 Dianne Hackborn <hackbod@google.com> Put in real "code" (aka marketing) name.

Change-Id: Idb3976edfae37293ed75cb5b869b4b42d8042bbe
/frameworks/base/core/java/android/app/ActivityManager.java
2d7576b082b84068fb9d68419b710b9bec49139b 04-Oct-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17752399: Multiple apps broken by GET_TASKS permission change

Keep around GET_TASKS as a permission available to apps, so apps still
think they have it and don't get all uppity because they don't.

Add a new REAL_GET_TASKS that is the actual permission now.

Plus some temporary compatibility code until everyone can transition
fromn GET_TASKS to REAL_GET_TASKS.

Change-Id: I12c1102eed24844685dcbd2fa3b612811603958f
/frameworks/base/core/java/android/app/ActivityManager.java
ae12dae13a58695653e6918124ca68cd8dcbf54e 29-Sep-2014 Winson Chung <winsonc@google.com> Fixing regression with black task bar background. (Bug 17584337)

Change-Id: Ieaa2defa4997ffc8851832c18dfe84e561ffedb5
/frameworks/base/core/java/android/app/ActivityManager.java
bdd4b201e45ffa82dcd3b09fb9724d243c86c8d8 26-Sep-2014 Jorim Jaggi <jjaggi@google.com> Don't preload task description icons when opening recents

Bug: 17624331
Change-Id: I55a1184efd5982122f87fab99a5402336b380d7c
/frameworks/base/core/java/android/app/ActivityManager.java
bdc07b6986d6ba5cab2ab98a36814ed9f8e3b520 24-Sep-2014 Zoltan Szatmary-Ban <szatmz@google.com> Merge "Register ActivityManagerService.PackageMonitor for all users." into lmp-dev
0bec95d0525971d5b78ff082150e05291275a939 23-Sep-2014 Zoltan Szatmary-Ban <szatmz@google.com> Register ActivityManagerService.PackageMonitor for all users.

With the introduction of managed profiles, ActivityManagerService.PackageMonitor
can receive Intents from users other than current one.

Bug: 17580914, 17314317
Change-Id: I7c601618f7819d6775cf422dca70a929ee1089d9
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.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/ActivityManager.java
0e8d7d63ba439cc0604af7055679dae3d30fdc48 03-Sep-2014 Amith Yamasani <yamasani@google.com> Add some @SystemApi tags for internal user-related APIs

Also added an internal isManagedProfile()

Bug: 17371392
Change-Id: Ibcc26771d954505cbd530192bf4a8a25a8d4cae0
/frameworks/base/core/java/android/app/ActivityManager.java
48a10a56e98b008ac55b9d50aee1ad33b377e367 27-Aug-2014 Winson Chung <winsonc@google.com> Change API to return thumbnail size instead of individual dimensions. (Bug 17295512)

- Fixing issue where we were pulling the thumbnail dimensions too early in AMS. (Bug 17286904)
- Simplifying the Recents code between start & configuration change

Change-Id: I6d667cbf37b844939e5fc466da613bb78ca05082
/frameworks/base/core/java/android/app/ActivityManager.java
80e29b66c5966f6af77e7404ab4b6321ef5cf23b 27-Aug-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #17179314: Make recents limits consistent" into lmp-dev
852975d5377bfe5f4abc9d2a28e301aa2fa99994 23-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17179314: Make recents limits consistent

The max limit is now 100 (or 50 on svelte devices), and that is
what everyone used.

Re-arranged things so we have a big expensive "fix the world!"
function for recents that we go in to at only select points:
when first initializing the system, when external storage comes
and goes, and if we detect something wrong with the recents
structure.

With that, now getRecentTasks() and addRecentTaskLocked() are
generally much simpler, doing very little work in most cases.
This will help a lot with scaling up to many more recents
entries.

Change-Id: I7b5ae89edc06568f68c8af54a4420aff7635581c
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
4610545dd28ebf316704e119572521e97dbbd6bd 26-Aug-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #16311398: Limit number of documents a process can open" into lmp-dev
5c1b42e4f5d7307ad09d0d7ad094adf34650fb62 26-Aug-2014 Winson Chung <winsonc@google.com> Merge "Multiple performance changes to speed recents invocation/app launching time. (Bug 16987565)" into lmp-dev
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/ActivityManager.java
a4ccb86ddc8f9f486aee25fb836f4aff97bf7679 23-Aug-2014 Winson Chung <winsonc@google.com> Multiple performance changes to speed recents invocation/app launching time. (Bug 16987565)

- Reverting changes to the existing thumbnail transition to prevent breaking applications
that currently depend on that transition. As a result, we need to create a new, hidden,
aspect-scaled thumbnail transition, and instead use that thumbnail to animate the
recents header so that we don't have to wait to do that inside the Recents activity.

In order for this to work, we also have to ensure that the thumbnail surface destruction
is synchronized with the application that is currently closing (when going down to
recents) or opening (when coming back up). The current thumbnail is destroyed when the
animation ends, but that can be at least 1 frame before the surface for the animating
window is destroyed. We change this by deferring destruction of this thumbnail window
to the animation that is being closed.

Especially on the way up, not having to wait for us to hide the header before doing the
transition up can save us the duration of that first animation (> 100ms).

- Other optimizations:
* No longer creating a new stack view on each transition to calculate the target rect
* Removing unnecessary call to get the thumbnail when transitioning up/down (the actual
window does its own animation.
* We reduced numerous system calls per task by adding a flag to ignore home-stack tasks
and caching the activity label and icon (and task description icon). These caches
follow the same eviction schemes as the thumbnail and icon cache.

- Also tweaked the touch slop for the nav bar swiping gesture to prevent conflicting with
tapping on home (Bug 17109581)

Change-Id: Ica697aad788051a9203edd9351c583e1cb038a71
/frameworks/base/core/java/android/app/ActivityManager.java
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/ActivityManager.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/ActivityManager.java
e9217a07292f6d1e7326bc52382e705e4d696165 08-Aug-2014 Winson Chung <winsonc@google.com> Exposing taskDescription for apps to read from their own AppTasks. (Bug 16826622)
/frameworks/base/core/java/android/app/ActivityManager.java
ec396d6399c5c31d697d81e94aff459e9771b0c6 07-Aug-2014 Winson Chung <winsonc@google.com> Initial changes to add task affiliation styling. (Bug 16656169)

- Fixing issue with launch-in-background animation
/frameworks/base/core/java/android/app/ActivityManager.java
22132d7950e57603e14259a337d6461d8478f07a 28-Jul-2014 Craig Mautner <cmautner@google.com> Make affiliatedTaskId public and unhidden.

Allow apps to see which of their tasks are affiliated in the
RecentTaskInfo returned by getAppTasks().

Fixes bug 16546323.

Change-Id: I54d75c02c194f58fb6513fa91c312289460f56b4
/frameworks/base/core/java/android/app/ActivityManager.java
0debc9aff4c0cbc28e083a948081d91b0f171319 17-Jul-2014 Adam Lesinski <adamlesinski@google.com> First iteration of a public UsageStats API

UsageStats API that allows apps to get a list of packages that have been
recently used, along with basic stats like how long they have been in
the foreground and the most recent time they were running.

Bug: 15165667

Change-Id: I2a2d1ff69bd0b5703ac3d9de1780df42ad90d439
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
386c94fdf9eaeea426dcf53c0b193037bb013152 14-Jul-2014 Jason Monk <jmonk@google.com> Add missing lock task API

It seems that currently there is no un-hidden way to determine if
the device is in lock task. This fixes that.

Change-Id: Ib5082b84de8073d261777b955fddff55367e5662
/frameworks/base/core/java/android/app/ActivityManager.java
a228ae95ea2f842c0e84f237c64bf032689410dd 09-Jul-2014 Craig Mautner <cmautner@google.com> Add task affiliation

Introduces new flag Intent.FLAG_ACTIVITY_LAUNCH_BEHIND which
causes the newly launched task to affiliate with the launching task.
(Later this flag will also launch the task behind the current task).
This shows up in a new member of the RecentTaskInfo class. This also
causes the recents list returned by getRecentsInfo to be rearranged
so that affiliated tasks are together.

Fixes bug 16157517.

Change-Id: Ia1386af50da2f01809278b62d249f05c6a0de951
/frameworks/base/core/java/android/app/ActivityManager.java
ffa2ec664479bff6b4b61d4c349d9db2cb37ca16 04-Jul-2014 Winson Chung <winsonc@google.com> Refactoring to support groups.

- Removing RecentService, determining animations just in time
- Fixing a few issues with animations of newly picked up tasks from the pool
- Moving helper classes into sub package

Change-Id: Ie10385d1f9ca79eea918b16932f56b60e2802304
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
2cb86c723195e24278f983241cd6b1e307acf159 25-Jun-2014 Winson Chung <winsonc@google.com> Saving last TaskDescription for TaskRecord.

Change-Id: I531e0fc661fdedeb78bee7d5472668de8e9c2104
/frameworks/base/core/java/android/app/ActivityManager.java
f1fbd77cf057e43926f9a0347692611386d09f40 25-Jun-2014 Winson Chung <winsonc@google.com> Use Task last active time to ensure we don't reload items for the cache.

Change-Id: I29206de0453f5d7d1370b27a27ef6d3594eff8e7
/frameworks/base/core/java/android/app/ActivityManager.java
a25a8b289bacce6dbaac2e71cd981d9eba06c959 30-May-2014 Dianne Hackborn <hackbod@google.com> Mark getRecentTasks() and getRunningTasks() as deprecated.

Change-Id: Idba79d7a4c0b9f0929f8dd27f25bd6aa548f5622
/frameworks/base/core/java/android/app/ActivityManager.java
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/ActivityManager.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/ActivityManager.java
e22b3b143240f0f18e3d6d3c06686ad3c23b131b 08-May-2014 Dianne Hackborn <hackbod@google.com> Usage stats!

Start reworking the usage stats service to be able
to have an API we can publish.

The basic information it keeps is still the same, though
that will be changing in the future. The one big addition
here is that we are also now collecting configuration usage
stats.

Also introduce the start of an access model for usage stats,
using app ops. There is an new app op that gives an application
access to usage stats even if it normally wouldn't have it,
disabled by default.

Change-Id: I6ead28e18a7f08eafd057d6ff37dd9cb216358f4
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.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/ActivityManager.java
684bf34ee8acc41931fac23762b13e14a22011db 30-Apr-2014 Dianne Hackborn <hackbod@google.com> Switch IProcessObserver to report process state

When IProcessObserver was created, the only information
we had for the state of a process was its "importance".
Now we have the process state, which is much more useful.
Switch to reporting that.

Change-Id: Icdb3eea8cf96f4eff7ed3d584f940a1bd9cc3884
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
35fc6a02aeded9578375af5828e14043164028d5 03-Apr-2014 Craig Mautner <cmautner@google.com> Merge "Implement setActivityLabelAndIcon()."
2a764949c943681a4d25a17a0b203a0127a4a486 02-Apr-2014 Kenny Guy <kennyguy@google.com> Rename related users to profiles.

Rename the related user concept as profiles.
When returning profiles of a user include the
user as a profile of itself.

Change-Id: Id5d4f29017b7ca6844632ce643f10331ad733e1d
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.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/ActivityManager.java
82326a98a4507deee89a90654dd0953c459811af 17-Mar-2014 Kenny Guy <kennyguy@google.com> Add flag to allow fetching related users recent tasks.

Fetch related users recent tasks along with requested users
tasks when flag is set
Set flag in requests coming from systemui/recents.

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

Change-Id: Ide2c202b4a5b25410f0f32bd0a81ccf817ede38f
/frameworks/base/core/java/android/app/ActivityManager.java
ed6649f89f236ea9e665028bd33d6d804b906a92 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/ActivityManager.java
daa0d5c9296515fe05cae65926a66dee609f382a 07-Nov-2013 Dianne Hackborn <hackbod@google.com> Fix issue #11223338: Not retaining service started state while restarting

When I cleaned up how we maintained the lifecycle of the tracker with a
service, I broke most tracking of the service restart state. (Since at
that point the service is no longer associated with a process, so I
must clean up the tracker state). This change introduces a new special
case for interacting with a service tracker to explicitly tell it when
a service is being restarted. It also fixes how we update the process
state when services are attached to it, so it goes in and out of the
restarting state correctly.

In addition:

- Maybe fix issue #11224000 (APR: Dependent processes not getting added
to LRU list). We were not clearing ServiceRecord.app when bringing
down a service, so if for some reason there were still connections to
it at that point (which could happen for example for non-create bindings),
then we would so it when updating the LRU state of that client process.
- dumpsys procstats's package argument can now be a package or process
name, and we will dump all relevent information we can find about that
name.
- Generally improved the quality of the dumpsys procstats output with its
various options.
- Fixed a bug in ActivityManager.dumpPackageState() where it would hang if
the service was dumping too much, added meminfo to the set of things
dumped, and tweaked command line options to include more data.
- Added some more cleaning code to ActiveServices.killServices() to make
sure we clean out any restarting ServiceRecord entries when a process is
being force stopped.
- Re-arranged ActiveServices.killServices() to do the main killing of the
service first, to avoid some wtf() calls that could happen when removing
connections.

Bug: 11223338
Bug: 11224000

Change-Id: I5db28561c2c78aa43561e52256ff92c02311c56f
/frameworks/base/core/java/android/app/ActivityManager.java
cc2195bb560cc155bf3e7d3a7f27fe619a497124 16-Oct-2013 Scott Main <smain@google.com> some javadoc improvements for virtual display and
new meta tag name

Change-Id: If9caba425f825652468a0f3e868f71ed1a778fb1
/frameworks/base/core/java/android/app/ActivityManager.java
ebc15ef80ff1b4354be99a45d348537f094d6b59 10-Oct-2013 Dianne Hackborn <hackbod@google.com> Fix some doc issues.

Bug: 11079621
Bug: 10461610
Bug: 10461369
Bug: 10461417
Change-Id: I7fd966f3cda0660ba20fa15d7164dcac95efadd3
/frameworks/base/core/java/android/app/ActivityManager.java
e8a9422495d6af9fc68cf4e838a4a5f19177034b 19-Sep-2013 Craig Mautner <cmautner@google.com> Merge "Return tasks in correct order." into klp-dev
bd413f6c05d10ecd001b80c0f30fd031145da8ae 19-Sep-2013 Christopher Tate <ctate@google.com> Support for "not the home app you're looking for" metadata

* Make sure that pm.getHomeActivities() returns the activity metadata
as well, so that the caller can trace the reference

* Add a public canonical name for that metadata key

Bug 10749961

Change-Id: Ic4d0750d61001ffe5af180398f042afa30eea1ce
/frameworks/base/core/java/android/app/ActivityManager.java
c0fd8052349976fe0e9422f702e30e5030a0adde 19-Sep-2013 Craig Mautner <cmautner@google.com> Return tasks in correct order.

Fixed ActivityManager.getRunningTasks().

Fixes bug 10705790.

Change-Id: Ia3f66e592e08a87896a1ab59f980618ec5310dfe
/frameworks/base/core/java/android/app/ActivityManager.java
be4c1d74a758f40de25e796a991ccfd1fe356857 09-Sep-2013 Dianne Hackborn <hackbod@google.com> Fix issue #10671878: Proc stats needs to remove old data structures

We now keep track of which process and service states are actively
in use, and remove any that are not in use during a commit. The
activity manager needed to be tweaked to report this data, and ensure
it does not try to operate on one of these structures when not in
use.

Also some other fixes:

- We now keep track of process names associated with services, for
display in the UI.
- Keep track of total run time for each service, also for UI.
- The parceled format is more efficient, not storing duplicates of
process/package names, and writing times as ints when possible.
- Reduced commit period from 1 day to 12 hours, so that our UI can
be a little closer at its attempt to display the stats over 1 day.

Change-Id: Ifeda0ffe963a7b49d8eb2a3f6923f3a5e71a4e43
/frameworks/base/core/java/android/app/ActivityManager.java
ac738a25f8d0a9fcd5e30ad1a7b98683726c49f3 27-Aug-2013 Craig Mautner <cmautner@google.com> Merge "Hide stackId from prying eyes." into klp-dev
2703052413387a0ba9d66f04b6e0421d5f59674e 26-Aug-2013 Craig Mautner <cmautner@google.com> Hide stackId from prying eyes.

Member variable does not have to be publicly visible.

Fixes bug 10461556.

Change-Id: I9aeaf4f451738b1d6dc0289afb1deae6e8f7e5c2
/frameworks/base/core/java/android/app/ActivityManager.java
2f61f91491785ef78d92d08ed3e09b0695564fad 20-Aug-2013 Christopher Tate <ctate@google.com> Make "low ram device" a readonly system property

This lets components outside the Zygote / Android resource regime
know whether this is considered a "low ram" device.

Set the property [ro.config.low_ram] to "true" if the device is to be
considered low-ram. Any other property string (or its absence) will
be interpreted as meaning this is a normal larger-ram device. The
"true" string must be all lower case.

Bug 10131789

Change-Id: I15332d169b4aa4eaa0a6c1952787af0b03d23a6b
/frameworks/base/core/java/android/app/ActivityManager.java
8a0de58ece89c467c8e7415097d193e5f8db9db8 08-Aug-2013 Dianne Hackborn <hackbod@google.com> Get ProcessStats callable from other processes.

Also fix a bug where, when parceling the stats, we were
computing the final duration values too late. We need to
do that before we write the long table.

Change-Id: Idb6c1ed95417448c56973fe5866bfb3570e525f4
/frameworks/base/core/java/android/app/ActivityManager.java
c8230519728b14065effd3b7d4eca273ff86160c 14-Jul-2013 Dianne Hackborn <hackbod@google.com> Switch proc stats to use new process state constants.

These new constants are a better mapping to the kind of
information that procstats is wanting to collect about
processes. In doing this, the process states are tweaked
to have a bit more information that we care about for
procstats.

This changes the format of the data printed by procstats,
so the checkin version is bumped to 2. The structure is
the same, however the codes for process states have all
changed. The new codes are, in order of precedence:

p -- persistent system process.
t -- top activity; actually any visible activity.
f -- important foreground process (ime, wallpaper, etc).
b -- important background process
u -- performing backup operation.
w -- heavy-weight process (currently not used).
s -- background process running a service.
r -- process running a receiver.
h -- process hosting home/launcher app when not on top.
l -- process hosting the last app the user was in.
a -- cached process hosting a previous activity.
c -- cached process hosting a client activity.
e -- cached process that is empty.

In addition, we are now collecting uss along with pss
data for each process, so the pss checkin entries now
have three new values at the end of the min/avg/max uss
values of that process.

With this switch to using process state constants more
fundamentally, I realized that they could actually be
used by the core oom adj code to make it a lot cleaner.
So that change has been made, that code has changed quite
radically, and lost a lot of its secondary states and flags
that it used to use in its computation, now relying on
primarily the oom_adj and proc state values for the process.

This also cleaned up a few problems -- for example for
purposes of determing the memory level of the device, if a
long-running service dropped into the cached oom_adj level,
it would start being counted as a cached process and thus
make us think that the memory state is better than it is.
Now we do this based on the proc state, which always stays
as a service regardless of what is happening like this, giving
as a more consistent view of the memory state of the device.

Making proc state a more fundamentally part of the oom adj
computation means that the values can also be more carefully
tuned in semantic meaning so the value assigned to a process
doesn't tend to change unless the semantics of the process
has really significantly changed.

For example, a process will be assigned the service state
regardless of whether that services is executing operations
in the foreground, running normally, or has been dropped to
the lru list for pruning. The top state is used for everything
related to activities visible to the user: when actually on
top, visible but not on top, currently pausing, etc.

There is a new Context.BIND_SHOWING_UI added for when system
services bind to apps, to explicitly indicate that the app
is showing UI for the system. This gives us a better metric
to determine when it is showing UI, and thus when it needs
to do a memory trim when it is no longer in that state. Without
this, services could get in bad states of continually trimming.

Finally, more HashSet containers have been changed to ArraySet,
reducing the temporary iterators created for iterating over
them.

Change-Id: I1724113f42abe7862e8aecb6faae5a7620245e89
/frameworks/base/core/java/android/app/ActivityManager.java
a413dc06b2193442a2d956571b829aeb5fb97862 12-Jul-2013 Dianne Hackborn <hackbod@google.com> Add new proc state constants and delivery.

The activity manager now keeps a new "process state" for
each process, indicating the general execution and memory
state of the process. This closely follows the out-of-memory
adjustment and scheduling class that it currently tracks,
but roles these together (plus a little more info) into one
more semantically meaningful number.

This value is reported to each process as it changes, so they
can do things like tune the Dalvik garbage collector to match
the current process state.

I think I should also switch to this for process states. It
will give is more meaningful divisions of time for each process.

Also fix a problem in the activity stack where the previous
process was not being set correctly when moving between
activity stacks.

Change-Id: I598b1667dc46547f8fadae304e210c352cc9d41f
/frameworks/base/core/java/android/app/ActivityManager.java
904a857d5a319e32d1df065b38e3191324b35b0f 29-Jun-2013 Dianne Hackborn <hackbod@google.com> More work on procstats: save/restore state, fixes.

We now persistent the current procstats to storage
to keep them across boots. Still need to do division
and pruning across days; right now they will just keep
collecting forever.

Also fix some bugs in the checkin output.

Change-Id: I4dd9317dbe2ee0642af8f2f0be1f2bd9c4055e80
/frameworks/base/core/java/android/app/ActivityManager.java
a3664247c701d975ebda9da9f0412bc49d3b6fae 27-Jun-2013 Christopher Tate <ctate@google.com> New API: apps can request a wipe of their own data

Bug 9588299

Change-Id: I817a90e272ba279d7171f6dbe88dbafd7e42b050
/frameworks/base/core/java/android/app/ActivityManager.java
b4e12494935697fa4ede006b37e6be889ef27109 27-Jun-2013 Dianne Hackborn <hackbod@google.com> Add new ActivityManager.isLowRamDevice().

This and the old isHighEndGfx() is set up through a
device configuration, rather than trying to compute it
automatically.

Change-Id: Ibc95c05791023a7ae6c88555b75bb61f2b613991
/frameworks/base/core/java/android/app/ActivityManager.java
8c84109b9fbbf473b225707a38261ff5f99d95fb 24-Jun-2013 Dianne Hackborn <hackbod@google.com> Use FastPrintWriter... everywhere.

One problem this turned up is, because FastPrintWriter does
its own buffering, a lot of code that used to use PrintWriter
would fail -- if it pointed to a StringWriter, there was no
buffering, so it could just immediately get the result. Now
you need to first flush the FastPrintWriter.

Also added some new constructors to specify the size of buffer
that FastPrintWriter should use.

Change-Id: If48cd28d7be0b6b3278bbb69a8357e6ce88cf54a
/frameworks/base/core/java/android/app/ActivityManager.java
91268cf21eace600792d04db1ac62e9268f48002 14-Jun-2013 Dianne Hackborn <hackbod@google.com> More work on process tracking.

Re-arranged code to be more flexible, now track
state of services, dump ordered list of running
processes while memory was critical and low.

Also rename battery stats service from "batteryinfo" to "batterystats".

Change-Id: I0f4f0c8d443c49d255cb84d0fc917e8ec18b152e
/frameworks/base/core/java/android/app/ActivityManager.java
cbfd23ee6f14445c3e17c5169abbc80c216fa137 11-Jun-2013 Dianne Hackborn <hackbod@google.com> Add new API to retrieve a dumpsys of a single package.

Adds a platform API, and pm command. Fixes some issues with
dumping per-package data in package manager, makes battery
stats able to dump per-package state.

Change-Id: I76ee6d059f0ba17f7a7061886792b1b716d46d2d
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
6d90fed076fad7874e04833110bb1d63cdbc7eac 23-May-2013 Craig Mautner <cmautner@google.com> Add stackId to RecentTaskInfo

Necessary for multi-stack activity overview.

Fixes bug 9092356.

Change-Id: I3d51a7b5cbca6166017759401bb5d31b4ae96f07
/frameworks/base/core/java/android/app/ActivityManager.java
9d851de6cc937c51b171f27cd4ecede75205202a 23-May-2013 Craig Mautner <cmautner@google.com> Revert "Add stackId to RecentTaskInfo"

Need to modify the API as well.
This reverts commit b9b9477581ce5f72a679dd1cd9a85e6c8f73944a

Change-Id: I34ea371408930b6b1bf4c53ad9ab8418b0070dbc
/frameworks/base/core/java/android/app/ActivityManager.java
b9b9477581ce5f72a679dd1cd9a85e6c8f73944a 23-May-2013 Craig Mautner <cmautner@google.com> Add stackId to RecentTaskInfo

Necessary for multi-stack activity overview.

Fixes bug 9092356.

Change-Id: I91fc68ebf72114224c8e651261101ac14517ff86
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
ecbfe253fb6fb83aa533828cce6e9c11ff7115da 28-Mar-2013 Craig Mautner <cmautner@google.com> Add flag to method's javadoc.

MOVE_TASK_NO_USER_ACTION was feeling neglected.

Change-Id: I1b8281878e99755ad9960904ba71b83ba3f05620
/frameworks/base/core/java/android/app/ActivityManager.java
d7d28e675ea7aac151c0c302d233b476537af946 12-Feb-2013 Dianne Hackborn <hackbod@google.com> App ops: media ops, set up to be callable from native code.

This is to help implementation of bug #8181262 and maybe
bug #8181261

Adds some definition for media ops (though nothing is yet using
them), and re-arranges things a bit so we can implement native
calling in to the app ops service.

Also add some java docs.

Change-Id: I637959745db820e676f23a35a5d2224f51bc6689
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.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/ActivityManager.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/ActivityManager.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/ActivityManager.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/ActivityManager.java
12631ec35eafc466e0deef315daa5fdfb5066372 30-Aug-2012 Dianne Hackborn <hackbod@google.com> Merge "Start implementing concept of "running" users." into jb-mr1-dev
bd6e1500aedc5461e832f69e76341bff0e55fa2b 28-Aug-2012 Jeff Brown <jeffbrown@google.com> Add initial multi-display support.

Split the DisplayManager into two parts. One part is bound
to a Context and takes care of Display compatibility and
caching Display objects on behalf of the Context. The other
part is global and takes care of communicating with the
DisplayManagerService, handling callbacks, and caching
DisplayInfo objects on behalf of the process.

Implemented support for enumerating Displays and getting
callbacks when displays are added, removed or changed.

Elaborated the roles of DisplayManagerService, DisplayAdapter,
and DisplayDevice. We now support having multiple display
adapters registered, each of which can register multiple display
devices and configure them dynamically.

Added an OverlayDisplayAdapter which is used to simulate
secondary displays by means of overlay windows. Different
configurations of overlays can be selected using a new
setting in the Developer Settings panel. The overlays can
be repositioned and resized by the user for convenience.

At the moment, all displays are mirrors of display 0 and
no display transformations are applied. This will be improved
in future patches.

Refactored the way that the window manager creates its threads.
The OverlayDisplayAdapter needs to be able to use hardware
acceleration so it must share the same UI thread as the Keyguard
and window manager policy. We now handle this explicitly as
part of starting up the system server. This puts us in a
better position to consider how we might want to share (or not
share) Loopers among components.

Overlay displays are disabled when in safe mode or in only-core
mode to reduce the number of dependencies started in these modes.

Change-Id: Ic2a661d5448dde01b095ab150697cb6791d69bb5
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
0c3804950236fe170ebf6cc7a5f1e3e305b8f315 21-Aug-2012 Dianne Hackborn <hackbod@google.com> Improve multi-user app management.

Introduce API to get per-user storage information, keep track
of services associated with users, and various small cleanup.

Change-Id: I5d4e784e7ff3cccfed627d66a090d2f464202634
/frameworks/base/core/java/android/app/ActivityManager.java
98365d7663cbd82979a5700faf0050220b01084d 20-Aug-2012 Jeff Brown <jeffbrown@google.com> Refactor for multi-display support.

Split WindowManagerImpl into two parts, the WindowManager
interface implementation remains where it is but the global
communications with the window manager are now handled by
the WindowManagerGlobal class. This change greatly simplifies
the challenge of having separate WindowManager instances
for each Context.

Removed WindowManagerImpl.getDefault(). This represents the
bulk of this change. Most of the usages of this method were
either to perform global functions (now handled by WindowManagerGlobal)
or to obtain the default display (now handled by DisplayManager).

Explicitly associate each new window with a display and make
the Display object available to the View hierarchy.

Add stubs for some new display manager API features.

Start to split apart the concepts of display id and layer stack.
since they operate at different layers of abstraction.
While it's true that each logical display uniquely corresponds to a
surface flinger layer stack, it is not necessarily the case that
they must use the same ids. Added Display.getLayerStack()
and started using it in places where it was relatively easy to do.

Change-Id: I29ed909114dec86807c4d3a5059c3fa0358bea61
/frameworks/base/core/java/android/app/ActivityManager.java
f02b60aa4f367516f40cf3d60fffae0c6fe3e1b8 16-Aug-2012 Dianne Hackborn <hackbod@google.com> Rename UserId to UserHandle.

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

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
7d19e0242faac8017033dabb872cdf1542fa184c 08-Aug-2012 Dianne Hackborn <hackbod@google.com> More mult-user API work.

- You can now use android:singleUser with receivers and providers.
- New API to send ordered broadcasts as a user.
- New Process.myUserHandle() API.

For now I am trying out "user handle" as the name for the numbers
representing users.

Change-Id: I754c713ab172494bb4251bc7a37a17324a2e235e
/frameworks/base/core/java/android/app/ActivityManager.java
a93c2c117d502ee57dd27705a0b5efca4bf65011 01-Jun-2012 Dianne Hackborn <hackbod@google.com> Extend process observer to be usable for media routing.

It now has a new callback to report changes in the "importance"
of processes. Rewrote the dispatching code to be a bit more
efficient now that we are sending more reports.

Change-Id: Ie865cfd286455819f04e8c14e9b6fd54d028f8f2
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
59325eb31f25704bb88c348160bb69e7c1aa3b48 10-May-2012 Dianne Hackborn <hackbod@google.com> Add new API to find total RAM.

Change-Id: Iad2dff3c44f471515f093e7f0d0d959528881ab9
/frameworks/base/core/java/android/app/ActivityManager.java
d0356a19c1630e598a096477ce5cb5d2942a9405 27-Apr-2012 Dianne Hackborn <hackbod@google.com> Fix launcher icon size for tvdpi.

We didn't have a case for tvdpi, so ended up in the default
scaling. This resulting in us using 319 instead of 320.

Fixed the default case to round, and added explicit cases
for tvdpi since this is a standard density.

Change-Id: I752b924e1556af94682428c8c0ed7c75d15ac4a4
/frameworks/base/core/java/android/app/ActivityManager.java
c5bf7584422adca286c1f27a073df925c06f068d 26-Apr-2012 Dianne Hackborn <hackbod@google.com> Update process importance documentation.

Also be more direct about some of the wallpaper APIs.

Change-Id: I2112898c0cd4415d6c5fd47923de682d59b8291f
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
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/ActivityManager.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/ActivityManager.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/ActivityManager.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/ActivityManager.java
d96e3dfa02b203b1fc826e80d6f9aa074ba9c250 26-Jan-2012 Dianne Hackborn <hackbod@google.com> Add xxhdpi; fix ActivityManager.getLauncherLargeIconSize() etc.

Change-Id: I519d6cdc527a402d93b98df17a64fc1da52ad598
/frameworks/base/core/java/android/app/ActivityManager.java
905577f6345c014fc2489a8068ea967ba8c18012 08-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5263361: Browser instance not created in application picker

The resolver activity was hiding the following activity from recents.

Also some other fixes: a little better memory use debugging, removed
some unneeded code from window manager, moved some system activities
into their own process, added some more running process information for
manage apps.

Change-Id: I66687d16989ff965d524b92dc360f37c19199717
/frameworks/base/core/java/android/app/ActivityManager.java
49d228b3f31789f4aed361b526b7edb619a542e9 25-Aug-2011 Dianne Hackborn <hackbod@google.com> New API to determine if device has lots of RAM.

Change-Id: Ie243e851960fdd9e1ebeaf1c1929879193620051
/frameworks/base/core/java/android/app/ActivityManager.java
b375632c9cf7b7be9309ff55f602499d59cfa597 12-Aug-2011 Dianne Hackborn <hackbod@google.com> Don't use HW accel drawing in lock screen on lower-end devices.

This saves about 8MB in the system process because we don't need
to do HW accelerated drawing there anymore.

Change-Id: Ieaf72fe772536e12d10cf129d9338ca9fce6a6d4
/frameworks/base/core/java/android/app/ActivityManager.java
7d608423b721e0153f37bfd5eba78fcd2489562d 08-Aug-2011 Dianne Hackborn <hackbod@google.com> Move OOM kernel settings to activity manager.

The activity manager now take care of plugging the correct settings
into the OOM killer in the kernel. This is a lot cleaner because
it is really central to how the activity manager works, and nobody
else cares about them.

Taking advantage of this, the activity manager computes what it
thinks are appropriate OOM levels based on the RAM and display
size of the device.

Also a small optization to the package manager to keep a binding
to the package install helper for a bit after done using it, to
avoid thrashing on it.

And some new APIs that are now needed by Settings.

Change-Id: I2b2d379194445d8305bde331c19bde91c8f24751
/frameworks/base/core/java/android/app/ActivityManager.java
9fc033083267d0c7f01e083400721b6cddb3a398 01-Jul-2011 Mark Brophy <mbrophy@google.com> Expose app resume times to the ApplicationProvider.

Add ActivityManager.getAllPackageUsageStats which returns
the PkgUsageStats object for all packages.

In UsageStatsService, remember the last resume time of each component, and
add that info to PkgUsageStats instances.

ApplicationProvider will use getAllPackageUsageStats and the new field
in PkgUsageStats to set the new SearchManager column
SUGGEST_COLUMN_LAST_USAGE_HINT for requests with the GLOBAL_SEARCH
permission.

Change-Id: I80e9b127410ed0d528515d2256787f30a953e9b0
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
c6c8ada1632b9ea0ff87c1caa1141f93ec2256b2 13-May-2011 Dianne Hackborn <hackbod@google.com> am dda64e9a: am 51454295: am df9799f0: Fix build.

* commit 'dda64e9a4af2e7dbc75a3b2fc7c41b9d63848a59':
Fix build.
3d0724dc220a2e027b9e38f61c39c84c28a505d5 13-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 0e59729b to master

Change-Id: I2d3a6bddf66b1df0c101c45ea2fec1cf65caf01b
df9799f0fc3ef04d9b004ebbda44883f85321b24 13-May-2011 Dianne Hackborn <hackbod@google.com> Fix build.

Change-Id: I97e357aa20c9ba91f20f77d53fc4dca1fd3aa598
/frameworks/base/core/java/android/app/ActivityManager.java
0f1de9adde0b52d2a385a76232bd7ac30c3eeea2 12-May-2011 Dianne Hackborn <hackbod@google.com> New compat mode front end: UI and persistence.

Adds a really crappy UI for toggling compat mode.

Persists compat mode selection across boots.

Turns on compat mode by default for newly installed apps.

Change-Id: Idc83494397bd17c41450bc9e9a05e4386c509399
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.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/ActivityManager.java
bcbab3684349353ee8cab30b556001824d0e7ccf 09-Apr-2011 Dianne Hackborn <hackbod@google.com> Merge "Rework thumbnails in activity manager."
f26fd99a7c2f554b0297760bb66336473c7db61f 09-Apr-2011 Dianne Hackborn <hackbod@google.com> Rework thumbnails in activity manager.

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

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

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

Change-Id: Ic2e8fa68797ea9d486f4117f3d82c98233cdab1e
/frameworks/base/core/java/android/app/ActivityManager.java
7ad33c8f9e7ecd356979dbad23c6c171b4f3339d 09-Mar-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4066157: ActivityManager.getMemoryClass() returning large memory class

Change-Id: I1970252e07f703087ac96378410ae2b6e6e4c2d3
/frameworks/base/core/java/android/app/ActivityManager.java
bfcda39cadd897cc89f77b40909a84fa8f56aace 02-Mar-2011 Peter Visontay <pvisontay@google.com> Fixed NPE in ActivityManager's launch count service.

Bug: 3497127
Change-Id: I38661fb0654e807f05cc57e43cff912de8d39096
/frameworks/base/core/java/android/app/ActivityManager.java
8d224caf989b212f8e633cc1a8b0db453300a742 18-Feb-2011 Peter Visontay <pvisontay@google.com> ActivityManager exposes launch count API.

Bug: 3431684
Change-Id: I49d4fb0b1620aafaf251d77700bc017859328968
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
5ef44b7566566db08b62245cbb9002b548071603 27-Jan-2011 Kenny Root <kroot@google.com> Add API for preferred Launcher icon size and density

Applications that create an icon for launcher to use couldn't determine
which size or density the icon should be created.

Bug: 3224340
Change-Id: Iee96113a4092696a9bd18eecbd2593b38f952a16
/frameworks/base/core/java/android/app/ActivityManager.java
de39851592679a545b8b6fb749507ccc7ec407f9 19-Jan-2011 Dianne Hackborn <hackbod@google.com> Hook up large heap API.

Change-Id: I215644f8de326fe3d4fa582447885b0aa01f72d3
/frameworks/base/core/java/android/app/ActivityManager.java
805fd7ee0e5dc2939e85c84f78d9890a51982bc0 17-Jan-2011 Dianne Hackborn <hackbod@google.com> Add API to get path to OBBs.

Also hide the bitmap thumbnail stuff, we can't support it in its
current form.

And fix some bugs with propagating paths to native code. Yikes!

Change-Id: I13ab37ddbdba5c073489cba5eab035117d3c1574
/frameworks/base/core/java/android/app/ActivityManager.java
3b81bc18bb661c02ad8074c39dab16644c1e65d0 15-Jan-2011 Dianne Hackborn <hackbod@google.com> Add manifest API to request a large heap.

You can now do android:largeHeap="true" on an application.

Doesn't yet do anything, waiting for Dalvik API.

Also tweak package parsing so that the SDK API level is set in the
configuration, allowing manifest resource value selection based on
that.

Change-Id: I6e035f9702a97b055416743b88f83a22ba4a9584
/frameworks/base/core/java/android/app/ActivityManager.java
3b4fcbc9f13bab6a2e9e5c37cc5e18fec7341c04 09-Jan-2011 Brett Chabot <brettchabot@android.com> Add ActivityManager#isRunningInTestHarness() public API.

Replaces use of ro.monkey system property. This new API is controlled by
ro.test_harness.

Bug 3329873

Change-Id: Idb5bbbd9ca691976ef842eec681be34c29915976
/frameworks/base/core/java/android/app/ActivityManager.java
4e24aac6aeb6c7dad2a40aa6d455debf2d1738f6 23-Dec-2010 Dianne Hackborn <hackbod@google.com> Add some standard definitions for device heaps.

These can be included as desired by particular devices to configure
their Dalvik heap in a standard way.

Change-Id: I487c751d7c583b0e93552f16ab43a93314219778
/frameworks/base/core/java/android/app/ActivityManager.java
d2835935d2df8be70d1b37d3ef3b2fe0155b3422 14-Dec-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3258849: Grab thumbnail when exiting an app via back

Also issue #3281400: Rotating a retained instance fragment leaks the fragment manager

And turn off fragment debug logging.

Change-Id: Ibdd7db82bb35618021bcba421ba92ced7cd691c2
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
5383f502e4479d117c89666fb2ee1ca53f3d27cf 22-Oct-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3122240: Expose xlarge in GB.

Plus some other small API cleanup.

Change-Id: I1a3c60f510f99224cccac9cc3f838f04141064f8
/frameworks/base/core/java/android/app/ActivityManager.java
424991704b5fb7a64f6cf0fcc3f4b1aabbf2a2e0 16-Oct-2010 Dianne Hackborn <hackbod@google.com> Implement issue #3094621 and #3094609 - wipe sd card

3094621: add "wipe sd card" option to factory data reset
3094609: collapse unmount/format into one command

Also since we have decided that it is important to consider
the Crespo storage as internal storage, DevicePolicyManager
gets a new API to be able to wipe it. (No big deal, since
all of the work for this is now done in the implementation
of the new UI.)

Change-Id: I32a77c410f710a87dcdcbf6586c09bd2e48a8807
/frameworks/base/core/java/android/app/ActivityManager.java
482566ed5cc7307b0401361509fb06acc5476115 03-Sep-2010 Dianne Hackborn <hackbod@google.com> These are not ready to be exposed. Also rename them to be better.

Change-Id: I7c234144497084b7769f8c46761b7d74d1c583d5
/frameworks/base/core/java/android/app/ActivityManager.java
9adb9c3b10991ef315c270993f4155709c8a232d 13-Aug-2010 Dianne Hackborn <hackbod@google.com> Various battery info things:

- Now track wake locks in battery history.
- Now track sensors in battery history.
- Some filtering of sensory data.
- Fixes to some data that wasn't cleared when resetting battery stats.
- Print amount discharged since last charge.

And the big part -- keep track of wake locks held per process,
and kill processes that hold wake locks too much while they are in
the background. This includes information in the battery stats
about the process being killed, which will be available to the
developer if the app is reported.

Change-Id: I97202e94d00aafe0526ba2db74a03212e7539c54
/frameworks/base/core/java/android/app/ActivityManager.java
0b2a6d0773211449fbde9d2706388714beeffebb 14-Jul-2010 Jim Miller <jaggies@google.com> Fix 2797185: Re-enable thumbnail generation in framework

This re-enables thumbnail generation code in the framework
with a few improvements.

In addition to enabling the system to capture thumbnails,
it removes padding from the borders to account for space
overlapped by system widgets (status bar, etc.). Thus,
the contents of the bitmap are only those pixels unique to
the activity.

It also maximizes resolution of the bitmap by capturing the
image in the application's current orientation. In landscape
mode, it captures a bitmap with dimensions w x h. In portrait,
it captures a bitmap with dimensions h x w. Where w and h are
thumbnail_width and thumbnail_height as defined in dimens.xml.

Though enabled, the change is not currently used in this
branch. The work is being checked in here to avoid
complicated downstream merges.

Change-Id: Ifc8a4e0075d7d0697d8159589be3816ace31d70c
/frameworks/base/core/java/android/app/ActivityManager.java
baf42c625c3ef4cb7b732956a97953efd93b23bc 24-Jun-2010 Dianne Hackborn <hackbod@google.com> Add APIs for finding heavy-weight apps.

Change-Id: I6c865cce404cac1a08eee056f963de5d276d5898
/frameworks/base/core/java/android/app/ActivityManager.java
32907cfb38bda2d3c052cf5139c5b592678fedbb 11-Jun-2010 Dianne Hackborn <hackbod@google.com> Adjust activity manager process OOM adj.

Modify OOM adj classes a bit, to take into account the new
heavy weight app type, and give "foreground services" their
own category to have a bettery chance to manager them when
things go wrong.

Also add some new code to battery stats to keep a history
of changes to the battery level.

Change-Id: I29f5ab6938777e1a7eafd7d8c38b5e564cc9f96a
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
53d9264de4f99a069dd7306f881d28ddd5956b35 13-Apr-2010 Dianne Hackborn <hackbod@google.com> Fix issue #2555171: Switching to app immediately after unmounting...

...SD card causes reboot.

Add option to not include temporarily unavailable recent tasks,
for the recent tasks UI to not display them.

Change-Id: I1495ca217b4292fd56f537459b44c0624262c292
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.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/ActivityManager.java
6e70912bd53aaa5264259e160eb2b4d2eb0f302c 07-Jan-2010 Dan Egnor <egnor@google.com> Bumper un-@hide (un-@pending actually) of previously reviewed APIs:

- new Log methods for reportable conditions
- EventLog publication, EventLogTags deprecation
- a new stackTrace field in ProcessErrorStateInfo
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.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/ActivityManager.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/ActivityManager.java
2c6c5e6e49795e6e24cd089c9018377d837ba931 09-Oct-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2176944: Need API so browser, others can determine memory size of device

Change-Id: I65d91cdb70df91b67fe84297dd6a94d26a785131
/frameworks/base/core/java/android/app/ActivityManager.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/ActivityManager.java
eb034652c2037a47ebfd99779e8383bb8bb528af 07-Sep-2009 Dianne Hackborn <hackbod@google.com> Implement all of the infrastructure for configuring wallpapers.

Actually being able to configure a wallpaper relies on additional
work in the launcher and wallpapers that will be in another change.
Also note that this breaks all existing wallpapers, since they now
need to include a meta-data item about themselves. This also
will be fixed in another change.

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