History log of /frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b2ad6b20d515f665618c7451480ad2946ded1977 29-Jun-2017 Andrii Kulian <akulian@google.com> Further restrict activity launch on virtual displays

Only callers with INTERNAL_SYSTEM_WINDOW permission can launch
an activity to a virtual display.

Bug: 63094482
Test: android.server.cts.ActivityManagerDisplayTests
Change-Id: I3f618fcbf3c07e5085e2b43b0f038f240df0c9d3
(cherry picked from commit 3a95edc0f51dbef8fbe7b3afa731f482454537c3)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
454117fe071e262328c72e73ef432a33da7e1a12 23-Jun-2017 Wale Ogunwale <ogunwale@google.com> Dump user id in dumpsys activity starter

To help with ANR debugging.

Test: adb shell dumpsys activity starter
Bug: 38121026
Change-Id: I96d530662e6a362b817df3ca8410cb173a2c0dd4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
692dcd64146786ce15c96cf054fb7808dd625667 20-Jun-2017 Wale Ogunwale <ogunwale@google.com> Added dumsys activity starter

Dumps the last state of ActivityStarter to help debug ANR issue.
Also log reason for starting an activity.

Bug: 38121026
Test: adb shell dumpsys activity starter
Change-Id: Ib77ff974b1122946fac96f8835ab3fdfc732cf7b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
59bcba6b172b5fafe2d34614bf911fa797818bca 16-Jun-2017 Wale Ogunwale <ogunwale@google.com> Log last home activity and result we tried to start

To help debug ANR.

Bug: 38121026
Test: manual
Change-Id: I484301810d07dcf7330dfdbab7310eac14638b90
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2ca51820f038fe612bc39906b40825b537ff54e5 15-Jun-2017 Sudheer Shanka <sudheersai@google.com> Merge "Use correct timestamps of events for logging." into oc-dev
04c3cc6d12012dcb39f8aef9a07143d91328ba77 15-Jun-2017 Jorim Jaggi <jjaggi@google.com> Merge "Use splashscreen if we can't fill horizontaly with snapshot" into oc-dev
42befc64c43377bfcec0e8cfe6fbcb9fdf5f0953 13-Jun-2017 Jorim Jaggi <jjaggi@google.com> Use splashscreen if we can't fill horizontaly with snapshot

A gap at the right side of the snapshot looks pretty bad. Thus,
we use a splash screen in case there would be a gap on the right
side. However, we don't want to do this from recents as we'd
produce another flicker

Test: go/wm-smoke
Test: Open app portrait, go launcher, rotate, open app landscape
Test: Open app landscape, go launcher rotate, open app portrait
Fixes: 62094756
Change-Id: Iaf1fecced822685187477a4698fa6b67c6e485d7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e3d4eb6b35d90b2ae6a562a3119d9a7b1d50b6f3 13-Jun-2017 Adam Lesinski <adamlesinski@google.com> Use UiContext with StrictMode Dialog

Bug: 62382723
Test: manual
Change-Id: I5cb5ac5de0800b31d0dad7698f9229873ff83e27
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c766db0a54679cd67884d7366cee8b6e8ecd447c 12-Jun-2017 Sudheer Shanka <sudheersai@google.com> Use correct timestamps of events for logging.

Currently when WM detects certain events, it will notify the logger
of these events asynchronously and logger uses the timestamp at which it
gets notified to log these events. It's possible that the delay between
when the event actually occurs and when the logger gets notified could be
large. So for better accuracy, WM should also pass on the event timestamp
to the logger.

Bug: 62375480
Test: Triggered sysui_multi_action event logs and verified that
APP_TRANSITION_DELAY_MS is less than APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS.
Test: When the system is not busy, the timestamps we used to log earlier
and timestamps we log with this change are almost same.
Change-Id: I5f62654a6b7f179d821c0082b180246c8a569df1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f1285916c3ab259b216e5f3da3dba397c8e898b8 10-Jun-2017 Wale Ogunwale <ogunwale@google.com> Added 'dumpsys activity lastanr'

Allows for dumping the activity state during the last anr. This will
also be included in collected bug reports.

Bug: 38121026
Test: Cause an anr to occur and run 'adb shell dumpsys activity lastanr'
Change-Id: I1e4200f9e5cc16bfab98e5af31fc599cdd54cd11
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
245281c056a5b880486671157b48d6c4e5815ce1 07-Jun-2017 Jorim Jaggi <jjaggi@google.com> Boost android.anim and wm lock sections to -10 during transition

-4 is not enough if we have to compete against RT and main thread
from top app that have -10. Boost it more during app transitions

Test: Inspect systrace, make sure priorities are right, including
getting reset after the transition.
Test: Open Chrome 100x
Test: go/wm-smoke

Change-Id: Id6b060b8aafded67b4bae61b6e8960e37976b096
Fixes: 36631902
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
18211fd8f6ff4a70a4b8b16fab642783d536102b 06-Jun-2017 Todd Kennedy <toddke@google.com> Passing callingUid to internal methods

Sometimes callers want to clear the calling identity [to avoid permission
calls]. In this case, allow passing the original calling identity to
internal methods.

Test: Manual; create profile account and observe launcher still works cross profile
Test: bit FrameworksServicesTests:com.android.server.pm.ShortcutManagerTest{1..10}
Change-Id: I73f8ad4b2dc1895227c3fcb14f3f1f18f600562f
Fixes: 38349978
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a30fdcb687c92cccbc21ba41a052d0bb311acd88 01-Jun-2017 Ivan Podogov <ginkage@google.com> Merge "Fix setRequestedOrientation() freeze on Android Wear." into oc-dev
c6467172e568dcd5a55b9c0470ef4587e59831e9 26-May-2017 Ivan Podogov <ginkage@google.com> Fix setRequestedOrientation() freeze on Android Wear.

In ag/1460784 and ag/1551198, logic of
ActivityManagerService.updateConfigurationLocked
(now updateDisplayOverrideConfigurationLocked) was changed a bit:
before those CL's, with (changes == 0) we were still calling
mWindowManager.setNewConfiguration(mGlobalConfiguration)
(which is now mWindowManager.setNewDisplayOverrideConfiguration).
Now, when there was a call to Activity.setRequestedOrientation, the
window becomes frozen and waiting for configuration, which is never sent
since there are no changes detected (which we don't know in advance when
freezing the window). This is important for watches, since they have
"square" screens, and resources configuration for them doesn't change
after requesting landscape orientation, i.e. display rotates 90 degrees,
yet the layout stays portrait. As a result, device becomes frozen.

This CL only moves mWindowManager.setNewDisplayOverrideConfiguration
call outside of the (changes == 0) check to restore the old logic.

Bug: 37684680
Test: go/wm-smoke (on Pixel), manual (on Wear)
Change-Id: Idf1f5989173494d51437b9a66296b4cac82d15c2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9be3a060827154617eed9132c64431af56d98eb4 31-May-2017 Erik Wolsheimer <ewol@google.com> Support multi-window on low-memory watches.

On watches, multi-window is used to present essential system UI, and thus it
must be supported regardless of device memory characteristics.

Bug: 37482466
Test: Manually, on a watch
Change-Id: I7929a090b7fd46de019d237ce771c82a6d7fd3f3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6fb15ea9d4d95cdb66a79764f38ec658f0053cc0 31-May-2017 Joe Onorato <joeo@google.com> Merge "Turn off logspam" into oc-dev
82ba91ddb4fe9d9ff8245e27f70dea64cc20553d 28-Apr-2017 Joe Onorato <joeo@google.com> Turn off logspam

For more information, see https://source.android.com/source/code-style#log-sparingly

Bug: 37252687
Test: development/tools/logblame/app_switch_test
Test: development/tools/logblame/power_toggle_test
Test: development/tools/logblame/medium_idle_test
Change-Id: Ie2f6ef33df7b6c1ea976a8180945651ac9482976
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
abe2a94853108dc522072a20ae1995c58587c775 30-May-2017 Dianne Hackborn <hackbod@google.com> Fix issue #62196301: Pre-O background restrictions allow starts...

...from background apps

The check for whether a calling app was in the foreground was
way too lose, treating anything better than a receive as foreground.
Now we use the same foreground state check as elsewhere.

Test: manual

Change-Id: I6bb621f207204d14abfadc0d425297e7d5efe0f6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e7ba686f63682246d2e2d856208d23e23c801079 24-May-2017 Winson Chung <winsonc@google.com> Ensure that windows are drawn before starting transition into PiP.

- Building upon ag/2125930, we ensure that all windows are drawn before
starting the enter PiP animation.

Bug: 37420370
Test: bit FrameworksServicesTests:com.android.server.wm.BoundsAnimationControllerTests
Test: android.server.cts.ActivityManagerPinnedStackTests

Change-Id: I73fb71681f62bbc684efedbd3d40c3e1a670db46
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3e6e3855ea10c92a0328c360fc8414e85fb3ad61 20-May-2017 Dianne Hackborn <hackbod@google.com> Fix issue #38393543: Not allowed to start service Intent

Turns out there was another path in to the activity manager
to trigger a PendingIntent, which needs to be modified to
now also pass in the whitelist token of that pending intent.

Test: manual
Change-Id: I755ff87db1b782fa6974d404dcb490786053c5e0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f5b6818009a70d77a272ca9b7b2aa167507dfd07 16-May-2017 Rob Carr <racarr@google.com> Merge "Preserve non-floating state when entering pinned stack." into oc-dev
c75bd416e9e8131f773bd0e6f89c2495d531917a 13-May-2017 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #38210653: Few more tweaks of job scheduler" into oc-dev
bfc2331f2f0bee2c12fe8f9cc8a2f3cca05feb86 11-May-2017 Dianne Hackborn <hackbod@google.com> Fix issue #38210653: Few more tweaks of job scheduler

- Now keep track of the time a job was enqueued, and order
the pending list by that.
- Added configuration constants for rescheduling: maximum
times to reschedule, minimum backoff times.
- Fixed printing of active jobs -- the method to get the current
JobStatus was old and didn't require the caller to hold a
lock, so made a copy, which didn't contain all the data we were
interested in. Now with our simple locking, we can just make
that require the caller hold a lock and return the real
JobStatus object.
- Include oom_adj and procstate when printing information about
processes being killed.
- Expanded documentation of BroadcastReceiver.goAsync().

Test: bit CtsJobSchedulerTestCases:*

Change-Id: I2e45f181e45be9836c74cbff1b844ffdf6e93019
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e2f908b6afa0e535963bc435aa6a44aa1d350c3c 13-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Work on issue #38242094: Activity manager oom adj computation seems broken" into oc-dev
ba99e9c72ceb916a22e4c33727ae882e1a83ae6c 12-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Merge "Add PID info into ANR crash log header" am: 2fe972c822 am: 5d57502c89 am: 5dbe26f0f1 am: 4ae323995d" into oc-dev
f4dd3711d1164ce6a442306615cac99119022215 12-May-2017 Dianne Hackborn <hackbod@google.com> Work on issue #38242094: Activity manager oom adj computation seems broken

This shouldn't change any behavior, but improve the reason we
report for each process's oom_adj / proc state level. There are
two significant things going on here:

1. We now consider a bump up in proc state to be just as significant
as a change in oom_adj, and accordingly update the reason when this
happens. Given how many proc stats we now have mapped to some of
the single oom_adj levels, this matches your expectation to have the
reason be why it is at that proc state and not just some random
other thing at that level.

2. There is special handling of an app at the top state connecting
to another app, deciding the actual state to apply at the end. This
was not at that point updating the reason, so anything the top app
is connected to would get the top state but myseriously have some other
reason, looking very broken. We now propagate the reason over.

Test: manual

Change-Id: Idecbe206d73e7c4cbd989ef6faf3b1679e06c088
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bb9218778c0092482c483cad0f04daee1011d7b1 12-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Reduce impact of RenderThread in system_server" into oc-dev
a41b729f8f5eae6e7aec59970b77bfb62d5528e5 11-May-2017 Jorim Jaggi <jjaggi@google.com> Reduce impact of RenderThread in system_server

- Don't try to persist snapshots during window animations. It can
wait and doing it later while decrease the load during window
animations, leading to less jank.
- Lower RT priority to 130 from system_server. It's only used for
background things.

Bug: 37631016
Bug: 36631902
Change-Id: I4fc21b53f257d0194a7f64c3064756ab2426ff17
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cad3c3251c2850715fe52fe6ffc370e1090132a4 11-May-2017 Andrii Kulian <akulian@google.com> Merge "Organize multi-window enabling" into oc-dev
351c1b5c0cacbc4e08a2738f67a3afa19bb8cd56 14-Apr-2017 Tsukasa Hashimoto <tsukasa.x.hashimoto@sonymobile.com> Merge "Add PID info into ANR crash log header" am: 2fe972c822 am: 5d57502c89 am: 5dbe26f0f1
am: 4ae323995d

Bug: 28713716

Change-Id: I2d83b2c741c8d6cbf730d093adc59ec80bf1899d
(cherry picked from commit 9191faf4eb07883240686f29228fdfc215fe413d)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
983055231b999e450def3e3df377fb4e23420711 06-May-2017 Dianne Hackborn <hackbod@google.com> Fix issue #37360626: Apps can schedule alarms (and other things) with temp whitelist

There is now an IBinder "token" that must be specified when setting
the whitelist duration for an Intent. To have the whitelist supplied,
the caller to send a PendingIntent must pass in the same token. The
PendingIntent and IntentSender classes now internally maintain this token
to pass in when their send() is called.

The big complexity for making this work is we now need to associate this
whitelist token correctly with the actual PendingIntent objects that
applications and other code is getting. To do this, we propagate the
token in the Notification object, and have a new API on Parcel that allows
us to make it available to PendingIntent when it is unmarshalled. And
this allows to deal with PendingIntents appearing in nested bundles, as
we can propagate that information from the original Parcel to the new
Parcel that Bundle keeps to delay unmarshalling.

Test: manual
Change-Id: Idda00490ccfe2be37e4ab21354b9ab7528a52750
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
18f622f08ce84bfb1a6cf19bca33d3ef0ad4aca9 08-May-2017 Robert Carr <racarr@google.com> Preserve non-floating state when entering pinned stack.

When transitioning between the fullscreen and pinned states
we often have a situation where we go from having a navigation and
status bar in the window to not. We'd like to use the source bounds
animation to crop these out rather than a sudden jump or scaling
but in order to do so we need to ensure they last until the end
of the animation. We track this state, and return the appropriate
value from isFloating. Furthermore, we add support to the bounds
animation to use the content frame as a source bounds when there
is no source bounds present, this means that we can crop out the
navigation and status bar so they will be invisible by the end of
the animation.

Bug: 37531386
Test: Manual
Change-Id: I72c549e3a3318534428d17b68ebee5832c32e6d7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
77840f9122750a650388551a4efac5990ddb94ff 09-May-2017 Andrii Kulian <akulian@google.com> Organize multi-window enabling

Use AMS#mSupportsMultiWindow to indicate if some form of multi-window is
supported.
- If no multi-window implementation is enabled, this will be always set
to false.
- If a corresponding config is set to false, it will disable all forms
of multi-window.

Bug: 38173505
Test: android.server.cts
Change-Id: I7efe07e2fe073891dd55844979156831097c28b7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
54a3ce2d0ea0639514ab81a1df233fd12f5eade6 09-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add some logging for buggy calls to AM" into oc-dev
0d8882e48793a5bb59343ee772a21b3a15aba9c2 09-May-2017 Amith Yamasani <yamasani@google.com> Add some logging for buggy calls to AM

Log which uid/pid/transactioncode caused a problem in
ActivityManagerService.

Bug: 38130899
Test: N/A
Change-Id: Ice50c472768780b8864651fb31d972094a4993c1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b73435cdedb03bbe03ccb3de3a51313d06ede09c 08-May-2017 Christopher Tate <ctate@google.com> Don't bring up backup agents in secondary app processes

When an app needs to be launched to make its agent available, we
were taking action in response to the first 'attach' operation we got
from any process running as the right uid. This turns out to be fraught;
it's possible that some other secondary-process component launch was
racing with the agent bringup request, such that the attach callback
arrives from that secondary app process instead of the main process.
*That,* in turn, can be fatal if it turns out to be an isolated
process or similarly incapable host environment for the agent.

So now we make sure it's actually the process we're waiting for
when deciding to instantiate the agent there.

Bug 38123540
Test: manual

Change-Id: I01648027d104cc93fe0ec9227ebab85ad3d83c88
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1801f688b9790375a9f7a8fb89629bcf18f9c52e 07-May-2017 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #38037532: Toasts cause apps to become foreground" into oc-dev
6f4aab2c01280fc563fb1535621c0d0d7cb34221 06-May-2017 Jeff Sharkey <jsharkey@google.com> Merge "Offer to wait until broadcasts have drained." into oc-dev
f965f4038cfe775bfee973850d62caf3138076c8 05-May-2017 Dianne Hackborn <hackbod@google.com> Fix issue #38037532: Toasts cause apps to become foreground

ForegroundToken is now ImportanceToken, and doesn't actually
cause an app to become foreground (that is not needed for
toasts anyway).

Also improved output and logging -- new logs for changing
in key uid stats, and when force stopping services after a
uid goes idle.

Test: manual

Change-Id: I44dd391bb8d37857be1359f4b7021dc8d2cd0285
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fd65813157e4dd7fa9f0b7c5dd4c8f536cc6316a 03-May-2017 Jeff Sharkey <jsharkey@android.com> Offer to wait until broadcasts have drained.

We've seen evidence of lab devices racing with other apps that are
using cache space immediately after tests wipe it clean, which can
cause test failures. To mitigate this, try our best to wait for the
device to go "idle" by watching for broadcast queues to fully drain.

Also improve javadocs along the way.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Bug: 37486230, 37566983, 37913442, 37914374
Change-Id: I4d430db443b6fa6d33a625fe07b90279b5d51c12
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f57b93cd0a2289f32a035f43722546162fc17442 05-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Update process state after unbinding a service." into oc-dev
802d008e1b1c766b375fce9c776cc76a0c6cbf5a 05-May-2017 Jorim Jaggi <jjaggi@google.com> Merge "Add TRON logging for bindApplication" into oc-dev
515dd689ad3fdef0f59088ff0206e4650ecec3eb 05-May-2017 Jorim Jaggi <jjaggi@google.com> Add TRON logging for bindApplication

Such that we know how much startup latency is the system to blame
and how much of it is the client process to blame.

Test: Open dead app, inspect logs
Change-Id: Ib8d359c2d59ef6f90893928f2b1d4e2ac2590d74
Fixes: 37327717
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e7e6ce027c418e6ee7cc22ae81de0277bb7cd875 05-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "ActivityManagerService: Add an overall stack dumping timeout." into oc-dev
385c3ad9955d729ac691f221e82131c349a42b74 04-May-2017 Amith Yamasani <yamasani@google.com> Update process state after unbinding a service.

Bug: 37334267
Test: manual
Change-Id: I5304ea26a1e742523b7b22fa0c7e1ab7d1ece9b3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c45d88b602bebda0fa3cbfac5bebff72d932a83f 04-May-2017 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #37938835: Undismissable "Camera is running in the..." into oc-dev
dbe2bbbdab71154faa64f4e0b1bad4484df93611 03-May-2017 Narayan Kamath <narayan@google.com> ActivityManagerService: Add an overall stack dumping timeout.

An ANR can result in stack dumps of a generally unbounded number
of processes. Dumping occurs on a thread that's patrolled by the
watchdog, so we should make sure that all dumps trigger within a
specified timeout.

Test: Manual; by setting the timeout to 1s.
Bug: 37177331

Change-Id: I626272dfbcc9f8b57c1ef1321fac43cdb937a885
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c5e289d4799db7037ff53ae0e10c0b94e7844088 04-May-2017 Winson Chung <winsonc@google.com> Merge "Workaround launching PiP task with CLEAR_TASK & NEW_TASK flag." into oc-dev
1d01f9cf67259c7c2c6a8b882dc59b284d1ff588 04-May-2017 Karthik Ravi Shankar <karthikrs@google.com> Merge "Rename CompatibilityDisplay to Vr2dDisplay" into oc-dev
2b9aaedf6310694de31301659ce604ff195b32ee 01-May-2017 Karthik Ravi Shankar <karthikrs@google.com> Rename CompatibilityDisplay to Vr2dDisplay

CompatibilityDisplay used for displaying 2D activities in Vr world. This
is confusing in more than one way. To clarify what it really means,
rename it to Vr2dDisplay.

Changes in this CL -

- /s/CompatibilityDisplay/Vr2dDisplay
- /s/Compatibility/Vr2d - in CompatibilityDisplay context.

Bug: 37851944
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
CtsServicesHostTestCases android.server.cts.ActivityManagerDisplayTests
passes on Marlin.

Change-Id: I0a442302fa9d0f48bbd0c01a7766b94369e04386
Signed-off-by: Karthik Ravi Shankar <karthikrs@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
be68d49cdb85458e7b8143ac8ccc64f80d32e5f5 04-May-2017 Dianne Hackborn <hackbod@google.com> Fix issue #37938835: Undismissable "Camera is running in the...

...background" notification even after force stopping camera

Ensure we have a message scheduled to dismiss the next app every
time we go through the app list. Also don't show the notification
for an app when it is in the foreground.

Test: manual

Change-Id: Idd93c8d9f8252b880c8b4bf069c71ad71a6b27c9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e6385a23d7d7e0628544c9751c59507d1df7885c 03-May-2017 Winson Chung <winsonc@google.com> Workaround launching PiP task with CLEAR_TASK & NEW_TASK flag.

- When launching an activity with CLEAR_TASK and NEW_TASK, the result code
of the start is START_SUCCESS, but we still need to notify SystemUI to
expand the PiP. However, because the PiP transition now waits for the
first draw, this can cause severe jank and delay if the original activity
is a trampoline activity. As a workaround, we immediately move the task
to the fullscreen stack when clearing and restarting the task to ensure
that the new task shows without delay.

Bug: 37501224
Test: Open YT in PIP, launch sub-shortcut from Home

Change-Id: I16bebf19b082f30695e99da1d93bc4adf5e9df0c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d4fc4c7f28da76e4ecb9d47e614cd1d1041f9044 02-May-2017 Sudheer Shanka <sudheersai@google.com> Reduce the timeout for waiting for the network state update.

Also add more info to wtf log.

Bug: 27803922
Test: manual
Change-Id: I746c7814a77eccc9206c36fa1fb5114a6baa3735
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
83b40f69bef4ba17bb63ac30d52f661a12d5b4f4 26-Apr-2017 Dianne Hackborn <hackbod@google.com> Work on issue #36891897: Need to ensure foreground services can't...

...hide themselves

The activity manager now keeps track of all apps that are running
foreground services and builds a notification showing them to the
user. We ensure they are shown to the user for at least 30 seconds
(configurable). If foreground services are executed while the
screen is off, their apps will be shown to the user for at least
30 seconds after the screen turns back on.

While doing this I am also adding a new process state to distinguish
between "important background" stuff that should bypass bg check vs.
ones that don't. By default, these now no longer bypass bg check,
which is really the expected (and documented) behavior. There is a
new bind flag to allow them to bypass bg check, which is currently
only used by the IME.

Also add some new job scheduler commands that will be used to
write new tests cases for jobs timing out.

Bug: 36891897

Test: manual

Change-Id: Ied3f7b56444254513fd776f06b88bc0e54704958
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1be5354aba7fdcb877125731a05debe35b39114f 28-Apr-2017 Dianne Hackborn <hackbod@google.com> Fix issue #37324532: API Review: android.content.pm.InstrumentationInfo

targetProcess -> targetProcesses

Test: bit CtsAppTestCases:InstrumentationTest

Change-Id: I859985c689cc588c585cd0ec6e0a20411493a7c0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0aa4c5065d1495ec0b2c6fe15324569f31dcbdb1 26-Apr-2017 Felipe Leme <felipeal@google.com> Refactored Autofill to move starting flag out of Session.

Otherwise, all onFillRequest() calls in the same partition would use
the same flags.

Fixes: 37675138
Test: existing CtsAutoFillServiceTestCases pass
Test: CtsAssistTestCases pass
Test: PartitionedActivityTest.testAutofill4ParitionsMixManualAndAuto() pass

Change-Id: I03c8a036637bae534904d4f41265e451088cf940
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
70c0221813d515c3496eb1ea1037198e9ad8ad44 28-Apr-2017 Svetoslav Ganov <svetoslavganov@google.com> Merge "Implement the rest of autofill importance modes" into oc-dev
fd31f85d0c6f19138d06d565d2b30b59e241a960 27-Apr-2017 Svet Ganov <svetoslavganov@google.com> Implement the rest of autofill importance modes

Test: CTS tests pass; augmented tests to verify new behavior

bug:36171235

Change-Id: Ieff2b8d7e1c3a3eba456deca7bed70c8e29c415e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f51625145346429c2ede305ed7c5a6f52cfae30d 28-Apr-2017 Joe Onorato <joeo@google.com> Merge "Turn off log spew, and make it use Slog.w instead of e.printStackTrace" into oc-dev
301663a61bda0e2eb863d6518de882cf805abcf7 27-Apr-2017 Makoto Onuki <omakoto@google.com> Merge "Change IMPORTANCE_PERCEPTIBLE_DEPRECATED to IMPORTANCE_PERCEPTIBLE_PRE_26" into oc-dev
213161f05d6825d20010e55fa932efc75bd2860b 27-Apr-2017 Joe Onorato <joeo@google.com> Turn off log spew, and make it use Slog.w instead of e.printStackTrace

That said, it's happening.

system 04-26 17:01:43.344 1000 1140 2684 W/ActivityManager: Failed setting process group of 21751 to 0
main 04-26 17:01:43.344 1000 1140 2684 W/System.err: java.lang.IllegalArgumentException: Given thread 21496 does not exist
main 04-26 17:01:43.349 1000 1140 2684 W/System.err: at android.os.Process.setThreadPriority(Native Method)
main 04-26 17:01:43.349 1000 1140 2684 W/System.err: at com.android.server.am.ActivityManagerService.applyOomAdjLocked(ActivityManagerService.java:21704)
main 04-26 17:01:43.349 1000 1140 2684 W/System.err: at com.android.server.am.ActivityManagerService.updateOomAdjLocked(ActivityManagerService.java:22015)
main 04-26 17:01:43.349 1000 1140 2684 W/System.err: at com.android.server.am.ActivityManagerService.updateOomAdjLocked(ActivityManagerService.java:22093)
main 04-26 17:01:43.349 1000 1140 2684 W/System.err: at com.android.server.am.ActiveServices.unbindServiceLocked(ActiveServices.java:1239)
main 04-26 17:01:43.349 1000 1140 2684 W/System.err: at com.android.server.am.ActivityManagerService.unbindService(ActivityManagerService.java:18127)
main 04-26 17:01:43.349 1000 1140 2684 W/System.err: at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:594)
main 04-26 17:01:43.349 1000 1140 2684 W/System.err: at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2936)
main 04-26 17:01:43.350 1000 1140 2684 W/System.err: at android.os.Binder.execTransact(Binder.java:674)

Bug: 37252687
Test: development/tools/logblame/app_switch_log_test
Change-Id: I138147c34141e212256012afe8aaf239f3443b82
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
709904f8003a7122e185cfd32d1209e0e6975b77 25-Apr-2017 Winson Chung <winsonc@google.com> Updating PiP API and documentation.

- Renaming PictureInPictureArgs to PictureInPictureParams, making it
immutable and built with a builder class. In addition, making the
aspect ratio rational.
- Moving the check to get max number of actions to the activity to have
more flexibility going forward
- Also ensures that enterPictureInPictureMode() returns true if the
activity is already in PiP mode.
- Will follow up with CL to remove PictureInPictureArgs and related methods
once this CL drops

Bug: 35765211
Bug: 37638323
Bug: 37637423
Bug: 37636674
Bug: 36342780
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: android.app.cts.PictureInPictureParamsBuilderTest

Change-Id: I54a487d55a59c9ce8ac7bd6c80c61209c8b26224
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e92f79450a0e3a55586eb2992577d09fc997761a 26-Apr-2017 Makoto Onuki <omakoto@google.com> Change IMPORTANCE_PERCEPTIBLE_DEPRECATED to IMPORTANCE_PERCEPTIBLE_PRE_26

Also make sure to return the legacy value from
RunningAppProcessInfo.importance.

Bug: 37636026

Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsAppTestCases -t 'android.app.cts.ActivityManagerTest#testGetRunningAppProcesses'
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsAppTestCases -t 'android.app.cts.ActivityManagerTest#testGetMyMemoryState'
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsAppTestCases -t 'android.app.cts.AlertWindowsTests'
Change-Id: Ie04e4dfa40c28ea391ae5ce3c769c6f8ee70a43d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0a4b7f5a867612fffc14cbc480da306e89ec4892 26-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add concept of implicitly exposed components" into oc-dev
5b4e16c3a5e08a3fa8b99b4c1d0aae4b514a6b7d 26-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Ensuring that isPictureInPictureMode() mirrors dispatched mode." into oc-dev
c05f5d12d9a1b98221833ec0919d081a869d2486 25-Apr-2017 Todd Kennedy <toddke@google.com> Add concept of implicitly exposed components

Implicitly exposed components are those that can still be accessed
via generic startActivity() calls. However, they cannot be started
by specifying a package or component. Additionally, package info
can't be obtained if the package only has implicitly shared
components.

Change-Id: I404a4dff87559cfeee6ad78f7dcc7f5d849d6869
Fixes: b_37343345
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ecabc596b71e2d5780afc788997a79f8bc627166 25-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Do not deliver INSTALL_SHORTCUT." into oc-dev
4288311d5381c87c3e85f6f9cbe087f162cc84a9 25-Apr-2017 Winson Chung <winsonc@google.com> Ensuring that isPictureInPictureMode() mirrors dispatched mode.

- When transitioning out of picture-in-picture, we schedule
onPictureInPictureModeChanged() when the animation starts, so the check
in isInPictureInPicture() should match this as well.

Bug: 36845078
Test: Updated android.server.cts.ActivityManagerPinnedStackTests to also
whenever PipActivity PiP mode changes, that it matches the activity
state as well.

Change-Id: I31d7a3307b01b818e867f86a4553a363c7f11307
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
24c9ed390038df1122482a2514d1073a250bfee7 22-Apr-2017 Makoto Onuki <omakoto@google.com> Do not deliver INSTALL_SHORTCUT.

(And pretend it succeeded.)

Test: manual test with Hangouts and Nova.
Bug 37511844

Change-Id: Ie6453bc1bd40d6e5874ca14ed6a49f9e3378d182
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0fa2574ecb2dbc2258065d4803afc35c2474c346 21-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix issue #32180780: Sync adapters inappropriately being run..." into oc-dev
f9bac16d61db0fceb15484587ecf876c2b802c37 21-Apr-2017 Dianne Hackborn <hackbod@google.com> Fix issue #32180780: Sync adapters inappropriately being run...

...during full-data backup/restore

The activity manager now tells job scheduler service about the
current backup that is running (only if it is a full backup), it
there is a new condition where we won't consider jobs associated
with the current backup to be ready to run.

Also... just a little optimization here. :) The focus is on
scheduling jobs with a 0 deadline, meaning they should run right
away. Now the timing controller does a quick check for a new
job to see if its constraints are already satisifed, and doesn't
do anything further if that is the case (doesn't add to the list,
doesn't re-evaluate alarms, etc). And in the path to scheduling
a job, we do a check to see if the new job is already ready and if
so then just directly add it to the pending list and schedule it.

Doing this required removing what I think is the last bit of code
relying on handler serializing for thread safety, so now everything
in the job scheduler is protected by our global lock and we can
do whatever we want with the lock held and be assured the state
remains consistent.

Also did some small optimizations to many of the other controllers,
mostly switching from an ArrayList to an ArraySet for their tracked
jobs, since one of the things we do frequently is add/remove jobs.

Finally, added some nullability annotations to the JobScheduler
APIs.

Test: bit CtsJobSchedulerTestCases:*

Change-Id: I533fad94ba59468a52fe3d077a0ceab3427f0012
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fea6f7b799225f6f0211d7114c779183adbf7b6b 19-Apr-2017 Julia Reynolds <juliacr@google.com> Remove long standing debug code

Because it stops real errors from bubbling up to the calling app.

Test: make, post notifications
Change-Id: I0e59c61b0a60302a5fd023b7ad909e84b97e5df5
Fixes: 37494547
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d347205e631257708e8ad7467b194d581828fb54 21-Apr-2017 Christopher Tate <ctate@google.com> Fix #37305009 : Beam crash in secondary users

The background-policy check for a-priori app uids needs to be an appId
check rather than nominal uid.

Along the way, even though the code is not invoked after the boot
sequence currently, make the "is this uid on the a-priori list?"
check thread safe.

Bug 37305009
Test: manual

Change-Id: I7c2525f86e73b213057cd4b7f327191ec20c4a6d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1f4e053aef81e38ed905c210687c00d8f8d8bda4 20-Apr-2017 Chad Brubaker <cbrubaker@google.com> Merge "Address API review comments for registerReceiver" into oc-dev
8f40881e3e801e3372a738df29eefdbeea33d706 20-Apr-2017 Sudheer Shanka <sudheersai@google.com> Merge "Revert "Add new api Activity.getStartInitiatedTime."" into oc-dev
9b32a057c76e460cfa157e6e7346c62a83a502f1 20-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "don't blindly reuse content providers" into oc-dev
8305a1fb38ebb701af7cef2b8698315e2d9ffd17 20-Apr-2017 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #37306208: CTS: ServiceTest#testForegroundService..." into oc-dev
6d6015f652f1b7bca129a22b1bd256b990e3ca28 18-Apr-2017 Chad Brubaker <cbrubaker@google.com> Address API review comments for registerReceiver

Bug: 37465538
Test: manual; Verified that Instant Apps can send broadcasts to
receivers still via the changed API.

Change-Id: Ib0f3d0c8ee71234288ccecd07e621554eb9b70ac
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7bed530d27c8bdda09535a57b68d33e79fb7b633 19-Apr-2017 Todd Kennedy <toddke@google.com> don't blindly reuse content providers

when a provider is already running, we would automatically
give it out to other processes that request it. for instant
apps, don't do that.

Change-Id: I159913adc599e88dac6253104776589592b251fd
Fixes: 37501319
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
55337a831aaa9920ed52d3bc41b80c40591222f8 19-Apr-2017 Sudheer Shanka <sudheersai@google.com> Revert "Add new api Activity.getStartInitiatedTime."

This reverts commit bc308988bdcb76d67c80e85183bcfa8128f73890.

Change-Id: Ieaca7c9ec8b4affbb8ce98ebbcb663a531904bf8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f82236ef0ae4ca818a639a5e9deb07bc95feeb28 19-Apr-2017 Dianne Hackborn <hackbod@google.com> Fix issue #37306208: CTS: ServiceTest#testForegroundService...

..._removeNotificationOnStop failure

We weren't removing the foreground timeout when a service is
brought down and still waiting for the app to make it foreground.
Instead, turn this in to an immediate crash of the app when we
detect it while bringing down the service. Also make various
paths more robust against trying to do things with a ServiceRecord
that isn't currently in ActiveServices.

Test: bit CtsAppTestCases:ServiceTest

Change-Id: I06f4ac48fb983483569677ab1ac6e5b0b681c4ae
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f20b596365301bcdd515e7f977409ed7bfb28f76 18-Apr-2017 Winson Chung <winsonc@google.com> Disable PiP when a task is locked.

Bug: 37135610
Test: Start PiP, enable screen pinning, ensure that PiP is dismissed.
Change-Id: Ie5165364db891b13dd4ef282089f915fe9f99615
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
00ed0baca874e171ecb39e51edfe0ee6eb6646f2 18-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Turn down the preliminary foreground service API" into oc-dev
eef5d285f954dee81debe520762ca865e134e9d4 18-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Account for content insets in source rect hint for transition into PiP" into oc-dev
4bcc9bf0f22c296f49c27fb4fd686f2e2fe0e94e 18-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix issue #36858643: Runtime restart on OPR1.170323.002" into oc-dev
8802eac3d8831e7af867f19d0bb1df3daa603140 17-Apr-2017 Winson Chung <winsonc@google.com> Account for content insets in source rect hint for transition into PiP

- As a part of transitioning into PiP, we remove the content insets, and
as a result, we also need to adjust the source hint rect for the change
in insets as well.

Bug: 37418994
Test: Enter PiP from YT, ensure no jump at the end

Change-Id: I74219b05c91d3c8b8466dd8fff4d6dd692f08725
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
242ba3e997b45ec7ab5f8c40663c9044a13ad31f 15-Apr-2017 Christopher Tate <ctate@google.com> Turn down the preliminary foreground service API

The NotificationManager.startServiceInForeground() experiment is over,
and will not ship as API, so it's time to tidy up and get rid of it.

Bug 36130212
Test: manual

Change-Id: I834d1ce059aa464ff27f69f5e5d3625cc5e61d8a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e4d1a2e0daf8a3a6fa6b0f327523ebc381386cde 15-Apr-2017 Dianne Hackborn <hackbod@google.com> Fix issue #36858643: Runtime restart on OPR1.170323.002

We had a layering problem between alarm manager, device idle
controller, and activity manager. The layering should be, from
bottom to top:

activity manager
alarm manager
device idle controller.

However in the path of activity manager's PendingIntent.send(),
it would do a direct call to device idle controller. It was
careful to do this without its lock held, but that isn't enough.
In this case, alarm manager is doing send() with its lock held,
expecting that to be safe, but it ends up causing it to call up
in to device idle controller via the activity manager (in order
to update the temporary whitelist).

To fix this, activity manager now has an internal data structure
representing pending temp whitelist requests, and all it does is
add to that during the call in, scheduling a message to later
dispatch those to device idle controller. But to make things
correct, we need to use this data stucture to act like the uid
is already on the temp whitelist even before we actually dispatch
that message. (So we don't have races with things calling
startService() for example.) So all the existing stuff looking
at the temp whitelist that is handed down by device idle controller
will also consult with this data structure of pending changes.

Test: bit CtsAppTestCases:ActivityManagerProcessStateTest

Change-Id: Id444b7ad3e694dc977c7f4fa236fbad855ce4066
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8bca9e47c17c86a3092d5384b14713c5b50dd78c 17-Apr-2017 Winson Chung <winsonc@google.com> Schedule PIP mode changes at the beginning/end of the transitions.

- When transitioning from fullscreen to PiP, ensure all PiP/MW/Config
changes come after the transition completes, and inversely, from PiP to
fullscreen, ensure that all changes come before the transition up starts
- Add a series of tests to verify the callback state when the animation
is canceled
- Also fixes an issue where the surface is preserved when we don't want

Bug: 37169080
Bug: 37103000
Test: bit FrameworksServicesTests:com.android.server.wm.BoundsAnimationControllerTests
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: I6425c95df358358ed76d9cc8a130606c2124062e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2359f016e28b0eca5974606013f99bdaef57bc22 15-Apr-2017 Sudheer Shanka <sudheersai@google.com> Merge "Add new api Activity.getStartInitiatedTime." into oc-dev
bc308988bdcb76d67c80e85183bcfa8128f73890 13-Apr-2017 Sudheer Shanka <sudheersai@google.com> Add new api Activity.getStartInitiatedTime.

This api will return the timestamp at which this activity start was last
initiated by the system. Implementation is wip.

Bug: 9058261
Test: cts-tradefed run singleCommand cts-dev -m CtsAppTestCases -t \
android.app.cts.ActivityStartTimeTest

Change-Id: I396458ecefbb09108f414b95f9c0beb6d609a4e1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2e86be7653022e1b76abe1d54941d8c235150f99 14-Apr-2017 Winson Chung <winsonc@google.com> Merge "Fix issue where we weren't dismissing the pip menu activity." into oc-dev
4191d996149505b8c70363b202cf4c36e71b4549 14-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I789945c1,I532b0928,I62c6df8b,Ib2bd81ad into oc-dev

* changes:
Fixing missing movement bounds notification to SystemUI.
Fixing animating bounds regression.
Tightening up rotation behavior for PIP (2/3)
Tightening up rotation behavior for PIP (1/3)
40a5f935acea488086ea1b6df7d5d09e74ea518f 14-Apr-2017 Winson Chung <winsonc@google.com> Fixing animating bounds regression.

- Prior to ag/1954388, we used getAnimatingBounds() to get the final target
bounds if animating or the current otherwise, but since we needed the
target bounds to calculate the window scale even after the animation
completes, the clearing of mBoundsAnimationTarget was removed.

This inadvertently broke the check in getAnimatingBounds() from ever
returning the current bounds (as it's never empty)! This CL fixes the
issue, and renames the related methods to better reflect what they are
doing going forward.

This caused a regression when calculating and notifying SysUI of the
movement bounds, which was never the current bounds, but the default
bounds. Leading the IME change to trigger the PIP to move down.

Bug: 37242422
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: Source hint rect animation still works

Change-Id: I532b0928ebfeaf95e9754a0254306af6fbb35833
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3a68287c6cbb5327f824515fa128117300806fac 10-Apr-2017 Winson Chung <winsonc@google.com> Tightening up rotation behavior for PIP (1/3)

- Defer getting the default bounds until after the task has been reparented
to the pinned stack
- Also move pinned stack-related methods into pinned stack window
controller and listener

Bug: 36879891
Test: android.server.cts.ActivityManagerPinnedStackTests

Change-Id: Ib2bd81ad9e2a3829b556177010f39c7512ba35bf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e62c211fabc213ee8ae3d35176f68de5aa15098f 14-Apr-2017 Christopher Tate <ctate@google.com> Turn down dynamic toggle for background restriction policy

Bug 35248677
Test: manual

Change-Id: Ib2a85df27a0de7f205783506bd3d2afe2da92baf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
be4a808b3d0e3c4a8d530d7f6a7b88856ebbb672 13-Apr-2017 Winson Chung <winsonc@google.com> Fix issue where we weren't dismissing the pip menu activity.

- Also don't crash if we get a deferred call to resize the pinned stack
that no longer exists.

Bug: 36049843
Test: Try to pinch and expand pip
Change-Id: I64c42e47c466c641464c4f22a20bded2209e29eb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
29c70437b337a8645fc2fb1e47c947b895af9180 13-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add new facility to find out when a PendingIntent is canceled." into oc-dev
f66adfd1cd0dd565d7ba497da28a407e69995272 13-Apr-2017 Dianne Hackborn <hackbod@google.com> Add new facility to find out when a PendingIntent is canceled.

This is just an internal API in the platform, not (yet?) available
in the SDK. But it will be useful for system services that want to
clean up state if a pending intent that has been registered with them
is canceled (either explicitly by the app, through the app being
uninstalled, etc).

Also improve the activity manager's dump of pending intents to
organize them by package, making it much easier to read (now that
we have so many active pending intents these days).

Test: ran and booted. no CTS, since no API.

Change-Id: Iad029cfedcd77e87357eca7da1b6ae94451dd981
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
809f4cf1219cd3afb74f5112325cfefd26a8bb54 13-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Debugging issue #37272284: ActivityManager: SELinux tag not defined" into oc-dev
c62f0d74954da92539bf8ea9eea852703b8a852d 13-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Work on issue #36427964: SecurityException: Unable to find app..." into oc-dev
d5a8b43f8eed211cc354966fb524782836576cf3 13-Apr-2017 Dianne Hackborn <hackbod@google.com> Debugging issue #37272284: ActivityManager: SELinux tag not defined

Add a little more info to the exception message.

Test: manual
Change-Id: I7ccbd5720d0e6c22a6caa9bfcb24cf40effde804
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7040f573f3bb3b424d5bf00856ee5c7e421575c0 13-Apr-2017 Rob Carr <racarr@google.com> Merge "Fix auto-pip visibility issues." into oc-dev
ad6ab44e15a86c1130eef3b638343d47b5ada0e1 12-Apr-2017 Dianne Hackborn <hackbod@google.com> Merge "Add API to get a uid's current importance." into oc-dev
83249ec4f17494484f7923c90b3800a966fd6da3 12-Apr-2017 Dianne Hackborn <hackbod@google.com> Add API to get a uid's current importance.

This is kind-of useful to go along with monitoring
uid importance changes.

Test: none yet

Change-Id: Ic0f8418955d17ea21d06f49dcd9641bc5f32387b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c33658e597347b733dc1a7859bebdb5da06738dc 12-Apr-2017 Robert Carr <racarr@google.com> Fix auto-pip visibility issues.

In the case that we defer stop for auto-enter picture
in picture, we should also defer changing the visibility. This causes
particularly awkward issues with SurfaceView as the views are left
in a severed state.

Test: Auto-pip Chrome from youtube. Things look alright!
Bug: 36355266
Bug: 36640131
Change-Id: I77de1c3eb9c61b03740cbe49f88dec1af2ed6577
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e7c5ced2119f89b8e8b722b9010e685db8168b69 12-Apr-2017 Charles He <qiurui@google.com> Disallow direct-boot aware activities to bypass work lock

Effectively reverting 89927b3cd96472c478a988d6c731cd09d412a043, which
allowed direct-boot aware activities in the work profile to show before
the profile was unlocked. This causes problems with key eviction
introduced in O. Specifically, many system activities (e.g.
ChooserActivity, activities in Settings, etc.) are marked direct-boot
aware, and therefore can be started while the work profile is locked
with key evicted. Currently they either bypass the keyguard when they
should not, or simply crash due to profile still being locked.

In the future, we need to create a new mechanism to allow activities
such as video calls, alarm clocks, etc. to bypass the work keyguard. It
probably involves checking for something like FLAG_SHOW_WHEN_LOCKED.

Bug: 36961785
Bug: 35708183
Bug: 30296144
Test: manual, by following the steps in the bugs quoted
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
Change-Id: I5ccaaf963f3dd96e4abb785a10aa258b15363178
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c75587ed5b08c57b7119c424becbf2d80326accb 12-Apr-2017 Dianne Hackborn <hackbod@google.com> Work on issue #36427964: SecurityException: Unable to find app...

...for caller android.app.IApplicationThread

Verify, if we don't find the caller on the LRU process list, that
it isn't actually on the main list. (And if it is on the main list,
we can now recover from that.) Also fix the error message when this
fails for startService() to print the correct calling pid.

Test: booted and ran

Change-Id: I0a81c679bb7e6eb15b854ed4b457d01b386d5dba
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
72790bade5f6f2c3673145f39c1e416666f7f579 08-Apr-2017 Andrii Kulian <akulian@google.com> Merge "Use feature instead of hidden config for multi-display" into oc-dev
1981f5fd17de4627201363ca57e90927a8a243fd 08-Apr-2017 Andrii Kulian <akulian@google.com> Use feature instead of hidden config for multi-display

Using a feature will allow app developers to find out if a
particular device supports running activities on secondary
screens before using the APIs.

Bug: 36776777
Test: android.server.cts.ActivityManagerDisplayTests
Change-Id: I7121bdb782cac9df70121e9df5cbf3fcb76f4a93
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
77d23337fb1ff687efc2c8588ea6931ea13421a5 08-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Don't show alert window notifications when in Vr mode." into oc-dev
597f3906815ddd3627812378513332238680bfea 07-Apr-2017 Andrii Kulian <akulian@google.com> Add hidden API to check support of Multi-Display

Added ActivityManager#supportsMultiDisplay() to check if system
supports running activities on secondary displays.

Bug: 36776777
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testMultiDisplayDisabled
Change-Id: I18f98f2f6a9e865ad8dc63a470210190536d3271
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a10fc7e294771dc97536a3fdae6f2d105bb3ed55 06-Apr-2017 Wale Ogunwale <ogunwale@google.com> Don't show alert window notifications when in Vr mode.

Change-Id: I6ef60682197f6581fb101598290b2390ea676091
Fixes: 35854095
Test: manual
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ff15be677bfb030e43f310cf69bbb695eab5f2a1 07-Apr-2017 Andrii Kulian <akulian@google.com> Merge "Add system config to specify Multi-Display support" into oc-dev
9e96ecfe9c9809e0dfdd271e08030a177c731a2a 07-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Preserve app window when it requests a relaunch" into oc-dev
eafd9db682c56c80cea19ec24001f5b162db5f0d 06-Apr-2017 Andrii Kulian <akulian@google.com> Add system config to specify Multi-Display support

Added config_supportsMultiDisplay. Devices that have the config set
to false will not allow launching activities on secondary screens.

Bug: 36776777
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testMultiDisplayDisabled
Change-Id: Iebb79044440866b1693897b0b53ccb987b5fd8e0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
71735d38b1a56410dff6933e0f6f63878db6042d 06-Apr-2017 Wale Ogunwale <ogunwale@google.com> Preserve app window when it requests a relaunch

Help allow blank screens when the app calls Activity.recreate().

Test: Take YouTube app in-out of split-screen and make sure there is't
a hole
Fixes 36567223

Change-Id: Ic4915153c2cb88cce9a1bea7500cf89be14c5aa4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f1bfee1ca2e1b66b823a2041627e97141fbb79ff 25-Mar-2017 Winson Chung <winsonc@google.com> Disable PiP when VR mode starts.

Bug: 36214284
Test: Ensure that PiP is stopped when VR is enabled.
Change-Id: Ib537e1f360be7b47199d230e5691f6fece0f925f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
279d34af31af65b6233dbc225205871642a8514b 31-Mar-2017 Ruben Brunk <rubenbrunk@google.com> Refactor VR state management in ActivityManagerService.

- Move VR-related state from ActivityManagerService into
VrController.
- Move VR-related render thread scheduling logic from
ActivityManagerService into VrController.
- Update state logic to better enforce invariants.

Bug: 36214284

Test: Covered by existing tests.
Change-Id: I02d1488da0c0f65a10dd0369f38f1a0c47cee174
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
424b03f75e98c8af4061236ef1dd2785f5608299 04-Apr-2017 Christopher Tate <ctate@google.com> Allow background default container service in a less crashy way

Turns out we run this code during early boot, before the device idle
service has even been constructed yet. Find another way to achieve
the needed service execution.

Bug 36865930
Test: manual

Change-Id: I8e3304f37c3a5ee125b73aef2b7d7c7b387aa200
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
36db127e4733ea8ef41a96be5b683e1a2e705677 28-Mar-2017 Jorim Jaggi <jjaggi@google.com> Boost thread priority when holding the WM lock

Test: Take systrace of open app, make sure thead is boosted while
doing stuff in WM
Test: Run WmSlam with and without boosting. Observe an
improvement.
Bug: 36631902
Change-Id: Iadb036f8d12bbf59091466500e82207cf6fa85d5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a52fc49845d1103dea2380f34b96e2a22ea1801e 04-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Themes: Apply themes to system_server safely" into oc-dev
9f467df80493159c2a367ef8d08c79a14a7d52aa 04-Apr-2017 Bryce Lee <brycelee@google.com> Merge "Clean up activity/stack associations." into oc-dev
af691c0be7bbfea63e880dd717c51a38a0bc874a 20-Mar-2017 Bryce Lee <brycelee@google.com> Clean up activity/stack associations.

The stack currently holds a reference to resuming and pausing
activities. These are usually cleaned up when the activity ends or
the task is reparented. However, it is possible for an activity to
lose its reference to its task in other areas (such as
ActivityStarter), which can lead to the stack not being updated
correctly.

This changelist adds a method to the ActivityStack to disassociate
the stack from an ActivityRecord. In addition to places where this is
called when an activity ends, this method is invoked on the children
of a task when the task is reparented. The task member variable of
ActivityRecord is also now surrounded by a setter/getter, with the
setter always invoking the dissociation logic on a previous stack.

Test: bit FrameworksServicesTests:com.android.server.am.ActivityRecordTests
Change-Id: Iffeccdb6f011958896271673946acfed28856f53
Fixes: 36387417
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
78e8ac9c141ca2b3fb99520dc627919bc2f97ba4 04-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Framework support to improve bg check CTS tests." into oc-dev
34ecbaa9910685012e7688bd9cf92a6163d1e0c2 03-Apr-2017 Winson Chung <winsonc@google.com> Merge "Ensuring multi-window callbacks contain new configuration and are in order" into oc-dev
644648ebfd93d11405b23cb667ac625653221b69 03-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Expose instant app to exposed providers" into oc-dev
6df866a8510af2776c48425a361f708ae7f5d7d6 31-Mar-2017 Jeff Sharkey <jsharkey@android.com> Enforce PACKAGE_USAGE_STATS for usage data.

Some system services are offering package usage data through both
public/system APIs and through dump() calls. In principle, usage
data hould always be protected with PACKAGE_USAGE_STATS, so start
enforcing that. (Otherwise if a user blocked PACKAGE_USAGE_STATS
access to an app, that app could still obtain the data via dump()
if they held the DUMP permission.)

Bottom line, let's respect the user's wishes.

Protecting the entire output like this is pretty blunt, but future
CLs can add more nuance to the output if desired.

Test: cts-tradefed run commandAndExit cts-dev -m CtsSecurityTestCases -t android.security.cts.ServicePermissionsTest
Bug: 32806790
Change-Id: I46173562713bea7d89e12a4313c78eb52ea8d77d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fe9a53bc45fd0124a876dc0a49680aaf86641d3e 31-Mar-2017 Jeff Sharkey <jsharkey@android.com> Consistent dump() permission checking.

This change introduces new methods on DumpUtils that can check if the
caller has DUMP and/or PACKAGE_USAGE_STATS access. It then moves all
existing dump() methods to use these checks so that we emit
consistent error messages.

Test: cts-tradefed run commandAndExit cts-dev -m CtsSecurityTestCases -t android.security.cts.ServicePermissionsTest
Bug: 32806790
Change-Id: Iaff6b9506818ee082b1e169c89ebe1001b3bfeca
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9484603c0fa738b67980c18b4abfd3505778ae74 01-Apr-2017 Dianne Hackborn <hackbod@google.com> Framework support to improve bg check CTS tests.

(Finally) introduce a new ServiceConnection callback to
tell you when the binding has died. This allows you to robustly
have a weak service monitoring, and also is an easy way to find
out about breakages due to app updates etc.

Also clean up some debug output.

Test: moved to own suite and ran them.

Change-Id: I526cc00816c384fa9eb1312b92406f38085cbff9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5af42fc3052ecaf35c937278a986143a65f6ce5f 25-Mar-2017 Winson Chung <winsonc@google.com> Ensuring multi-window callbacks contain new configuration and are in order

- This CL has two main changes:
1) It modifies the activity multi-window and picture-in-picture mode
changed callbacks to provide the configuration of the activity with
the mode applied.
2) It modifies the order in which the multi-window and picture-in-picture
mode callbacks are made, to ensure that when going in and out of
picture-in-picture: first PiP, then MW, and then the config change.
- Previously, the ordering of the two callbacks was inconsistent. When
calling moveActivityToPinnedStack(), we reparent the task into the pinned
stack (triggering the picture-in-picture mode change), followed by the
resize animation (causes configuration changes). Inversely, when we
expand the task to fullscreen (and not just remove it), we run the
animation first, which resizes the task to the final size (causes
configuration changes) then reparent after the animation completes
(triggering the picture-in-picture mode change).

In this CL, we ensure that for both the transition in and out of PiP, we
defer to the bounds animation to trigger the PiP mode change. Normal
calls to reparent or adding a new task are unchanged. When the PiP
mode change is called from the animation, it provides the final target
bounds which we use to calculate the target configuration of the activity
for the callback. If the bounds animation is interrupted, an update will
also be scheduled if we change the fullscreen state we are animating to.

To work around the issue where we are scheduling MW/PiP mode changes in
both the animation and the configuration change, we also now keep track
of each state internally in the ActivityRecord.

Bug: 36099777
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testConfigurationChangeOrderDuringTransition

Change-Id: I03513bc3a4d4a72c250983f22f079ce9d7a2cb40
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f04d039584b933c705c7e9d319579d4385bd6cb7 01-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'launch-2d-activities-vr' into oc-dev

* changes:
Allow shell uid to access Vr APIs
Add vr persistent mode enable/disable
Launch 2D activities in VR mode
2d161b1d3fd8ceae065d8a475d2ca13de1b48dc2 01-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Implement issue #36590595: Add ability to associated a ClipData with JobInfo" into oc-dev
63ee64cca76a6f12d29695b31d0a9a594cc0ea86 31-Mar-2017 Todd Kennedy <toddke@google.com> Expose instant app to exposed providers

Bug: 36814248
Test: Manual
Change-Id: Ia919bcb2d9c8a52c7277429004ad09be2db03a43
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f2cd4371fe4985ad23473ac7885754927a578ca2 31-Mar-2017 Sudheer Shanka <sudheersai@google.com> Merge "Update default max time of waiting for network state to get updated." into oc-dev
a47223f99b6b7ade4ae909c458d975eb487062b3 30-Mar-2017 Dianne Hackborn <hackbod@google.com> Implement issue #36590595: Add ability to associated a ClipData with JobInfo

Yum!

Also needed to have a Context.revokeUriPermission() variant that is sane,
so reasonable CTS tests can be written.

Test: new ClipDataJobTest added.

Change-Id: Ia3135ea788a6e32c971bae7dab3a844d0ef4139c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
441162562b75f8510586e1acdf2009820f25493d 31-Mar-2017 Chris Wren <cwren@android.com> Merge "standardize system notification IDs" into oc-dev
282cfefea0fbbd299839e353e6d30affdcd4a55c 27-Mar-2017 Chris Wren <cwren@android.com> standardize system notification IDs

All the trivial cases, plus some fixes to try to
mitigate collisions with the complex ones.

Complex services to follow in another CL,

Bug: 32584866
Test: make framework services
Change-Id: Ie9663600171d8ede11676e9d66f009dbb06def03
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
99493dbc94989d4493ca6acb0db265a02f49f62e 09-Mar-2017 Karthik Ravi Shankar <karthikrs@google.com> Launch 2D activities in VR mode

When in VR mode, launch all activities into the virtual display ID as
provided by the Compatibility display. This includes two cases -

- New activity launches
- Existing activity in the background.

Testing Done: Tested with PlanarVirtualDisplay app and Settings,
Calculator and GestureApp with different intent flags.

Bug: 36071574
Bug: 36071445
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testVrActivityLaunch
Test: #testVrActivityReLaunch

Change-Id: Ic590a7cbd6f9b339dc83b22a8ffb1252219ef22e
Signed-off-by: Karthik Ravi Shankar <karthikrs@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
20959b2d406d6b76fb6f16075230da7542e1e3e8 31-Mar-2017 Sudheer Shanka <sudheersai@google.com> Merge "Don't increment procStateSeq if uid doesn't have internet permission." into oc-dev
08992ac57e973d6bf32693725ebb341a481e5944 21-Mar-2017 Christopher Tate <ctate@google.com> API refactor: context.startForegroundService()

Rather than require an a-priori Notification be supplied in order to
start a service directly into the foreground state, we adopt a two-stage
compound operation for undertaking ongoing service work even from a
background execution state. Context#startForegroundService() is not
subject to background restrictions, with the requirement that the
service formally enter the foreground state via startForeground() within
5 seconds. If the service does not do so, it is stopped by the OS and
the app is blamed with a service ANR.

We also introduce a new flavor of PendingIntent that starts a service
into this two-stage "promises to call startForeground()" sequence, so
that deferred and second-party launches can take advantage of it.

Bug 36130212
Test: CTS

Change-Id: I96d6b23fcfc27d8fa606827b7d48a093611b2345
(cherry picked from commit 79047c62b58fb0a0ddf28e2b90fe4d17e05bc528)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cd181e63ff1a03aff38041e6f30e23cfa27f5c72 30-Mar-2017 Chad Brubaker <cbrubaker@google.com> Merge "Track isolated process owners" into oc-dev
f4923ea0b25edb6e6ca6804ed4c66f57a8ec29c2 28-Mar-2017 Sudheer Shanka <sudheersai@google.com> Don't increment procStateSeq if uid doesn't have internet permission.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
and manual

Change-Id: I02bfd86837813cc79f37301d91489485c6a1d056
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0f28a80d8e80a3546fe0776999b2deaa3dc2157c 29-Mar-2017 Chad Brubaker <cbrubaker@google.com> Track isolated process owners

This fixes two issues:
1) Isolated processes spawned by Instant Apps do not get full access to
package lists as those spawned by normal apps do
2) Package manager considers the isolated process the same app as the
Instant App that created it when determining what packages are exposed.

Bug: 34087569
Test: Webview works
Test: Isolated apps cannot access package info of other apps via start
an isolated service.

Change-Id: Ib26280b87fb46dc66f1f25ee6209427a095342b0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1feecdd73e75242525333741d784b42af62ee151 29-Mar-2017 Sudheer Shanka <sudheersai@google.com> Update default max time of waiting for network state to get updated.

It is updated to a non-zero value, so an activity will wait for the
network rules to get updated before starting.

Bug: 27803922
Test: runtest -c com.android.server.net.ConnOnActivityStartTest frameworks-services
Change-Id: Ie491dac08dd257232a3f87d9a1013d6593424752
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ec319aba34deb91f89ec4e15004eee62d5f2801c 28-Mar-2017 Tony Mak <tonymak@google.com> Introduce AMS.getLastResumedActivityUserId to fix work profile icon issue

Problem:
Work profile status bar icon feeature is relied on two callbacks
1. onForegroundProfileSwitch (AMS.setResumedActivityLocked)
2. appTransitionStarting (WMS)

We assume callback 1 is always called before 2, but it is not the case.
These two callbacks are triggered by two handlers in two different threads,
and hence race condition happens.

Solution:
Not rely on onForegroundProfileSwitch to update mManagedProfileFocused
flag anymore. Query getLastResumedActivityUserId in appTransitionStarting.
Also, make sure mLastResumedActivity is updated before sending message
to WMS in setResumedActivityLocked.

Test: Start a work app, observe that the work icon is shown.
Test: Start a personal app, observe that work icon is gone.
Test: Dock the work app, tap on it (give it focus), observe that work
icon is shown.
Test: Start a work app, switch user, can see the icon is gone. Switch back,
icon is back.

Bug: 34159089

Change-Id: I2cee141d18e8b7d5607b26dd7a2fd5bc9cd0ebb3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a82b62678a0e1eaba50ec5adce93862683dac065 22-Mar-2017 Adam Lesinski <adamlesinski@google.com> Themes: Apply themes to system_server safely

Creates a new UI Context for UI based operations.
This UI Context is wired up the same way a normal app
Context would be, and is subject to change when overlays
are enabled/disabled.

For this reason, only UI should be using this new Context.
All other operations should be using the original system Context
so that changing themes don't impact the regular operations of
system_server.

Also added some sanity checks at key places where we show UI
(ShutdownThread, BaseErrorDialog).

Bug: 36059431
Test: $ adb shell am crash com.android.settings
Test: Observe crash and power off dialogs are blue with PixelTheme
Change-Id: I87227ee2e0be1e72dcde8f482b37725cb687260b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
99ca99ec3aab73d772291006af51d377df7a5df0 28-Mar-2017 Andreas Gampe <agampe@google.com> ActivityManager: Allow DiskRead for wrap.sh determination

Avoid killing debuggable apps which at the same time have a strict-mode
policy installed.

(cherry picked from commit 62be34e32e72323e917bebb9ca39eb911e7d9371)

Bug: 33668201
Test: m
Change-Id: Ic3c56b01fe42a473e28c1d6280526afdc85793df
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f7f39d4af5e218d6e257570307991625b8f34474 23-Mar-2017 Chad Brubaker <cbrubaker@google.com> Throw an error if no package name is provided by the app when needed

Avoid crashing system server if a calling app does not provide a package
name to broadcastIntent, instead throw an exception back.

Bug: 36452829
Test: Devices boots, apps work
Change-Id: Ie67ad4b631f399e674449e0787ed8fab47b89cb6
(cherry picked from commit 674702f0f99091c86bb3eb66572c88304de38a6b)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
deeb08fdcb2ccf90d013a9e909122e1a997c40bb 24-Mar-2017 Sudheer Shanka <sudheersai@google.com> Uncomment a test.

It was commented earlier because of a crash. Since that issue has been
fixed, uncomment the test.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
Change-Id: I5f2b1b0bffe032633f42c8c34ed8a7ae5a3dfc10
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e784f7a0a34789047a4db037ee28ee00ef06e990 27-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "WatchDog: dump hal pids when killing a process."
6b47c54a65d8c0aca9a6523a926a386ecfaec069 21-Mar-2017 Steven Moreland <smoreland@google.com> WatchDog: dump hal pids when killing a process.

Test: `adb shell am hang --allow-restart` -> Watchdog dumps
hal traces (eventually)
Bug: 36414311
Change-Id: I5143cedf3e5ab4695d2507a29993e748f6de17d5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d292c1555875e3e2c134f8d477b2a77d27df55d4 25-Mar-2017 Sudheer Shanka <sudheersai@google.com> Merge "Update AMS to use NetworkManagementInternal.isNetworkRestrictedForUid."
5918c6700bd8e660abbf2c8f78cac5ea6a947374 22-Mar-2017 Sudheer Shanka <sudheersai@google.com> Update AMS to use NetworkManagementInternal.isNetworkRestrictedForUid.

And add global setting WAIT_FOR_NETWORK_TIMEOUT_MS.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests
runtest -c android.provider.SettingsBackupTest frameworks-core
and manual

Change-Id: I6949cd517255670e2ce21ab2de24271082461b11
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d81542cef49b152f0505a5d537cac68b40aa6259 24-Mar-2017 Dianne Hackborn <hackbod@google.com> Merge "Partially return NEW_PICTURE and NEW_VIDEO."
52c46a5fd6af620fb3319bbee6c6dd1af1dc9ac0 23-Mar-2017 Dianne Hackborn <hackbod@google.com> Merge "A little cleanup of activity manager dumpsys output."
ca3d5434e8bc02a8e95ceef343f734d1d6e4b52a 17-Mar-2017 Naveen Kalla <mrnaveen@google.com> Add API to request Bug Report with a certain title and description

ActivityManagerService will send the details to dumpstate and
BugreportProgressService will get the details from dumpstate and use
that for the notification.

Bug: 33561517
Test: Modify TelephonyMonitor to use this API and ensure that the
notification uses that the title and description sent as arguments
to the API. File a bug using betterBug and ensure that the
information gets populated automatically.

Change-Id: I455f1df2278e5d569dd19c74245a0704dcf5a321
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0aa4313ec4424af00f86293b5ca72115faa9dc15 22-Mar-2017 Dianne Hackborn <hackbod@google.com> A little cleanup of activity manager dumpsys output.

Test: manually ran dumpsys

Change-Id: I0c3a523c501576beba2bf85c61faa026eb2a0440
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
08f81890bc70a0c8f4d25817a1dd0c93f8927e78 03-Mar-2017 Winson Chung <winsonc@google.com> Adding source bounds hint to support better PiP transition.

Bug: 35396882
Test: Start a transition with source bounds hint.
Change-Id: I4897242af84744bc05a093111a15ea52e49815e8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a359c9846d2fa8bfe2784222be350d2e6046de16 22-Mar-2017 Jorim Jaggi <jjaggi@google.com> Merge "Add API to disable snapshotting of activities"
0fe7ce968bc7f0eff64f08e2d51c8b1e6b4a6fc8 22-Feb-2017 Jorim Jaggi <jjaggi@google.com> Add API to disable snapshotting of activities

Test: runtest frameworks-services -c
com.android.server.wm.TaskSnapshotControllerTest
Test: Launch DisableScreenshotsActivity, go to recents, make sure
content is white.
Bug: 31339431

Change-Id: I329925d2fca389e561da3389a67fe888b5bb1033
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8a29aecb73c8793fc8e52694cc793361b27aeb2b 22-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Better ContentProvider error messages."
c0cc220e63b4caead383d94ab6423087476b99ba 22-Mar-2017 Jeff Sharkey <jsharkey@android.com> Better ContentProvider error messages.

Help guide developers towards ACTION_OPEN_DOCUMENT and related
APIs when a Uri is backed by a DocumentProvider.

Also help developer understand that we expected a valid
ContentProvider for Uri notifications.

Test: builds, boots
Bug: 32642790, 36075317
Change-Id: I8e0e3cb25b183c4a9a094a53018822a4212bdaf9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
327dfaa6592b156bd2a7ecbe311699c557a6b6b8 21-Mar-2017 Steven Thomas <steventhomas@google.com> Merge "Revert "Revert "Add remote callbacks for persistent vr mode"""
b70845c708a8c402219f05d26edaea38713e13c3 16-Mar-2017 Steven Thomas <steventhomas@google.com> Revert "Revert "Add remote callbacks for persistent vr mode""

This reverts commit 2abf1c60cc2fc6ec9bc590cb35e94581ecf93c2e.

We need the ability to register remote callbacks for persistent vr mode,
so vr flinger can register for persistent vr mode events.

Bug: 35885165

Test: Manually confirmed vr flinger can register and receive persistent
vr mode events.

Change-Id: I7713c4c8acae9a369fd0c06695ef712fddd12be8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5d37e364dba5769d388483ee677cee3559cedb51 21-Mar-2017 Brian Carlstrom <bdc@google.com> Merge "Improvements to ActivityManagerService stack dumping"
35e3f53a30588b79e0309fdbeef29a8c18eef65d 17-Mar-2017 Jorim Jaggi <jjaggi@google.com> Also store reduced resolution screenshots

In order to speed up loading time when scrolling through it
in recents. They will be used in recents in the next CL. Also, we
use JPG instead as loading JPG is much faster than PNG.

Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotCacheTest
Bug: 34829962
Change-Id: I4c74b26969ae459bd3b1a42707011a49f425abd9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
84a4895c9c1eb7f381d99fb8eb298d8335d4e480 09-Mar-2017 Sudheer Shanka <sudheersai@google.com> Update AMS to wait for network state update if requested by the main thread.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
runtest -c com.android.server.am.ActivityManagerInternalTest frameworks-services
cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests
and manual
Change-Id: I7d1052b9941c1fae51ff8ab1c9b89dca3919ccd2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
51ab3acf270c655ed90706895b43915433d022c7 08-Mar-2017 Sudheer Shanka <sudheersai@google.com> Add lastProcStateSeqDispatchedToObservers to UidRecord.

This will help in identifying the last procStateSeq for which AMS
notified NPMS about the process state change.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services

Change-Id: I741a8ffe31de92070f3ebbc9c4f95fc1c0a340cd
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4c66f8b20d860bb99bf7a49b9302fe8bafff8bd9 21-Mar-2017 Sudheer Shanka <sudheersai@google.com> Merge "Update NPMS to notify AMS when network policy rules are updated."
e736185ee90e0f19a7092542cadab4cf561a5703 07-Mar-2017 Sudheer Shanka <sudheersai@google.com> Update NPMS to notify AMS when network policy rules are updated.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerInternalTest frameworks-services
runtest -c com.android.server.NetworkPolicyManagerServiceTest frameworks-services

Change-Id: I357fd5c80b7e6d3e63df95397e328c52f233958b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7bd4ea53e943b09cb9be2fc4b45f4f7ed24173d6 20-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow setting a persistent VR thread."
dc4796c209c1b604f3dfe0615c04c0fcf69f55c5 08-Mar-2017 Craig Donner <cdonner@google.com> Allow setting a persistent VR thread.

Bug: 36215076
Test: adb shell am instrument -w -e class \
android.os.SetPersistentVrThreadTest \
com.android.frameworks.coretests/\
android.support.test.runner.AndroidJUnitRunner
cts-tradefed run cts -m CtsVrTestCases -t android.vr.cts.VrSetFIFOThreadTest
Change-Id: If2f3a5f1c8593c74ac35964f68dcbe75b4da472e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
291df4fc0c3fc7a28bf0d89619b7e7bc0ea672e1 14-Mar-2017 Chad Brubaker <cbrubaker@google.com> Expose Intents to Instant Apps

This exposes Intents used by Android widgets to Instant Apps.

The following Intents are exposed:
Intent.ACTION_TIME_TICK
Intent.ACTION_DATE_CHANGED
Intent.ACTION_TIMEZONE_CHANGED
Intent.ACTION_TIME_CHANGED
Intent.ACTION_CONFIGURATION_CHANGED
Intent.ACTION_LOCALE_CHANGED
Intent.ACTION_SCREEN_OFF
Intent.ACTION_SCREEN_ON
Intent.ACTION_USER_PRESENT

Bug: 33350280
Test: Manually verified that broadcasts are received.
Change-Id: Ife94f594c1ff30f2625a57e1cc69f36cc00d1f34
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
beed965c25d6996ed0f7947bf8a569ca4489f79e 20-Mar-2017 Brian Carlstrom <bdc@google.com> Improvements to ActivityManagerService stack dumping

- Deduplicate code in DumpStackFileObserver, ensure consistent behavior at addition use site
- Fix bug in DumpStackFileObserver where closed state was not reset
- Align TRACE_DUMP_TIMEOUT_MS with frameworks/native/cmds/dumpstate/utils.cpp
- Fallback to Debug.dumpNativeBacktraceToFileTimeout on timeout
- Share timeout constant with other Debug.dumpNativeBacktraceToFileTimeout caller

Test: Insert 1s sleep in system/bt/btif/src/bluetooth.cc is_profile to trigger ANR
Test: Insert hang into art/runtime/signal_catcher.cc after "reacting to signal"
Bug: 35962833

Change-Id: I6b5cc3f106f1e2b49400e382b8ad71ddbd4685f3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
02a2813ad2e4c4db0ce8fbb1049c2cd1630ca8e6 18-Mar-2017 Brian Carlstrom <bdc@google.com> Merge "Warn when ActivityManagerService.dumpStackTraces times out"
dd1997bc9c7ab36f3fb9f47cc9d111736c50464b 18-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Getting ephemeral flag from PackageManager when UidRecord is null"
834b66c47907a34a81290751c8ad6045b3cf6bff 16-Mar-2017 Suprabh Shukla <suprabh@google.com> Getting ephemeral flag from PackageManager when UidRecord is null

When a user switches off background running for an app that was already
stopped, UidRecord is null when passed in to
AcitivityManager#doStopUidLocked resulting in an NPE. We need to get
ephemeral state flag from package manager in such cases.

Test: Manual

Bug: 36158380
Change-Id: Id77848c252cc0ff0c803113ac2c7c19aa0dcf254
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7bdfe5cdd146bfe23c1364ff222ec666cfb40566 14-Mar-2017 Brian Carlstrom <bdc@google.com> Warn when ActivityManagerService.dumpStackTraces times out

Test: Insert hang into art/runtime/signal_catcher.cc after "reacting to signal"
Bug: 35962833
Change-Id: Ia5444e7e23b3fc34f233ce8cc083d44b284a6cdc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
aca8d4cd302a7e6aa352fbe61b497dcfd8555fc7 14-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Don't provide Build.Serial to apps targeting v2 sandbox"
3878ca3333da1bf5cbc83d33e5e8b3ce68c8c5e4 03-Feb-2017 Jorim Jaggi <jjaggi@google.com> Fix multi-dimen app transition delay tron event

Make sure to log everything.

Test: Open app, inspect log.
Test: com.android.systemmetrics.functional.AppStartTests

Bug: 33086172
Change-Id: I6fdfef625c09267dcf20724e853cf7471abc86c9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b324c25794b31cf10389be6f1ef1d055c4914825 14-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "No direct Uri grants from system."
0de9e5ca3ddb69b4d3d9f3756f03d29f09b81469 14-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Lower-overhead version of LockGuard."
7e7465aaa5daaa5109a69e3c455e1cca31023f2a 13-Mar-2017 Chad Brubaker <cbrubaker@google.com> Don't provide Build.Serial to apps targeting v2 sandbox

Bug: 35882064
Test: cts-tradefed run commandAndExit cts-dev -m
CtsAppSecurityHostTestCases -t
android.appsecurity.cts.EphemeralTest#testBuildSerialUnknown

Change-Id: I66360a2efe5b0df7935a74f22096a2b54e122300
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5f3e93451e87d72c513e75c5d5459a4bd2cc41b2 13-Mar-2017 Jeff Sharkey <jsharkey@android.com> Lower-overhead version of LockGuard.

Instead of building up a giant set of all locks inside the system
server, there are only a handful that we're interested in watching:
specifically those below the ActivityManagerService lock.

This change adds a index-based variant of lock registering and
checking, which has much lower overhead that doesn't bring a device
to its knees. It's disabled by default, but can be enabled on local
development builds.

Currently uses the boostPriorityForLockedSection() hook in AMS to
check for lock inversions when enabled.

Test: builds, boots, no AMS lock inversions detected
Bug: 35410906
Change-Id: I473d634d23c08538029412a1254bf4f92b96fb84
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ebf3a0d57fb940d6a312181a615f9ff0d1d55862 13-Mar-2017 Chad Brubaker <cbrubaker@google.com> Merge changes from topic 'receiver_IA'

* changes:
Enforce visibleToInstantApps for receivers
Only send exposed broadcasts to Instant Apps
646dde0ace455447b772443f7965ff0101fb5834 21-Nov-2016 Jeff Sharkey <jsharkey@android.com> No direct Uri grants from system.

The system should never be extending Uri permission grants from
itself, since it automatically holds all the permissions. Instead,
the system should always be a mediator between two specific apps, and
it should be using startActivityAsCaller() if it needs to extend
permissions.

Blocking at this level fixes an entire class of confused deputy
security issues.

There is a small exemption for the "com.android.settings.files"
authority which is used for photo cropping in the Settings app.

Test: builds, normal intent resolution UI works
Bug: 33019296, 35158271
Change-Id: I3f0de58facedab8767541291b5dfa022fa2e4414
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
02e71939151e0ea46fe11be6cbbe08e3c756e74f 10-Mar-2017 Winson Chung <winsonc@google.com> Prevent updating the PiP when it is being dismissed.

Bug: 35588768
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testPreventSetAspectRatioWhileExpanding

Change-Id: I2bcfdaad97c552cccef253370a6231253c956d22
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6e01539168a01c81d9f073d51b11ec40e0537885 11-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixes minimized state to match task and stack bounds for cts test"
5573fadab910d3fa61f10a2d383c49d24385e2c0 11-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixing issue with TaskRecord lookup."
aa2b620cb76cb8a710c3c4500bc5f6975ddc7a84 10-Feb-2017 Matthew Ng <ngmatthew@google.com> Fixes minimized state to match task and stack bounds for cts test

Fixes minimized state for its task and stack bounds to always match
inline with the cts test that was failing.

This also fixes multiple state issues related to splitting home and
recents into different stacks when recents incorrectly reads home stack
bounds to determine bounds for recents.

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
CtsServicesHostTestCases
android.server.cts.ActivityManagerActivityVisibilityTests or
ActivityManagerDockedStackTests
Fixes: 35351074, 35145587
Change-Id: I6417a567e937c647818ff26dc08df463e6ef4257
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c37cc6030146f7179d658cc1969a5353dad5fd97 11-Mar-2017 Sudheer Shanka <sudheersai@google.com> Merge "Update IUidObserver.onUidStateChanged to include procStateSeq."
8025580449081ddd21f449f8719bc87d1cc9fc7b 04-Mar-2017 Sudheer Shanka <sudheersai@google.com> Update IUidObserver.onUidStateChanged to include procStateSeq.

This procStateSeq is associated with the process state change of
an uid and will help in identifying if network policy rules have been
updated for a process state change.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest
frameworks-services
Change-Id: Iaab8d004f476b96f28d08c886c7b0a6b585b9fef
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
61f31c7b3a2de5b4b5acedfc5a0d0fa27a03ce69 11-Mar-2017 Sudheer Shanka <sudheersai@google.com> Merge changes If6c9684f,Iefab4b8b

* changes:
Extract the logic to dispatch uid state changes into separate method.
Add tests for ActivityManagerService.dispatchUidsChanged.
5da9e9495daf0cd1d353f1cdb9983908997bdfe3 10-Mar-2017 Dianne Hackborn <hackbod@google.com> Partially return NEW_PICTURE and NEW_VIDEO.

They are again allowed to be dispatched, but now only
to registered receivers.

Test: manual, still need to write CTS

Change-Id: Ib95293d818430129d168cfc0616eb90bef25e5c6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cac01fea95925b6fb45a31d4ef4e2cb2a52662af 04-Mar-2017 Sudheer Shanka <sudheersai@google.com> Extract the logic to dispatch uid state changes into separate method.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest
frameworks-services
Change-Id: If6c9684f4fb49b798e51da68721ec793c7faec64
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7900beee54d5dd8d5a057c0bd7bef0c2dcf2d599 10-Mar-2017 Winson Chung <winsonc@google.com> Fixing issue with TaskRecord lookup.

- In ag/1721556, we switched from looking up the task in WM to looking
up the task in AM (and using the window container controller). However,
AM's call, anyTaskForIdLocked(), will return tasks in the recent tasks
list along with the current stacks. The naming of the parameter
restoreFromRecents is partly to blame as it does not prevent lookup in
the recent tasks and only prevents that task from being restored into
the provided stack.

As a result, when we removed a task from a stack, we also remove the
associated window container controller, but when we query for the task
to make a WCC call to it, it finds the one in the recent tasks list
and happily uses that one (which crashes because we've the WCC).

Instead, we break up the call to explicitly search for tasks in the
stacks only, in stacks or recents, and in stacks or recents with restore.
All existing calls to anyTaskForIdLocked() that are actually looking up
a task for a WCC call (like those in ag/1721556) can use STACK_ONLY,
while existing calls will match recents tasks and restore as required.

Bug: 35960163
Test: Open up settings > display > brightness dialog, quick switch to
another task using overview

Change-Id: I835116fa80d47450da8c4de41fe0d54fc70cb43b
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
858f98d13e10afba6420daba0a42b2e056452e24 22-Feb-2017 Amith Yamasani <yamasani@google.com> AssistStructure improvements

Added isOpaque() for Views
Added getAcquisitionStartTime(), ...EndTime()
Added isHomeActivity()

Bug: 30895450
Test: cts-tradefed run cts-dev -m CtsAssistTestCases -t
android.assist.cts.AssistStructureTest#testAssistStructure

Change-Id: I294a089aa3454ebfebf0442036d98ccb86cb2827
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
642028fccd655d6c9dc8fd0865cd526c694993ab 10-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Replaced auto-fill by autofill to keep it consistent with API style."
af526ec9c36dfbb3c244ad03f8df79311e5ba03c 09-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Corrects the recents and home stacks position around docked state (1/2)"
640f30a7763b0a4b80c767acb84c740aac04768b 07-Mar-2017 Felipe Leme <felipeal@google.com> Replaced auto-fill by autofill to keep it consistent with API style.

This change will affects 2 types of apps: autofill service implementations
and apps that use autofill APIs.

Since just the former is known to be used at the moment, we're not trying
to keep backward compatibility with the latter.

Bug: 35956626
Test: CtsAutoFillServiceTestCases pass
Test: android.provider.SettingsBackupTest pass

Change-Id: Ia720083508716deae9e887f9faa7ae7c5a82f471
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
330757dffa8d8de106e2c073eff09bf8238549a5 28-Feb-2017 Matthew Ng <ngmatthew@google.com> Corrects the recents and home stacks position around docked state (1/2)

Since splitting home stack into home and recents, some problems where
the home stack would appear above when home stack is not visible. This
would cause home stack to be below docked stack and think home is
visible when it is not. Then docking an app would minimize the docked
stack and go into a wierd state when recents is resumed/launched.

When docked stack is used, it will verify that recents is created and
avoids seeing home stack as visible when below docked stack with at
least 1 stack in between. Whenever an app is docked, this will make sure
home stack is below recents.

This will fix some parts of the cts tests that use
"adb shell am stack move-task <taskId> 3 true" and avoid glitches with
the docked stack.

The following scenarios were tested:
- Boot and dock and app without starting recents
- Dock after launching an app (when recents already created)
- Toggle dock with "adb shell am stack move-task <taskId> 3 true" and
undocking multiple times
- Dock with long press recents

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
CtsServicesHostTestCases
android.server.cts.ActivityManagerDockedStackTests
Bug: 35351074, 35145587
Change-Id: I6ac25c64f7d1050ea2260631ff4c052fcca3f185
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
261c0f3c69ca471b72afac5e26d332ac1de3f9a3 08-Mar-2017 Winson Chung <winsonc@google.com> Updating moveTaskToBack to handle PiP activities

- When a PiP activity calls moveTaskToBack(), we should fall through to
the same behaviour as dismissing the PiP if there are no other tasks
to show.

Bug: 36034065
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testMovePipToBackWithNoFullscreenStack
Test: #testMovePipToBackWithVisibleFullscreenStack
Test: #testMovePipToBackWithHiddenFullscreenStack

Change-Id: I83c3d27dabc031546f9f1cf20b808bb8f13d4646
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
816c83bf037e2284a61ac8e918ff882d162d9321 02-Mar-2017 Chad Brubaker <cbrubaker@google.com> Enforce visibleToInstantApps for receivers

Instant apps can only send broadcasts to receivers that are declared in
the manifest with android:visibleToInstantApps=true or if the app
registers a receiver at runtime using the new methods that take
visibleToInstantApps.

Bug:33350280
Test: Manually sending broadcasts from Instant Apps only goes to
receivers with visibleToInstantApps set to true.
Test: Receiving a broadcast from within the same app does not require
visibleToInstantApps to be set.

Change-Id: I54d79a502ba9c5fd03ede3c09e08afc88fe2775f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4c9afa87d09a9b6abecbddc956343a70363f0c5f 01-Mar-2017 Sudheer Shanka <sudheersai@google.com> Add tests for ActivityManagerService.dispatchUidsChanged.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
Change-Id: Iefab4b8beab710108ba55fde8edeb578ef70349d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b7e34d5508b41c421994eb70f96f56e5db7ede74 22-Feb-2017 Chad Brubaker <cbrubaker@google.com> Only send exposed broadcasts to Instant Apps

In order to prevent Instant Apps from receiving potentially sensitive
broadcasts they will only receive those that the sender explicitly
exposes to Instant Apps by setting
Intent.FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS.

Bug:33350280
Test: `adb shell am broadcast` does not get delivered to Instant App
Test: `adb shell am broadcast -f 0x0x200000` gets delivered to Instant
App
Test: Verified that an Instant App can send a broadcast to itself
without FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS
Change-Id: Ie363448bf224abba530dd4caf69258939fff00af
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1ec752f2dac36b2bf32a9d3fdf5f1f022a09228c 03-Mar-2017 Dianne Hackborn <hackbod@google.com> Merge "Add tracking of bg check violations in broadcast stats."
da0d07be7bc274e06797d6b943483df7b3d6625c 03-Mar-2017 Winson Chung <winsonc@google.com> Merge "Prevent PiP movement while the resize animation is running."
d11f127428a01dd86f5bb71797105b9b30be9e40 03-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Make sure to call the original reply-to receiver when..."
75323c1889d164fc481f87f124468bce38ed33a8 03-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Resize task to fullscreen when moving from pinned stack."
5603a16e9e32bd202607957529147be0392c1a77 03-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix issue #35365651: ActivityManager.getPackageImportance() doesn't..."
3e7d845161870f6289aeecdf4bfd762097f487d6 03-Mar-2017 Makoto Onuki <omakoto@google.com> Make sure to call the original reply-to receiver when...

replacing a queued broadcast.

- Also don't replace a broadcast for a different user.

Test: Manual test with the following test code:

Intent intent = new Intent(Intent.ACTION_PROVIDER_CHANGED)
.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
AlarmManager alm = this.getSystemService(AlarmManager.class);
long time = SystemClock.elapsedRealtime() + 5 * 1000;
for (int i = 0; i < 5; i++) {
alm.setExact(AlarmManager.ELAPSED_REALTIME, time,
PendingIntent.getBroadcast(this, i, intent, PendingIntent.FLAG_UPDATE_CURRENT));
}

Without this CL, after the alarm fires, AlarmManagerService.mBroadcastRefCount
is left > 0 and the wake lock is held forever.

With this CL, mBroadcastRefCount eventually gets back to 0.

Bug: 35779096
Change-Id: I4e21c94b08f25f9ca1242182670ff4a69f8bd9f2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
85d3998aa39f412f269806114b3e6154ccbee73f 25-Feb-2017 Winson Chung <winsonc@google.com> Prevent PiP movement while the resize animation is running.

- This was causing numerous artifacts when the user starts touching while
transitioning into PiP where the move rects clobber the animating rect.

Bug: 35764922
Test: Try touching the PiP while it is entering or exiting PiP
Change-Id: I5a72b5bea694b01aab401d2bb78a493688a9c655
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
45e69d6de9b2677b23530fe3a132f956f591c9ba 02-Mar-2017 Dianne Hackborn <hackbod@google.com> Fix issue #35365651: ActivityManager.getPackageImportance() doesn't...

...return the highest importance of all processes

Also clean up the importance constants to correctly reflect the
current state of the system.

Test: run activity test, added new conditions to it for this.
Change-Id: I25c4351b017c4a703212f604079e13f7d4fead5b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
aa5e8c3a298e0290a84776a89f85ebab37aea49c 02-Mar-2017 Bryce Lee <brycelee@google.com> Remove activity from task if not set properly.

We do not start an activity in the case of a lock task mode
violation. However, the activity is still associated with the task
and therefore participates in future interactions, such as
visibility checks.

This changelist addresses this issue by removing the assocation in
the case of failures.

Change-Id: Ibf7edd2bd4532de5e7f355311a808ffd21e542e3
Fixes: 35034729
Fixes: 35035258
Fixes: 34179495
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerTest#testLockTask_deviceOwnerUser
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7466610e097f310a5df24200c319306ca73e0c2d 23-Feb-2017 Winson Chung <winsonc@google.com> Resize task to fullscreen when moving from pinned stack.

- This was a regression in the original change to move the tasks to the
fullscreen stack when the pinned stack was removed. The task kept its
old bounds, which causes the next animation into the PiP to not run
since the stack bounds are taken from task bounds (which are the old
pinned stack bounds)

Bug: 35326108
Test: run-test CtsServicesHostTestCases
Change-Id: I234910107cf62cc23b2d663161d250b9d59b3934
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f1d8cb26afe18e93062e78a0df6b64f2e7a08c47 02-Mar-2017 Bryce Lee <brycelee@google.com> Merge "Revert "Remove activity from task if not set properly.""
98689f751d0e45797a574499b5732989dfec750b 02-Mar-2017 Bryce Lee <brycelee@google.com> Revert "Remove activity from task if not set properly."

This reverts commit 0f9bde84a1120a17dc73d107fc7bb8e5c8c6e719.

Reason for revert: causing b/35879503

Change-Id: I06402356ecdb559dcb8342f3a6cca755aea6533a
Fixes: 35879503
Bug: 35034729
Bug: 35035258
Bug: 34179495
Test: manual with repro steps
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
485c0feea53199b1d43db8782073044c846424c4 01-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adding flags to filter dumping of activities."
1ea593325f5e0b4523ed9e631a48ea9968c92c57 01-Mar-2017 Carmen Jackson <carmenjackson@google.com> Merge "Add tracing for broadcast sending and processing."
18d62becbd98a906f74f1249251cd88a56019ab3 01-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add a process state seq counter to UidRecord."
88c4d1ce97f5fa3859dd1854d4a82305e68a2b0e 24-Feb-2017 Sudheer Shanka <sudheersai@google.com> Add a process state seq counter to UidRecord.

This seq counter is associated with the process state in UidRecord
and will be incremented whenever the uid state is going from
background to foreground or vice versa.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
Change-Id: I1183d929bc7e0b2c9912de3822eb344d2bb0dcf7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2cda00e29a9a081087a7f16333fd492b88da988a 01-Mar-2017 Geoffrey Pitsch <gpitsch@google.com> Merge "Channels for Frameworks notifications"
55af6c5f7094b6be72da46de478ea334a6519543 19-Oct-2016 Shunta Sato <shunta.sato@sonymobile.com> Avoid deadlock when installing app

Symptom:
System crash is occurred by deadlock

Root cause:
ActivityManagerService's APIs usually hold a lock of itself instance.

In this case, four threads tried to take the same lock and it caused
deadlock.
Following three objects are in a three-cornered deadlocked.
- ActivityManagerService's instance
- PackageInstallerSession.mLock
- PackageManagerService.mPackages

Solution:
Call checkUidPermission before taking a lock of ActivityManagerService's
instance.

Fixes: 32425801
Test: manual
Author: Kazuki Nakayama <kazuki.x.nakayama@sonymobile.com>
Change-Id: I71ce57b1b8f3e0e9ba64b94a7b1f210b702efb6a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
af759c52ce01fe6b5144957e38da956af01a217b 15-Feb-2017 Geoffrey Pitsch <gpitsch@google.com> Channels for Frameworks notifications

Adapts all notifications used by system services to use channels.
Channels are initialized by SystemServer after the NotificationService
has started.

Test: runtest systemui-notification
Change-Id: I25c45293b786adb57787aeab4c2613c9d7c89dab
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6998bc4f137fc04e1946c5bffe25bcb8e9d8a886 01-Mar-2017 Winson Chung <winsonc@google.com> Adding flags to filter dumping of activities.

- To make it consistent with other dump calls, by default dumping
'activity all' or 'activity <activity>' will now dump it if it exists
even if it is not in a visible stack. If -v is specified, only
activities in visible stacks will be dumped, and if -f is specified
then only activities in the focused stack will be dumped.

Bug: 35850518
Test: adb shell dumpsys activity <package> and ensure it runs in the background
Change-Id: Ib8284aedce8073e2a30023a7cd925c6c525817c8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
910ac520d0607d6123f0a8e2eaf0df9f5de5216a 28-Feb-2017 David Stevens <stevensd@google.com> Merge "Only kill processes on default display density change"
d057cf8e218b915ef7e3fc3b9b518c2fcb4e2507 25-Feb-2017 David Stevens <stevensd@google.com> Only kill processes on default display density change

This means pre-N apps launched on secondary displays might not work
properly after a density change, but multiwindow (let alone
multidisplay) isn't something truly supported by those apps.

Test: manual
Change-Id: I80e18c6db19faa716ec1d653caef410c67327546
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fbe8553860fd99b0a1ac98af453acb7f08c506fd 28-Feb-2017 Chris Tate <ctate@android.com> Merge "A little more logging for receiver reregistration"
58e1fd557e99b90111eaf0ae4569612d735ae789 25-Feb-2017 Christopher Tate <ctate@google.com> A little more logging for receiver reregistration

Bug 34983231
Test: n/a

Change-Id: I44d3c9f0b010dd3bfc66e58bcfa7730262dbfd89
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2d0c0e35a6a2c2982675bced0151c9783166a9a0 27-Feb-2017 Jeff Sharkey <jsharkey@android.com> Consider disabled authorities for notifs.

They're still valid providers, even when they're disabled.

Test: builds, boots, disabled authorities considered
Bug: 35791633
Change-Id: Ie1c40ae92a72b5b9f6869ea3dca19f2b74f80bae
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9687767d759936a51ca2f7d90b3810f8b9bea0d4 27-Feb-2017 Makoto Onuki <omakoto@google.com> Merge "Allow querying providers with a specific metadata."
0f9bde84a1120a17dc73d107fc7bb8e5c8c6e719 23-Feb-2017 Bryce Lee <brycelee@google.com> Remove activity from task if not set properly.

We do not start an activity in the case of a lock task mode
violation. However, the activity is still associated with the task
and therefore participates in future interactions, such as
visibility checks.

This changelist addresses this issue by removing the assocation in
the case of failures.

Change-Id: I77692465cb1082478528771fd6fd844fab62f697
Fixes: 35034729
Fixes: 35035258
Fixes: 34179495
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerTest#testLockTask_deviceOwnerUser
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e44f60ec359acc05075ce330c3005aa524e968b3 24-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Require valid authorities for Uri notifications."
912e80d3450943ac2bbca03f33c31c042799a0a1 24-Feb-2017 Jeff Sharkey <jsharkey@android.com> Require valid authorities for Uri notifications.

Content changed notifications are really only valid for content://
Uris, which are really only valid when we have a valid ContentProvider
backing them. This has been implicit for a long time, but we actually
need to start enforcing it based on target API.

We also now tell developers about why their notification requests
are being denied, instead of silently logging.

Test: builds, boots, common operations work
Bug: 34049049
Change-Id: Ie8ab8d8674cff13e3e9269ffddc4ad998cb848c4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2e0d0f311100d8e0bb40d7d60b8498237f011f0c 02-Jun-2016 Mårten Kongstad <marten.kongstad@sonymobile.com> OMS: integrate OverlayManagerService into framework

Hand over ownership of overlays to OverlayManagerService.

Changes to a package's overlays are propagated using the activity life
cycle. Affected activities will be recreated as needed. This provides a
well-defined point to modify an application's assets while the
application is paused.

Consolidate how overlays targeting the system and overlays targeting
regular applications are handled. Previously, system overlays were
handled as a special case. Now, everything is handled identically. As a
side effect, the call to idmap --scan during Zygote boot has become
obsolete and is removed.

Information on what overlays to use is recorded in
ApplicationInfo.resourceDirs. The PackageManagerService is responsible
for the creation of ApplicationInfo objects. The OverlayManagerService
is responsible for informing the PackageManagerService in advance about
what resourceDirs to use.

When launching an application, the ApplicationInfo is already populated
with up-to-date information about overlays.

When enabling or disabling an overlay for a running application, the
OverlayManagerService first notifies the PackageManagerService about the
updated resourceDirs. It then tells the ActivityManagerService to push
the new ApplicationInfo object to the application's ActivityThread.
Finally the application requests its ResourcesManager to create new
ResourcesImpl objects based on the updated paths.

Change-Id: Ib8afa05ccab4e2db558f89ce4423983c086bb61a
Co-authored-by: Martin Wallgren <martin.wallgren@sonymobile.com>
Signed-off-by: Zoran Jovanovic <zoran.jovanovic@sonymobile.com>
Bug: 31052947
Test: run tests from 'OMS: tests for OverlayManagerService'
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4098172f467e6fab5fea96d84ba8e36e032542ca 23-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Ensure we use the fullscreen stack bounds when expanding PiP."
32757292030117e3abda2bb2a3eb349f646c9fa8 22-Feb-2017 Makoto Onuki <omakoto@google.com> Allow querying providers with a specific metadata.

CP2 will need it to scan GAL providers faster.

Test: Manual test with CP2 under development
Bug: 35388445
Change-Id: I1202420078b1bbe48f6eb4bb9e3f705c71df9c0c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f764962b0d58008530955b70af1ebf68beb8d4ba 22-Feb-2017 Sudheer Shanka <sudheersai@google.com> Merge "Revert "Ensure network connectivity on app start.""
c9d9407e8ec10a56a4caa3c84122d1c6a1fedaab 22-Feb-2017 Sudheer Shanka <sudheersai@google.com> Revert "Ensure network connectivity on app start."

This reverts commit 27e693158398059d00ff20e60640cb105e255625.

Change-Id: I4c41ce7c1839d3b91931bc8a8f117f32bf6cd381
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4eee99977b2553369d93d0e72d3bc090babcc074 22-Feb-2017 Sudheer Shanka <sudheersai@google.com> Revert "Notify NPMS when uid becomes active or idle."

This reverts commit ac0a61bad30e5a2ff45a85aaa6cf910e08911a2b.

Change-Id: I87d239cef51fc00567054644efceeca1ad2b463d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
55893331fb3c23067ede1463fe06c7bb6519141c 18-Feb-2017 Winson Chung <winsonc@google.com> Ensure we use the fullscreen stack bounds when expanding PiP.

- When in split screen, the PiP needs to animate to the fullscreen stack
bounds when expanding.
- Created PinnedStackWindowController to house pinned-stack specific
logic.

Bug: 35396882
Test: Expand PiP activity while split

Change-Id: If7397843743ce11b676f5566eba90e3442289fec
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ac0a61bad30e5a2ff45a85aaa6cf910e08911a2b 18-Feb-2017 Sudheer Shanka <sudheersai@google.com> Notify NPMS when uid becomes active or idle.

We used to notify for these events but this got
regressed in ag/1829603.

Bug: 35523062
Test: manual
Change-Id: I05e1517384f1436ee07094cdc6c3a339941f75ff
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7fc46d8bcca52b623a42639853379db59b3f065b 15-Feb-2017 Dianne Hackborn <hackbod@google.com> Add tracking of bg check violations in broadcast stats.

Test: manually booted and checked output

Change-Id: Ie29a8424ae80c2b193645dcb2b1f4f6a8779ff6a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8c9a6b0089ff712df4e06454ade1443b77a4a9f4 17-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert "Revert "Per user setting for instant app"""
be0b8896d1bc385d4c8fb54c21929745935dcbea 15-Feb-2017 Todd Kennedy <toddke@google.com> Revert "Revert "Per user setting for instant app""

This reverts commit be9ffa15af9e1906e9ffb505768328d62d4a3793.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Ib21321cf157a79890de487060a093840f7182047
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
72ad5bd8396cc9a6cc7f63234b717de9aae00aa6 16-Feb-2017 Marco Nelissen <marcone@google.com> Merge "Make audio effects work"
fb6df0b969008fe65b0452764beda154dc8f9254 16-Feb-2017 Marco Nelissen <marcone@google.com> Make audio effects work

This makes the built-in audio effects work again.
3rd party effect panels can be made to work by disabling the built-in one
in Settings.
TODO: implement selection mechanism for third party effect panels.

Bug: 35316970
Test: manual
Change-Id: I6cd1cfba909bf74c31f37e9ecedcb28046f9109b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
92aaaa21ee9178e7bd52fb465449566a5e1d9da7 16-Feb-2017 Felipe Leme <felipeal@google.com> Moved bugreport intents to the com.android.internal namespace.

Change-Id: I5ad53668b9393188cee4d8b0382f9c303ff95777
Fixes: 35275802
Test: manual verification
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3cb867326ae9d79cc8035ad9fa6c1d656946692f 14-Feb-2017 Robin Lee <rgl@google.com> Merge "Theme work lock activity with the task primaryColor"
27e693158398059d00ff20e60640cb105e255625 23-Jan-2017 Sudheer Shanka <sudheersai@google.com> Ensure network connectivity on app start.

Bug: 27803922
Test: cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests
Change-Id: Ifd7a52924cd6bbc809c9a3f92d52fe2df09b7fe2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d725de1e863db7f001e423b6262c9c7b8b7d1167 14-Feb-2017 Amith Yamasani <yamasani@google.com> Merge "Revert "No direct Uri grants from system.""
dae86855cc938d6cf51d801b9f036accb3ce530f 14-Feb-2017 Amith Yamasani <yamasani@google.com> Revert "No direct Uri grants from system."

Reason for revert: b/35158271
Bug: 35158271
This reverts commit 2dfe92c2dfbaddd69dabe6e43ab77c4c204c4065.

Change-Id: Id04eab8100bfb0b3e137095b25b7d4b12c6d11e6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3c82d3d5bfea9b6483ad0264e6956eb5a00a2a4a 19-Jan-2017 Robin Lee <rgl@google.com> Theme work lock activity with the task primaryColor

This involves adding another system RPC, getTaskDescription(taskId)
gated on MANAGE_ACTIVITY_STACKS permission.

Bug: 31001762
Test: runtest -x frameworks/base/packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityTest.java
Change-Id: Ieb996f7fab5bc79737df570e35733551118118d3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3023320d33fcb1ac182a7ddb4eb52124ba66e44e 13-Feb-2017 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #35309312: Background start not allowed: service..."
12cb6628dbfc2f50a04502f37386d453956a02e3 13-Feb-2017 Winson Chung <winsonc@google.com> Merge "Create a new stack for the assistant activity."
b1e7776e2ca348ad734fdddc68d9bda6eb17c5e0 13-Feb-2017 Dianne Hackborn <hackbod@google.com> Fix issue #35309312: Background start not allowed: service...

...Intent { flg=0x100 cmp=com.android.systemui/.SystemUIService }
to com.android.systemui/.SystemUIService from pid=28245 uid=1000 pkg=android

Rework the persistent app check to just directly look at the package
manager (but as efficiently as possible). My idea for trying to keep
this in the UidRecord was stupid. :p

Test: manually tested it boots
Change-Id: I5a88717a27fa3529048d37a853518a3ec04055db
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
04fa542db5c0e3c8cca3867c54730f91abf1db58 13-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Set oom adj for processes displaying app-overlays to PERCEPTIBLE_APP_ADJ"
d993a573d7fcf1a69d35528cae4dd96581c9aacd 05-Feb-2017 Wale Ogunwale <ogunwale@google.com> Set oom adj for processes displaying app-overlays to PERCEPTIBLE_APP_ADJ

For processes with a window of type TYPE_APPLICATION_OVERLAY adjust their
oom importance to PERCEPTIBLE_APP_ADJ to reduce the chance of them getting
killed by the low-memory-killer since they are displaying something that
is perceptible to the user.

Also z-order TYPE_DREAM windows above alerts windows.

Bug: 33256752
Test: cts/.../run-test CtsAppTestCases android.app.cts.AlertWindowsTests
Change-Id: I4c05a9fee6fad61399bf4d10c8647467cc596ca6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8347163dbb64fb61012c0393163283106a0a351e 13-Dec-2016 Winson Chung <winsonc@google.com> Create a new stack for the assistant activity.

- Add a new stack that is not resized with multiwindow, and
appears above the fullscreen and docked stacks, but below
the pinned stack
- Add a method on VoiceInteractionSession to allow the assistant
to launch activities into this new fullscreen stack.
- Also prevent any activities in the assist stack from the
fetching of the on screen assist data.

Bug: 30999386
Test: android.server.cts.ActivityManagerAssistantStackTests

Change-Id: I22ab7629b5f758cf1e66d7d1c26648af6bc887c9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f106167447656954fd29dd0353e77253543ddd61 10-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix missing break statement."
3d227ad86cee7aa06f8edd804e93a518d42db5b0 10-Feb-2017 Andrii Kulian <akulian@google.com> Merge "Allow destroying display content on removal"
250d653325ffeeb8ef75e51e3a3d08d6abb8cf9c 09-Feb-2017 Andrii Kulian <akulian@google.com> Allow destroying display content on removal

This CL sets the behavior for displays when they are removed.
For public displays by default all content will be moved to the
primary display and become focused. For private displays default
behavior is to destroy all content - first it moves stacks from
the secondary display to the primary display to the bottom, then
it destroys all activities in those stacks.

This CL adds two specified behaviors as modes, so in future these
rules might be altered if needed.

Bug: 34263289
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testContentDestroyOnDisplayRemoved
Change-Id: I3f89f06ff82cb4b487df58a86ba3b146a32cbd00
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2d695667aea20e043b487418e047626f00f50196 10-Feb-2017 Ruben Brunk <rubenbrunk@google.com> Fix missing break statement.

Test: manual - check display behavior in lockscreen after screenoff in
VR app.

Change-Id: Icbcc99101473b9ff9f379c72dad07480a0dea666
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7408813e3cea3bf553028a0e8e272ec96473ba41 09-Feb-2017 Christopher Tate <ctate@google.com> Check bg persistent-app policy against base uid, not nominal

SysUI, for example, needs to be able to start services in secondary
users, and in those users they run as the user-appropriate decorated
uid.

Bug 35200453
Test: verify user switch behavior via logging

Change-Id: Ia154f140e315fd97aed414c6444ba550632eb610
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
62e9fc656c7deb4e473df6759dedd85d3877e674 09-Feb-2017 Christopher Tate <ctate@google.com> Enable background restrictions

Can be disabled by setting the "debug.bgcheck" system property to
"n" or "no" or "0" or "false" or "off". (Writing that property
requires root.)

Bug 30953212
Test: observed restrictions being enforced

Change-Id: I4cda9b7840ff25240b6bcaab210ea13888d08cad
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bf99f78a3827af8cbcb394c7dd42d83915c2b551 08-Feb-2017 songjinshi <songjinshi@xiaomi.com> Merge "[Debug]: Add timeout for dumpNativeBacktraceToFile." am: b6f7a85b85 am: ec69bd0aa3 am: 36bcc913f7
am: 78a3d9dab4

Change-Id: I421bf706b51fb657855dbc71a13919982e70fd44
78a3d9dab407c61141553f7985f53f2860f2a057 08-Feb-2017 songjinshi <songjinshi@xiaomi.com> Merge "[Debug]: Add timeout for dumpNativeBacktraceToFile." am: b6f7a85b85 am: ec69bd0aa3
am: 36bcc913f7

Change-Id: Icf40ff98196d885e6974eb679532064b30bc68cd
36bcc913f7f5b2150e8b467eb4a52e0dc4663e5b 08-Feb-2017 songjinshi <songjinshi@xiaomi.com> Merge "[Debug]: Add timeout for dumpNativeBacktraceToFile." am: b6f7a85b85
am: ec69bd0aa3

Change-Id: Idfe455733dd12bf82c31cb505681e4fa89d57bfb
ec69bd0aa3eeaab9082cd22103c919aabe750aa2 08-Feb-2017 songjinshi <songjinshi@xiaomi.com> Merge "[Debug]: Add timeout for dumpNativeBacktraceToFile."
am: b6f7a85b85

Change-Id: Iea79127b2c7d823844406f677a98fea54043f4cb
39c36cab3a7d1994008a92a289c0a119fa66dad5 08-Feb-2017 Erik Wolsheimer <ewol@google.com> DO NOT MERGE Guard against null entries in process list during updateOomAdjLocked am: 84aa5a864f
am: 36008dd6bd

Change-Id: Ia7e636049d4a3a0490013a54ffb90d7f4f534949
49f38bb4873bbab124b7686397cd52c1027c8287 08-Feb-2017 Julia Reynolds <juliacr@google.com> Merge "Don't let apps permanently delete channels."
76002353391a69a8432d38d0bda14eacc2e0ea09 08-Feb-2017 Erik Wolsheimer <ewol@google.com> DO NOT MERGE Guard against null entries in process list during updateOomAdjLocked
am: 84aa5a864f

Change-Id: I9b5c9b25a9bd4ad5b51f7d0c7004c7275ce1e460
36008dd6bd1d57d135f8a5d517faefc45e67d50b 08-Feb-2017 Erik Wolsheimer <ewol@google.com> DO NOT MERGE Guard against null entries in process list during updateOomAdjLocked
am: 84aa5a864f

Change-Id: Ibcbaba3bb406e07f97561bc87916f6891fc25b74
84aa5a864f5b8a59845bbda761725fefab71e3cc 08-Feb-2017 Erik Wolsheimer <ewol@google.com> DO NOT MERGE Guard against null entries in process list during updateOomAdjLocked

BUG: 34312358
Change-Id: I9b303d443b082bba8b440e6e1ef68b050a970386
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cd161864a32873d67e304af7898df69dfb9d5f9d 07-Feb-2017 Winson Chung <winsonc@google.com> Merge changes I3ef361bd,I89a5184c

* changes:
Refactor PiP logic in preparation for expanded state.
Modifying RemoteAction callback to PendingIntent.
5355e8593a6962f2990a88cd0101ab53a852a1a2 07-Feb-2017 Julia Reynolds <juliacr@google.com> Don't let apps permanently delete channels.

Test: manual
Change-Id: Ia2582e3b4213f0b77579af2ff94f79b08e5d1a91
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e02e3ea7f97fe9554a9ff1464a2875b7d07a19bf 16-Dec-2016 songjinshi <songjinshi@xiaomi.com> [Debug]: Add timeout for dumpNativeBacktraceToFile.

If the debuggerd be blocked, the watchdog and
activitymanager thread will be blocked when the
ANR or watchdog occurs,so we needed to add
timeout for dumpNativeBacktraceToFile.

Change-Id: Iab1a64328e70257025d860638d93a4fb8eaaeea2
Signed-off-by: songjinshi <songjinshi@xiaomi.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2a82fe587b850061ace024d2025047554987c10d 02-Feb-2017 Winson Chung <winsonc@google.com> Refactor PiP logic in preparation for expanded state.

- #1: Move logic for handling IME size changes into SysUI, and only rely
on PinnedStackController to provide bounds when first entering
PiP and on rotation
- #2: Doing #1 allows us to move PipMotionHelper to SysUI completely, which
lets us aggregate the animation calls out of PipTouchHandler
- #3: Add proper callbacks to the listeners when the movement bounds
changed from config change, ime change, or aspect ratio change. This
allows SysUI to calculate the associated movement bounds for the
expanded state, and we can then remove the corresponding WM call.
It also means that SysUI is the only thing that needs to know about
the expanded state.
- #4: Fix issue where TV was getting the default bounds, not taking the
aspect ratio when the PiP was entered into account. Doing #3
allows us to report the right bounds.
- #5: Remove dead code related to edge snapping/minimizing now that they
are on by default and associated tuner setting, and controller
callbacks

Test: android.server.cts.ActivityManagerPinnedStackTests (all existing tests pass)

Change-Id: I3ef361bdf8d44094b4c0a11c70ba4db7d697fdec
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bab851c7c9dfe6f3d063a1009c4d57cfa2ff005c 04-Feb-2017 Felipe Leme <felipeal@google.com> Refined session management so Save can be automatically called.

This is yet another big refactoring:

- AutoFillManager keeps track of its current AutoFillSession.
- Views call AFM.startSession(View) when they can trigger autofill.
(virtual views can call it as well). At this point, the manager
sets an AutoFillSession, gets the activity token, and passes it to
the service.
- Subsequent calls to AFM.start() will be ignored since the session
is set.
- When the Activity is gone, it calls AFM.finishSession().
- Simlilarly, virtual views could call it as well.
- Added getAutoFillValue() to View.
- Removed AFM.updateAutoFillInput(childId): virtual views should now
call startSession(childId) to start a session, and use the
VirtualViewListener callbacks for updates.
- Change AutoFillValue to use String (which is immutable) instead of
CharSequence for text values.
- Check if view is enabled before auto-filling.
- Removed 'cmd autofill fill' since it would require the appCallback
- Automatically dismiss the snack bar after 30s
- Moved the "don't change autofill value when autofilling" Inception
logic into the service side.
- Etc...

BUG: 34819567
BUG: 33269702
BUG: 31001899

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: I5fad928d4d666701302049d142026a1efa7291cd
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
290e57886db79fb83df61ce00636609b6c03c67f 02-Feb-2017 Bryce Lee <brycelee@google.com> Limit getRunningServices to calling uid's services.

Previously all running services for the user were returned when calling
ActivityManager#getRunningServices. This changelist enforces restrictions
similar to getRunningTasks, where only the user services with a matching
uid will be returned.

Fixes: 34274345
Test: manual with sample app
Test: make -j32 cts; cts-tradefed; run cts --module CtsAppTestCases
--test android.app.cts.ServiceTest#testRunningServices
Change-Id: I2a13328424d3741fec6076f45ba638bb754d19c5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
340417356d92d0db71d0692344e66886ca795dfd 01-Feb-2017 Dianne Hackborn <hackbod@google.com> Implement issue #30977956: Enable Instrumentation tests for multi-process apps

New android:targetProcess attribute on <instrumentation> allows you to
specify the processes the instrumentation will run in.

This reworks how instrumentation is run in the activity manager to better
formalize its state and semantics, allowing us to keep track of it across
multiple processes. This also clearly defines what happens when multiple
instrumentations are running at the same time, which is useful for writing
CTS tests that test the instrumentation APIs themselves.

Adds a couple new APIs to Instrumentation that helps with the new
situation where instrumentation can run concurrently in multiple processes.

Test: new CTS tests added (textXxxProcessInstrumentation in
ActivityManagerTest.java in cts/tests/app/src)

Change-Id: I2811e6c75bc98d4856045b2f0a45fb24af5d366f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
825a242ea90f4bdea41dbfa21caaa09129da386d 03-Feb-2017 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE. No direct Uri grants from system. am: b61338ecb3
am: 30a4388481

Change-Id: I8b612304980150f522b0424e564f3bedf030c2b9
8fa904847719a20a7d60e50c3f17de5af3ecef4a 03-Feb-2017 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE. No direct Uri grants from system. am: b61338ecb3 am: 30a4388481
am: 190511955f

Change-Id: I0a4149d160f990357e4e8ee7229bfbdf68b67a68
190511955fe388988bda3209981120820943e075 03-Feb-2017 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE. No direct Uri grants from system. am: b61338ecb3
am: 30a4388481

Change-Id: I5088038dbd457b7d2314a014da11ebd14192a211
30a4388481de8a180e2fc701501051da89f208d3 03-Feb-2017 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE. No direct Uri grants from system.
am: b61338ecb3

Change-Id: I56e937265e43bc9dd0adbe24167ae52b5bc0b818
b61338ecb307a2f595a8f78e290b5287a6503aaa 21-Nov-2016 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE. No direct Uri grants from system.

The system should never be extending Uri permission grants from
itself, since it automatically holds all the permissions. Instead,
the system should always be a mediator between two specific app, and
it should be using startActivityAsCaller() if it needs to extend
permissions.

Blocking at this level fixes an entire class of confused deputy
security issues.

Test: builds, normal intent resolution UI works
Bug: 33019296, 32990341, 32879915, 32879772
Change-Id: Iaa57c393a386d8068e807d0dd0caccc89d8a11db
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5523f9a2fcaf472e92c1d380a79776c4bf857a80 02-Feb-2017 Felipe Leme <felipeal@google.com> Merge "Improved AutoFill Save workflow."
14fbe141e0990d423b8564c0fc3a786ed26232c0 20-Dec-2016 Winson Chung <winsonc@google.com> Adding initial TRON logging for picture-in-picture.

Bug: 33756317
Test: Run PIP activity
Change-Id: Iad270dfdf6521d4659653a0697effaed4a0d4137
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4dabf2396f4fe18b2f83641fe2ac52a913763bad 25-Jan-2017 Winson Chung <winsonc@google.com> Preventing cases where an app can be stopped while entering PiP.

- Ensure that we clear the timeouts on the old stack and reschedule
them on the new stack when moving an activity to a new stack,
otherwise the pause timeout from the old stack will cause onStop()
to be called.
- When adding an activity to the stopping list for processing, prevent
scheduling an idle immediately in case an activity tries to enter
picture-in-picture when handling onUserLeaveHint(). In that case,
schedule an idle after the default idle delay instead.
- In addition, when resuming a resumeWhilePausing activity, prevent the
activity idle to trigger pausing activities to be immediately put into
a stopped state. This was a race between the handling of pause/resume
that would cause a pip activity to get onStop() even if it called enter
pip on pause. Instead, when processing an idle from the activity or
from an immediate idle scheduled by the system, we defer processing
pausing activities until a later idle (that it reschedules).

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testEnterPipWithResumeWhilePausingActivityNoStop

Change-Id: I375369a800b7fadaa57d6e00e0564bc3ee338979
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0200d9ea1509089c0c03b7071aa271e3a9b35c11 25-Jan-2017 Felipe Leme <felipeal@google.com> Improved AutoFill Save workflow.

Currently, the onProvideAutoFillStructure() methods can be called
twice: to auto-fill an activity and to save the activity's data
in the service.

The problem with this approach is that when the save workflow is
called, the activity might have been gone. Hence, a proper approach
is to keep the initial AssistStructure data in the system_service
memory, watch for view changes, and then passed the new structure
back to the AutoFillService.

A side effect of this change is that we need another way to determine
if the view is sanitized or not. For "standard" views, that will be
defined based on whether the view content come from a resource or not,
but that logic is not implemented yet (for now, all views will be
considered sanitized, except for TextView passwords). For "custom"
views (such as WebView), this logic is responsibility of the view
implementation, through the newChild() method, which now takes a
flag (whose value could be AUTO_FILL_FLAG_SANITIZED for sanitized
views).

The SaveCallback.onSuccess() method was simplified: it does
not need a list of saved ids anymore the auto-fill UI will not use it
anymore.

Another side effect is that the Save notification is gone - until
it's attached again, it can be test by using:

adb shell cmd autofill save

Finally, hook AutoFillUI on ACTION_CLOSE_SYSTEM_DIALOGS events.

BUG: 33269702
BUG: 31001899
Test: manual verification
Test: CtsAutoFillServiceTestCases passes
Change-Id: I907a7e21d1b3cd1ab6dec3a08d144a52655da46f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c869ebff63439ec3e51fdcd4d8b157cdcc8014c1 31-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add instant cookie APIs"
a09a31f99f9d65e1100f8295c2b9db485fe68b07 31-Jan-2017 Dianne Hackborn <hackbod@google.com> Merge "Remove some unused code around process state reporting."
096d304ae3d85c1bfcda1a1d9cd4eb13d0815500 31-Jan-2017 Svetoslav Ganov <svetoslavganov@google.com> Add instant cookie APIs

This change adds APIs for instant apps to store cookie data
that is presisted across instant installs and across the
upgrade from an instant to a standard app. Standard apps
can use the cookie APIs but when they are uninstalled the
cookie is also deleted. The cookies are kept longer than
the instant apps as they are much smaller - 16KB by default.
We can change the cookie size via a system setting i.e.
after we ship we can increase size if needed.

We also add internal APIs to surface information about
installed and uninstalled instant apps which should be
used for showing them in the UI. For this puporse we store
the icon, permissions, and label of uninstalled apps. If
the app is re-installed we drop this meta-data but keep
the cookie around. If we have cookie data stored and the
signing cert of the app changes when it gets re-intalled
we wipe the cookie.

Test: CTS tests pass; hiddent APIs tested manually

Change-Id: If145c0440cc61a5303e2cbb70228d235d36037a5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b76e0fdf1ef2767e2d4f0ced2886756ff9556b19 30-Jan-2017 Fyodor Kupolov <fkupolov@google.com> Read SystemConfig on a worker thread

Also added lazy accessor for mBackgroundLaunchBroadcasts to give more
time for SystemConfig init to finish.

Test: manual
Bug: 34809967
Change-Id: Iaba0ac61714d94e72d571f33cd22d8700b89bb31
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bb44e42de93e2e02d4314ffdee4cbc4d0df7ecc2 25-Jan-2017 Shukang Zhou <shukang@google.com> [Frameworks] Add an 'am' cmd option to enable streaming in profiling.

Add option '--streaming' to 'am start' and 'am profile' commands.
If the option is given, the output of method trace profiling
will be streamed into the specified file, so the output is no
longer limited by the buffer size.

Test: m -j48 test-art-host;
m -j48 ART_TEST_TRACE=true ART_TEST_TRACE_STREAM=true test-art-host;
I also tested manually. Tried all 8 combinations of
sampling/instrumention
streaming/non-streaming
'am start --start-profiler' / 'am profile start'
The output files are all in expected shape.

Bug: 33300765

Merged-In: I8a5136a1c7330c8260b7c6c8da63f42a73aee275

Change-Id: I8a5136a1c7330c8260b7c6c8da63f42a73aee275
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
628c0f1879b1fb966e5fb5d41c70c9c3db4c0cb3 30-Jan-2017 Nicolas Geoffray <ngeoffray@google.com> Merge "Introduce DEBUG_JAVA_DEBUGGABLE." am: 4df43ad959 am: 27ffe754a4 am: 1852c380e0
am: 96ea5ccef6

Change-Id: I4f8ba4240106ea84c29b6ae11dfc007af7048eb1
96ea5ccef6c3db4178005a52c4e619f6f5368303 30-Jan-2017 Nicolas Geoffray <ngeoffray@google.com> Merge "Introduce DEBUG_JAVA_DEBUGGABLE." am: 4df43ad959 am: 27ffe754a4
am: 1852c380e0

Change-Id: I8fcc8b0329269a0b21057f973b3a7dc5d8d80284
1852c380e0cb5497f1eb0587e97d4e6048961dd8 30-Jan-2017 Nicolas Geoffray <ngeoffray@google.com> Merge "Introduce DEBUG_JAVA_DEBUGGABLE." am: 4df43ad959
am: 27ffe754a4

Change-Id: I24d3eed3d6172fdff79a74945ecadea7b0d76590
27ffe754a4c0a3f64676635a29c37af14734cde3 30-Jan-2017 Nicolas Geoffray <ngeoffray@google.com> Merge "Introduce DEBUG_JAVA_DEBUGGABLE."
am: 4df43ad959

Change-Id: Iebecb5b77d07bf91820044eda8923b2b30ebfe60
4df43ad959a01beb1240549c8358a27bad975c09 30-Jan-2017 Nicolas Geoffray <ngeoffray@google.com> Merge "Introduce DEBUG_JAVA_DEBUGGABLE."
347b1df98890f843b41123ff3a08e483a4b966f9 20-Dec-2016 Nicolas Geoffray <ngeoffray@google.com> Introduce DEBUG_JAVA_DEBUGGABLE.

For notifying ART it will run a debuggable app.

Also rename ENABLE_DEBUGGER to ENABLE_JDWP.

Test: builds and runs
bug: 28769520
Change-Id: Ic096a176edfd5bf0bbe92b8367fbaa687a07d284
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
221e58fe9561c5f942c029d7ad6466a1a6dc4bc0 27-Jan-2017 Shukang Zhou <shukang@google.com> Merge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling." am: e924640c4b
am: b0f03a64ea

Change-Id: I35fa80e43cd4f6af76099848714f838f217b7989
b0f03a64ea7e897bd93dc2e4e6b2e211f8004623 27-Jan-2017 Shukang Zhou <shukang@google.com> Merge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling."
am: e924640c4b

Change-Id: I7e56dd815f5ac72b27ac6e2e2ca7614eaa648db1
e924640c4b82c705e42e766681eff76175e8a3dd 27-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling."
e682445698cadccbb60c4cd797cf1a65167aa399 27-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'session_refactoring'

* changes:
Adds autofill save ui
Moar AutoFill Framework refactoring...
bd00fef41ce38d2c711bd4151997c1cd8964b712 25-Jan-2017 Felipe Leme <felipeal@google.com> Moar AutoFill Framework refactoring...

* Encapsulated application-level auto-fill logic on AutoFillSession.
Currently, Activity.java directly manages the IAutoFillCallback binder
object used to auto-fill its views, but this logic need to be
extended so Views can use it to draw the auto-fill bar.

* Pass auto-fill id and boundaries to requests
So AutoFillUI can display its affordance in the right places.

* Uses a new auto-fill id on View (instead of reusing accessibility's).
That allows moving the logic on whether a new request should be made or
the existing UI moved to the service side.

* Split service methods in 2, for shell cmd and app
And applied the right permission check on both.

* Removed CancelationSignal from onSaveRequest()
Since it's not really needed.

* Etc...
¯\_(ツ)_/¯

BUG: 34637800
BUG: 31001899
Test: CtsAutoFillServiceTestCases passes
Test: manual verification

Change-Id: Ibd0cb2cfff6d0f6bb6b697a423ed5e89df687b82
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ff73dd9c60e8616e60abcaf62d1156ba08bebc99 26-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Splitscreen for minimized state that works with resizable launchers"
e15352e516fb6ecde12866f0eb27c32470ddbded 21-Dec-2016 Matthew Ng <ngmatthew@google.com> Splitscreen for minimized state that works with resizable launchers

If a launcher is resizable, going to minimized mode (dock task and then
press home) would show a cropped height of the task at the top in a
minimized state and the fullscreen stack would show the home launcher
which takes the rest of the remaining height. If the launcher is not
resizable, it will default the original behavior.

To enable this in a launcher, add android:resizeableActivity="true" in
the AndroidManifest.xml in the <application/> tag.

Test: manual - rotating while minimized, minimizing using dragging task
or holding overview nav button, installing resizable launcher with a
non-resizable launcher
Fixes: 32504542
Change-Id: Idf4015b40f9bec81b70f146f0f2d7df8ccfb4cf0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9e77aefe9ce2c3caa8c0daebf21c86088e10b951 26-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling."
132dffbc83b2dd91218a8e82a4df9e4d2da128ac 26-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Animate starting work challenge from work lock"
a68e3450ffa7a0905a30d9cab4ec869e4006257f 17-Jan-2017 Carmen Jackson <carmenjackson@google.com> Add tracing for broadcast sending and processing.

This change instruments BroadcastQueue using asyncTrace to give us
visibility into broadcasts from a trace. There's one traced section for
the time the broadcasts spend in the queue, and another one for the time
it takes to dispatch the broadcast.

My previous solution for this bug was incomplete, so this change also
cleans up that solution (which instrumented a callsite). Last, there's a
couple minor changes to logs (fixing a typo and making a log clearer).

Bug: 33645477
Test: https://screenshot.googleplex.com/2F6SWiCtEUD

Change-Id: I27e38cd70fee144986405bae302eb04045dff06d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6ffd4f9bab6b4c83f40caa6455664c6e6aadc6df 26-Jan-2017 Shukang Zhou <shukang@google.com> [Frameworks] Add an 'am' cmd option to enable streaming in profiling.

Add option '--streaming' to 'am start' and 'am profile' commands.
If the option is given, the output of method trace profiling
will be streamed into the specified file, so the output is no
longer limited by the buffer size.

Test: m -j48 test-art-host;
m -j48 ART_TEST_TRACE=true ART_TEST_TRACE_STREAM=true test-art-host;
I also tested manually. Tried all 8 combinations of
sampling/instrumention
streaming/non-streaming
'am start --start-profiler' / 'am profile start'
The output files are all in expected shape.

Bug: 33300765

Change-Id: I8a5136a1c7330c8260b7c6c8da63f42a73aee275
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6ec0b7e21d0f6fdee9f24d91b33c0c71e50cafc4 25-Jan-2017 Shukang Zhou <shukang@google.com> [Frameworks] Add an 'am' cmd option to enable streaming in profiling.

Add option '--streaming' to 'am start' and 'am profile' commands.
If the option is given, the output of method trace profiling
will be streamed into the specified file, so the output is no
longer limited by the buffer size.

Test: m -j48 test-art-host;
m -j48 ART_TEST_TRACE=true ART_TEST_TRACE_STREAM=true test-art-host;
I also tested manually. Tried all 8 combinations of
sampling/instrumention
streaming/non-streaming
'am start --start-profiler' / 'am profile start'
The output files are all in expected shape.

Bug: 33300765

Merged-In: I8a5136a1c7330c8260b7c6c8da63f42a73aee275

Change-Id: I8a5136a1c7330c8260b7c6c8da63f42a73aee275
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ee9e85f12e1bf4864435a1fe395cf31499f90b0a 25-Jan-2017 Dianne Hackborn <hackbod@google.com> Remove some unused code around process state reporting.

Test: manual (removing stuff that wasn't tested anyway)

Change-Id: I6aec4047ecea406db5d740550b838b295d128a1a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c5d458930ca4f69cf2d976ffd65a8679328de62c 25-Jan-2017 Dianne Hackborn <hackbod@google.com> Merge "Add some new experiment constants for activity and power manager."
5d59242c2ec590c5bc57744d4a7ab62890cc76c8 18-Jan-2017 Robin Lee <rgl@google.com> Animate starting work challenge from work lock

Bug: 31001762
Test: adb shell service call trust 6 i32 10 i32 1 && adb shell am start -a com.android.systemui.recents.TOGGLE_RECENTS
Change-Id: Ic6c622c32718bd235eb71704881b853072383dba
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7f9f8647158fd5cb82a81c10718b3e820ddca5eb 25-Jan-2017 Robin Lee <rgl@google.com> Merge "Lock all profile tasks if keyguard is locked too"
0ef403e53e2762d077750dd0a50b73c2125cadb0 25-Jan-2017 Dianne Hackborn <hackbod@google.com> Add some new experiment constants for activity and power manager.

Activity manager now has constants, starting with two: bg check
and process limit.

Power manager now has constants, starting with one: controlling
disabling of wake locks from cached processes.

Test: manual

Change-Id: I05db42e2104e9d31584f85251412df2d5efb34b6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
01e4eeb0e86c5517bbdb51527e1c0dacd1f98779 25-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added StackWindowContainerController"
dfbba3e790247de6b85c3fb17a2bd3529e6e5cc3 25-Jan-2017 Chris Tate <ctate@android.com> Merge "unbindBackupAgent and initialize inFullBackup" am: 36654ffef5 am: 3a13bb43f6 am: 6793b1f0b8
am: c8d9b32db8

Change-Id: I19a58876417cd00019c3d5fead9ee6bb48eb3f8d
c8d9b32db860eca36170c50d89780cb3869bb37b 25-Jan-2017 Chris Tate <ctate@android.com> Merge "unbindBackupAgent and initialize inFullBackup" am: 36654ffef5 am: 3a13bb43f6
am: 6793b1f0b8

Change-Id: I16e1b48e818023243f2c05e43599432f59203a19
6793b1f0b86d1465370aa6d0283c5e2ea5a8aad3 25-Jan-2017 Chris Tate <ctate@android.com> Merge "unbindBackupAgent and initialize inFullBackup" am: 36654ffef5
am: 3a13bb43f6

Change-Id: I44fcb1ff849d39ff528adb85f8d76563eb9b9d52
3a13bb43f6c9896eb7f8c64c59b2c76de4dbf4bd 25-Jan-2017 Chris Tate <ctate@android.com> Merge "unbindBackupAgent and initialize inFullBackup"
am: 36654ffef5

Change-Id: I5ba75075e2fb2dae0dcabbb0cee3b83c3d0c15ea
1666e317dc1a17e9435246ec6c8209dbb6ee3696 16-Dec-2016 Wale Ogunwale <ogunwale@google.com> Added StackWindowContainerController

For linking ActivityStack in AMS to TaskStack window container in WMS.

Change-Id: I8b9eaef49e62854d59b22d27f80f5935a5a4d7fc
Bug: 30060889
Test: bit FrameworksServicesTests:com.android.server.wm.StackWindowContainerControllerTests
Test: bit FrameworksServicesTests:com.android.server.wm.TaskWindowContainerControllerTests
Test: Existing test pass and manual testing.
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6d2fe9e96d821f64537fb9af4ea407bfcbc657bc 24-Jan-2017 Winson Chung <winsonc@google.com> Merge "Remove dependency on resizable activity to enter PiP."
d339538a67b7d6bb3d7ad73f31ad20ffc932f891 13-Dec-2016 Winson Chung <winsonc@google.com> Remove dependency on resizable activity to enter PiP.

- Removing the requirement for activities to have both the
resizeableActivity and supportsPictureInPicture attribute
to enter PiP. The activity may still be resized when
entering picture-in-picture.

Bug: 34256643
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: If6bd4721c53072e5518f554a8c7598705517c132
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
daab716f3515af8def9ac28ce4e71eede4ec8bef 21-Jan-2017 Dmitri Plotnikov <dplotnikov@google.com> Disabling crash dialogs on TV

Bug: 34518944
Test: threw an exception and saw the app nicely disappear without a dialog
Change-Id: I08ccfe7b34af6e2af6f91fea8750e81955901f40
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e7056216f85c4db4b2245e7c449f4ed6e6599865 23-Jan-2017 Robin Lee <rgl@google.com> Lock all profile tasks if keyguard is locked too

Bug: 29244275
Test: //tests/PoApi/src/com/google/android/afwtest/poapi/WorkChallengeTest
Change-Id: I1df84aa1af675af68180a84440ef36adb003b42d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
24454ca4b86102f8eff6b43a0f73711cbb6d292f 24-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add an 'am crash' shell command"
5f1a2a34d9307828b107b4ef092bf689517bb764 24-Jan-2017 Dianne Hackborn <hackbod@google.com> Merge "Optimize bg check flow."
c3af19a87dc70c321ffcc1e90453bb6f0545aef2 21-Jan-2017 Dianne Hackborn <hackbod@google.com> Optimize bg check flow.

No longer need to look up the application info, target SDK is
explicitly passed in to the check. For the external method, we
change this to just checked to see if background is completely
disabled, which doesn't need a target SDK check (and is the only
thing any of the current clients care about).

Now allow SystemUI to put targets of notification pending intents
on the temporary whitelist when they fire, so developers can avoid
dealing with background restrictions in this case (if the user
interacts with their notification, they will temporarily be
considered in the foreground).

Remove any thoughts of enforing restrictions on registerReceiver(),
so we don't need to deal with target SDK versions there (which can't
be done all that efficiently).

Also bring back the old "allow starts coming from foreground apps"
only for the MODE_IGNORE app op, since it should provide some
better compatibility.

Test: ran them.

Change-Id: Id4ea7f992d12ce4bd8e54f1dbaeb4a460a3dee59
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8aa8fe128992f7e47ecbc8588027eaec82012f3a 21-Jan-2017 Christopher Tate <ctate@google.com> Add an 'am crash' shell command

Induce a normal VM crash via adb, because it's quite different from the
effects of 'am kill'.

Test: induced crashes via adb shell using both pid & pkg

Change-Id: I79654afa7c4a70364cfd7d3af3e80a7b0e59b882
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2899a69295a92d1222a5c75e0f656ea898b03b95 23-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I72139780,I8e563654

* changes:
Fix screenshotting with includeDecor=true in multi-window
Implement restoring & correct caching of snapshots
7361babf94baa985eaa8bd2e94fcb16f00670998 16-Jan-2017 Jorim Jaggi <jjaggi@google.com> Implement restoring & correct caching of snapshots

Introduce a retrieval cache that holds the last accessed
snapshots, in addition to the cache of the activities
that are the top most activtiy of a task that have a
running process.

Change everything to use an integer id instead of a Task object
to work around the issue that some tasks SystemUI might access
might not exist in WM yet (not yet restored from recents).

Don't put anything in the cache on the SystemUI side, but still
retrieve the thumbnails after a task changed event to make sure
the cache on the system_server side is fresh.

Test: runtest frameworks-services -c
com.android.server.wm.TaskSnapshotCacheTest

Bug: 31339431
Change-Id: I8e56365459a677735320adaa169da8fb033ceab0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5feefa54c4cec9ac57137b10a4f23db66d159bc6 21-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Introduce RescueParty."
fe6f85cac9e823fd33a134f7129fdf7310703293 20-Jan-2017 Jeff Sharkey <jsharkey@android.com> Introduce RescueParty.

When a device gets stuck in a crash loop, it's pretty much unusable
and impossible for users to recover from.

To help rescue devices from this state, this change introduces a new
feature that watches for runtime restart loops and persistent app
crash loops, and escalates through a series of increasingly
aggressive rescue operations. Currently these rescue levels walk
through clearing any experiments in SettingsProvider before finally
rebooting and prompting the user to wipe data.

Crash loops are detected based on a number of events in a specific
window of time. App stats can be stored in memory, but boot stats
need to be stored in system properties to be more robust.

Start up RecoveryService much earlier during the boot so we can
reboot into recovery when needed.

Add properties tha push system_server or SystemUI into a crash loops
for testing purposes.

Test: builds, boots, forced crashing walks through modes
Bug: 24872457, 30951331
Change-Id: I6cdd37682973fe18de0f08521e88f70ee7d7728b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
961405613c0570e360fecb05c7d72e61f68e4d46 21-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Updating picture-in-picture API."
85e35643ba245c2d2b96662989aa505f04204cd7 13-Jan-2017 Dianne Hackborn <hackbod@google.com> Improve behavior of bg check.

There is a new APP_START_MODE_DELAYED_RIGID which means that
things discovering something is not allowed to start should
report a clear error back to the caller. This is how apps
that opt in to bg check should behave, and will now
be used if the app op mode is set to ERRORED.

This (for now?) removes the code that allows services to
be started if the request is coming from a foreground process.
That behavior isn't in the current bg check spec, and
probably not what we want as the standard platform model (since
it makes knowing when a service can start even harder to
determine). It was originally done for the experimental
bg check work in N to see how much we could avoid
breaking existing apps, so not relevant when apps need to
explicitly opt in.

Also report temporary whitelist changes to activity manager for
it to lift background restrictions temporarily for apps. Being
on the whitelist is now part of UidRecord, preventing a uid from
going idle.

Test: Initial CTS test added.

Change-Id: I36fd906fa69de8b7ff360605ae17c088f182e172
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
99695b0fc981097872281b2a17df3f58df48b92a 20-Jan-2017 Julia Reynolds <juliacr@google.com> Merge "Save deleted channels."
4c0659f5313bcc70be704a3808af9e670f467ee6 20-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Enable background restrictions"
17e1d9844de82251414a2f319c6fb35c383d8a17 20-Jan-2017 wonyoung.lee <wonyoung.lee@lge.com> unbindBackupAgent and initialize inFullBackup

the package has full backup failed (transport rejected) and broadcast discarded by app.inFullBackup

Test: example package : com.lge.clock
1) push txt file over 25Mb size to data/data/com.lge.clock/shared_prefs/
2) adb shell bmgr fullbackup com.lge.clock
3) fullbackup failed by quota_exceeded and not happened alarm receive.

Change-Id: Ic475abb0fe779757dc3d7949cf52977ab8760a04
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c2baac059c42765351745f1e2d46b685fe889db7 11-Jan-2017 Winson Chung <winsonc@google.com> Updating picture-in-picture API.

- Consolidating to enterPictureInPictureMode(), the new method will
attempt to put the activity into picture-in-picture mode if the
activity is visible or pausing in a state that would allow us to
pip it. Also consolidate the setting of the PiP aspect ratio and
actions into setPictureInPictureArgs().
- Fixing issue with onPause not completing when moving the
paused activity between stacks while dispatching onPause

Bug: 33692987
Test: android.server.cts.ActivityManagerPinnedStackTests

Change-Id: I3af2365f31a9b95de4a92eae46b77108947b2a49
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
42a386b7717300bf6d75cbd3b4f7ad00f294be0d 07-Nov-2016 Christopher Tate <ctate@google.com> Enable background restrictions

Apps that target O+ are always subject to background restrictions.
Legacy apps' background restriction is subject to the OP_RUN_IN_BACKGROUND
app op.

Apps with these properties are exempted from background restrictions:
- persistent process
- currently on the idle battery whitelist
- global whitelist for things like bluetooth services

Bug 30953212

Change-Id: Icc19b2fbc05f40dcf8c3fc4abf718c373dc8d4f6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0e989d00ed1e95be0ccb77c29846ee0b6ac33356 13-Jan-2017 Todd Kennedy <toddke@google.com> Grant access to ephemeral metadata

When an ephemeral application explicitly accesses an
installed application, it grants access to its package
metadata. The ephemeral application effectively stays
hidden if it doesn't explicitly connect to any activity,
service or provider [i.e. implicit connections using
an ACTION_VIEW/CATEGORY_BROWSABLE intent will not expose
its metadata].

Bug: 34123112
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: I7e1680902599b3ada0d4fba5998af30566017051
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8f3b174d90e3bf2093751fb1a1bd0603adac0222 19-Jan-2017 Adam Lesinski <adamlesinski@google.com> Merge "Teach apps to refresh AppInfos without restarting"
9e83cbbc10014b3ed560b3181f594868cd89f9ae 19-Jan-2017 Chris Tate <ctate@android.com> Revert "Enable background restrictions"

This reverts commit 21f778060badb1e78bffde05e8de7662d275003d.

Change-Id: I65586f9739da84fb32b51b0ea166b8288c41d1b3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
21f778060badb1e78bffde05e8de7662d275003d 07-Nov-2016 Christopher Tate <ctate@google.com> Enable background restrictions

Apps that target O+ are always subject to background restrictions.
Legacy apps' background restriction is subject to the OP_RUN_IN_BACKGROUND
app op.

Apps with these properties are exempted from background restrictions:
- persistent process
- currently on the idle battery whitelist
- global whitelist for things like bluetooth services

Bug 30953212

Change-Id: Ib444829a2d222125f64ff19e8218823fa78373f9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4036e8d4c636ae36f28585d283b522a7a97eaf72 13-Jan-2017 Julia Reynolds <juliacr@google.com> Save deleted channels.

To discourage the pattern of deleting channels and
recreating them to get around user settings.

Behavior:
- Creating a deleted channel brings back the old channel
(with it's old settings)
- Updating a deleted channel fails
- public getChannel apis should not return deleted channels

Also align data clean up done when clearing data & uninstalling
a package

Test: runtest systemui-notification, cts, cts-verifier

Change-Id: If19c20311c978fd8d3b1cb8b234dc1e68c7356be
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
49a4a1dfceeebc4b94022827b7e68cc971689c84 12-Jan-2017 Mårten Kongstad <marten.kongstad@sonymobile.com> Teach apps to refresh AppInfos without restarting

Teach running applications to refresh already loaded ApplicationInfo
objects without resorting to restarting the application process.

Activities will be scheduled for restart via the regular life-cycle.
This is similar to a configuration change but since ApplicationInfo
changes are too low-level we don't permit apps to opt out.

This change is intended to be used with runtime resource overlays and
split APKs.

Test: Manual - command to update application via ActivityManagerShellCommand
Change-Id: Ice10a1691cced90eee95e3278fd784b8a9206d87
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c5cc301689649695e03f502e7d1c1492ef5e5d1e 13-Jan-2017 Wale Ogunwale <ogunwale@google.com> Have better separation between adding, positioning, and reparenting task

Several methods in activity manager and window manager performed adding,
positioning, and reparenting a task operation and sometimes failed silently
when things don't work due the callers using the methods for a particular
operation, but getting a different operation due to programmer error.
This CL better separate the methods responsible for adding, positioning, and
reparenting a task and also fails hard when there is an error.

Test: bit FrameworksServicesTests:com.android.server.wm.TaskWindowContainerControllerTests
Test: Manual testing existing PiP doesn't leave the device in a bad state.
Bug: 34260633
Change-Id: Id64367da30fc6214eb6f95b2bd5e58ed0e953a88
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
32d41b1b38b8ac06aa7b718b1d0da2d2ed71c557 12-Jan-2017 Shukang Zhou <shukang@google.com> Merge "Close a file descriptor before losing its reference."
e2c77f903504766102fe545af40c3e4ebcb3adc7 29-Dec-2016 Jorim Jaggi <jjaggi@google.com> Handle content insets for snapshots

Pass information about content insets of a snapshotted task to
SystemUI and use it there to correctly offset the snapshot
when drawing.

Test: Open app, go to recents, make sure app aligns before
and after the animation.
Bug: 31339431
Change-Id: I2ff9bd44534bd8f66b591385da1e1e3aec40b6c5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
02886a82d876aa5e31a92444fec70208599c509c 06-Dec-2016 Jorim Jaggi <jjaggi@google.com> Initial implementation of snapshots

All this functionality is hidden behind a flag. If this flag is
active, we disable the regular screenshots.

Instead, we take a screenshot when an app transition for which a
task is disappearing is starting. The screenshot gets stored
into a gralloc buffer. SystemUI uses a new method to retrieve
a snapshot gralloc buffer and then draws it using GraphicBuffer.
createHardwareBitmap().

When starting an existing activity in an existing tasks, or when
bringing an existing tasks to front from recents, we add a new
snapshot starting window. For that, we reuse the existing
starting window, but when creating the window, we use a fake
window that draws the contents of the starting window.

Test: runtest frameworks-services -c
com.android.server.wm.TaskSnapshotControllerTest
Bug: 31339431
Change-Id: If72df07b3e56f30413db5029d0887b8c9665aaf4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6853e0dcb435090977aae886c2018c29dfb04d50 12-Jan-2017 Tim Murray <timmurray@google.com> resolve merge conflicts of 8d7b18292b63 to master

Change-Id: Id59ab691bfdb98cff179dfa23e3ddb185e646f53
8d7b18292b63d51c09edf32d57b16fc3f8a03eed 12-Jan-2017 Tim Murray <timmurray@google.com> add additional logging to ActiityManagerService
am: 82e201f03d

Change-Id: I0ea737adc3f59674a0ce313a0a8caa49d926e359
0b7b79a882e4a7680132bfcc24d003baf70d79d5 12-Jan-2017 Tim Murray <timmurray@google.com> Merge "add additional logging to ActiityManagerService" into nyc-mr2-dev
c88368c270504ff93f415da33b40aa32d36a1f60 12-Jan-2017 Felipe Leme <felipeal@google.com> Added BUGREPORT_OPTION_TELEPHONY.
am: a561b1f9c0

Change-Id: I063a0d6c4c66035082789d4361b649439da00bf9
82e201f03d7da6fdaa562bbaad92153a56c2f598 11-Jan-2017 Tim Murray <timmurray@google.com> add additional logging to ActiityManagerService

add logging to help debugging issues with attachApplication/attachApplicationLocked.

bug 34193533
Tests: boots and starts apps

Change-Id: I6ef46dd92e893b71c164bfb28eeba1835dddffee
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8b21542ba3052ad8bec74ff9303c28dd9bd92169 11-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added BUGREPORT_OPTION_TELEPHONY."
3c6f28aa5968b1edb823495efa15e7358de5261e 11-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added TaskWindowContainerController"
3101b3ad21b52be9ef06400b33016cf6c973382f 11-Jan-2017 Robin Lee <rgl@google.com> Merge changes I3fd28e69,If43820b6

* changes:
Lock work tasks from SystemUI instead of ActivityStarter
Bounce work challenge through a WorkLockActivity
e1fe7fa288a34ecaaab390f49ef540edc4a6c52d 16-Dec-2016 Wale Ogunwale <ogunwale@google.com> Added TaskWindowContainerController

For linking TaskRecord in AMS to Task window container in WMS.

Bug: 30060889
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowContainerControllerTests
Test: bit FrameworksServicesTests:com.android.server.wm.TaskWindowContainerControllerTests
Test: Existing test pass and manual testing.
Change-Id: I16248f3e96e5087ba24198a48a3bd10a12ae76a6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9606c3bf5894753d37b32aed909413db680fa396 05-Jan-2017 Felipe Leme <felipeal@google.com> Added BUGREPORT_OPTION_TELEPHONY.

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

BUG: 32589463
BUG: 26849505
Test: manual
Change-Id: I6f90c02779a1e8aead690428626e3b9f06aa04df
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3fef1f284390a2ff7a58e0dcd56cb90bf83d2017 20-Dec-2016 Robin Lee <rgl@google.com> Bounce work challenge through a WorkLockActivity

This stops us from depending on Settings for keeping the work profile
secure. Instead that is delegated to a smaller Activity inside SystemUI
which has just two jobs:

1) Don't let anyone see the content that's supposed to be locked.

2) Start ConfirmCredentialsActivity (still lives in Settings for now)

Bug: 31001762
Test: //cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/MixedManagedProfileOwnerTest#testResetPasswordFbe
Test: //tests/PoApi/src/com/google/android/afwtest/poapi/WorkChallengeTest
Change-Id: If43820b683007a60a37edf32fb65b442a8fb709b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8c72ab3ee65c9e51c17514e44eb66f48ce1fa729 11-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Shuffle around shell protected broadcast checks."
90da5a7c5072bbf97a52c05539c1ac5662b47fbc 11-Jan-2017 Jeff Sharkey <jsharkey@android.com> Shuffle around shell protected broadcast checks.

If a shell is running as root, they should be able to send protected
broadcasts, but we still want to suppress Log.wtf() when sending
broadcasts from the shell.

Test: builds, boots
Bug: 34107119
Change-Id: Id475b2c9d98ca6a675ee1545ed324736f0587caf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a561b1f9c0b02fab5a77f80b0ea0cfa368af0053 05-Jan-2017 Felipe Leme <felipeal@google.com> Added BUGREPORT_OPTION_TELEPHONY.

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

BUG: 32589463
BUG: 26849505
Test: manual
Merged-In: I6f90c02779a1e8aead690428626e3b9f06aa04df
Change-Id: I6f90c02779a1e8aead690428626e3b9f06aa04df
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6d553874bed06280766ae24ea605f9bbde3f5a4a 09-Dec-2016 Felipe Leme <felipeal@google.com> YAMAFFR - Yet Another Major AutoFill Framework Refactoring

- Explicitly split View methods into Assist and AutoFill methods, rather
than use an overloaded method that takes flags.
- Simarly, renamed ASSIST_FLAG_SANITIZED_TEXT and
ASSIST_FLAG_NON_SANITIZED_TEXT flags to
AUTO_FILL_FLAG_TYPE_FILL and AUTO_FILL_FLAG_TYPE_SAVE respectively.
- Created a AutoFillUI class to host the auto-fill bar and other UI
affordances.
- Moved the temporary notifications to AutoFillUI (eventually that
class will host the real UI).
- Moved FillData to android.app.view.autofill package.
- Split IAutoFillCallback in 2 (IAutoFillAppCallback and
IAutoFillServerCallback, residing at the app and system_server
respectively), so service cannot fill the app directly (which lets
the framework control the UI).
- Moved assist's IResultReceiver to AutoFillServiceImpl so
system_server can act as a mediator between the AutoFillService
implementation and the app being auto-filled.
- Replaced FillData and FillableInputFields by a bunch of new objects:
- FillResponse contains a group of Datasets, each representing
different values
that can be used to auto-fill an activity (for example, different
user accounts), optional id of fields the service is interested
to save, and an optional bundle for service-side extras.
- Dataset contains a name, Fields, and an optional bundle for
service-side extras.
- Fields contain an AutoFillId (parcelable) and a value (Bundle)
- Changed the temporary notifications to emulate the new workflow:
- Initial notification requests the auto-fill data but do not
auto-fill.
- Once service calls back, a new notification is shown with the
results.
- Then if the user selects a dataset, the activity is auto-filled
with it.
- It also shows a notification to emulate what can be saved.
- Created an VirtualViewDelegate for views that uses a virtual
hierarchy for assist data.
- Added new methods on ViewStructure to add children with virtual ids.
- Added 2 methods on View to support auto-fill:
- autoFill(Bundle) to auto-fill the view.
- getAutoFillType() to return how the view can be auto-filled.
- AutoFillType defines the input fields that support auto-fill:
- Text fields (like EditText)
- Toggle fields (like CheckBox)
- Lists (like RadioGroup)
- AutoFillType can also have a sub-type representing its semantic (for
now only text fields have it, and it's the same as getInputType()).
- etc :-)

Bug: 31001899
Test: manual verification
Change-Id: I2dd2fdedcb3ecd1e4403f9c32fa644cb914e186f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
54402aab14deb9f21b0a9b451f80113ab9821b04 10-Jan-2017 Andrew Scull <ascull@google.com> Merge "Evict CE key on request and when work mode is turned off."
b9520e49b20f70e991b97fb77f2b5dc015d56229 06-Jan-2017 Shukang Zhou <shukang@google.com> Close a file descriptor before losing its reference.

In ActivityManagerService.profileControl(..), a duplicate of 'mProfileFd'
is passed to the app via proc.thread.profilerControl(..) as the output
file of profiling trace. 'mProfileFd' itself is set to null shortly after.

This made the ParcelFileDescriptor object referred by 'mProfileFd'
unreachable, but the file descriptor remained open until next garbage
collection, which would close the file descriptor before deallocating it.

This behavior was not harmful to ActivityManagerService, but at system
level the file was kept open for longer than it is needed. Other entities
on the system that are interested in the same file may get confused if
they are monitoring the file's status.

This CL closes the file descriptor promptly after it becomes useless.

More details can be found at b/33300094#comment3.

Bug: b/33300094.

Test: Flashed angler-eng build to a Nexus 6P and it worked as expected.
Change-Id: Ifa511dea5101a854c5db5f369504cd04e4425f43
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a8d123de108e5a934db96de6b54132c04e19c3ef 06-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Support for WindowContainer controllers and listeners"
26c0dfed7a0cd54abafdd0ccbb5b757506d51c76 14-Dec-2016 Wale Ogunwale <ogunwale@google.com> Support for WindowContainer controllers and listeners

- WindowContainerController class allows a component outside window manager
to create a window container and communicate directly with it to make
changes. For example, the ActivityRecord class in activity manager uses the
AppWindowContainerController class to create and communicate with
AppWindowToken window container class which is its counterpart on the window
manager side.
- WindowContainerListener interface allows a component outside WM to get
notified of changes to a window container. For example, the ActivityRecord
class in AM implements the AppWindowContainerListener interface to get
notified of changes to the AppWindowToken container.

Bug: 30060889
Test: Existing tests pass and manual testing.
Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerControllerTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests
Change-Id: I2896bfa46a80b227052528c7da8cf4e56beab4bc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a5c336c32dae4586ff88d047a6def87b23d83d26 16-Dec-2016 Wei Wang <wvw@google.com> Move ProcessCpuTracker.init into CpuTracker thread

ProcessCpuTracker.init is slow to start, moving it out of main thread
will accelerate the boot up. ProcessCpuTracker.init is protected with
synchronized keyword, so once the CpuTracker thread is up and running,
we should not see any racing condition caused by this move.

This changes saves ~140ms starting time on marlin

Test: run test frameworks/base/tests/ActivityTests
Bug: 33681304
Change-Id: I260a57ca721999be3a84c0e43837d684e47e3941
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
45b2070637b9a95b366eee486c6483954f84a767 04-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added a deprecation warning to AM.requestBugReport()"
8e514b7864b645b56a6d3eee8038db778cf0965d 04-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Tracing for unaccounted parts"
6dd2ba286664a67046ec6825acadbc108f9fc273 07-Dec-2016 Fyodor Kupolov <fkupolov@google.com> Tracing for unaccounted parts

Bug: 33199244
Test: manual
Change-Id: Idf71332e8ebd666e5e0defada696414b4550ff23
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
dbc2ef417b5689dc502c52312e99f5dc2fd730a3 03-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Offer to measure disk stats using quotas." am: f8720b95be am: 4b80a4a372 am: 1e1cdbead1
am: 7664e61885

Change-Id: I91c0810aad2ec530650855bcd2f1d25c309717a1
7664e6188574a6a10b5dcb70791b15fe3a8c4707 03-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Offer to measure disk stats using quotas." am: f8720b95be am: 4b80a4a372
am: 1e1cdbead1

Change-Id: Ic00acfb0efb6188a15357322528075d41467310b
1e1cdbead134b55301786c85e8fe5ec8776df061 03-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Offer to measure disk stats using quotas." am: f8720b95be
am: 4b80a4a372

Change-Id: I2ab9a2bd2ff60cafea332998789ad947dda0140b
4b80a4a3727f7f9fc45997fb6c1ac8e708a2bc65 03-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Offer to measure disk stats using quotas."
am: f8720b95be

Change-Id: I56bab3ec4895c232ce8287623827c20f2dbfaaf6
5eb3eb58acf18dd624c477d5b11b45a23aea6261 13-Dec-2016 Jeff Sharkey <jsharkey@android.com> Offer to measure disk stats using quotas.

Now we're getting somewhere! This CL starts measuring disk usage
using quotactl(), which is almost instant and has much lower impact
on flash memory lifetime.

We now grant the per-app cache GID to every launched app, and the
ContextImpl logic that creates cache directories matches the logic
down in installd.

Test: builds, boots, quota stats match manual stats
Bug: 27948817
Change-Id: Ie269a2958ce0e1c17cb74dbfecc791a5c12922cf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
96b97d722f14cd18223b00aaf57ef6b0db47dc0c 29-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Disallow entering PiP without dismissing keyguard."
0655da0374caff1569c09017e17ac28c4b0b7069 17-Dec-2016 Winson Chung <winsonc@google.com> Disallow entering PiP without dismissing keyguard.

- If an activity is showing on the keyguard and enters picture-
in-picture, then prompt the user to authenticate first
- Fixing NPE in SystemUI due to null runnable being added to the
post-keyguard-gone callbacks
- Prevent FLAG_SHOW_WHEN_LOCKED from applying when determining
visibility over keyguard for activities that are in the pinned
stack

Bug: 33660880
Test: android.server.cts.KeyguardLockedTests
Test: #testEnterPipOverKeyguard

Change-Id: I89477a8a0067e285e5d0122e918fac45274c57ad
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d276563b38907647ce70940e1e90603826df6ab4 13-Dec-2016 Andrii Kulian <akulian@google.com> Add positionChildAt method to WindowContainer

Added method to change the position of a child among siblings.
It accepts int value, which can either specify a target position
or POSITION_TOP/POSITION_BOTTOM.
When child is moved to top or bottom, there is an option to also
perform same action on parents. This will effectively move the
entire branch of the hierarchy tree to top/bottom.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests
Test: #testPositionChildAt
Test: #testPositionChildAtIncludeParents
Test: #testPositionChildAtInvalid
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackContainersTests
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackTests
Change-Id: I6ade787487055f1c9a305afea64270c243196614
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1205974dd7a1a176627d1f11cbbac8ff3d7f06ff 21-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Always create grant structures when persistable."
08f1959e1050f339dfe1821760da717634760661 21-Dec-2016 Jeff Sharkey <jsharkey@android.com> Always create grant structures when persistable.

Certain apps may already hold permissions to an underlying provider,
but they expect APIs like takePersistableUriPermission() and
getPersistedUriPermissions() to work when a permission grant was
extended with FLAG_GRANT_PERSISTABLE_URI_PERMISSION.

Test: builds, boots
Bug: 31239684
Change-Id: I4b21c57956b70133ecadb50d0d3ee339f41e2260
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f8efc667734b027165f755604b3430dec783777f 21-Dec-2016 Jeff Sharkey <jsharkey@google.com> Merge "Relax protected broadcast checks for shell."
6a34e5678089f9870ea0f0ced9c17c684a5d0a33 21-Dec-2016 Jeff Sharkey <jsharkey@android.com> Relax protected broadcast checks for shell.

On userdebug/eng devices, the shell can run as non-shell UIDs, so
define a flag to identify broadcasts coming from the shell, and
don't yell if they're non-protected.

Test: builds, boots, root shell can send broadcasts
Bug: 32369665
Change-Id: I5f55930ee434cb8318c86aaf05eba3c59a326694
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cabf9af3190fa37d8f6f7320965cd54391d6808e 20-Dec-2016 Carmen Jackson <carmenjackson@google.com> Merge "Add tracing for broadcast sending."
85a63bc1a06870b5a86926b0bce94a2bf559e3f0 24-Oct-2016 Andrew Scull <ascull@google.com> Evict CE key on request and when work mode is turned off.

DPMS.lockNow takes a flag which can request the managed profile CE key to
be evicted.

Test: com.android.cts.devicepolicy.ManagedProfileTest#testLockNowWithKeyEviction*
Bug: 31000719
Change-Id: I68f4d6eed4b041c39fd13375f7f284f5d6ac33da
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
10bb9b56392b5e718c1e0589ad3ce82a98c8f656 20-Dec-2016 Felipe Leme <felipeal@google.com> Added a deprecation warning to AM.requestBugReport()

BUG: 33776167
BUG: 26187278

Test: not needed

Change-Id: I2cfc1a403ad74740e3315bba96f7b124c59c9815
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9e2366704b5ea82347f0d682f8f9a9a7aa2ad4f8 14-Dec-2016 Carmen Jackson <carmenjackson@google.com> Add tracing for broadcast sending.

Trace broadcasts at the time they're being processed, including
information about the caller and the intent payload.

Bug: 33645477
Test: https://screenshot.googleplex.com/9W1ugzJtVeK &
https://screenshot.googleplex.com/3RbERMPo1sA
Change-Id: I2fcfb8e056881f4ad60ec2ec3c7bf3e0e1060194
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0603a0c21fd1185f606842d7b8fe567549140992 17-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Move tasks to fullscreen stack when removing the pinned stack."
f4b0962cac1c4922716608215d7b089e3dd488a6 16-Dec-2016 Tamas Berghammer <tberghammer@google.com> Enable logwrapper functionality on user builds am: 0ca16fa584 am: db05d4b4ed am: ed8757a761
am: f00963c71f

Change-Id: I10b9a367a1c2477683dbb404ebb8bfdd41d92263
a5a598c969beaebfd52531afbb93c3fe816c9a0e 16-Dec-2016 Tamas Berghammer <tberghammer@google.com> Zygote: Add invoke-with to zygote protocol am: b8f7c351b9 am: 45c2fffc52 am: d71bb300e6
am: b8d0e4d9fc

Change-Id: I7d962109d6fae5e0a359cb3fe04b1fc191e545de
f00963c71f00e8c7cd5ed294941b93ff54b6b0a7 16-Dec-2016 Tamas Berghammer <tberghammer@google.com> Enable logwrapper functionality on user builds am: 0ca16fa584 am: db05d4b4ed
am: ed8757a761

Change-Id: I0f27f6aeb58690addb1c5f7978047ccb8d73ab84
b8d0e4d9fc663b7c44a114000862f0fb3130fb45 16-Dec-2016 Tamas Berghammer <tberghammer@google.com> Zygote: Add invoke-with to zygote protocol am: b8f7c351b9 am: 45c2fffc52
am: d71bb300e6

Change-Id: Ied54640c44ade52abd6a905526ba7789be14a332
ed8757a761f26e747ffc62d28f3c477038066075 16-Dec-2016 Tamas Berghammer <tberghammer@google.com> Enable logwrapper functionality on user builds am: 0ca16fa584
am: db05d4b4ed

Change-Id: Ic6c3395f9965657a7f9abe580867eeb81b59ed88
d71bb300e6626b6e36a7718cbb98f6c987208501 16-Dec-2016 Tamas Berghammer <tberghammer@google.com> Zygote: Add invoke-with to zygote protocol am: b8f7c351b9
am: 45c2fffc52

Change-Id: I90999d84c9694bfeebea8d2c2d95d1d545bac7e8
db05d4b4ed10b56e0d72dea6ab94c64c68175f5a 16-Dec-2016 Tamas Berghammer <tberghammer@google.com> Enable logwrapper functionality on user builds
am: 0ca16fa584

Change-Id: Ic18991f9a59f05356fcbcc65acc79be43fc68542
45c2fffc52f55891f758e61a07c39287b87ed3e6 16-Dec-2016 Tamas Berghammer <tberghammer@google.com> Zygote: Add invoke-with to zygote protocol
am: b8f7c351b9

Change-Id: I79db6f759b02ef612364fc857102615d51900cd9
010927a96707248115d60ddffd4c32f0197e978d 16-Dec-2016 Winson Chung <winsonc@google.com> Move tasks to fullscreen stack when removing the pinned stack.

- When the user dismisses the PiP, it's not necessarily desirable
for the tasks to be destroyed and non-accessible from Overview.
As a result, we shift the tasks from the pinned stack to the
fullscreen stack, either under the existing top visible
fullscreen task, or to the top of the stack if the fullscreen
stack is not visible.

Bug: 33304808
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testRemovePipWithNoFullscreenStack
Test: #testRemovePipWithVisibleFullscreenStack
Test: #testRemovePipWithHiddenFullscreenStack

Change-Id: I802f44949705f86c55bdbd8ce0fd839513a8d95b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0ca16fa58454b1685afcf8cf49c4b67b59221349 11-Nov-2016 Tamas Berghammer <tberghammer@google.com> Enable logwrapper functionality on user builds

When an app is debuggable, check whether a script called "wrap.sh" exists
in the app's native library directory. If so, start the app using the
invoke-with functionality over the script. Weaken the invoke-with check
on the zygote side to allow the functionality for debuggable apps.

The goal of the functionality is to make malloc debug, strace and other
similar tools available for NDK based application developers.

Bug: 33668201
Test: manual - debug malloc can be enabled using the new feature
Change-Id: Ia4bec0854cf4dc08446f1671494200f54ef366ee
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b8f7c351b97da590a4bd8da3dddbab166f9f789d 11-Nov-2016 Tamas Berghammer <tberghammer@google.com> Zygote: Add invoke-with to zygote protocol

Add "--invoke-with" to the zygote connection protocol. It was
already understood as an argument by the zygote.

Bug: 33668201
Test: m
Change-Id: I59095f2ac542aadff78a7ff1dded86cf5f192707
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cc43150bd76d1f61ff13e32d9c45ca3beb5d7edc 16-Dec-2016 Ruben Brunk <rubenbrunk@google.com> Don't call into VrManagerService with AM lock.
am: 27b53cfe88

Change-Id: I9670487f160e9ef2af6b8da250943c7ad4749e5d
fecb615093e9781309efcc4d51ffb1808f26415d 29-Oct-2016 Ruben Brunk <rubenbrunk@google.com> Fix VR interaction with screen on/off/lockscreen.

- Add mechanism to prevent VR mode from being enabled.
- Disable VR mode while screen is off, or user is in lockscreen,
and re-enable when this is no longer the case.

Test: Fix merge from nyc-mr2-dev.

Bug: 31665197
Bug: 33655854
Change-Id: If777e0ef40b29bff42722f2aa10cff86a5831bc0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
27b53cfe88df05f015c509259993071d54cdcb36 16-Dec-2016 Ruben Brunk <rubenbrunk@google.com> Don't call into VrManagerService with AM lock.

Bug: 33655854
Merged-In: If777e0ef40b29bff42722f2aa10cff86a5831bc0
Change-Id: I365d0033cf20172cee57b0ef2a53dd8648640c8d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5fb5881dbd08f6a14a5b8caa482d4a61776f9bcb 15-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adding support for PIP actions."
854e46bd087dcac6c4b8adc2fec007e48784f79e 15-Dec-2016 Jorim Jaggi <jjaggi@google.com> Merge "Revert "Fix VR interaction with screen on/off/lockscreen.""
bbb5b6e8db346df613c15447c0697def8a76584d 15-Dec-2016 Jorim Jaggi <jjaggi@google.com> Revert "Fix VR interaction with screen on/off/lockscreen."

This reverts commit dfe0d7157da8e8a40ee86f0875531bfe2d657831.

Reason for revert: 33655854

Change-Id: Ie8573a394dee768859d64493dd8c17ee0c613287
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
73aeea2da24bf0d4eae0dc803df18d1266f85136 18-Nov-2016 Lenka Trochtova <ltrochtova@google.com> Make master clear constants system APIs.

This is needed for unbundling of the OobConfig apk.

Test: gts-tradefed run gts -m GtsGmscoreHostTestCases --test com.google.android.gts.devicepolicy.DeviceOwnerUserRestrictionTest#testFactoryReset_disallowFactoryReset

Bug: 32974361

Change-Id: I71e7270bb4c3234ec0516382b18a2ca35aab4c81
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a29eb98d9fba99528f0809c448daf2ddae37de7e 14-Dec-2016 Winson Chung <winsonc@google.com> Adding support for PIP actions.

- Introduced generic RemoteAction to represents an action
that can be made across processes with an icon and text
description based on a Notification action.
- Modified PinnedStackController to ensure that it notifies
the listeners from the source of truth, this ensures that
SysUI is in the right state if killed and re-registers
itself.

Test: Enable menu & minimize in SystemUI tuner.
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testNumPipActions

Change-Id: I5b5d0cf9de3f06b5687337d59cfb91e17355bdb1
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a97a01e5a2f63363b2852ac06bb36ab26cb0e525 14-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added supports-split-screen-multi-window command to am"
124460817263f5449d59a4345ab24dde82645bd9 14-Dec-2016 Ruben Brunk <rubenbrunk@google.com> Fix VR interaction with screen on/off/lockscreen.
am: 040484cf90

Change-Id: I16023e2b02d9660b8c109c1586125316526f3fc9
3661a6f91b29de855597effaed555f64e316f458 14-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix VR interaction with screen on/off/lockscreen." into nyc-mr2-dev
dfe0d7157da8e8a40ee86f0875531bfe2d657831 29-Oct-2016 Ruben Brunk <rubenbrunk@google.com> Fix VR interaction with screen on/off/lockscreen.

- Add mechanism to prevent VR mode from being enabled.
- Disable VR mode while screen is off, or user is in lockscreen,
and re-enable when this is no longer the case.

Test: Fix merge from nyc-mr2-dev.

Bug: 31665197
Change-Id: Ia0a7fe8d443a24dce9395053cfe3d1c5847a88f2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
040484cf902d70d7c4b5af8f35cbf33f5c3ef4a7 29-Oct-2016 Ruben Brunk <rubenbrunk@google.com> Fix VR interaction with screen on/off/lockscreen.

- Add mechanism to prevent VR mode from being enabled.
- Disable VR mode while screen is off, or user is in lockscreen,
and re-enable when this is no longer the case.

Merged-In: Ia0a7fe8d443a24dce9395053cfe3d1c5847a88f2

Bug: 31665197
Change-Id: Ia0a7fe8d443a24dce9395053cfe3d1c5847a88f2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4460839e5ce43777e7f32841e4ab2e2ce0008257 13-Dec-2016 Ivan Podogov <ginkage@google.com> Finish resolving conflict from d23dc17

Test: Treehugger
Change-Id: If7fa9f7e300f3d810e41447369ccbbfbc3963b94
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
903d6414e51ace98fa67fb5bf6f103ff9e4303d5 13-Dec-2016 Ivan Podogov <ginkage@google.com> resolve merge conflicts of b1e2da7 to nyc-mr1-dev-plus-aosp

Test: build police
Change-Id: Ifec1ab6760ebb94b0b411c9c60f07066e151206b
d23dc17754f1ef1416f4dfb36c9226626113f08c 13-Dec-2016 Svetoslav Ganov <svetoslavganov@google.com> Add Bluetooth toggle prompts - framework
am: b1e2da7c24

Change-Id: I29c038d23488c504c838a85bd97c255b84919aab
e5592abb83916cdb32e23d6b4812d91dcce34646 13-Dec-2016 Ivan Podogov <ginkage@google.com> Merge changes from topic 'f-radio-toggle' into cw-f-dev

* changes:
Add WiFi toggle prompts - framework
Add Bluetooth toggle prompts - framework
d4f08a007d7b640c0bd046c7a8168fb93491b7e3 13-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AutoFill Framework refactoring."
1ca634a544a47193dd9e57f9b3eb3e42ab0dbbf1 29-Nov-2016 Felipe Leme <felipeal@google.com> AutoFill Framework refactoring.

The AutoFill Framework uses the same AssitStructure provided by the Assist API
and so far it was using the same methods as well, both internally and externally
(public API).

Sharing that internal code internally is fine, but the public APIs must distinguish between the 2 cases so they can fill the assist structures accordingly (although the initial implementation still shares the same logic).

This CL also splits the original 'auto-fill' request in 2 types of requests,
which are set by View flags:

- ASSIST_FLAG_SANITIZED_TEXT
- ASSIST_FLAG_NON_SANITIZED_TEXT

It also added new methods and callbacks to handle save requests.

Bug: 31001899
Test: manual verification

Change-Id: I4eb09099dc19a43cb7e053e64d939aed3704b410
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
72d633f430264181baf93f3344dfbcf269cd7c62 12-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Scope package manager queries for ephemeral apps"
c2ac5bde6f6e9cc95a476a2404f020246516ccfc 30-Jun-2016 Svetoslav Ganov <svetoslavganov@google.com> DO NOT MERGE Add Bluetooth toggle prompts - framework

If permission review is enabled toggling bluetoth on or off
results in a user prompt to collect consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

Also added a configuration resource which controls whether
permission review mode is enabled. By default it is not and
an OEM can change this via an overlay. For now we also keep
the old mechanism to toggle review mode via a build property
which is still used and will be removed when clients have
transitioned.

bug:28715749
Change-Id: I77bca2305f9d0f20034b2c8fc5b58e0565d5e617
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7bc3a70966f17bf16acbf4fe640dab0698866d72 08-Dec-2016 Todd Kennedy <toddke@google.com> Scope package manager queries for ephemeral apps

Ephemeral apps can only see their own components or those components
exposed via the "visibleToEphemeral" XML attribute.

Normal apps can only see other normal apps. There is no way to expose
ephemeral components to normal apps.

Bug: 33458220
Test: Manually install ephemeral/normal apps and ensure they can only see appropriate components
Change-Id: I6ae65fd2a6ddc9aa9691f02cd55d4953048966b0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c5b56942024a3211234cf35fed44e3e732143947 11-Dec-2016 Jeff Sharkey <jsharkey@android.com> Merge commit '7797e545239e81a9216994527badcc98178ebfcc' into dec10

Change-Id: I430a39241bd2d278eaf1e01b89be3ad368789f6d
9ff67746e60ce9e49d7c21e2af087c081873c544 11-Dec-2016 Jeff Sharkey <jsharkey@android.com> Merge "Final push of installd to Binder; goodbye socket!" am: 1950377f91
am: 104fd011b2

Change-Id: I4b2ae2329e8842def8682199c5ee8544c22c2be4
740f523b2571d1c4eb4a954e1faedea45dd7fa53 09-Dec-2016 Jeff Sharkey <jsharkey@android.com> Final push of installd to Binder; goodbye socket!

Move last two straggling installd commands to Binder and destroy the
socket-based communication channel forever.

Test: builds, boots, apps install fine, pre-OTA dexopt works
Bug: 13758960, 30944031
Change-Id: I9afb9f71858febde34a94f53839b2986493b68a0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
626e0cc0aab466b6f0c8ac3608ba76995230ef24 08-Dec-2016 Matthew Ng <ngmatthew@google.com> Added supports-split-screen-multi-window command to am

The supports-split-screen-multi-window command allows the ability to
check if the device has split screen multiwindow support in shell. The
other changes allows the code to determine if the device has support for
it as well.

This will also help CTS tests to determine if the device has split
screen before trying to run the test.

Test: manual - adb shell am supports-split-screen-multi-window
Change-Id: I3da32b5b03712a8537104469d67100ec796de9e6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2498d0e39aff17f6deb29cbe124bafa76d20b416 09-Dec-2016 Jeff Sharkey <jsharkey@android.com> Fix race condition bug related to freezing apps. am: 41d2be0f0f am: 453efdc065
am: 1395bf02cc

Change-Id: I7d9478a626e3217cf061da22394d4c6263f1fb66
1395bf02ccb2d9b77200dd67ac509992eee85a55 09-Dec-2016 Jeff Sharkey <jsharkey@android.com> Fix race condition bug related to freezing apps. am: 41d2be0f0f
am: 453efdc065

Change-Id: I879874943a30db52cfb91d5902126c275cf2ecac
a025a0cdec3ef962a72c0a15264d7282068a7331 09-Dec-2016 Jeff Sharkey <jsharkey@android.com> Fix race condition bug related to freezing apps.
am: 41d2be0f0f

Change-Id: I0b308d992725d0ffb0643157fdad27b394ff992a
41d2be0f0f824c002090c2fb663a0a9cdafca034 09-Dec-2016 Jeff Sharkey <jsharkey@android.com> Fix race condition bug related to freezing apps.

Consider the following situation:

1. Package is frozen.
2. We try forking the app while frozen, causing a ProcessRecord with
PID 0 to be recorded in mProcessNames. As a result of the failed
fork, removeProcessLocked() tears down that ProcessRecord, but a
special case records it into mRemovedProcesses.
3. Package is unfrozen.
4. We try forking the app, and this time it proceeds normally now
that we're unfrozen. The new valid ProcessRecord is recorded in
mProcessNames.
5. activityIdleInternalLocked() triggers a clean-up pass of
mRemovedProcesses. trimApplications() ends up cleaning up the
stale reference from (2) above *by hash key* and not *by reference*,
which causes us to remove the new valid ProcessRecord. This results
in the valid ProcessRecord in (4) becoming an orphaned PID, which
starts a chain reaction of havoc that ensues.

This issue is fixed by checking the expected ProcessRecord by value
before actually removing it, thus preventing orphaned PIDs.

Test: builds, boots, over 600 installs without orphaned PIDs
Bug: 28395549
Change-Id: I5ea1b31c3fd374ea7f5cc40ff35bb9195d9f3e2b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e3a3524dac2c63546866dd0e6ccbf7f47279904a 08-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I6477b6d1,Ieb11345f

* changes:
Adding ability for an app to request auto-enter picture-in-picture.
Only allowed visible, non-stopped activities to enter PIP.
b5c41b786862618b22e532849ddcca48bdc40025 08-Dec-2016 Winson Chung <winsonc@google.com> Adding ability for an app to request auto-enter picture-in-picture.

- If an activity requests that it can auto-enter PIP, then we will trigger
it to enter PIP when the task is effectively being occluded. This does
not affect the activity when the screen is locking, or if it starts new
activities within its own task, or if it finishes itself, or if there is
already a PIP activity.
- Changed setPictureInPictureAspectRatio to also specify the aspect ratio
to use when auto-entering PIP. If the activity is not PIP'ed and has
not requested auto-enter, then the call continues to fail.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testAutoEnterPictureInPicture
Test: #testAutoEnterPictureInPictureLaunchActivity
Test: #testAutoEnterPictureInPictureFinish
Test: #testAutoEnterPictureInPictureAspectRatio
Test: #testAutoEnterPictureInPictureOverPip

Change-Id: I6477b6d1f160cf0219d935123bbb505f57ee7a56
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e630804797b4be77ee7aa6b8f5d82efe0c5f09a4 31-Oct-2016 Winson Chung <winsonc@google.com> Only allowed visible, non-stopped activities to enter PIP.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testDisallowPipLaunchFromStoppedActivity

Change-Id: Ieb11345f09019bc83d6aaf92acbc3fb986d9ec43
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1e129a4212ec3b388c65db8f6ce18896362ac35c 21-Nov-2016 Wale Ogunwale <ogunwale@google.com> Reduce object allocations in WM in some frequently called methods

With the use of lambdas to get all windows in the window container
hierarchy, we need to be careful in frequently called code paths to
make sure the number of objects we allocate isn't crazy. This CL
converts some commonly called code paths that use lambda to use a
method reference for the lambda so we only need to allocate once vs.
each time the code path is executed.

Test: Perform some common operations on the phone and make sure
the object allocations that show-up in Allocator Tracker for
window manager seems reasonable

Change-Id: Ie0f245980de96ec68a4e62e76130db7d98c3f7d9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
04a7a5370c02c21601d3a6ab46749d234ac39cff 02-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Split home stack into home and recents stack"
37d3eecbac3645d7d8245c1064efc96176c00093 02-Dec-2016 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE: Check provider access for content changes. am: c813f5dae2
am: 2b7584f5b1

Change-Id: I1a74f306a4d9858a4e9726cd53ab544d28542522
2b7584f5b164618296f845fe7cfa19238653cb1a 02-Dec-2016 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE: Check provider access for content changes.
am: c813f5dae2

Change-Id: I939bca8887198e2578916356d49b0f2f0a2bf3d2
5ec25934ce64d9f7e85dec34c8901da88cb27233 02-Dec-2016 Jeff Sharkey <jsharkey@google.com> Merge "DO NOT MERGE: Check provider access for content changes." into nyc-mr1-dev
e4ddf44967e90cc9fd13ba748def97ef99d06342 02-Dec-2016 Robert Sesek <rsesek@google.com> Merge "Add new hostingType for startProcessLocked() that selects using the WebViewZygote." am: eda1af611f am: bbcd9d26b1 am: 5806963539
am: 5c44250176

Change-Id: Ia1a819697d7144073f824a98dd8a315eb60c779b
5806963539445b1f0dc83d7060f286a658d4fc06 02-Dec-2016 Robert Sesek <rsesek@google.com> Merge "Add new hostingType for startProcessLocked() that selects using the WebViewZygote." am: eda1af611f
am: bbcd9d26b1

Change-Id: I7b7fbf2cc65712bd748a577c2eee1c0a1e35efee
bbcd9d26b13117c867cd6be6812f7f330c1e8554 02-Dec-2016 Robert Sesek <rsesek@google.com> Merge "Add new hostingType for startProcessLocked() that selects using the WebViewZygote."
am: eda1af611f

Change-Id: I539fb728175c109a93cbff7d8929b584e88bb70c
eda1af611fd9542693a35c6ead405159b950ff76 02-Dec-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Add new hostingType for startProcessLocked() that selects using the WebViewZygote."
b1e2da7c24613ce393bca871069d379cd4378c26 30-Jun-2016 Svetoslav Ganov <svetoslavganov@google.com> Add Bluetooth toggle prompts - framework

If permission review is enabled toggling bluetoth on or off
results in a user prompt to collect consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

Also added a configuration resource which controls whether
permission review mode is enabled. By default it is not and
an OEM can change this via an overlay. For now we also keep
the old mechanism to toggle review mode via a build property
which is still used and will be removed when clients have
transitioned.

bug:28715749

Change-Id: I94c5828ad6c8aa6b363622a26ff9da4fc2e2fac7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6dbcefeea6356860c5b2c765240cdc9ff904f649 02-Dec-2016 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE. Retain DownloadManager Uri grants when clearing. am: 6eee8e37fd
am: 6795459a80

Change-Id: I2ca4cd7315a5e22c0bc53519b3705248ebf924ed
6795459a80c536e9c7858e5b7fb2519c795506f3 02-Dec-2016 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
am: 6eee8e37fd

Change-Id: I431b334bbf3580f51fc8e31da28c9c9d6f5944ee
6eee8e37fd06bd47dd19b8503bc30cc8ccaf72a7 01-Dec-2016 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE. Retain DownloadManager Uri grants when clearing.

As part of fixing a recent security issue, DownloadManager now needs
to issue Uri permission grants for all downloads. However, if an app
that requested a download is upgraded or otherwise force-stopped,
the required permission grants are removed.

We could tell DownloadManager about the app being stopped, but that
would be racy (due to background broadcast), and waking it up would
degrade system health. Instead, as a special case we now only
consider clearing DownloadManager permission grants when app data
is being cleared.

Bug: 32172542, 30537115
Test: builds, boots, app upgrade doesn't clear grants
Change-Id: I7e3d4546fd12bfe5f81b9fb9857ece58d574a6b9
(cherry picked from commit 23ec811266fb728cf159a90ce4882b3c9bac1887)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ae1ff4f85ffd12ab8a14c610b1474a012536888f 11-Nov-2016 Matthew Ng <ngmatthew@google.com> Split home stack into home and recents stack

Refactored functionality of home stack (HOME_STACK_ID) in the code
base to home stack and recents stack (RECENTS_STACK_ID). Also changed
function and variable names from homeStack to homeOrRecentsStack.

Differentiating home and recents stack will allow readablilty and
managing logic between home and recents stacks. For example, for
multi-window minimized dock state, the home and recents stacks can
be set to different rects where the home stack needs to be a fixed
large size while the recents stack is hidden and the dock stack is
animating to be minimized.

Fixes: 32839371
Test: ./run-test android.server.cts and manually tested split and
rotation
Change-Id: I7603359c2dc20e35924664178634eb761e0367a6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ed1b65b1ca22532ef8ecf823279ead4fb26151d3 01-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Retain DownloadManager Uri grants when clearing."
f81df2d5e52e50fe7197135baf5cabcabdba4628 01-Dec-2016 Amith Yamasani <yamasani@google.com> Merge "Secure MATCH_UNINSTALLED_PACKAGES across users"
23ec811266fb728cf159a90ce4882b3c9bac1887 01-Dec-2016 Jeff Sharkey <jsharkey@android.com> Retain DownloadManager Uri grants when clearing.

As part of fixing a recent security issue, DownloadManager now needs
to issue Uri permission grants for all downloads. However, if an app
that requested a download is upgraded or otherwise force-stopped,
the required permission grants are removed.

We could tell DownloadManager about the app being stopped, but that
would be racy (due to background broadcast), and waking it up would
degrade system health. Instead, as a special case we now only
consider clearing DownloadManager permission grants when app data
is being cleared.

Bug: 32172542, 30537115
Test: builds, boots, app upgrade doesn't clear grants
Change-Id: I7e3d4546fd12bfe5f81b9fb9857ece58d574a6b9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
42bb160818776e13ee147abf3a1f388bb4fcbe6b 01-Dec-2016 Jeff Sharkey <jsharkey@google.com> Merge "Grant MMS Uri permissions as the calling UID."
7ff418d9a9afb9ecf42f87fffd3e65477decb55e 30-Nov-2016 Jeff Sharkey <jsharkey@android.com> Grant MMS Uri permissions as the calling UID.

A recent security fix prevents the system UID from handing out Uri
permission grants directly from itself. Instead, services need to
issue grants as the original calling UID to ensure that the caller
actually has access to the Uris.

Test: builds, boots, send/recv MMS works in primary/secondary users
Bug: 33231106
Change-Id: Ia9fe19843b52977c8a94ee5349b907beda1882fc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0d1fd8d09163566d2c7eb72037f63b6404ada642 12-Oct-2016 Amith Yamasani <yamasani@google.com> Secure MATCH_UNINSTALLED_PACKAGES across users

Introduce a new internal flag MATCH_ANY_USER for genuine uses
of searching through all apps on the device.

Some temporary accommodations for Launchers that reach across
to the work profile until we have a new LauncherApps API to do
that officially.

Bug: 31000380
Test: CTS tests added
Change-Id: I2e43dc49d6c2e11814a8f8d1eb07ef557f31af34
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
13b590bc5b6afadfb60ae7dc6770378ba6e0319b 30-Nov-2016 Mark Lu <Mark_Lu@htc.com> Merge "Fix batterySendBroadcast not synchronized issue." am: 32e756a4bc am: 15df815e1e am: e5a3ad23fd
am: 835932f4c5

Change-Id: I0e23e30c6f5f29b6df50ec9dab0707c3ce73bfb4
15df815e1e3f38e60deed5e1c1678710e41491bb 30-Nov-2016 Mark Lu <Mark_Lu@htc.com> Merge "Fix batterySendBroadcast not synchronized issue."
am: 32e756a4bc

Change-Id: Ieab665e92bdb17c449c82de66604fbef5688de17
32e756a4bcb5e98869a13c5c748c47b294c1e363 30-Nov-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Fix batterySendBroadcast not synchronized issue."
ca007a6284d487bc560e62a7dd5ebe04334cb6c1 23-Nov-2016 Andrii Kulian <akulian@google.com> Check if the display is attached when updating config

The display might not be added yet or be already detached when
config is updated.

Bug: 32983305
Test: android.media.cts.EncodeVirtualDisplayWithCompositionTest
Test: #testVirtualDisplayRecycles
Change-Id: I3b0e52e8ebb93a57ab6b0e80c0599db33ce2ae03
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c5f86647b19d5cac4d9874ef84954fcf7a6d5fa9 04-Nov-2016 Robert Sesek <rsesek@google.com> Add new hostingType for startProcessLocked() that selects using the WebViewZygote.

Test: m
Test: angler boots
Test: Turn on Multiprocess WebView in Developer Options and launch the WebView
Shell. The sandboxed_service parent process is the webview_zygote.

Bug: 21643067
Change-Id: I9dab548853372fd91f6bbe204cc8686ef2e94448
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d25cf04e9880c69d370bab21de0068cec5502267 29-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add explicit method to dismiss Keyguard"
241ae10b2189f449e57d8d660235ac56d8fb1b80 03-Nov-2016 Jorim Jaggi <jjaggi@google.com> Add explicit method to dismiss Keyguard

The flag is a bit clunky for most cases, and a method is more
clear.

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
android.server.cts.KeyguardTests

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
android.server.cts.KeyguardLockedTests

Test: runtest systemui -c
com.android.systemui.keyguard.DismissCallbackRegistryTest

Bug: 30961403
Bug: 27422134
Change-Id: I39de90c7cfecd99350a74f72cd76418e337f2b79
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3dfca02da4d1a324fded26ab4bb2251b6fe7a27f 22-Nov-2016 Neil Fuller <nfuller@google.com> Merge "Change EXTRA_TIME_PREF_24_HOUR_FORMAT from boolean to int"
2dfe92c2dfbaddd69dabe6e43ab77c4c204c4065 21-Nov-2016 Jeff Sharkey <jsharkey@android.com> No direct Uri grants from system.

The system should never be extending Uri permission grants from
itself, since it automatically holds all the permissions. Instead,
the system should always be a mediator between two specific app, and
it should be using startActivityAsCaller() if it needs to extend
permissions.

Blocking at this level fixes an entire class of confused deputy
security issues.

Test: builds, normal intent resolution UI works
Bug: 33019296
Change-Id: Iaa57c393a386d8068e807d0dd0caccc89d8a11db
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ca50c360bf29b2d93369661e4141c32eb29fb920 21-Nov-2016 Jeff Sharkey <jsharkey@google.com> Merge "Check provider access for content changes."
b7146fec0d864fc8d107ff42c863f999d1129c84 15-Nov-2016 Neil Fuller <nfuller@google.com> Change EXTRA_TIME_PREF_24_HOUR_FORMAT from boolean to int

... on Intent.ACTION_TIME_CHANGED.

This is to better represent the possible settings values for
the "use 24 hour format" setting. These are "12" (use 12 hour
formatting), "24" (use 24 hour formatting), unset
(use locale default formatting).

The EXTRA_TIME_PREF_24_HOUR_FORMAT for the ACTION_TIME_CHANGED
is now an int, not a boolean. 0 means "12", 1 means "24" and
2 means "use locale default". This is not a backwards compatible
change but the EXTRA_TIME_PREF_24_HOUR_FORMAT is not public
and so should only affect platform code that generates or
consumes the intent like settings code.

There are associated changes to Settings code to update the source
of the Intent.

The related underlying code that is triggered in response to the
intent and previously assumed a boolean now takes a Boolean.

Other changes:

The ActivityManagerService now only sends a binder notification
to running services if the EXTRA_TIME_PREF_24_HOUR_FORMAT
is present. There is an example of ACTION_TIME_CHANGED
being sent from the platform (AlarmManagerService, when the system
clock is noticed to have changed independently of the RTC) that
does not set the extra and would previously have misinterpreted
to mean "user wants 12 hour formatting", which would have been a
bug.

i.e. the code from ActivityManagerService that would interpret the
missing extra as false:

final int is24Hour =
intent.getBooleanExtra(
Intent.EXTRA_TIME_PREF_24_HOUR_FORMAT, false) ? 1 : 0;

Some methods and constants have be renamed to better reflect their
use.

Bug: 32761619
Bug: 32933009
Test: Manual testing
Change-Id: Ie7e9c62ce65e7e3a056b2751b45fe6cb9de86498
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
428d4847d4ab5ee69f17c69c9b3375fe6d885f50 18-Nov-2016 Chris Tate <ctate@android.com> Merge "Schedule agentDisconnected() in handler thread" am: c02a4a4613 am: 72a838e704 am: 18d0df806e
am: f053fc7133

Change-Id: Ice34a562d184b5228f7ffa2adf47a5e9c1e37a82
72a838e70433fdf0699e738baf37f5f0d6eb5848 18-Nov-2016 Chris Tate <ctate@android.com> Merge "Schedule agentDisconnected() in handler thread"
am: c02a4a4613

Change-Id: I1e2da0be53678a791dd16be5d00caa5e712fa036
c02a4a46139761f1bb06540007a322dbd83fea0a 18-Nov-2016 Chris Tate <ctate@android.com> Merge "Schedule agentDisconnected() in handler thread"
9ccb85d344bd9e569efee47b3450c2c6c4f8049c 18-Nov-2016 Jeff Sharkey <jsharkey@android.com> wtf() should not be fatal for core components.

Core system components (such as those marked as "persistent") are
aggressively restarted by the system, so crashing them as a side
effect of wtf() could easily cause system instability.

Instead, this change now treats persistent processes the same as the
system_server; we still log the wtf() event, but we don't crash
the app.

This change also causes wtf() events to be fatal on "eng" builds,
which will result in bugs being caught earlier during development
instead of later during QA testing.

Test: builds, boots, SystemUI no longer crashes
Bug: 32976626
Change-Id: Ib2d1a73379be40556f8dab5d1f15b9ed91ba7082
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c813f5dae231bd8f01864227c5dba10d43a89249 17-Nov-2016 Jeff Sharkey <jsharkey@android.com> DO NOT MERGE: Check provider access for content changes.

For an app to either send or receive content change notifications,
require that they have some level of access to the underlying
provider.

Without these checks, a malicious app could sniff sensitive user data
from the notifications of otherwise private providers.

Test: builds, boots, PoC app now fails
Bug: 32555637
Change-Id: If2dcd45cb0a9f1fb3b93e39fc7b8ae9c34c2fdef
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
923e0b8811ae07659408624aeeede18bc8b1197c 17-Nov-2016 Jeff Sharkey <jsharkey@android.com> Check provider access for content changes.

For an app to either send or receive content change notifications,
require that they have some level of access to the underlying
provider.

Without these checks, a malicious app could sniff sensitive user data
from the notifications of otherwise private providers.

Test: builds, boots, PoC app now fails
Bug: 32555637
Change-Id: If2dcd45cb0a9f1fb3b93e39fc7b8ae9c34c2fdef
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
63ff0d822b700948131b82d57df612fb5ce99574 16-Nov-2016 Svetoslav Ganov <svetoslavganov@google.com> Merge "Temporary enable Build#SERIAL"
b5e603f2705dbb6a2dc79d8d2e28b56bc862ff71 16-Nov-2016 Svet Ganov <svetoslavganov@google.com> Temporary enable Build#SERIAL

Filed STOPSHIP b/32918547

bug:31803186

Change-Id: I66b26e5948d19391513e007daad099f51cb64155
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2250d56a0b47b93016018340c8f4040325aa5611 08-Nov-2016 Sudheer Shanka <sudheersai@google.com> Rename MountService to StorageManagerService.

Bug: 30977067
Test: Existing tests pass
Change-Id: Ieac0f11c2b249dcd60441b14c1f391e6f8131d42
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
29a5b0d0f1cc7fd6cbfe97c816b8a687d9e438cc 25-Oct-2016 Felipe Leme <felipeal@google.com> Added a callback for AutoFillService.

So far AutoFillService only received the assist data from framework; in
this CL, it also offers a method where the auto-fill provider can send
the auto-fill data back to framework.

The workflow is:

- AFMSI calls a new AM method (requestAutoFillData(), instead
of requestAssistContextExtras()).
- The assist receiver is located in the app, not on system service.
- AM uses a new request type (ASSIST_CONTEXT_AUTOFILL) to request the
assist data to the activity.
- ViewStructure has a new setAutoFillId() method which is used to set an
unique id for the view.
- View uses the accessibility id to implement the auto-fill id.
- When the activity fullfills the request, it creates an IAutoFillCallback
remote object - that will be used to set the auto-fill fields - and
returns it in the assist bundle (using the
VoiceInteractionSession.KEY_AUTO_FILL_CALLBACK key).
- The app-visible AutoFillService class offers an onFillRequest() method,
which contains the assist data and a FillCallback used to handle it.

BUG: 31001899
Test: manually built and ran it

Change-Id: I3d208c14e81022dc96dd03f38bbe25a778b24a67
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7075d79cabb3c23540bdcbd07b772705a14e932f 11-Nov-2016 Winson Chung <winsonc@google.com> Merge "Adding API for apps to specify their aspect ratio when entering PIP."
e07641d4fbdd0528c18305213e861a6e1aff4a3b 10-Nov-2016 Dianne Hackborn <hackbod@google.com> Start implementing background restrictions for eph apps.

This implements the additional intended path for checking
allowed background operations, APP_START_MODE_DISABLED, which
doesn't allow an app to launch in the background at all.

Also change the semantics of delivering broadcasts to manifest
receivers to always restrict those, not changing based on
whether the app is currently idle. This is the desired intended
behavior for apps as they explicitly update to work with
bg check.

And now that we have ephemerality associated with the uid state
in the activity manager, we can propagate this through the
relevant callbacks in IUidObserver so things watching these
changes can immediately determine whether they should do their
more aggressive shut down work for the uid rather than having
to walk through all their state looking for package associated
with that uid and whether they should be shut down.

Also remove the "lenient" bg check mode, since that was
just an early experiment that we won't actually use.

Add a new "make-idle" activity manager command to immediately
put a uid into the idle state (if possible) to make it easier
to test.

Test: manually against an eph app
Change-Id: I43a138ff281f69a9251d3f29ab6e13f48cff8ad6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
84a3834a0c23c4fee4f909f986ba6975a87c807b 09-Nov-2016 Winson Chung <winsonc@google.com> Adding API for apps to specify their aspect ratio when entering PIP.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testEnterPipAspectRatio
Test: #testEnterPipExtremeAspectRatios

Change-Id: I9efba942b9a6451dec07428fe1e428ef4a896867
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
446e723c0885773716f365328aa4a7c242a6c9a2 10-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "The big Keyguard transition refactor (8/n)"
e69c93181f1f313dcedd07f677af1cea953fdf16 01-Nov-2016 Jorim Jaggi <jjaggi@google.com> The big Keyguard transition refactor (8/n)

Don't force mKeyguardGoingAway, as this never recovers. Make sure
to only show the dismissing Keyguard activtiy and recover the
state when trusted state changes.

Test: Make sure Keyguard is in a trusted state, start an activity
with FLAG_DISMISS_KEYGUARD from FLAG_SHOW_WHEN_LOCKED activity
and make sure there is no flicker.

Bug: 32057734
Change-Id: I5d212f6f9d5430250b22c8370f45dc95756432d2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d0ac9d3bac179d2787ebfc11fe0d9c3d7e6d425e 09-Nov-2016 Jeff Sharkey <jsharkey@google.com> Merge "Detect non-oneway calls leaving system_server."
5614bf5a1ae4522dfc1a041f003cebc9b25c8b93 08-Nov-2016 Dianne Hackborn <hackbod@google.com> Move code for handling uid obs "cutoff" to activity manager

To do this, I had to fix the PROCESS_STATE_NONEXISTENT constant
to be the last value (instead of the special magical -1 value)
so it semantically matches the public importance constants. I
think this is better anyway.

Also this fixes a big problem in the implementation, where we
weren't keeping track of the last proc state per uid...! Duh.

Test: manually ran testUidImportanceListener
Change-Id: Ie3008f824446089840f896885e6033472abb065e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0a17db1cc5942ea000ca87bb72853de57a15ec64 04-Nov-2016 Jeff Sharkey <jsharkey@android.com> Detect non-oneway calls leaving system_server.

To protect system stability, any Binder calls leaving the
system_server must carefully be performed using FLAG_ONEWAY (or
the 'oneway' verb in AIDL) which prevents the call from blocking
indefinitely on the remote process.

In this CL, the system_server uses the new Binder.setWarnOnBlocking()
method to enable detection by default for all remote Binder
interfaces. It can also use Binder.allowBlocking() to allow
blocking calls on certain remote interfaces that have been
determined to be safe.

This CL adds the 'oneway' verb to several interfaces and methods
where it should have been added, and marks a handful of system
ContentProviders as being safe to call into. Also, we assume that
any services obtained from ServiceManager are part of the core
OS, and are okay to make blocking calls to.

Test: builds, boots, runs with minimal logs triggered
Bug: 32715088
Change-Id: Ide476e120cb40436a94b7faf7615c943d691f4c0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
058f1e4468bd54d0ac39fdf81b4df7221b28721a 03-Nov-2016 Dianne Hackborn <hackbod@google.com> Implement system API for monitoring uid importance changes.

Changed the permission for registerUidObserver to be
PACKAGE_USAGE_STATS, which better matches the semantics of this
API and is accessible to system apps.

Test: Added testUidImportanceListener()

Change-Id: Ib47d02bd654fbe399a9c92550c89ecbd38f928dc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fc46e9b643881b7b2ab76854f3a0ac077e9def8d 22-Oct-2016 Sudheer Shanka <sudheersai@google.com> Move IActivityManager to aidl.

Bug: 30977067
Test: Existing tests are passing, dump commands still working.
Change-Id: I9cf81c4d381ebce14a6c701e409cbb269f2ff1fb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
839def9b549b6279aabd4150b304999e58d15762 02-Nov-2016 Andrii Kulian <akulian@google.com> Add shell command to move activity stacks between displays

Also rename "stack movetask" command to be consistent with other
shell commands.

Test: New CTS tests coming soon.
Change-Id: I3d7e04e0ae8ea76c27c3e4c1e286d5cd4539870c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5a108c225a81cedacb1cec9b5b1986f2f3eff75c 13-Oct-2016 Jorim Jaggi <jjaggi@google.com> The big keyguard transition refactor (2/n)

Introduce UnknownVisibilityController, which keeps track of apps that
may or may not be visible when launching an activity behind Keyguard.
When Keyguard is occluded and we launch another activity, we don't
know whether we still have to keep Keyguard occluded until the app
has gone through the resume path and issued a relayout call to update
the Keyguard flags.

This class keeps track of that state and defers the app transition
until the unknown visibility of all apps is resolved.

Test:
1) Have an occluding activity that starts another occluding
activity, ensure that there is no flicker.
2) Have an occluding activity while the Keyguard is insecure, start
a DISMISS_KEYGUARD activity, ensure there is no flicker.
3) runtest frameworks-services -c com.android.server.wm.UnknownVisibilityControllerTest

Bug: 32057734
Change-Id: I5145b272722ab8c31dd7c5383286f5c9473e26a4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fe762344f4475a3a336bb46aef2d59c1fabf32ab 13-Oct-2016 Jorim Jaggi <jjaggi@google.com> The big keyguard transition refactor (1/n)

The heart of this change are two things:
1) Instead of using the force hide mechanism to hide windows behind
Keyguard, we actually make the activities invisible in activity manager.
2) When Keyguard is going away, we change the visibilities in activity
manager and run an app transition.

At the very core we move the responsibility of hiding activities to
ActivityStack, which checks whether Keyguard is showing, and then
hides all non-show-when-locked activities. For that, we need to check
whether any window of an activity has SHOW_WHEN_LOCKED set. We
introduce a callback from WM -> AM in case these Keyguard flags have
changed.

Furthermore, we decide whether to occlude Keyguard in KeyguardController,
which just checks whether the top activity has SHOW_WHEN_LOCKED set. When
this state changes, we prepare an occlude/unocclude app transition, and
in PWM we just inform the Keyguard about the animation so SysUI can play
along this animations in a mostly synchronized manner.

Since we now use an app transition when unlocking the phone, we get
lockscreen launch animations for free - window manager automatically
waits until the activity is drawn, or directly executes the transition
if there is nothing to animate. Thus, we can remove all the infrastructure
around "waitingForActivityDrawn".

The logic to show/hide non-app windows is moved to policy, and we add the
ability to run animations on non-app windows when executing an app
transition.

Test:
1) runtest frameworks-services -c com.android.server.wm.AppTransitionTests
2) Manually test unlocking Keyguard:
2a) Without security
2b) With security
2c) With security but trusted
2d) Portrait while activity behind is in landscape
3) Test launching things from Keyguard
3a) Without security
3b) With security
3c) Launch camera without security
3d) Launch camera with security
3e) Launch camera with securtiy and trusted
3f) Launch voice affordance
4) Set no notifications on lockscreen, drag down, make sure you get
the correct animation
5) Test clicking "emergency" on bouncer
5b) Test "Emergency info" on emergency dialer
5c) Test clicking edit button on emergency info, should show pattern on
Keyguard

Bug: 32057734
Change-Id: Icada03cca74d6a612c1f988845f4d4f601087558
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
655332c641ccb12ee1ae3ce89135ca847fba1abf 31-Oct-2016 Winson Chung <winsonc@google.com> Creating PinnedStackController.

- Creating a PinnedStackController to keep track of the state of the PIP
to prevent changes in the system (ie. IME showing) and user interaction
from clobbering each other.
- Refactoring calls in AM into WM/controller

Test: android.server.cts.ActivityManagerPinnedStackTests

Change-Id: Ie59dfd45d5c54764ba69a589b3b8148845e92cc3
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
006b53a68149d22dc8174ed6c46175967e6f0764 31-Oct-2016 Chad Brubaker <cbrubaker@google.com> Merge "Add ephemeral protection level"
fed503cb461f884b4589cadd6ee9d48381500749 31-Oct-2016 Yorke Lee <yorkelee@google.com> Merge "Add new methods to ITaskStackListener"
c19706a937abc5d025a59b354b3a0d89e7d62805 14-Oct-2016 Chad Brubaker <cbrubaker@google.com> Add ephemeral protection level

Ephemeral applications will only be able to be granted permissions that
have the ephemeral proteciton level, this allows us to tighly define
what behavior is OK for ephemeral applications.

This includes an initial small whitelist of permissions for ephemeral
apps, it may be expanded later.

Test: adb install --ephemeral, verified against both runtime and install
time permissions
Test: cts-tradefed run cts -m CtsPermission2TestCases
Change-Id: I854c44cf7a293d484b674cdd4fb5141e362a2f1a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d409b7872886f1f477cd9a6b33a120745e0e163f 29-Oct-2016 Dianne Hackborn <hackbod@google.com> Merge "Power manager now prevents wake locks from idle uids."
bd54c2aab6acc50ac415dfc4a7462d12826e8223 25-Oct-2016 Yorke Lee <yorkelee@google.com> Add new methods to ITaskStackListener

Refactor task change notification logic into a separate class
TaskChangeNotificationController.

Add ActivityManagerService.unregisterTaskStackChangedListener

Add a no-op implementation that clients can subclass to avoid
having to reimplement all new methods when they are added.

Add new methods:
onTaskAdded
onTaskRemoved
onTaskMovedToFront
onTaskDescriptionChanged
onActivityRequestedOrientationChanged
onTaskFinishing

Design doc:
https://docs.google.com/document/d/1IgWZ44rKe9k1CzkjP2Mohv12OgRD1FxH8oLAyzhvCY4/edit#heading=h.yhzl6os0dbo5

Cherry-picked from I8302d6d3baf1ac1ca928765fe203091b9fab4070

Bug: 32277482
Test: Verify that callbacks are called in dummy implementations

Change-Id: I2ac2b870147ef049f3ee05fc5916c99332334526
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d33c7cd87a8ca6ede8622392601f8ce9df7694ad 26-Oct-2016 Dianne Hackborn <hackbod@google.com> Power manager now prevents wake locks from idle uids.

The activity manager now pushes the idle/active state
down in to the power manager. The power manager now
tracks a structure of data about each uid: how many
wake locks it holds, whether it is active, and (as before)
its current process state.

Now when apps are inactive, we always disable wake locks
they hold, regardless of the system's device idle or
other state.

Test: none

Change-Id: I2cd4077e4d8a8572525406ae9747f0a2435764da
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f9e2ad0b3c2efb3bd93bb8b4ce2580512563005a 30-Jun-2016 Svetoslav Ganov <svetoslavganov@google.com> Add Bluetooth toggle prompts - framework

If permission review is enabled toggling bluetoth on or off
results in a user prompt to collect consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

Also added a configuration resource which controls whether
permission review mode is enabled. By default it is not and
an OEM can change this via an overlay. For now we also keep
the old mechanism to toggle review mode via a build property
which is still used and will be removed when clients have
transitioned.

bug:28715749

Change-Id: I94c5828ad6c8aa6b363622a26ff9da4fc2e2fac7
(cherry picked from commit ac69be543f89ea6e9a27204492e0a170d9b3450e)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1ab879be90a0d58219fca206e556349709fdfda0 07-Oct-2016 Leonard Mosescu <mosescu@google.com> Adding "attach-agent" to ActivityManagerShellCommand

This new command is used to attach runtime agents to a running application:

attach-agent <PROCESS> <FILE>
Attach an agent to the specified <PROCESS>,
which may be either a process name or a PID.

Test: m test-art-host, manual testing:
. invalid syntax, missing arguments
. invalid syntax, extra arguments
. invalid numeric PID
. invalid process name
. valid process, not debuggable
. valid process, missing agent
. valid process, valid agent

Bug: 31682382

Change-Id: Ife88dbf23991dde7945d9208e54cd014bb7ecdc6

Merged-In: Ife88dbf23991dde7945d9208e54cd014bb7ecdc6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
debcf7603f574478e8dd11af415796f4fa6976f0 27-Oct-2016 Andrii Kulian <akulian@google.com> Merge "Refactor stack removal methods"
6d6fb401c79aadeb35cfc66cd36cb30f92d3552f 27-Oct-2016 Andrii Kulian <akulian@google.com> Refactor stack removal methods

Refactor some parts of stack removal to make methods implementations
correspond to their names.

Change-Id: Ie686c463d67232d9d5fd96468fe3911003d22471
Test: Manual and existing tests still pass.
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
303c6b78b645a9a655e09677e4856269d278a85d 25-Oct-2016 Winson Chung <winsonc@google.com> Fix wrong bounds being used in landscape.

- Ensure we use the right display size when calculating PIP bounds.
- Also update interface to take the display id.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testPinnedStackDefaultBounds
Test: #testPinnedStackMovementBounds

Change-Id: I01fd8ba6dee212c29a9a092673ee8f7843e41af6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f3409ceee59a006155915010b11af81a822225aa 07-Oct-2016 Leonard Mosescu <mosescu@google.com> Adding "attach-agent" to ActivityManagerShellCommand

This new command is used to attach runtime agents to a running application:

attach-agent <PROCESS> <FILE>
Attach an agent to the specified <PROCESS>,
which may be either a process name or a PID.

Test: m test-art-host, manual testing:
. invalid syntax, missing arguments
. invalid syntax, extra arguments
. invalid numeric PID
. invalid process name
. valid process, not debuggable
. valid process, missing agent
. valid process, valid agent

Bug: 31682382

Change-Id: Ife88dbf23991dde7945d9208e54cd014bb7ecdc6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fe511037114beffbecc09e267df542be736f84bb 26-Oct-2016 Dianne Hackborn <hackbod@google.com> Merge "Tweak ActivityManager.getPackageImportance()"
5406e7ade87c33f70c83a283781dcc48fb67cdb9 21-Oct-2016 Andrii Kulian <akulian@google.com> Apply display override config for secondary displays

Now display-specific settings, such as dimensions and orientation,
are stored in display override config. For default display it is
mirroring the global config. Each time when global config is updated,
override of the default display should be updated too and vice versa.

Test: Existing and manual tests still pass.
Change-Id: Ic6c2190092d328820f314a05bed43c875db18170
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9df8f51044c19c884058202a156a5a506ad4a276 25-Oct-2016 Dianne Hackborn <hackbod@google.com> Tweak ActivityManager.getPackageImportance()

- Now requires PACKAGE_USAGE_STATS permission.
- Simpler implementation.

Test: none

Change-Id: Id42ee31d0af8d896cbc94c81666bc734198c1273
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
824ab5c4be2a3c3f7240178438126567d00bddec 20-Oct-2016 Wale Ogunwale <ogunwale@google.com> Removed WindowManagerService.getWindowListLocked()

3rd step in trying to make the WindowList private to DisplayContent.
The method was another an indirect way to the the window list
from the display content.

Test: Manual testing and existing tests pass.
Change-Id: Ifb0548a91b5bc64461e14f63256b61b8fa5e2e0c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b72fd03d5af14e7b1b55bba08c1073cb7c73aeb6 21-Oct-2016 Winson Chung <winsonc@google.com> Merge "Changing initial PIP bounds specifications."
c2c956b3c4d05b8343e21670a1fdeff005417ea8 20-Oct-2016 Sudheer Shanka <sudheersai@google.com> Merge "Move ApplicationThread to aidl."
06868c37df46c0c973a96a0a25b1f301384db4be 13-Oct-2016 Winson <winsonc@google.com> Changing initial PIP bounds specifications.

- Change from a absolute bounds to a size, gravity and inset to
allow easier tweaking of initial pinned stack bounds.

Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testPinnedStackDefaultBounds
Test: #testPinnedStackMovementBounds

Change-Id: I82a102bbd2d83259c6c84915071d1a16728e3aa7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e0866a3356e66276ce13934950350fde9ba1e766 19-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adds user id when dumping a task."
cc6418feb7d5d13fd5062d9fd469650651eeda00 13-Oct-2016 Sudheer Shanka <sudheersai@google.com> Move ApplicationThread to aidl.

Bug: 30977067
Test: Existing tests are passing, dump commands still working.
Change-Id: Iecb382e8720dfb1b6b707272497e3793e6995edb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b44a1578bd621c7ba02898afef8b6ff93890876d 19-Oct-2016 Felipe Leme <felipeal@google.com> Adds user id when dumping a task.

Test: manual verification
Bug: 31001899
Change-Id: Ifa2f2719e9d02c48ab913dd8b359c0b63039134f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
008a08dcee1b43cbd3a0bf8755b1eb6fe0e3ba48 07-Jul-2016 Gopal Krishna Shukla <gshukla@codeaurora.org> Schedule agentDisconnected() in handler thread

BackupManager.agentDisconnected() need not acquire
ActivityManagerService lock. Post this in handler thread.
This will avoid a potential deadlock between
ActivityManagerService lock and BackupManagerService lock.

Test: Build successful

Change-Id: Iabea1159d3e2bd8980c8a0d068fb5d0583c08535
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
22f3aa3b487308ccd86195491476b4cdff853d4e 17-Oct-2016 yangzhenyu <yangzhenyu@xiaomi.com> Merge "[ActivityManager] Fix the inconsistence between ProcessRecord and BroadcastQueues" am: 09dcaf1948 am: 744f0e0997
am: 6bdc11f95f

Change-Id: I18a747cffe5d81e10bbc5d63b95a36521883e933
744f0e0997f08f00786e4f0266d8cbdb4b2b4569 17-Oct-2016 yangzhenyu <yangzhenyu@xiaomi.com> Merge "[ActivityManager] Fix the inconsistence between ProcessRecord and BroadcastQueues"
am: 09dcaf1948

Change-Id: I6227536c270cdac730be60edf35f7ff704e59af0
d509bc93e6d13d46c45707d76ae95a6f735fc037 31-Aug-2016 yangzhenyu <yangzhenyu@xiaomi.com> [ActivityManager] Fix the inconsistence between ProcessRecord and BroadcastQueues

Symptom:
Even though one process is executing one BroadcastReceiver,
it may be killed as one EMPTY process occasionally

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

Root cause:
app.curReceiver can only remember the last running.
If an application is both receiving FG and BG broadcast,
when one is finished, app.curReceiver becomes null,
the state of application becomes EMPTY.

Solution:
save all running receivers at ProcessRecord

Change-Id: I01b8813af652a8c434be7de0678dc06f99831ae0
Signed-off-by: yangzhenyu <yangzhenyu@xiaomi.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
aa3c463a5ba487c40a21a6a9709585e0b94fe792 13-Oct-2016 Robert Sesek <rsesek@google.com> resolve merge conflicts of 0b58f19 to nyc-mr1-dev-plus-aosp

Change-Id: I374d842cab49b58b570d5ad7ef3dffb7b148d236
21713ac8ddce33fe49cfa457010da30a883f2239 13-Oct-2016 Andrii Kulian <akulian@google.com> ActivityStack cleanup

- Moved some methods that mostly operate with internals of
ActivityRecord and/or logically should belong their to
ActivityRecord class.
- Reduced visibility of some methods and fields.
- Other minor cleanups.

Test: Manual and existing tests still pass.
Change-Id: I87ed6987c88512dda3cd69fa43a1f093d47d0bff
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1779e6108ab264689b7d5e5c42ba3cbca6c8189f 13-Oct-2016 Andrii Kulian <akulian@google.com> Use ConfigurationContainer for holding configs in AM hierarchy

Extract configuration holding and handling into separate class
and use it both in hierarchy in AM.

Change-Id: I19ca20152f7473af2c4a7bbedeff69422b1454eb
Test: ConfigurationContainerTests
Test: Existing and manual tests still pass.
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0b58f198df6c3ce5df1d2061c54bd691ee32ac3a 11-Oct-2016 Robert Sesek <rsesek@google.com> resolve merge conflicts of 8f8d187 to nyc-dev-plus-aosp

Change-Id: I75c7110ee4f0c9717e7276b609caa2402ef5c2be
8f8d187a78b48109911a800ba5993b645d3015c5 18-Mar-2016 Robert Sesek <rsesek@google.com> Split the zygote logic out of android.os.Process into a new ZygoteProcess class.

There is no functional change. This is to support adding new types of zygotes
that all operate using the same protocol.

Bug: 21643067
(cherry picked from commit 94e824bc1b5f83024b7c9a228a8f2d0cd1347d11)
(cherry picked from commit 96b49848e7784bc4b40ffd01e2524461e1efcab7)

Change-Id: I2e12057e4c2e7567f909d699b487e70b1664cca8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
02b7a83b97593bc0c0c459272dca15d2e7ef8dd5 07-Oct-2016 Andrii Kulian <akulian@google.com> Make stack field private in TaskRecord

This is needed to enforce usage of setter - prerequisite
for ag/1499587.

Change-Id: I194008899d8320a213e82b9106f0589f499941b4
Test: Refactoring only. Manual and existing tests still pass.
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
02896ab71376aa3d9386c5e5abc51c97b69b10c5 05-Oct-2016 Wale Ogunwale <ogunwale@google.com> Fixed issue with screen rotation not working for landscape<->seascape

Problem as introduced in the refactor to change how configuration works
in activity manager in ag/1460784. With the new change we don't call back
into window manager to set new configuration if there are no changes.
The new change is correct, however window manager was relying on this to
unfreeze the display since the rotation changed.
We now have activity manager return if it updated the configuration to
window manager when the rotation changes do window manager can decide
if it needs to perform additional actions like unfreezing the display.

Bug: 31916697
Test: CTS and Manual testing.
CTS: cts-tradefed run commandAndExit cts-dev --module CtsServicesHostTestCases --test android.server.cts.ActivityManagerDockedStackTests
Manual: Launch an app that suports all orientations and rotate it from
landscape to seascape.
Change-Id: I36ddeff1ccc9f6089227147b117a865571b8571e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
28537b6ae92a3211b5993ac00482ef905a911244 07-Sep-2016 Sudheer Shanka <sudheersai@google.com> Don't limit RetailDemoModeService to start only during demo mode.

- Update RetailDemoModeService to not do anything outside demo mode.
- Add am command get-started-user-state which is needed for cts tests.
- Update unit tests for RetailDemoModeService.

Bug: 31342350
Test: adb shell am instrument -e class com.android.server.retaildemo.RetailDemoModeServiceTest -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: Idf50512facd27d47d7111e75cbc2f7b260f49740
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b2d9a6f7231d7965fc30ce8dee0319fbb62ba6d9 30-Sep-2016 liulvping <liulvping@xiaomi.com> Merge "Clear pending activity launches when force stop package" am: 00b678dd2d am: 5b65b132b3
am: 8b1f60a993

Change-Id: I4ddc8198a5b786aea177303492b17f6ec119f6de
f5ac9e64836bdc78839e1313988f43cfc28689cd 29-Sep-2016 Dianne Hackborn <hackbod@google.com> Merge "New infrastructure to switch remaining commands to "cmd" calls."
8b1f60a99382e65cef379bacefde97e8a84b4662 29-Sep-2016 liulvping <liulvping@xiaomi.com> Merge "Clear pending activity launches when force stop package" am: 00b678dd2d
am: 5b65b132b3

Change-Id: Ie5287b8e3c27ae48c513fed6111cab8914cac4dc
5b65b132b3b6a8e2c173c0d581dc1aba0186059c 29-Sep-2016 liulvping <liulvping@xiaomi.com> Merge "Clear pending activity launches when force stop package"
am: 00b678dd2d

Change-Id: Icd953ce6aff52a657e960d84799db7e4ca079688
0b2a37470b756a2647095a31872596658b441e01 29-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Clear pending activity launches when force stop package"
354736e196ff79962b3ddb52619a674044d773e2 23-Aug-2016 Dianne Hackborn <hackbod@google.com> New infrastructure to switch remaining commands to "cmd" calls.

This introduces a new feature of the IBinder command protocol
to allow the shell command implementation to call back into
its caller to ask it to open files in the calling context. This
is needed so that commands that have arguments specifying files
can open those files as the calling shell, not the system (or
whatever) process.

To test this all out, move the "am start" implementation over
to ActivityManagerShellCommand, in particular along with its
option to specify a file in which to write profiling data.

Test: Manual

Change-Id: I0c1e3857defefbd19a2ac29413aafbb34b1e48a3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
83d3f0284a1b67aba4ec44e294a0240792bd1be1 29-Sep-2016 Svetoslav Ganov <svetoslavganov@google.com> Don't touch usage stats before system ready am: 09d3285503 am: 25681d469d
am: 734ce67675

Change-Id: I2ab854e8842693ea406cf7345ebd06778777427d
734ce676759307cfd7e5bb6b3004bf35694726e4 29-Sep-2016 Svetoslav Ganov <svetoslavganov@google.com> Don't touch usage stats before system ready am: 09d3285503
am: 25681d469d

Change-Id: Ib38f30db325ce2813e2957fc1ee97c21cfb804e6
25681d469dfc783983de7b3d6489c7e894cd67d5 29-Sep-2016 Svetoslav Ganov <svetoslavganov@google.com> Don't touch usage stats before system ready
am: 09d3285503

Change-Id: Idd27629f73a457e2ee5e3dd9f4d90881cc978e51
b55e42df971e6ab0cc2b21da14027d40cf2a754e 26-Sep-2016 liulvping <liulvping@xiaomi.com> Clear pending activity launches when force stop package

https://code.google.com/p/android/issues/detail?id=223731

It is possible that an activity in pending launches be resumed while
it's package was stopped by some other reason, like uninstall pkg.

Merged-In: I130ded89cee162aa59ac2bf330f026e49e16ef69
Change-Id: I130ded89cee162aa59ac2bf330f026e49e16ef69
Signed-off-by: liulvping <liulvping@xiaomi.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cfa825ff66d23da0741dd4ff11921474c4db297a 26-Sep-2016 liulvping <liulvping@xiaomi.com> Clear pending activity launches when force stop package

https://code.google.com/p/android/issues/detail?id=223731

It is possible that an activity in pending launches be resumed while
it's package was stopped by some other reason, like uninstall pkg.

Test: Current tests pass.
Change-Id: I130ded89cee162aa59ac2bf330f026e49e16ef69
Signed-off-by: liulvping <liulvping@xiaomi.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
09d32855038caf024cb77728bf141f87a6688917 28-Sep-2016 Svetoslav Ganov <svetoslavganov@google.com> Don't touch usage stats before system ready

When a content provider is accessed we update its foreground
state and usage stats if the calling app is in the foreground.
However we install system providers before the
PHASE_SYSTEM_SERVICES_READY phase which means we cannot touch
the the usage stats service as it calls into the content
service triggering the sync manager creation before system
ready violating the contract of the latter causing cascading
issues.

bug:31562236

Change-Id: Ied446cf3de8949e0850bab8f2b92155eac793591
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8379340f085bdde98ab85e6c3dc0bca31fe2fc16 28-Sep-2016 yuanhuihui <yuanhuihui@xiaomi.com> Merge "fix persistent process is killed and restart again and again" am: ae302cef52 am: b322dc384e am: 20a5fe414e
am: de671ad0e6

Change-Id: Ic4dbc59df650a9477e97620091abb685a1fd2bc4
de671ad0e6272b1746559df8184a7ca431344c1b 28-Sep-2016 yuanhuihui <yuanhuihui@xiaomi.com> Merge "fix persistent process is killed and restart again and again" am: ae302cef52 am: b322dc384e
am: 20a5fe414e

Change-Id: I9a454463a8881dded9b3d7905d4cf76223b4acd4
20a5fe414e23ae1bbf5000299629de42e013ab26 28-Sep-2016 yuanhuihui <yuanhuihui@xiaomi.com> Merge "fix persistent process is killed and restart again and again" am: ae302cef52
am: b322dc384e

Change-Id: Ie1802af0a6f22cb69c3b62f0912363a299f8f453
b322dc384efc2fef364691890c0939ddd3932eaa 28-Sep-2016 yuanhuihui <yuanhuihui@xiaomi.com> Merge "fix persistent process is killed and restart again and again"
am: ae302cef52

Change-Id: I31ead1fe09561e69df0cd94f366b2ef4648b29f3
ae302cef52dae719b057a16f564af863b9fc8e96 28-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "fix persistent process is killed and restart again and again"
3fbaf383d32720e03c9aef0e7c9073f9d9273eef 26-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Use a system property to call different bugreport types."
42ed4974161990d2ffab15f670a723b4c32e3f82 24-Sep-2016 Sudheer Shanka <sudheersai@google.com> Merge "Add usermanager related perf tests - part2"
d31f3467d947549e29abb87837cf6fd1c1f58dc3 23-Sep-2016 John Reck <jreck@google.com> Add error messages to send-trim-memory

Fixes: 23006305
Test: manual, adb shell am send-trim-memory
Change-Id: Iae5607ea9abf0ffa5b5276a6540afb0dc6aa31f5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1561aae30886126179167bb9deb7358b92fbc903 23-Sep-2016 Jeff Sharkey <jsharkey@android.com> Limit LOCALE_CHANGED broadcast when init'ing. am: d26e1ff2de
am: 8c54ee72b1

Change-Id: I790c21c47c7af00e76f7c816bbfe635d58d852d8
067a7832ae2a2bd95da40cb20be4ecf9202d1343 23-Sep-2016 Android Build Merger (Role) <android-build-merger@google.com> Merge "Merge "[ActivityManager] Reset killed flag at attachApplicationLocked" am: 1d5447d70b am: 5820f7fff5 am: 689c4ab00a am: d105706775"
a6574cf111eceaf3271cffc705916b5fbadacabf 23-Sep-2016 yuanhuihui <yuanhuihui@xiaomi.com> Merge "[ActivityManager] Reset killed flag at attachApplicationLocked" am: 1d5447d70b am: 5820f7fff5 am: 689c4ab00a
am: d105706775

Change-Id: I5b11e708511cea2b8ac77a96effd0c41e231c7df
8c54ee72b1b5fce81d979267f7b63d6f63f44b62 23-Sep-2016 Jeff Sharkey <jsharkey@android.com> Limit LOCALE_CHANGED broadcast when init'ing.
am: d26e1ff2de

Change-Id: Ib735e27a05b787fab6c955a084e55870d1e9442c
2da45672e279502366e9781e7e43858ec549a118 23-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Limit LOCALE_CHANGED broadcast when init'ing."
d26e1ff2de354896781c44143d9dfc7b8a350acd 23-Sep-2016 Jeff Sharkey <jsharkey@android.com> Limit LOCALE_CHANGED broadcast when init'ing.

Immediately when a device finishes booting, retrieveSettings() will
read out the current configuration details, including locale. At
that point mProcessesReady has been set, meaning third-party apps can
be launched. But we haven't started persistent apps yet!

If you have a persistent app (like com.android.phone) which also has
a somewhat related app (like com.android.stk) merged into the same
process, the LOCALE_CHANGED broadcast could start the process pointing
at an unexpected code/data location.

This change avoids this by only sending LOCALE_CHANGED broadcasts to
registered receivers (no manifest receivers) when the locale is being
read for the first time (initLocale).

Test: booted device with locked SIM
Bug: 31665819
Change-Id: I977a596501c6ba492005f98a2367e4b9f67e2dba
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
09e13358f50f3bd405c9c87061285eafc29603f8 23-Sep-2016 Jeff Sharkey <jsharkey@android.com> Limit LOCALE_CHANGED broadcast when init'ing.

Immediately when a device finishes booting, retrieveSettings() will
read out the current configuration details, including locale. At
that point mProcessesReady has been set, meaning third-party apps can
be launched. But we haven't started persistent apps yet!

If you have a persistent app (like com.android.phone) which also has
a somewhat related app (like com.android.stk) merged into the same
process, the LOCALE_CHANGED broadcast could start the process pointing
at an unexpected code/data location.

This change avoids this by only sending LOCALE_CHANGED broadcasts to
registered receivers (no manifest receivers) when the locale is being
read for the first time (initLocale).

Test: booted device with locked SIM
Bug: 31665819
Change-Id: I977a596501c6ba492005f98a2367e4b9f67e2dba
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d105706775c3841be399adf8f96f0a70886875c5 23-Sep-2016 yuanhuihui <yuanhuihui@xiaomi.com> Merge "[ActivityManager] Reset killed flag at attachApplicationLocked" am: 1d5447d70b am: 5820f7fff5
am: 689c4ab00a

Change-Id: I54afd53f6fe0219f33521295a2dde90e911a55f7
689c4ab00aae3e7ea86cfb78f102474ed2da1d73 22-Sep-2016 yuanhuihui <yuanhuihui@xiaomi.com> Merge "[ActivityManager] Reset killed flag at attachApplicationLocked" am: 1d5447d70b
am: 5820f7fff5

Change-Id: I6062fdf8a686fcb64340b26f8aa200d5506fb91c
5820f7fff57b32aec694116c41e3babdb8418539 22-Sep-2016 yuanhuihui <yuanhuihui@xiaomi.com> Merge "[ActivityManager] Reset killed flag at attachApplicationLocked"
am: 1d5447d70b

Change-Id: Id51a6dabbf1fec793ca0a905454a412359e0cd57
1d5447d70b50a24a5ebbd88897e8da4ed4407e18 22-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "[ActivityManager] Reset killed flag at attachApplicationLocked"
dc94b2973f76f1a2fa743353759154210306a0cf 22-Sep-2016 yuanhuihui <yuanhuihui@xiaomi.com> [ActivityManager] Reset killed flag at attachApplicationLocked

A restarted process will reuse original process record.
If only reset KilledByAm flag, not reset Killed flag.
When app process have been killed by AMS can skip unnessary ANR,
but not catch lowmemorykiller in AppErrors.appNotResponding()

Change-Id: Ie4653edf4252797eaeefbf9a4a35ac00cfa857d8
Signed-off-by: yuanhuihui <yuanhuihui@xiaomi.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
362d490c685879e17ad053be6f88cad546169423 22-Sep-2016 Amith Yamasani <yamasani@google.com> Don't inform usage stats of interaction for a toast am: 43caafa2b6 am: 0775c2e29a
am: aa8e8c4ff9

Change-Id: I10014c6e43d0e45df66456836d768420e7c1d455
0775c2e29ab2f300b7e693de66ee2558c9c1bc72 21-Sep-2016 Amith Yamasani <yamasani@google.com> Don't inform usage stats of interaction for a toast
am: 43caafa2b6

Change-Id: I7b1c81eef73870b115be65dae2e2bd9094333dff
43caafa2b6468c0852b753952d29a4949ee68e46 21-Sep-2016 Amith Yamasani <yamasani@google.com> Don't inform usage stats of interaction for a toast

If the process is forced to the foreground due to a toast,
don't inform usage stats of an interaction. Otherwise app standby
will be defeated easily.

Bug: 31544592
Test: cts-tradefed run commandAndExit cts -m CtsHostsideNetworkTests -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testAppIdle_toast
Change-Id: I100d839ef8cf361704fd5db4b26dcc878672a235
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1a83dede85a0ad6e973174dc011e460db846ffc1 21-Sep-2016 Felipe Leme <felipeal@google.com> Use a system property to call different bugreport types.

Currently, we define 4 hardcoded init services to launch dumpstate with
different command-line options (since dumpstate must be launched by
root):

- bugreport
- bugreportplus
- bugreportwear
- bugreportremote

This approach does not scale well; a better option is to have just one
service, and let the framework pass the extra arguments through a system
property.

BUG: 31649719

Test: manual
Change-Id: I1d627a73bfbdd9930c605fa4468c15282a23bb65
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8b6456bc88d21d4106d25849a405e2876e597425 21-Sep-2016 Svetoslav Ganov <svetoslavganov@google.com> Merge "Move device serial behing a permission"
988759bc4da063308a80a101913f379ae5b4b52d 21-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Extract global configuration update"
3a507b5da984efc6fa895e30b770a44f65a07d34 20-Sep-2016 Andrii Kulian <akulian@google.com> Extract global configuration update

- Separated config update in AM into several methods.
- Updated global config update in WM to reconfigure and
notify all displays.
- Removed redundant list of displays that are waiting for
configuration update.

Test: Manual testing and existing tests still pass.
Change-Id: I60d3013301267bd668348565dcd0a68e09023a0e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
03d0a367cf8b229c12e51dc5f452deb710093b20 20-Sep-2016 Wei Liu <luciferleo@google.com> resolve merge conflicts of 82d5fc1 to master

Test: device boots

Change-Id: I78e5667577e413763b6be3b06a2feda99ef0d739
710a7acc07da30d1bd6c5b74ec3a8687122b7e14 20-Sep-2016 Sudheer Shanka <sudheersai@google.com> Fix deadlock in AcitivityManagerService. am: 67e05b4d28 am: 433a36e9df
am: 6b2a372d62

Change-Id: I5588d6f29331a355856500eda07d9ab9d2ad5876
911f86e817a0f75165cac41d10c3fff6fcacd336 20-Sep-2016 Sudheer Shanka <sudheersai@google.com> Fix deadlock in AcitivityManagerService. am: 67e05b4d28 am: 44c9e2f4bf
am: b4ecfb9df1

Change-Id: I5f544bbba63ff7176db49b689cfa1794a512767b
82d5fc17b5f19b1fcd4533beb489b35b7ff58606 20-Sep-2016 Wei Liu <luciferleo@google.com> Make VrManager service optional.
am: ef89d21a1b

Change-Id: Ia0a194d34b19ca89e5acdb110a87479187fa4d85
ef89d21a1bf9a8b11befd9b55130816ccf9fb4fb 20-Sep-2016 Wei Liu <luciferleo@google.com> Make VrManager service optional.

b/31244699

Change-Id: I7d276e6945f19b575f880df16f140b84b03052a9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6b2a372d622d0d3d71ff5f8587420d9a435165c4 19-Sep-2016 Sudheer Shanka <sudheersai@google.com> Fix deadlock in AcitivityManagerService. am: 67e05b4d28
am: 433a36e9df

Change-Id: I1ec79a8382d987f6909237ba0fb13dfbd32eb565
b4ecfb9df195aa75f20fadf0a00e7c9f022c60c4 19-Sep-2016 Sudheer Shanka <sudheersai@google.com> Fix deadlock in AcitivityManagerService. am: 67e05b4d28
am: 44c9e2f4bf

Change-Id: I22ce07b7b273cef869ddcebee029c15316ec9c1c
44c9e2f4bffafe8fcc8cad24a4779e629613db5f 19-Sep-2016 Sudheer Shanka <sudheersai@google.com> Fix deadlock in AcitivityManagerService.
am: 67e05b4d28

Change-Id: I3dd3a1eb43bb3da17ff13a41c1b847b51f6701d6
1e32e025ad5677ce4e3697ca026c2019fe0bd8e9 17-Sep-2016 Andrii Kulian <akulian@google.com> Move updating stack override config to ActivityStack

Also added some multi-display TODOs.

Change-Id: Iada3f84c4f57c9623fc7f116819d4e0267ebc32a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
433a36e9dfb222ceb3c21d6c3897ea72ad64b4f1 19-Sep-2016 Sudheer Shanka <sudheersai@google.com> Fix deadlock in AcitivityManagerService.
am: 67e05b4d28

Change-Id: Ie590be7c82c693691e69a5855602c4ed5499c428
b10330d5191ebb50c397d8f3de50fda44698337a 16-Sep-2016 Andrii Kulian <akulian@google.com> Use Configuration#unset() instead of #setToDefaults() for clearing

Now Configuration.EMPTY has fontScale set to 0 instead of default 1.
To get config equal to empty unset() method should be used.
Because of incorrect usage of setToDefaults() there was a black flash
when exiting split-screen because override config was no completely
empty. Fixing that also allows us to simplify things a bit when checking
if override config changed.

Bug: 31533188
Test: manual - long-press overview to enter split-screen, repeat to exit.
Change-Id: I6bf7994ff88ebb42db2e2357b762857710432a58
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8072d11f6a41a68600a15623ca5316ca0def1856 16-Sep-2016 Andrii Kulian <akulian@google.com> Configuration renaming and minor cleanup in AM and WM

- Configuration members in AM and WM are renamed to
mGlobalConfiguration.
- Renamed parameters names in some methods to better represent
their meaning.
- Added and fixed some docs.

Change-Id: Ie51f687fe4c10dbce776435f29d6b853fda50eec
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3ba5331a83b86d2d898851387268e93ace1e4180 15-Sep-2016 Rubin Xu <rubinxu@google.com> resolve merge conflicts of 4daa1b7 to master

Change-Id: I5292c074234fccc26c7a843f56eb68edce26d678
67e05b4d28bb63974f88f6abaf8b3636215c9511 14-Sep-2016 Sudheer Shanka <sudheersai@google.com> Fix deadlock in AcitivityManagerService.

Don't hold mPidsSelfLocked lock when calling
cleanUpApplicationRecordLocked.

Bug: 31463143
Change-Id: I421962cbfd7c466662edcef805c3e27321dc5a98
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
89927b3cd96472c478a988d6c731cd09d412a043 28-Jul-2016 Rubin Xu <rubinxu@google.com> Allow direct-boot aware activity to show before profile is unlocked

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

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

Bug: 30296144
Change-Id: Ib6395271cee2d4781009bb08d50351d73824de0c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c5e62691fb8b99f7f238503c6396e5cfd33a708c 14-Sep-2016 Wale Ogunwale <ogunwale@google.com> Don't try to show crash dialog if lock screen is showing. am: 9645b0ffda am: dbda5ec64b
am: 8a4c3c956a

Change-Id: I13b4e9e11b3c9927af348811580543baf52ffed0
9645b0ffda8d328fd563ae9ad611c18a44102930 12-Sep-2016 Wale Ogunwale <ogunwale@google.com> Don't try to show crash dialog if lock screen is showing.

The crash dialog doesn't show on top of the lock screen so
don't try to display the crash dialog in this case so that
the process can be killed right way instead of waiting for
the user to interact with the crash dialog that isn't visible.

Bug: 31395870
Change-Id: Ic1ce9a133ea12cee8a27690004ac3b56cf75808b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
05efd438fe69831bf5df9b38480eb68feb0ebe65 12-Sep-2016 yuanhuihui <yuanhuihui@xiaomi.com> fix persistent process is killed and restart again and again

start presistent app before system booting, in NewProcessRecordLocked
will set persistent = true, but not set r.maxAdj = ProcessList.PERSISTENT_PROC_ADJ.
so this process may become CACHED_EMPTY, then be killed.
while persistent = true, will restart again.

https://code.google.com/p/android/issues/detail?id=222224

Change-Id: I91b405ca3f3bbe8934e4a495d9a54eab4f51e21f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
37e43275eeee064947f1b448cdf129bea39cf918 10-Sep-2016 Svet Ganov <svetoslavganov@google.com> Move device serial behing a permission

Build serial is non-user resettable freely available deivice
identifier. It can be used by ad-netowrks to track the user
across apps which violates the user's privacy.

This change deprecates Build.SERIAL and adds a new Build.getSerial()
API which requires holding the read_phone_state permission.
The Build.SERIAL value is set to "undefined" for apps targeting
high enough SDK and for legacy app the value is still available.

bug:31402365

Change-Id: Iddd13430b2bd1d9ab4966e31038ecabdbdcec06d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
96b49848e7784bc4b40ffd01e2524461e1efcab7 18-Mar-2016 Robert Sesek <rsesek@google.com> Split the zygote logic out of android.os.Process into a new ZygoteProcess class.

There is no functional change. This is to support adding new types of zygotes
that all operate using the same protocol.

Bug: 21643067
(cherry picked from commit 94e824bc1b5f83024b7c9a228a8f2d0cd1347d11)

Merged-In: Ie673ee816cae34ac20ffb8c774ec3e6461c3fd0a
Change-Id: I104e6133a90dc93a9854836b5e92d3cd542163a3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2c4522cc1bf3a3d0178688427a33b860ddfe4bba 28-Aug-2016 Sudheer Shanka <sudheersai@google.com> Add usermanager related perf tests - part2

- Add onLockedBootComplete callback to UserSwitchObserver.

Bug: 30948225
Test: adb shell am instrument -e class android.multiuser.UserLifecycleTest -w com.android.perftests.multiuser/android.support.test.runner.AndroidJUnitRunner
Change-Id: I87533094805a81fbd85d4f492e637b3304ecd5e2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
32daa7a95cd49cbedf00c006cf80929518cc5465 08-Sep-2016 Robin Lee <rgl@google.com> DO NOT MERGE Stop work challenge freeform bypass am: 0737c2b4c2
am: ec5ceae174

Change-Id: Ic4bbce08944881f0d20a08c1ebb4db5531208f23
ec5ceae1743b64822cb7ca35d5938109a8beb370 08-Sep-2016 Robin Lee <rgl@google.com> DO NOT MERGE Stop work challenge freeform bypass
am: 0737c2b4c2

Change-Id: Ia76391f710e42e9634010bd211a0370230b318e3
2450fb3d593ff9e450bd63b428ab636db396f0a7 08-Sep-2016 Robin Lee <rgl@google.com> DO NOT MERGE Stop work challenge freeform bypass
am: 0737c2b4c2

Change-Id: Ib613296306978c0bfbf1ea6e1dcdb7a72b867a55
a712d4058f6f85268838710857e6070a739cf6f9 07-Sep-2016 Todd Kjos <tkjos@google.com> Revert "Enable migration to big cores for app launches."

This reverts commit a326a116f7f9fb939fac3d28c80d32542016decc.

Change-Id: I9f9497990fbf0697d05445f563ad46a28d6d6eeb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1bf4ac3569f038e3c07169fc514bd2317eecf024 03-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Doing nothing when switching to the foreground user"
58cbfafa1ba2183ba10e8fbe6fc5e2f1166a7912 30-Aug-2016 Suprabh Shukla <suprabh@google.com> Doing nothing when switching to the foreground user

If someone attempts switching to the current user, code from
ActivityManager#switchUser to UserController#startUser is unnecessarily
run. It also ends up freezing the screen and showing the user switching
dialog.

Bug: 30413087
Change-Id: I064f55feac69ca203ca8a917930e8788e3ca44c5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2f2b5aca204281179e164396fa63f6e67c2dd599 01-Sep-2016 Amith Yamasani <yamasani@google.com> Call Debug.getPss without a lock held am: 10e8f16add am: f10d31f5d0
am: 65fdd196fa

Change-Id: Ic41194d60d8919d69123bd40082c86b2a1e22571
10e8f16add72b5384a21c947eebff14d34a66924 31-Aug-2016 Amith Yamasani <yamasani@google.com> Call Debug.getPss without a lock held

Attempt to reduce the chances of watchdog killing the system
server if process pss gathering takes too long during heavy load.

Bug: 30896716
Change-Id: I4ed1a15c0c512a8c82842cde74e733d99d887ee0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
69d2ed20b717e9d2d0d1c91fb95b199357fba80c 26-Aug-2016 Adrian Roos <roosa@google.com> Merge "DirectReply: Fix bugs when replying from HUNs" into nyc-mr1-dev am: a8cf435e81 am: 009853b018
am: 2705e6505a

Change-Id: I7e08a4371478b12566b6ac8cc6467fb0bc553698
0737c2b4c2ae6415eced00926235f848d1957bae 08-Aug-2016 Robin Lee <rgl@google.com> DO NOT MERGE Stop work challenge freeform bypass

Bypassing work challenge in freeform mode was trivial by just keeping
work apps open in freeform mode and then switching focus to them from
another app.

Because the only interception point is startActivity this never
triggered work challenge.

The solution is to trigger the check on focus change events and also to
allow passing the result back into the freeform stack instead of dumping
our user out into the homescreen.

Change-Id: I141ecf90b5f0e708a21d27141b6fec6074e5d475
Fix: 30693465
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
009853b01852875d602b321014eafc22cfc9ef6a 25-Aug-2016 Guang Zhu <guangzhu@google.com> use threadtime when collecting logcat
am: d8ac1dd3ed

Change-Id: I99bfb4cdfe482108849fca72ba151fa04e2efaac
333680114d366d317e835b7879291c782158e4d4 25-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "use threadtime when collecting logcat" into nyc-mr1-dev
d8ac1dd3edeff61d3b91e084e81f227934e93976 24-Aug-2016 Guang Zhu <guangzhu@google.com> use threadtime when collecting logcat

Bug: 31048686
Test: make droid

Change-Id: I55cd38b9cdc4224fcd319af706d421cdac062f83
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fe3df28e9affe8d46593a9bed18d9e90a45ec703 24-Aug-2016 Amith Yamasani <yamasani@google.com> Don't complain about sender of MASTER_CLEAR am: d8a55f6dd8 am: 8b2adb1ee1
am: be0889cf6f

Change-Id: I5abb6fcce2bc7e2e17aeaa4386ae2c4ec0f6a105
d79d203b357b8ac54c36e028d8bb80e3a39165f5 23-Aug-2016 Jeff Sharkey <jsharkey@android.com> Bring back wtf() for missing services.

Publish DropBox extremely early during boot process so that it can
pick up wtf() calls while booting.

Bug: 28634953
Change-Id: Ie71d53fc125ebc47fa08ef59a8b7e4f66f2e805c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d8a55f6dd87621faa8f8765e0e4cdf7be0824e56 23-Aug-2016 Amith Yamasani <yamasani@google.com> Don't complain about sender of MASTER_CLEAR

Make an exception for MASTER_CLEAR broadcast when checking for
non-protected broadcasts being sent by system uid; Settings app in
this case.

Change-Id: I296404faf2be03601f8f937b96d3e2f70c0e816d
Fixes: 30891377
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b7380a1c0ce8848ef10ba54966c296b5b505dd30 19-Aug-2016 Amith Yamasani <yamasani@google.com> DO NOT MERGE: Clean up when recycling a pid with a pending launch
am: 55eacb9441

Change-Id: Id1ee0a3dd76a7bb549838e9d74b9927956b96570
047054c1d9803979e4adad11941fa0aa4d6d214a 19-Aug-2016 Christopher Tate <ctate@google.com> Isolated processes don't get precached system service binders am: 2c61c57ac5 am: bf3d892df2
am: 35f883d9cf

Change-Id: I06726ff14caa8628ab37f40d1fb90e21506c23db
2c61c57ac53cbb270b4e76b9d04465f8a3f6eadc 17-Aug-2016 Christopher Tate <ctate@google.com> Isolated processes don't get precached system service binders

More specifically, they get a PackageManager binder -- necessary for
Android process startup and configuration -- but none of the other
usual preloaded service binders.

Bug 30202228

Change-Id: I3810649f504cd631665ece338a83d2e54d41ad05
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
77df6f315d6fbb22622ca46ae5735a5c73cc367d 17-Aug-2016 Svet Ganov <svetoslavganov@google.com> Remove permission review build property - framework

Change-Id: Ifcfd436f2d57a6006ef804292d2875434e4669da
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
55eacb944122ddc0a3bb693b36fe0f07b0fe18c9 06-Aug-2016 Amith Yamasani <yamasani@google.com> DO NOT MERGE: Clean up when recycling a pid with a pending launch

Fix for accidental launch of a broadcast receiver in an
incorrect app instance.

Bug: 30202481
Change-Id: I8ec8f19c633f3aec8da084dab5fd5b312443336f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f4825a431d3f4ab9a8e0b3b7a3a7392724405f8b 12-Aug-2016 Amith Yamasani <yamasani@google.com> Clean up when recycling a pid with a pending launch am: d86e14e45c am: 92de60bd7f
am: 1fa3fd30bd

Change-Id: Ib4e36dc0be9c6a73907bbdf7f146a20e0d2eeb3f
92de60bd7fce725404ee2ace951b68aed4f0bf25 11-Aug-2016 Amith Yamasani <yamasani@google.com> Clean up when recycling a pid with a pending launch
am: d86e14e45c

Change-Id: If77af8cc8a0b9620c2fc5e4704c178667fc0703e
792aaab77a3514b268c192717f2da25a58dc40fb 11-Aug-2016 Amith Yamasani <yamasani@google.com> Merge "Clean up when recycling a pid with a pending launch" into nyc-mr1-dev
8f203ce87cf819653929e89e22b289f17216acb6 11-Aug-2016 Tim Murray <timmurray@google.com> Fix exception spam in ActivityManagerService. am: feb846c299 am: 76ac2e7a8b
am: fb1021f32e

Change-Id: I7a3695b0e545fb37c5cbb41eb2b24c60f6c4e312
feb846c299cba3cb73eb19ecc2d7fb6de9be85d6 08-Aug-2016 Tim Murray <timmurray@google.com> Fix exception spam in ActivityManagerService.

If a thread that ActivityManagerService should be setting to FIFO dies,
it throws an exception. However, it is expected that threads may
die (due to LMK or app behavior), so we should suppress as much of this
as possible.

bug 30746129

Change-Id: Ief1ab8568fe8b27284ec442570b6a06677998ff1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
05f58f6be4ccf1ea9b0113f5f6cc18472b788ba2 10-Aug-2016 Ruben Brunk <rubenbrunk@google.com> Fix setVrThread's exception handling. am: 83ea55a9c6 am: b25be4bd37
am: 34e4e80db1

Change-Id: Iec0098aa85e3388cadf18f644451189005908065
83ea55a9c60ca52873ffc752d92fa3e05e5bd3ac 10-Aug-2016 Ruben Brunk <rubenbrunk@google.com> Fix setVrThread's exception handling.

Bug: 30746129
Change-Id: I49ee29f12b52c9f9f5f061508c5cc8c89fd1cd11
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
717b2b9cd037ddb1a85a26ab88fe7d633c88a565 10-Aug-2016 Chong Zhang <chz@google.com> Merge "Put activity into stopped state if recreated while stopped"
fec694eca19f695556a8530bf2f8720cce94fe46 09-Aug-2016 Chong Zhang <chz@google.com> Put activity into stopped state if recreated while stopped

Move handling of recreate from client side to AMS, so that relaunch
happens at the right condition and activity goes to right state
after it's relaunched.

bug: 30060825
Change-Id: Ia475c26927b305eb25ae12be8640aab1fb7677a0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d86e14e45c15cd1a17925d9cb131471d496ab389 06-Aug-2016 Amith Yamasani <yamasani@google.com> Clean up when recycling a pid with a pending launch

Fix for accidental launch of a broadcast receiver in an
incorrect app instance.

Bug: 30202481
Change-Id: I8ec8f19c633f3aec8da084dab5fd5b312443336f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1839645126c8e7e0909e8ed8f0686c2122ba6078 28-Jul-2016 Evan Rosky <erosky@google.com> Add support for custom user-switch UI

Given config_customUserSwitchUi, AM/UserController will not show any
UI during user-switch (no dialog or screen-freeze).

Provides a mechanism (WM.setSwitchingUser) by which a custom user-switch
UI can notify WM/Keyguard when it expects a user-switch operation to
be running.

Bug: 29329555
Change-Id: Ic903fc251d7ec3a54bc6a77906d3afa45a6a5fac
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
73d5996e59ae5ce1c6ed7de5ccbb6f6e15a8b761 05-Aug-2016 Ruben Brunk <rubenbrunk@google.com> Don't crash system server when setting scheduler. am: 29a4a9edb3 am: 76f7a40780
am: 2b439261f8

Change-Id: I3c5918c4b8d8c628cfb53600e709790fa3c8188b
76f7a40780f680c452c909f0ede55e4ab5f1c7b5 05-Aug-2016 Ruben Brunk <rubenbrunk@google.com> Don't crash system server when setting scheduler.
am: 29a4a9edb3

Change-Id: Ibb96a4df03857c14be87162df7685130ad6ee9cc
2f917df4be5963bc30f2f684208c9aa4177353cc 04-Aug-2016 Ruben Brunk <rubenbrunk@google.com> Merge "Don't crash system server when setting scheduler." into nyc-mr1-dev
29a4a9edb30c0ca25f3e51139962f84c2160b0ed 04-Aug-2016 Ruben Brunk <rubenbrunk@google.com> Don't crash system server when setting scheduler.

Bug: 30671326
Change-Id: I2f7913cd3cca052d5a653ff288459b0a6a69deda
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a28418bfe4977f483cb68c0e02e59747dbc37215 04-Aug-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Update foreground check. am: 33525d2f1a am: 386fd915fc
am: d7f86b7115

Change-Id: I4ebd4315910b35849e970319fa1e265e5b79a4b8
33525d2f1a8116820f58fc90941cb53bcba54805 04-Aug-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Update foreground check.

- When the cached UID state says a UID is in the background,
check with AM and get the latest state, since the state
might just have been changed.

Bug 30640208

Change-Id: If448f6f21f290fa0fc13550d9c740f56aa8bfce0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2642cc3f835b2c73a9f822bc74f0309624c7bd05 03-Aug-2016 Dianne Hackborn <hackbod@google.com> Fix issue #30601353: Don't warn of non-protected explicit intent broadcasts am: de8572d931 am: 88fe0c260b
am: 1a7c4f46f2

Change-Id: I4efc1d12d37a1d2b9ad0d8bd80e455bdc8aa8a31
de8572d9319cd1ff3b765d64fc131f8e9695c473 02-Aug-2016 Dianne Hackborn <hackbod@google.com> Fix issue #30601353: Don't warn of non-protected explicit intent broadcasts

We still check for security errors of non-system apps trying to send
protected broadcasts at the front.

However, the WTF check for system apps sending non-protected broadcasts
is now moved down to where we actually resolve the receivers, so we
can loosed then check to make it okay as long as you are sending an
explicit intent to only appropriately protected receivers.

Change-Id: I5214c6c26a60de083f1f9578bcc5e95ba19f7001
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4a70ed12f174068dd02263d43d2c1e299a26dd0a 29-Jul-2016 Makoto Onuki <omakoto@google.com> Relax isUserRunning check and allow in-profile calls am: 8198deacb5 am: f29793a40c
am: c6a4953acf

Change-Id: I769cf8827fcc2bfbf952efb33e7529811a373a22
5ecf85949477b9c81ae87280711f0d64c49ecf24 29-Jul-2016 Jorim Jaggi <jjaggi@google.com> Follow up for I420bee8a11d430b1e52ded050536e56a85a48800 am: 8d4f5f52a1 am: ffb289c7b3
am: f878d518c1

Change-Id: I45a3a50685cceb2c59476a236cb883846ae0f51a
60dba736d990e243cb2fe5bb2c0a53bb1a9738ec 29-Jul-2016 Adam Lesinski <adamlesinski@google.com> Register isolated UIDs before reporting process state am: e2b78ac686 am: c526e02c2f
am: b3d36b7692

Change-Id: I5ae741b85f7b85cc512e0f36f1204b52d1998737
a9281e74bd9e8357c58ef15e9b4439c3ee1ce1cf 29-Jul-2016 Tim Murray <timmurray@google.com> Increase UI and RenderThread priority when not using FIFO. am: a636b0b4b6 am: c8ee2116d7
am: 40e06f9a18

Change-Id: I95c5f8e6e55d52e09be65078e3f67be93ed0f45e
f29793a40c2377e68e0bc3285537159df36e640e 28-Jul-2016 Makoto Onuki <omakoto@google.com> Relax isUserRunning check and allow in-profile calls
am: 8198deacb5

Change-Id: I55a2badbfd89f65f56bdd75daa15b81ec46c0cdd
82c2e88890fbe0b7e112964e14b9b9ef3887d3f1 28-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Relax isUserRunning check and allow in-profile calls" into nyc-mr1-dev
8198deacb52eb082ae9f0a5658d594dc9b689882 28-Jul-2016 Makoto Onuki <omakoto@google.com> Relax isUserRunning check and allow in-profile calls

Bug 30475753

Change-Id: I739ee7e259f041f5e133edf048b6b54cb7a770db
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ffb289c7b314b90c4811aee5e3c0f7a91a358dbb 28-Jul-2016 Jorim Jaggi <jjaggi@google.com> Follow up for I420bee8a11d430b1e52ded050536e56a85a48800
am: 8d4f5f52a1

Change-Id: I9b5c7d18520d57c355f3c8ea76e2dfc0e6d6ff39
ca5310dd5f77ea894006f8060e34958bfe5a7f1c 28-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Follow up for I420bee8a11d430b1e52ded050536e56a85a48800" into nyc-mr1-dev
c526e02c2f90e4e1476576873edf866ed6a3ff63 28-Jul-2016 Adam Lesinski <adamlesinski@google.com> Register isolated UIDs before reporting process state
am: e2b78ac686

Change-Id: Ia535bd3c12c414e8bb0e2e7890ca84eb4b90ca20
c8ee2116d73cee0319da35091c4b87c1f838e3da 28-Jul-2016 Tim Murray <timmurray@google.com> Increase UI and RenderThread priority when not using FIFO.
am: a636b0b4b6

Change-Id: I3d586b9aa8ca8b3d989c8d4d5d95ccba916ea068
5b9d782a2d14fbfff3ae3e7f2dd53873a27da93b 28-Jul-2016 Adam Lesinski <adamlesinski@google.com> Merge "Register isolated UIDs before reporting process state" into nyc-mr1-dev
a232c5bed72300701517c3ce26868bd3b16263a2 28-Jul-2016 Tim Murray <timmurray@google.com> Merge "Increase UI and RenderThread priority when not using FIFO." into nyc-mr1-dev
a636b0b4b6d7c4794b3a3bc7dde943f78a38db92 28-Jul-2016 Tim Murray <timmurray@google.com> Increase UI and RenderThread priority when not using FIFO.

bug 30441279

Change-Id: I5714179236af59ce79dbe118c7870d5f1771168a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e2b78ac68653c295149ff70c7f4489150033e8f6 27-Jul-2016 Adam Lesinski <adamlesinski@google.com> Register isolated UIDs before reporting process state

Isolated UIDs should be registered with a real app UID
before any process state changes are reported for them.

Bug:25195548
Change-Id: Id0d3a5373ca57d3725315b2d99e5f8e5286022c8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8d4f5f52a1b1ff8e1a5bdffeeed37f766a166c66 25-Jul-2016 Jorim Jaggi <jjaggi@google.com> Follow up for I420bee8a11d430b1e52ded050536e56a85a48800

- Log when hasTopUi state changes
- Add hasTopUi to dumpstate
- Only allow persistent processes to honor this flag

Bug: 30292998
Change-Id: Ifb481c8d50b102ea4cac3078ea3eb39e45c08259
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
403cb5193cba0ce82004261974983d9a22a673e1 27-Jul-2016 Amith Yamasani <yamasani@google.com> Persist configuration for the calling or current user am: 034ec49b19
am: cd1b117b48

Change-Id: I7d06ccfdeab31c5f2b3bdcdbb955dcc6a64925c4
cd1b117b483d15e51fcbfee00af1b29e63bb7a23 27-Jul-2016 Amith Yamasani <yamasani@google.com> Persist configuration for the calling or current user
am: 034ec49b19

Change-Id: Id5809af87a9d72cc93851ee32a437aea1849bc8a
7853ba63cd8b0d79a7bd99ca91035399ac00d73f 27-Jul-2016 Amith Yamasani <yamasani@google.com> Merge "Persist configuration for the calling or current user" into nyc-mr1-dev
034ec49b19058284c7e123cfe8d239761a75b632 25-Jul-2016 Amith Yamasani <yamasani@google.com> Persist configuration for the calling or current user

Persist the font size change to the correct user.

Bug: 30273473
Change-Id: Ia29735d4112720389a30b61f961f6c1071ce4ba2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f12d0c96d3f2927e48036ba14f8828e5f888fe68 26-Jul-2016 Vladislav Kaznacheev <kaznacheev@google.com> Fix AM.revokeUriPermissionFromOwner for prefix mode.
am: 4498aa6c58

Change-Id: I752efeb20f5fd28576babb7f90bdc79dbec02366
0217d4e6b8f5cd3fa8f862783e7c6119bfb9d0eb 25-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix AM.revokeUriPermissionFromOwner for prefix mode." into nyc-mr1-dev
ac69be543f89ea6e9a27204492e0a170d9b3450e 30-Jun-2016 Svetoslav Ganov <svetoslavganov@google.com> Add Bluetooth toggle prompts - framework

If permission review is enabled toggling bluetoth on or off
results in a user prompt to collect consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

Also added a configuration resource which controls whether
permission review mode is enabled. By default it is not and
an OEM can change this via an overlay. For now we also keep
the old mechanism to toggle review mode via a build property
which is still used and will be removed when clients have
transitioned.

bug:28715749

Change-Id: I94c5828ad6c8aa6b363622a26ff9da4fc2e2fac7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
758f841d86bf9a5af54de267d1dec179d85bc860 23-Jul-2016 Jorim Jaggi <jjaggi@google.com> Move SysUI to top app scheduling if panel expanded am: f6782ee1c8
am: b712ee18b2

Change-Id: I71a73ff87c0f791316c9ac32e39d3bc54eeab37f
f6782ee1c87ba1f39f595d1facb8b13d851988b9 22-Jul-2016 Jorim Jaggi <jjaggi@google.com> Move SysUI to top app scheduling if panel expanded

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

Bug: 30292998
Change-Id: I420bee8a11d430b1e52ded050536e56a85a48800
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4498aa6c58664d29779131751592d8dc5f53ce9c 21-Jul-2016 Vladislav Kaznacheev <kaznacheev@google.com> Fix AM.revokeUriPermissionFromOwner for prefix mode.

Currently ActivityManager.revokeUriPermissionFromOwner is doing
nothing when called with flags containing
Intent.FLAG_GRANT_PREFIX_URI_PERMISSION.

Bug: 30284061
Change-Id: Iafac98f3eb61a29f56ce274031c01cd555e13063
(cherry picked from commit ff7a500d72fa37ea3e2bf8e1c1908649475e9c2c)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
252af16f4a20ef8fdf5099bbc8c9b61eb97d40fb 22-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix AM.revokeUriPermissionFromOwner for prefix mode."
d2cb311c02a922ce8c1cd6ae48525259c23c4da2 20-Jul-2016 Chong Zhang <chz@google.com> Call completeResumeLocked after activity is resume-relaunched

This is only needed when we're resuming an activity in
resumeTopActivityInnerLocked. If the activity is being resume-
relaunched elsewhere, we don't need to check this.

Also make sure RESUMED state is only set in ActivityStack#
setResumedActivityLocked.

Change-Id: If4be211f9ded7e5057257563ffc566cd4d65fb33
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ff7a500d72fa37ea3e2bf8e1c1908649475e9c2c 21-Jul-2016 Vladislav Kaznacheev <kaznacheev@google.com> Fix AM.revokeUriPermissionFromOwner for prefix mode.

Currently ActivityManager.revokeUriPermissionFromOwner is doing
nothing when called with flags containing
Intent.FLAG_GRANT_PREFIX_URI_PERMISSION.

Bug: 30284061
Change-Id: Iafac98f3eb61a29f56ce274031c01cd555e13063
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
de1e6e4d2d37ceb736d6849b0caa8efe9fad66dc 21-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Support multiple intents in ShortcutInfo\\" into nyc-mr1-dev am: b84ce2e034
am: 9a6109f284

Change-Id: I0f1caf54cc544db0b73f8e3275005923904f57a8
440a1ea8e2204ecb171e0187318beb2f08f6012c 20-Jul-2016 Makoto Onuki <omakoto@google.com> Support multiple intents in ShortcutInfo

Also fix b/30230996.

TODO: Support the sourceBounds argument to LauncherApps.
startShortcut().

Bug 30218829
Bug 30230996

Change-Id: Ibb6c59d5b7c0a320c21d09436d016d0eac94644f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bc0c4bd03ca53efcce3cf57602c8a8b4c0cd1289 19-Jul-2016 Adrian Roos <roosa@google.com> Merge \\"AppErrors: Fix bad flags printing in dropbox crash reports\\" into nyc-mr1-dev am: b4addbc282
am: 579f69dc4e

Change-Id: Idf13c3ee24c12cd65af5daf2f13b2073df9455a6
b4addbc28229187b676f4b8cb2f8d8002fba1903 19-Jul-2016 Adrian Roos <roosa@google.com> Merge "AppErrors: Fix bad flags printing in dropbox crash reports" into nyc-mr1-dev
402aee85a3a98fb1cc9b468798cc6d6d1aee9093 13-Jul-2016 Alan Leung <acleung@google.com> Fix thread priority after boosting.

The previous CL wrongly restores all priority to nice 0.

This CL changes two things:

1. It remembers and restores the previous priority.
2. If the thread has priority of < -2. Do not set it to -2.

BUG: 29930920
Change-Id: I927e060d789c9bbf92f6a166f44317d9db0f5205
(cherry picked from commit d6e67e6a165e0f1161090730996f5e82d3b6421b)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
44b7f75587fbd8e382b3a58e5f272a9776f1efc2 19-Jul-2016 Tim Murray <timmurray@google.com> Merge changes I15da2563,I7845542d into nyc-mr1-dev am: 7b8b1aab93
am: 619682b960

Change-Id: I98afd5bead70cf25ca43e49c1215ccef1e472a83
e2279c6d239f0ddf6edfaf41a7bf87cacca2c4bb 19-Jul-2016 Tim Murray <timmurray@google.com> Don't reset current thread's priority accidentally.

If there's no RenderThread for the top app and FIFO UI is enabled, it's
possible to reset the current system_server thread's priority and
scheduler.

bug 30173296

Change-Id: I15da2563356ddd66911d695db43660ce5400da07
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d3f643944d4dd490fecc7ea5bbcfa214a88ab2c1 18-Jul-2016 Adrian Roos <roosa@google.com> AppErrors: Fix bad flags printing in dropbox crash reports

Fixes a bug where flags were written as a signed hex value.

Change-Id: Icf65f745f6d02d0e0d4f85c108f170951310f2a7
Fixes: 30147712
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3f94a2e35cfc5d274d7b457f00cdfc0e491556cc 18-Jul-2016 Chong Zhang <chz@google.com> Merge "Remove two-finger scroll specific code"
2e2c81a8d67f6ceccf178c5c7264d27e8c72e9ff 15-Jul-2016 Chong Zhang <chz@google.com> Remove two-finger scroll specific code

Revert changes in ag/845161, ag/843943 and ag/817515 that's added
specifically for two-finger scroll mode.

Change-Id: I8679a3bd5b3907180d33d99e3a071e7edfb2ed96
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
19b938834f17bcdb97c91580442966389e3cfa9e 15-Jul-2016 Alan Leung <acleung@google.com> Merge \\"Fix thread priority after boosting.\\" into nyc-mr1-dev am: 1e9b8138f0
am: 379df004a0

Change-Id: If4c3e2c72dcca52ec3a6789b6c5fd907edeb9a47
1e9b8138f076d152022d1b20f66f5ce4a70342cd 15-Jul-2016 Alan Leung <acleung@google.com> Merge "Fix thread priority after boosting." into nyc-mr1-dev
6a8581339ba4ac35f55906b9d55bf21a1e7c23ce 15-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Handle locale change and pacakge change in different way\\" into nyc-mr1-dev am: 83fa7a8255
am: 22963b8937

Change-Id: I39da795eeed8bb3d0e53b0ed02663cce1088cabf
83fa7a82558a41a18d959c7b9fb197b787c52779 15-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Handle locale change and pacakge change in different way" into nyc-mr1-dev
d6e67e6a165e0f1161090730996f5e82d3b6421b 13-Jul-2016 Alan Leung <acleung@google.com> Fix thread priority after boosting.

The previous CL wrongly restores all priority to nice 0.

This CL changes two things:

1. It remembers and restores the previous priority.
2. If the thread has priority of < -2. Do not set it to -2.

BUG: 29930920
Change-Id: I927e060d789c9bbf92f6a166f44317d9db0f5205
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a83b73f38c6e948eeaa335b0b41e86d9791b5390 14-Jul-2016 Chong Zhang <chz@google.com> Merge "Remove mFocusedActivity in AM and only keep focused stack"
6cda19cab2bcd6d538f98782bd315c6c7ff5a4d5 15-Jun-2016 Chong Zhang <chz@google.com> Remove mFocusedActivity in AM and only keep focused stack

- Remove mFocusedActivity and replace it with resumed activity
where applicable.

- Remove setFocusedActivityLocked and related recursions, only
keep track of focused stack.

- Update focus app with WM at resume time.

- Some clean up of startActivityUnchecked, make sure each of the
setTaskFromXXX methods set up the focused stack properly, and
remove the extra setFocusedActivityLocked before starting.

bug: 29937415

Change-Id: Ib93d3f4d9cded0aa3b480d0d423435c536b7e7b5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4e6cef49ef11bbb5bfc0e9f0fb865188492d88b0 14-Jul-2016 Makoto Onuki <omakoto@google.com> Handle locale change and pacakge change in different way

- Stop using a custom callback from AM to detect locale changes
and use the LOCALE_CHANGED broadcast instead.

- This would open up a chance where a publisher app fetches
its won manifest shortcuts after a locale change but
ShortcutManager hasn't updated string resources.

- So instead, at every entry point from ShortcutManager, check
if the locale has changed, and if so, update all resources
(and reset throttling).

- Do the same for package change events too. At every entry point
from ShortcutManager, check if the caller package has been updated,
or any target activities have been disabled. If so, rescan the
caller package.

- We do *not* do the same check at the LauncherApps entry points,
because the launcher should use the callback to listen to
shortcut changes.

- Also stopped using PackageMonitor for now because we want to
set a higher priority and changing PackageMonitor at this point
seems too much for DR.

Bug 29895275
Bug 30123329

Change-Id: Ib4a2f626a936c7328e2cc032324f5c3d1c3b9122
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2cd9eb7c353a2e4d2ad63ec7ff705385a29aee87 14-Jul-2016 Wei Liu <luciferleo@google.com> Merge \\"Add BUGREPORT_OPTION_WEAR so that Wear can customize its bugreporting.\\" into nyc-mr1-dev am: 6e8630307a
am: 05c2c22a80

Change-Id: I8af1193d4af465f234c8ba08ff0eeefa7279e029
6e8630307aa066abc5fdd553d3332f24aa477fd9 14-Jul-2016 Wei Liu <luciferleo@google.com> Merge "Add BUGREPORT_OPTION_WEAR so that Wear can customize its bugreporting." into nyc-mr1-dev
8664c1e7fd13fa95be8f9d2f718929b2c33a5321 13-Jul-2016 Andrii Kulian <akulian@google.com> Merge \\"Don\\'t make redundant launch while updating configuration\\" into nyc-mr1-dev am: 4c7b339411
am: 082cab4bb4

Change-Id: I33a09d4a35d36707e155eb56ca53bab79f31af06
db3e4ecf86939924be863e95d1db9fbb328fa9d8 13-Jul-2016 Andrii Kulian <akulian@google.com> Don't make redundant launch while updating configuration

If the configuration changed the same time when the app was launched,
from ActivityStackSupervisor#realStartActivityLocked we updated
configuration, which lead to resuming top activity in focused stack.
This caused second redundant launch of already launching activity.

Bug: 29516875
Change-Id: I2babe1936dfb53b5a440deee34874731913db2eb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
be0e56e9d2b7c81852f81584e654de23d165f25c 12-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Throw ActivityNotFoundException when failed to launch shortcut\\" into nyc-mr1-dev am: 50752f7391
am: b1e0982173

Change-Id: I466a7c5985cb080e6e2780cfbafa3bb90cc58dbf
83f6d2da372de339dc563d6a7786be3facc52e76 11-Jul-2016 Makoto Onuki <omakoto@google.com> Throw ActivityNotFoundException when failed to launch shortcut

Originally the code used IIntentSender, but I had to switch to calling
startActivitiesInPackage() directly, because sendIntentSender() does
not support returning errors.

Bug 30035853

Change-Id: I5d7669c96a2f1805373c71aebf45b97ac1d01ff6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
43d1f26ef976b3165350dd4e8d5624dde5713480 15-Jun-2016 Winson <winsonc@google.com> Allow dumping activity from all visible stacks.

Change-Id: I89ef198b8d629fb0f57c2866ce581942701910e6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
967fc8dd62be9d29f89e3520ec79d4873df03481 08-Jul-2016 Wei Liu <luciferleo@google.com> Add BUGREPORT_OPTION_WEAR so that Wear can customize its bugreporting.

b/30041885

Change-Id: I4ffa7b5c8ddad35e32f0f31ce904848ff40ad734
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
aa1735370b24428647508d2ff0f29a617cb955e9 07-Jul-2016 Tim Murray <timmurray@google.com> Merge changes from topic \\'fifo\\' into nyc-mr1-dev am: a96d445aef
am: 03b34e402c

Change-Id: If3104889f659aef9a6d7035e18ab839544c9ecb3
a96d445aef1456398410e41e9c29d9181287edc5 07-Jul-2016 Tim Murray <timmurray@google.com> Merge changes from topic 'fifo' into nyc-mr1-dev

* changes:
Add new mode for SCHED_FIFO on UI and RenderThreads.
Add isThreadInProcess.
5c1d5461c9e44c48c22819d6985406f056eca35a 07-Jul-2016 Jeff Sharkey <jsharkey@android.com> Merge \\"Remove \\"starting apps\\" boot message.\\" into nyc-mr1-dev am: bb2d9ab98e
am: cb2dce0352

Change-Id: Ieee93cccfb67ff3e9f28ed76813bc789208492db
33eb07f5759b85a5617f8057d8a335019c7d24dd 10-Jun-2016 Tim Murray <timmurray@google.com> Add new mode for SCHED_FIFO on UI and RenderThreads.

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

bug 24503801

Change-Id: I7b8a31830ad80f7efa00236928d5476998ed4e00
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7380c321ad23b6cbf0af239fbd2e037f67b08545 28-Jun-2016 Jeff Sharkey <jsharkey@android.com> Remove "starting apps" boot message.

The "starting apps" message is only shown for a short period of time
before we show the lock screen. Recent boot animations now have a
spin down phase which is just long enough to result in us flashing
this message for a very short period of time, which looks janky.

To avoid the janky behavior, remove this message altogether. Other
boot messages for dexopt'ing after an OTA remain intact.

Also fix security bug that would allow any app to show a message.

Bug: 29367890
Change-Id: I77bb65acbe0e5afb4033dc6b83e533e665dce690
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b89970e0fb11b71592e10570d387eac3bbb6f6d6 01-Jul-2016 Tim Murray <timmurray@google.com> Add isThreadInProcess.

Use this to make sure that the VR thread belongs to a given process when
it is assigned.

bug 28715706

Change-Id: I4e5b0d8493e69e443eb907f0a6f2a9482fb64bac
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b8e1286605042da38891bf1ed5fe7db0fc63d2cc 01-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Start shortcuts as if publisher apps did using PendingIntent\\" into nyc-mr1-dev am: 60efbf2586
am: 20a9ca9311

Change-Id: I3bb569bb53b95176dc5e3b19f4122cf75511ac1e
60efbf25865ae395548c38be42b856e6ede22f7d 30-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "Start shortcuts as if publisher apps did using PendingIntent" into nyc-mr1-dev
6d4f195f1ab24942e9a56e37b05e5c80500b3ba4 30-Jun-2016 Chad Brubaker <cbrubaker@google.com> Merge changes from topics 'handle-storage-update', 'action-storage-changed'

* changes:
Update trusted certificates when the trust store is changed
Deprecate ACTION_STORAGE_CHANGED
ef79f35c69cb6ba1828422ff96e3816285ba4800 30-Jun-2016 Tim Murray <timmurray@google.com> Merge \\"Add a new API to improve VR thread scheduling.\\" into nyc-mr1-dev am: 5e261441d3
am: 75c6078c8b

Change-Id: Ic101c2d17e98fcb1cc2d6e3cccebfb6e378f9914
5e261441d3a5920bf69b827d8a2491848b91b50e 30-Jun-2016 Tim Murray <timmurray@google.com> Merge "Add a new API to improve VR thread scheduling." into nyc-mr1-dev
e535a5827b7b7c7c70f4701d74051c9bb5eb0b98 28-Jun-2016 Srinath Sridharan <srinathsr@google.com> Add a new API to improve VR thread scheduling.

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

BUG: 29163534
Change-Id: I58d7be0eb266eca452c804cd07004784fb7daf2b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c72875b01e04a12fa25bbc5468cf87f8bf11fcfa 28-Apr-2016 Chad Brubaker <cbrubaker@google.com> Update trusted certificates when the trust store is changed

This CL flushes the trusted cert cache of all active Network Security
Configs and their TrustManagers. Previously CA addition mostly worked
however removed CAs would remain cached in the X509TrustManager causing
the removed CA to still be trusted.

Change-Id: I0f5fd39932f8f8ed3ec5dfd088a82e982b366c43
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ea11db15bd0cfe6ecbc44dd80a988ddf0e8c1ce7 25-Jun-2016 Makoto Onuki <omakoto@google.com> Start shortcuts as if publisher apps did using PendingIntent

Bug 29639471

Change-Id: I2aad115669b431cbea785ba92040b1958117ab47
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0f5130bd951ae31e1c02ce4ede44b9c690057c75 30-Jun-2016 Jeff Sharkey <jsharkey@android.com> Move getRecentTasks() to ParceledListSlice. am: 479212cf50 am: ce3c8ac0f4
am: 38b322d171

Change-Id: Id28e985eff80210d5f25d8632db1e98fd111b896
38b322d1717154d2a0ddf24d4e3f4ce0205cd65d 30-Jun-2016 Jeff Sharkey <jsharkey@android.com> Move getRecentTasks() to ParceledListSlice. am: 479212cf50
am: ce3c8ac0f4

Change-Id: Ie0c3873c46832d1a10b016bafb26e860eba4ec07
3362400aa5a22ded3ec256bc6bbff06d036fdc41 30-Jun-2016 Jeff Sharkey <jsharkey@android.com> Move getRecentTasks() to ParceledListSlice.
am: 479212cf50

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

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

Bug: 29635557
Change-Id: Iaf1227234f5f8c9451f73a6a5c1dc89f2067f05f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b3bab1634106923ba39bde3123305d2a4c142b49 28-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \\\"Add extra waiting when switching users\\\" into nyc-dev am: 4d6be6b308 am: 9525331c5e
am: 7510331afb

Change-Id: I3f1887f5418f25bef553940668e86f7059985549
7510331afb34ebc40ca38468f93b38dafa888556 28-Jun-2016 Andre Eisenbach <eisenbach@google.com> Merge \\"Add extra waiting when switching users\\" into nyc-dev am: 4d6be6b308
am: 9525331c5e

Change-Id: I670cf48d1aac97dcf26213d7db5627ac7a1ef654
91df8559c0d338234b9ee6140ddb2d49a0327e04 28-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \"Fix bug where process whitelist manager state would not be correct.\" into nyc-dev
am: a39d380651

Change-Id: Ideb81a07d14e1fff71593cec822f3120c4f523f6
a590d2be935ef502943a1e6615500aa10e67c85a 28-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix bug where process whitelist manager state would not be correct.

We can't update this in updateOomAdjLocked(), because we very
deliberately only iterate through services in there as needed.
The correct thing to do is update the process as services/connections
are associated with it, so do that.

Now basically all of the logic for tracking the state is in
ActiveServices, as we bind and unbind services and add and removing
them from process records. It's a little messy because we don't
have a central place for removing them from process records, which
should be cleaned up in the future.

Part of fixes for issue #29480440

Change-Id: Iac96f002a5b4e3b0277df244ff7b90f59a6e8440
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4eefd6801c5955a3017ff80f7bf61dd71a50b1a8 27-Jun-2016 Steven Ng <stevenckng@google.com> Merge \\"Disallow disable / hide device provision app\\" into nyc-mr1-dev am: dc52eaaa98
am: 8b764a81ef

Change-Id: Id04c937ce560d0446037a495394ec168875782cb
9d48a731d0a7c016b58bc9c1afc4acd94200650f 24-Jun-2016 Steven Ng <stevenckng@google.com> Disallow disable / hide device provision app

+ Rename functions in ProtectedPackages.
+ Add a Set in ProtectedPackages to store protected package.

Bug: 29116229
Change-Id: Ib7dd93a158c09ebbf70f4d57c1afbd2c5102edbd
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2e33e0df3c1017b865c2fd6662325a9d203ad4ec 24-Jun-2016 Amith Yamasani <yamasani@google.com> Merge \\"Resetting some settings on starting a new demo session\\" into nyc-mr1-dev am: bb1fb395ca
am: 5c451c08bc

Change-Id: I7e44f3ec7c29d0e1adfd5e4baff1cbfba7368bcc
bb1fb395cae4dd92739db4ce6fa48037ba5383f6 24-Jun-2016 Amith Yamasani <yamasani@google.com> Merge "Resetting some settings on starting a new demo session" into nyc-mr1-dev
517d8db3a5da977178a2e4f635636efb49482c0a 24-Jun-2016 Adrian Roos <roosa@google.com> Merge \\\"Improve ANR dropbox reports\\\" into nyc-dev am: 594c9cb356 am: fe45e68667
am: 3a10153161

Change-Id: Ibf38b8ef30f75b1344f9eb3eac7584413cd05be6
3a10153161a0d0572087e5350eff11f9bf930ace 24-Jun-2016 Adrian Roos <roosa@google.com> Merge \\"Improve ANR dropbox reports\\" into nyc-dev am: 594c9cb356
am: fe45e68667

Change-Id: I067c42ea4ec354713ad546c4673fd8e275aa3feb
ffc89988d2ca166c6f8e89ecb690b5f60ad6e8b3 24-Jun-2016 Adrian Roos <roosa@google.com> Merge \"Improve ANR dropbox reports\" into nyc-dev
am: 594c9cb356

Change-Id: Ic3c8b1c5fc1c1b9c2c5e5d8df48d072269a92cc6
594c9cb356f04e04f8c2fe0cacd0f85b6fa8a375 24-Jun-2016 Adrian Roos <roosa@google.com> Merge "Improve ANR dropbox reports" into nyc-dev
73d1ce85ac5e7d2bb20996bdadb3df5f31cb4bc1 24-Jun-2016 Adrian Roos <roosa@google.com> Improve ANR dropbox reports

Work towards better diagnosing b/29501073. Adds logic to ensure that the dropbox
entry generated for ANRs fits at least some part of the logcat before the MAX_DROPBOX_SIZE
mark. Also reduces the MAX_DROPBOX_SIZE to be better match size restrictions.

Bug: 29501073
Change-Id: Ice5599582cbb536b7d81aa0c0340ff753ca86ebf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6472501f2e7ba018d8aa43c61e55874d756cecb8 15-Jun-2016 Suprabh Shukla <suprabh@google.com> Resetting some settings on starting a new demo session

Muting ringer and media volume and turning off the flashlight
before starting a new session. Also, resetting the configuration of any
new demo user to the configuration of user 0 on the device. Moved
RetailDemoModeService and RetailDemoModeServiceInternal to more
appropriate new packages

Bug: 29519612
Change-Id: Ib65f89ce61afab2d2f1b2dd0c761f5d35a466181
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1d84a7ffef52c95b0e80e65bf9a7b8f7deffbd65 24-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge \"Merge \\"Print names of observers causing timeout\\" into nyc-mr1-dev am: 38d7897690\" into nyc-mr1-dev-plus-aosp
am: a5b7b96500

Change-Id: I04decfb9d3988e5080ab3ff5c88032836dd1306a
38d7897690b61378d94cfe3553d083648aca8e43 23-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Print names of observers causing timeout" into nyc-mr1-dev
d4ed6289951ed49907b5dc900784ad2c6c4226f3 23-Jun-2016 Jeff Sharkey <jsharkey@android.com> Merge \\\"When uninstalling, only kill the requested user.\\\" into nyc-dev am: 060d5a0e0a am: eaa1c9ae42
am: 68106fc9bb

Change-Id: I2257e663979d4b34e0736b807b3765aa7b2aa060
eaa1c9ae4248810ed30c52d85e348712f5621a50 23-Jun-2016 Jeff Sharkey <jsharkey@android.com> Merge \"When uninstalling, only kill the requested user.\" into nyc-dev
am: 060d5a0e0a

Change-Id: I3975462d7f027cc4fd449c56ba0c5f6442369a1b
0b77ef9f5199b7cd0956f2bfe049cbd699ca03b4 21-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Print names of observers causing timeout

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

Bug: 29039588
Change-Id: I09c4bcc986168a07f5e20ad0f38667b783332288
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
060d5a0e0a304400ee2ec1479346a37793bce0d7 23-Jun-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "When uninstalling, only kill the requested user." into nyc-dev
85f449eaba207d5d3a72bd091855a02ff019404c 23-Jun-2016 Jeff Sharkey <jsharkey@android.com> When uninstalling, only kill the requested user.

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

Bug: 28875343
Change-Id: Ie60753cfd22df10a2b17d8c3732b6f19d2fe1fb9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1a91866400a458138dbb8d46009f4915bbb742e2 23-Jun-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Notify user when application does not support current display zoom" into nyc-mr1-dev
e4c1812750a47fe0beb4d6d998647c248b454232 23-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge \\\"Use granted userId to look up provider info\\\" into nyc-dev am: f9f2c7ceef am: 7bc1db96ed
am: d50b61ff36

Change-Id: Iceec1009f0ac020d402b980e6952a0de7d0a671c
d50b61ff368a0c956136fd56ac39ab37566cbeda 23-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge \\"Use granted userId to look up provider info\\" into nyc-dev am: f9f2c7ceef
am: 7bc1db96ed

Change-Id: I914c389f3b326eefdada42e2d55c116d308521c4
7bc1db96edca9fbcc34e2e5a266c58f31781243e 23-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge \"Use granted userId to look up provider info\" into nyc-dev
am: f9f2c7ceef

Change-Id: Ifb6876fbb424632d3b47ec68686c01b56720b0a4
f9f2c7ceefa1348c57f1070327cf5d36c9c0d8d5 23-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Use granted userId to look up provider info" into nyc-dev
bc62493ea9f62f068c912663da3bf1bce8cecd3f 22-Jun-2016 Felipe Leme <felipeal@google.com> Merge \\\"Fixed whitelistManager assignment.\\\" into nyc-dev am: dea7aa0da1 am: 3aa1952e5c
am: df404d3780

Change-Id: I4ced4f9d02e406ae9f2d7b69b7f9ecb986d77680
df404d3780f4cd27c50c3c00b69bd393c3ec003c 22-Jun-2016 Felipe Leme <felipeal@google.com> Merge \\"Fixed whitelistManager assignment.\\" into nyc-dev am: dea7aa0da1
am: 3aa1952e5c

Change-Id: I0cacc3e9824e580cd8902b15bc28439f79993bd8
3aa1952e5cf76cfed9f2811b114983254f18258f 22-Jun-2016 Felipe Leme <felipeal@google.com> Merge \"Fixed whitelistManager assignment.\" into nyc-dev
am: dea7aa0da1

Change-Id: I3ba91e222cf0a04e2a08bbefc7d0aeea20485bcb
6e051cc2c3fe3f7186930792dcd8e1a04b78a311 22-Jun-2016 Felipe Leme <felipeal@google.com> Fixed whitelistManager assignment.

It must be set before looping through all app services...

Fixes: 29480440

Change-Id: I38f78255ea44f00ea4226010d334b94fb4baadb4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9bbaacf845f6f387cd6e16834da50f7c1a0b451f 20-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Use granted userId to look up provider info

In getPersistedUriPermissions, use granted userId instead of the calling
userId to look up provider info.

Bug: 29058113
Change-Id: Ia637be414f9ef3b8e9bce13bb56bd335cfb28ac7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e0e7f9cbe85b308b68bc259db0c1d9ad0d5e592f 21-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \\\"Reduce race when connecting to an existing content provider.\\\" into nyc-dev am: 5f9afa968d am: 3716762e38
am: ee18f5fe68

Change-Id: If032e53cc81ac3863818d98c5284f5b2501c8226
ee18f5fe68b4de62be26810b1061823e7068f1fa 21-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \\"Reduce race when connecting to an existing content provider.\\" into nyc-dev am: 5f9afa968d
am: 3716762e38

Change-Id: Ida00a7b77605d505ed5b32ff84b69c8c9ed7564b
580f2e159ec7cd4b00b80e9d189652d4e11ddd9c 21-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \"Reduce race when connecting to an existing content provider.\" into nyc-dev
am: 5f9afa968d

Change-Id: I7ca258416372dd251759aa920f51c2486d432f9c
5f9afa968dcb2477a992c4a95a898bca71b16c46 21-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge "Reduce race when connecting to an existing content provider." into nyc-dev
5f31b984553d7d26a5e49b2625def327e8a88c44 21-Jun-2016 Alan Viverette <alanv@google.com> Notify user when application does not support current display zoom

Bug: 29322470
Change-Id: Id33215f6b0b20b332c3c9101aedf9de0261ee5ea
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4de5a3ac6655f76b67af38712ae5aeb6d7c15938 21-Jun-2016 Dianne Hackborn <hackbod@google.com> Reduce race when connecting to an existing content provider.

We lost the code that checks to see if the target process still
exists and aborts trying to use it if so. To reduce the race
there, we have a new explicit check of the state of the process.

Hopefully fixes some of issue #28737082.

Change-Id: I37a7a6e9767516d564168ef5e110c4adafe3fb76
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
20e0a5c759066d1ef15de338f7ab79ce39232c4c 21-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \\\"Fix issue #29438842: Enter the \\\"am broadcast -a...\\\" into nyc-dev am: d2480ab7bb am: 61923ced0c
am: a2391dcc6f

Change-Id: I060c6e600e4d27ac63bbc3b1befc7e574d12d1d7
a2391dcc6f41645e81cd60b0e4017e4dbfab2d9e 21-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \\"Fix issue #29438842: Enter the \\"am broadcast -a...\\" into nyc-dev am: d2480ab7bb
am: 61923ced0c

Change-Id: I8b91961e7711e6ff2b92506c6204fb57d6f0aed9
2fcd92182a966440e6b8171ed4ecd52ae753e602 21-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \"Fix issue #29438842: Enter the \"am broadcast -a...\" into nyc-dev
am: d2480ab7bb

Change-Id: I57f8a28b73cb91f6602f7ac9dce67bdb5ea545aa
d2480ab7bb70c8150a2c663fe049370b0860553d 21-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #29438842: Enter the "am broadcast -a..." into nyc-dev
4af72f335a30c80a3597e2de587e86d488589476 20-Jun-2016 Wale Ogunwale <ogunwale@google.com> Merge \\\"Revert \\\"Don\\\'t re-launch activities while the device is sleeping\\\"\\\" into nyc-dev am: beaf3707fa am: f929560813
am: 4553be6e30

Change-Id: I78c2143c1fed3736cb9bd8714b12dd829b4dcaeb
4553be6e301e328fc53513858b97c90f318b17c6 20-Jun-2016 Wale Ogunwale <ogunwale@google.com> Merge \\"Revert \\"Don\\'t re-launch activities while the device is sleeping\\"\\" into nyc-dev am: beaf3707fa
am: f929560813

Change-Id: Iab35cc9bcfffef209ef45707feb4498165a0507b
96eea7136a795b225eda6b7542acf0f958e55b56 20-Jun-2016 Wale Ogunwale <ogunwale@google.com> Merge \"Revert \"Don\'t re-launch activities while the device is sleeping\"\" into nyc-dev
am: beaf3707fa

Change-Id: I50f6a45a56650569047c046d275f39b0929c38e4
ea05cd57f5b2b26650276a7ff03053e7cb78c538 20-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix issue #29438842: Enter the "am broadcast -a...

...'android.hardware.action.NEW_PICTURE'" to terminal, but does not have a response.

Change-Id: I264f386810237a7abc767f68363afeccda557b9c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
60920d5aa11bbb0e82a7f101cee825586e87aff0 20-Jun-2016 Wale Ogunwale <ogunwale@google.com> Revert "Don't re-launch activities while the device is sleeping"

This reverts commit 0619545be9adca4458cb627c18c211faad6b6275.

Bug: 29497152
Bug: 28518380
Change-Id: I8684b731b1e9973ead7066dc650eff720f70ac91
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a45656669388987abe82837e7801d21f41f9279d 18-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \"Work on issue #29328569: NPE in \" com.google.android.configupdater\"\" into nyc-dev
am: 6bc33b07f4

Change-Id: Idd1a2bffd1425f541df6bea7c064fd9389a24638
cf9c82b124c1a544b6df19bface5645d437555c0 18-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge \"Do not schedule restarts if the system is shutting down\" into nyc-dev
am: 1f0151220e

Change-Id: I34df39f82516cb0e40c12a25340a7b3bb2c5f65a
c8108f57c12de8e6e7cfbad406c9fd12c150cf69 18-Jun-2016 Wei Wang <wvw@google.com> Merge \"Merge \\"remove Intent.FLAG_ACTIVITY_NEW_TASK flag check\\" into nyc-mr1-dev am: 92bc5edfa2\" into nyc-mr1-dev-plus-aosp
am: 941cc66b14

Change-Id: Icaf586d5a61be09463227a2e9c820a21d0652687
36f95d273e2d783d9a0dcd180359f7d045a428e4 18-Jun-2016 Wei Wang <wvw@google.com> Merge \"remove Intent.FLAG_ACTIVITY_NEW_TASK flag check\" into nyc-mr1-dev
am: 92bc5edfa2

Change-Id: I70c9ad37c5e81167ea71b3fa82a8699f8efec221
92bc5edfa286b6d372a64450f4f195687a32fd4f 18-Jun-2016 Wei Wang <wvw@google.com> Merge "remove Intent.FLAG_ACTIVITY_NEW_TASK flag check" into nyc-mr1-dev
abd19f3373f2ff285a810f17f6217e8b8fb25e6d 17-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \\\"Work on issue #29328569: NPE in \\\" com.google.android.configupdater\\\"\\\" into nyc-dev am: 6bc33b07f4 am: 3230838f91
am: 459fedce53

Change-Id: I2c2152068b8169d3376039d439301187e0537836
d576c45783cc392faf5be0f20e7b7dec97762400 17-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge \\\"Do not schedule restarts if the system is shutting down\\\" into nyc-dev am: 1f0151220e am: 825e477fbe
am: 7635669ec4

Change-Id: Ib7a85c51f7e8041a4364d6a34deda0088439ca71
cf6d621e7d27497fd426882c705ade58020b04cc 17-Jun-2016 Alan Viverette <alanv@google.com> resolve merge conflicts of 0073a03 to nyc-mr1-dev-plus-aosp
am: aa02b97667

Change-Id: I640c1012d31bd226941e7294867f2200860b4b0e
3a4a018572a92171109c65b71b4d3adca0015402 17-Jun-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of cffb19c to mnc-dev am: 3f9ea2d386 am: d6c1126fab am: e2c9b1af3e am: d2a4e1b39c am: 1c3be1a5b1 am: 6b24c84fa2
am: 6bf184819c

Change-Id: I542d7994dcf165295bc11ad3678cd9b7038d003b
459fedce53fcdc1b5f7493e373610b897eaa9065 17-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \\"Work on issue #29328569: NPE in \\" com.google.android.configupdater\\"\\" into nyc-dev am: 6bc33b07f4
am: 3230838f91

Change-Id: Ieecd701765fcb9646b2dab92e004b556b9799900
49b77c0efb8e6c80908e2224f120e37684d10e09 17-Jun-2016 Wale Ogunwale <ogunwale@google.com> Merge \"Merge \\\"Don\\\'t re-launch activities while the device is sleeping\\\" into nyc-dev am: f6e3c9a553 am: 4e9c615769\" into nyc-mr1-dev-plus-aosp
am: ac769204af

Change-Id: I8b8b26c094b81a89257a7d31ac122c27b6238efc
6bc33b07f43b6568be9920905083c20b879a97b1 17-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #29328569: NPE in " com.google.android.configupdater"" into nyc-dev
4f7b337cddaf21347690c4f8006a99bfeaa848a1 17-Jun-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of cffb19c to mnc-dev am: 3f9ea2d386 am: d6c1126fab am: e2c9b1af3e am: d2a4e1b39c
am: 1c3be1a5b1

Change-Id: If72735aeb86874e3d672a9567f03fecdb9ed00eb
7635669ec40a1e21ae986c58541f4a1ca96befee 17-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge \\"Do not schedule restarts if the system is shutting down\\" into nyc-dev am: 1f0151220e
am: 825e477fbe

Change-Id: Icb2528c9eb25a5fd02debdd7be4b4f3ab01e168b
1f0151220e8c3054e826d2c89056bb3aeaf6542e 17-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Do not schedule restarts if the system is shutting down" into nyc-dev
aa02b97667f593baf668f81b64395e3816c03c9c 17-Jun-2016 Alan Viverette <alanv@google.com> resolve merge conflicts of 0073a03 to nyc-mr1-dev-plus-aosp

Change-Id: I89383ebf0633996f1f706b6c14a9b34cb47aadc2
c577a50d099c35c5e2c96f50b62cfa81843398ef 17-Jun-2016 Alan Viverette <alanv@google.com> Merge "Notify user when application does not support current display zoom" into nyc-dev
6bf184819c6f1239822b55815f076c2ba8932249 17-Jun-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of cffb19c to mnc-dev am: 3f9ea2d386 am: d6c1126fab am: e2c9b1af3e am: d2a4e1b39c am: 1c3be1a5b1
am: 6b24c84fa2

Change-Id: I76d2691cdbdc5577b12e2f5b6a58f0478eb48dff
9b80b94167a7d218da28b357d1daabf5ab1f309d 17-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Do not schedule restarts if the system is shutting down

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

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

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

Change-Id: Iadf90edb02bacf645896f7d074d011a2aca4b251
66ec21a817db000ffc9868eddcf0fcb1caf9eee7 17-Jun-2016 Dianne Hackborn <hackbod@google.com> Work on issue #29328569: NPE in " com.google.android.configupdater"

Make the activity manager look at the "killed" state of a process
before deciding it is in a state where a new client can attach to
a content provider. Hopefully this will get rid of some races
around attaching to providers and processes being killed.

Also add a little more information when killing a client of a
provider describing the oom adj of that provider's process.

Change-Id: I4efe5daf0a96e4663d5df88827ef401b1311de3f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3f9ea2d386507fd814b33fd9fa6c2a2824f80416 17-Jun-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of cffb19c to mnc-dev

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

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

Change-Id: I3b0bd91c38b5f13770f09f39c2eea78b63c29d7c
75fec97065babeb45f2cfed1bb837f671953c4af 16-Jun-2016 Wale Ogunwale <ogunwale@google.com> Merge \\"Don\\'t re-launch activities while the device is sleeping\\" into nyc-dev am: f6e3c9a553
am: 4e9c615769

Change-Id: I3f3fac134443a475138d279153fd6eccf1b20d9b
55ce4a5f19970da83c8f66daae81e51ee42ee0c0 16-Jun-2016 Wale Ogunwale <ogunwale@google.com> Merge \"Don\'t re-launch activities while the device is sleeping\" into nyc-dev
am: f6e3c9a553

Change-Id: I72d39e81ae786f18fb3991fb243837e802440311
0619545be9adca4458cb627c18c211faad6b6275 16-Jun-2016 Wale Ogunwale <ogunwale@google.com> Don't re-launch activities while the device is sleeping

- Don't ensure configuration for top running activity that is in the
stopped state if the configuration change while the device is sleeping
as we don't want to relaunch activities in this state.
- Don't make activities visible while the device is sleeping and the
activity isn't in voice interaction mode. Making it visible can also
lead to the activity been relaunched due to configuration changing.

Note the the right configuration will be applied to the activity the next
time we try to make it visible. The re-launch will happen then.

Bug: 28518380
Change-Id: Ic22193db645dec358065cb05e7f1afc6fc8ac49f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7df9b45bfe3cc6a6b3f33be008bb69a31b15999f 16-Jun-2016 Alan Viverette <alanv@google.com> Notify user when application does not support current display zoom

Bug: 29322470
Change-Id: Id33215f6b0b20b332c3c9101aedf9de0261ee5ea
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cc8e25a7df35920488b52110155491a510ff63af 16-Jun-2016 Ruben Brunk <rubenbrunk@google.com> Merge \\\"Fix VR transition for display on/off sequence.\\\" into nyc-dev am: 931a7c03e0 am: fafe810a61
am: 0dc7b8af98

Change-Id: Ib4afffdb096401999669887eacf7eeba6078587c
fafe810a61d11f66f3ab0213c4abef669e915cd9 16-Jun-2016 Ruben Brunk <rubenbrunk@google.com> Merge \"Fix VR transition for display on/off sequence.\" into nyc-dev
am: 931a7c03e0

Change-Id: I70301a77d89271e74e69efb92f340f1dbf6b3ca8
af9f004f99d81bdc81a05e179ff04d6b3fcb1041 16-Jun-2016 Ruben Brunk <rubenbrunk@google.com> Fix VR transition for display on/off sequence.

- Ensure VR transition has been applied before display power
off sequence.

Bug: 29364940
Change-Id: I1224ac653d466919cb418e5c357a748606c4fd7d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c58054f25fb8ad624a749ed48e3f5775de4bec14 14-Jun-2016 Christopher Tate <ctate@google.com> Don't trust callers to supply app info to bindBackupAgent()

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

Bug 28795098

Change-Id: I215786bc894dedf7ca28e9c80cefabd0e40ca877
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4f6aad268b675e178642647886203b2ce7d07d2a 14-Jun-2016 Chong Zhang <chz@google.com> Merge \\\"Prevent crash from null ApplicationInfo after package is removed.\\\" into nyc-dev am: 42edc7c2c2 am: ea5f896ecc
am: 35866a2f86

Change-Id: Idda3e5d9bd691cfd7a3c76614ded0d64e1f04b0c
eacbc45469f7670900457d539f8394802064910a 14-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \"Merge \\\"Push DO/PO package names from DPMS to PM\\\" into nyc-dev am: f419bd9e03 am: 93322e6818\" into nyc-mr1-dev-plus-aosp
am: 1dc43402e9

Change-Id: I6621d43fdebb9f7b76d9c2f49a77ec626642f8da
31a5d3affa89b9ac95ecf55d4abc64bdce1a2a74 14-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \\"Push DO/PO package names from DPMS to PM\\" into nyc-dev am: f419bd9e03
am: 93322e6818

Change-Id: I4fd9877c9e6adcdeeb17a9a5a2e70731f6e0b596
ea5f896ecc48bab6127cd718af1f1125dd4f1c4d 14-Jun-2016 Chong Zhang <chz@google.com> Merge \"Prevent crash from null ApplicationInfo after package is removed.\" into nyc-dev
am: 42edc7c2c2

Change-Id: I6400e818f7333323e633756bf63e582e5b658900
42edc7c2c25aabe44d41b12bfa4557b028491671 14-Jun-2016 Chong Zhang <chz@google.com> Merge "Prevent crash from null ApplicationInfo after package is removed." into nyc-dev
1de22da763576cd54b2d3d51bc47ce99cf89f1ab 13-Jun-2016 Chong Zhang <chz@google.com> Prevent crash from null ApplicationInfo after package is removed.

Bug: 29234926
Change-Id: I8c2fed7c7e862e1f6798d5ed535d1937f9a74c1a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
78f16950c62c68ccc6a5547f7388afd9b1c77fde 13-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \"Push DO/PO package names from DPMS to PM\" into nyc-dev
am: f419bd9e03

Change-Id: Ic3071f3a712da72fd141ef37ac6aabe6dbd09355
f419bd9e03574d63581694f646f1b1136e7574d8 13-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "Push DO/PO package names from DPMS to PM" into nyc-dev
e11e386c05d150a99ab4061093c9f3bfe3d9d354 10-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \\\"Fix issue #29252997: Should be able to dump only broadcast stats as checkin format\\\" into nyc-dev am: 9303ecb317 am: df2485cf48
am: 18f63beea0

Change-Id: Iaefb0543a69db421ac6fb895f651fd8125dd0c84
18f63beea044202107e77488274d776ced94ae08 10-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \\"Fix issue #29252997: Should be able to dump only broadcast stats as checkin format\\" into nyc-dev am: 9303ecb317
am: df2485cf48

Change-Id: Id44bf78312e173b84dc4abe65a099e81d00812f4
3abe96145037e085a4b70f42bad1f4748c0c3ba0 10-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge \"Fix issue #29252997: Should be able to dump only broadcast stats as checkin format\" into nyc-dev
am: 9303ecb317

Change-Id: Ib7479599ba70cf05dec9b323d62149670612abaa
9303ecb3178932d488824936b3f01b6da3f2cacb 10-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #29252997: Should be able to dump only broadcast stats as checkin format" into nyc-dev
bf43273d5efccca0958c07a4d5e5691c8f68d043 10-Jun-2016 Chong Zhang <chz@google.com> Merge \\\"Use user id 0 to get missing appId for debugger\\\" into nyc-dev am: 792918e5fd am: 0814666bec
am: 995034b9ae

Change-Id: Ia5014bc3c5824cf7c9c8f6c08a97b03ca10a4c6c
0814666bec852341bba0306872dd300b4efcbbac 10-Jun-2016 Chong Zhang <chz@google.com> Merge \"Use user id 0 to get missing appId for debugger\" into nyc-dev
am: 792918e5fd

Change-Id: I8ccb08fe3aa9c00b715078086b233a55a338eb94
792918e5fda62004f0dc83981a4a6648c3f7c5d4 10-Jun-2016 Chong Zhang <chz@google.com> Merge "Use user id 0 to get missing appId for debugger" into nyc-dev
f73bd84ed7d520b71631f569f07501707e107fb1 10-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix issue #29252997: Should be able to dump only broadcast stats as checkin format

Change-Id: I36d4e5e20ff2ed1b4d02a04390e0415b9b2394a3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d25944e120aa9029aa6b5cb89f5f08fd95afdbbc 10-Jun-2016 Chong Zhang <chz@google.com> Use user id 0 to get missing appId for debugger

When forceStopPackageLocked is used to kill existing app process for
relaunching with debugger, user id could be -1 and getPackageUid will
already return -1. This results in killPackageProcessesLocked() not
able to find and kill the app, and wait for debugger will.

This also revert commit 55c9d739 (ag/969408) which tried to fix the
same problem but got it wrong. It's valid to -D when the process is
already running, as we're supposed to kill it. The really problem is
that the killing fails because of bad appId.

bug: 28980761
Change-Id: Ibebdcc26865464216a1f4b6773e540921cdad7d2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
62c3beab115a44c6e0768642b3112a5dbab555a6 09-Jun-2016 Svet Ganov <svetoslavganov@google.com> Merge \\\"Teach persistable Uri grants about direct boot\\\" into nyc-dev am: 7014eef54a am: ca7e80f3c5
am: 90ba2d71db

Change-Id: I705b1611b46285e4953c59e828336869cea616bb
ca7e80f3c5685bb531bdb153ea8c8f0518c593dc 08-Jun-2016 Svet Ganov <svetoslavganov@google.com> Merge \"Teach persistable Uri grants about direct boot\" into nyc-dev
am: 7014eef54a

Change-Id: I5096120ecd7c2959724e7e16f6d0a0c3712c18fa
f581be6ff5a08023b780a9502c7895351e4f2b17 08-Jun-2016 Svet Ganov <svetoslavganov@google.com> Teach persistable Uri grants about direct boot

We read the persistable Uri grants on boot at which point
the user is not unlocked. This results in ignoring Uri
grants for boot unaware content providers.

This change reads all persisted Uri grants on boot but
filters them out during query based on the current user
unlock state.

bug:29058113

Change-Id: I2643fc098f42359e72a4c534236debc9b9389256
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c29f62c7388f550da2c7368c5dbc0aec7d1564fe 07-Jun-2016 Makoto Onuki <omakoto@google.com> Push DO/PO package names from DPMS to PM

Bug 29126573

Change-Id: I95ea1559f6acf5d2f0e1b0953568cdfc938e83b9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
60137f4f3fca031f18820055f234f676b4597999 05-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix issue #29006049: Add logging for implicit broadcasts am: bc02a3901d am: ced0e2960d
am: cb369c20ad

* commit 'cb369c20ad99f461ec55d5eec3ea1dbad7d3e512':
Fix issue #29006049: Add logging for implicit broadcasts

Change-Id: If8bbd41a7884eaa1cdd0e757bfffc059caff44e0
cb369c20ad99f461ec55d5eec3ea1dbad7d3e512 05-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix issue #29006049: Add logging for implicit broadcasts am: bc02a3901d
am: ced0e2960d

* commit 'ced0e2960d1608df92d7de28fffc6c51001843d2':
Fix issue #29006049: Add logging for implicit broadcasts

Change-Id: I17bcafe217d4f138410c18a6f3f52bc4fb2d2c29
13c2764cef15b9fe4b67f98be458f3108a9137f3 05-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix issue #29006049: Add logging for implicit broadcasts
am: bc02a3901d

* commit 'bc02a3901dea52d236dd855722191155156cb856':
Fix issue #29006049: Add logging for implicit broadcasts

Change-Id: Ifd88a4ce68bd9c2853d085bb10f74df682ae8ee6
bc02a3901dea52d236dd855722191155156cb856 03-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix issue #29006049: Add logging for implicit broadcasts

We now have stats on broadcasts. We collect them over a day and
then reset, retaining the last days stats. When a checkin happens,
we return either the last day or the current stats and then clear
them. Not bothing to persist anything to storage, this data is
not that critical.

Change-Id: I1c3b331bcd03f79fa5e10575d9bc2ad7d9104f6f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
03c2856c7e6278ce2cbc545059f5c27210bf4a83 02-Jun-2016 Erik Wolsheimer <ewol@google.com> Merge "Merge "Show crash/ANR dialogs on userdebug watch builds" into nyc-mr1-dev am: d7b9669b54" into nyc-mr1-dev-plus-aosp
am: 11ac61453f

* commit '11ac61453f36d47b7154a0fe38398822a971f9f9':
Show crash/ANR dialogs on userdebug watch builds

Change-Id: Iaa9bd660d8e633b078ab1a157be28d6dfebcfede
7c4986085e94b05398621cb4c0c9a43427ec5f2d 02-Jun-2016 Jorim Jaggi <jjaggi@google.com> Merge "Merge "Don\'t crash activity manager when supplying invalid URI" into nyc-dev am: 13d534e7f2 am: 859465c105" into nyc-mr1-dev-plus-aosp
am: 1c943786eb

* commit '1c943786ebd68739254b2d35317914da0e78e47a':
Don't crash activity manager when supplying invalid URI

Change-Id: Iff3b4c66798a0a18a26d9e4e6facd5d088daa43a
d7b9669b5421ae3718afd3d7c1b1dfa59537fb08 01-Jun-2016 Erik Wolsheimer <ewol@google.com> Merge "Show crash/ANR dialogs on userdebug watch builds" into nyc-mr1-dev
9e5c7126e3620a77929e3e767d9f0ba258845321 26-May-2016 Wei Wang <wvw@google.com> remove Intent.FLAG_ACTIVITY_NEW_TASK flag check

Bug: 29071719
Change-Id: Ib3eb0198454e3ed84c0f98dce82e7981aa57fc4f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
859465c105215cc7d0e152ad2280419c4f820598 01-Jun-2016 Jorim Jaggi <jjaggi@google.com> Merge "Don\'t crash activity manager when supplying invalid URI" into nyc-dev
am: 13d534e7f2

* commit '13d534e7f2419219e3e26e582b1f6f5ae79be408':
Don't crash activity manager when supplying invalid URI

Change-Id: I1f87d39822fe9a938b511a2b55fda2338311290e
3e2280ed2be5601cf5e68274257bcf6b70f9db53 01-Jun-2016 Ian Rogers <irogers@google.com> Merge "Fix call to equals that could never succeed."
59f05690e255552804e1c47e8fa5329adbe9be09 31-May-2016 Erik Wolsheimer <ewol@google.com> Show crash/ANR dialogs on userdebug watch builds

BUG: 28960987
Change-Id: Iaa237df9578816b91638d0bef0e0730721d62ba2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cc64dfcf66a19084a58372ea7f9f5139ccc93221 01-Jun-2016 Jorim Jaggi <jjaggi@google.com> Don't crash activity manager when supplying invalid URI

Change-Id: I30a058f14d5d0a09ba86fdd10312a51db7a4a9df
Fixes: 29039290
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
88e376dac4d37359c661c931bfe5a011d842eaf7 31-May-2016 Ian Rogers <irogers@google.com> Fix call to equals that could never succeed.

Caught by Error Prone.
Bug: 27723540

Change-Id: I9368201b37818f145b5ffc33130fbfd7d03e48aa
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
95057570aa3605942b3697364c9cae5eb843d1fb 31-May-2016 Hall Liu <hallliu@google.com> Merge "Disable app pinning when emergency call button pressed" into nyc-dev am: 8b655e0f57 am: 49459e4ee8
am: 4e52453d0e

* commit '4e52453d0efe7b3e05182bf43b5193b44aa1c88a':
Disable app pinning when emergency call button pressed

Change-Id: Ifb4b7500d28674b3440d37920185cc266e1b1f54
49459e4ee88dbaa342fb6add9af51ccbadc88d98 31-May-2016 Hall Liu <hallliu@google.com> Merge "Disable app pinning when emergency call button pressed" into nyc-dev
am: 8b655e0f57

* commit '8b655e0f57b071756e7d6a3547eeabe35885bcc9':
Disable app pinning when emergency call button pressed

Change-Id: Ibe8d37716ad1630359b3ef08350f485b0d1177a7
8b655e0f57b071756e7d6a3547eeabe35885bcc9 31-May-2016 Hall Liu <hallliu@google.com> Merge "Disable app pinning when emergency call button pressed" into nyc-dev
26446eb6649d1a7bcac7346cb04a04cf425d3c22 28-May-2016 Jorim Jaggi <jjaggi@google.com> Merge "Replace Log.wtf by Log.e" into nyc-dev am: be2527b964 am: cbd53dca91
am: 5553ac4d3b

* commit '5553ac4d3b37aecaca25267849634f3812ee03ab':
Replace Log.wtf by Log.e

Change-Id: I42fc946ffd8ee8480064295d6a34e42c940c4772
5553ac4d3b37aecaca25267849634f3812ee03ab 28-May-2016 Jorim Jaggi <jjaggi@google.com> Merge "Replace Log.wtf by Log.e" into nyc-dev am: be2527b964
am: cbd53dca91

* commit 'cbd53dca9159679a5c5ba06d9ca6e9607ca86fc4':
Replace Log.wtf by Log.e

Change-Id: I2e039cdc9d35bcce822b85b53f05a70caec3317c
031def9e8e3ece07182f01ac033e745697125a6e 28-May-2016 Jorim Jaggi <jjaggi@google.com> Merge "Replace Log.wtf by Log.e" into nyc-dev
am: be2527b964

* commit 'be2527b964796aa490f94043deedc2ad7bcd222d':
Replace Log.wtf by Log.e

Change-Id: Ifb47a055fb715852310f3ec65f38d040f29554b9
25f332ca19bbd8ab53cbadf989ce919a04c3a8a7 28-May-2016 Jorim Jaggi <jjaggi@google.com> Replace Log.wtf by Log.e

Bug: 28949995
Change-Id: I2193511566124980860843da0a822621184218b1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6afa2e1d1d4ba9bae912c675f018ba78a7d86804 28-May-2016 Felipe Leme <felipeal@google.com> Merge "Allow apps to bypass Power Save restrictions when launched from a Notification\'s PendingIntent." into nyc-dev am: efa291a860 am: 8c8ea506d9
am: d786355405

* commit 'd786355405dfb50b1e6eb0bb8628276b9b2823c6':
Allow apps to bypass Power Save restrictions when launched from a Notification's PendingIntent.

Change-Id: Ic8f6cbfce572c54d7124a508af12043a58d5bc66
13c00802a583c7c10050098a9bc9d28ebcb712cf 28-May-2016 Wale Ogunwale <ogunwale@google.com> Merge "Merge "Only make Recents activity invisible if not focused on TV devices." into nyc-dev am: 20237bc68f am: b3c7e1c4f2" into nyc-mr1-dev-plus-aosp
am: b1aa5535d8

* commit 'b1aa5535d8e3095a956135112dbaa0f175cfdbd2':
Only make Recents activity invisible if not focused on TV devices.

Change-Id: I6bbcbbef25be062b187e0129cc04a6218453aa8b
7dac366a7f72e3d3f0c7e26616ec0ee55efe1fcd 27-May-2016 Hall Liu <hallliu@google.com> Disable app pinning when emergency call button pressed

Also disables app pinning when the "return to call" button is pressed
and brings up the in-call screen when app pinning is stopped if there is
an existing call.

Bug: 28558307
Change-Id: I7672123bfa6ba6b5e960bd5166876c50425d3f76
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8c8ea506d91db44de1d312612a8f63ab107af799 27-May-2016 Felipe Leme <felipeal@google.com> Merge "Allow apps to bypass Power Save restrictions when launched from a Notification\'s PendingIntent." into nyc-dev
am: efa291a860

* commit 'efa291a8605e91d775faf46ada349ec7f81fcdb9':
Allow apps to bypass Power Save restrictions when launched from a Notification's PendingIntent.

Change-Id: Ibd09b082140b66d25bd8583040761581bb20af76
efa291a8605e91d775faf46ada349ec7f81fcdb9 27-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow apps to bypass Power Save restrictions when launched from a Notification's PendingIntent." into nyc-dev
f9508873dd67f34a79ab04128010768dd147aca6 27-May-2016 Jeff Sharkey <jsharkey@android.com> Merge "Merge "Delay PACKAGE_RESTARTED until after data cleared." into nyc-dev am: d6ee899397" into nyc-mr1-dev am: 4e8b6bfe69
am: d948e39e94

* commit 'd948e39e949c939f2f26fb95bfd1dbacea60493c':
Delay PACKAGE_RESTARTED until after data cleared.

Change-Id: I5bf677218fe3ee19eb667f708d6220c7e82736ee
3163314ca03ade5d890baf0328710198a577e9a4 27-May-2016 Jeff Sharkey <jsharkey@android.com> Merge "Merge "Careful process validation for unaware providers." into nyc-dev am: 678dba737b" into nyc-mr1-dev am: 37b78dcdd7
am: a822d4e73a

* commit 'a822d4e73af571a44f73da6701beb0966eb4c5b9':
Careful process validation for unaware providers.

Change-Id: Id1a9171c660ac2b9266cb36bdda03c1e235dfcdb
a1b79bfd7a15006a93da933695359765e0fee495 24-May-2016 Felipe Leme <felipeal@google.com> Allow apps to bypass Power Save restrictions when launched from a Notification's PendingIntent.

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

In a nutshell, the workflow is:

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

Fixes: 28818704

Change-Id: I00d46036a2cbb73f7f733fd35bf0b743a02807a1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b3c7e1c4f2d700d5621219bde71a1fc095f15d1a 27-May-2016 Wale Ogunwale <ogunwale@google.com> Merge "Only make Recents activity invisible if not focused on TV devices." into nyc-dev
am: 20237bc68f

* commit '20237bc68fa32422fe256f75e331a4a3bdc3fd24':
Only make Recents activity invisible if not focused on TV devices.

Change-Id: I98ed5ae3e4fd84033dca361d148d344fb28bc05a
4e79d8b2354c9c06ad901e3a85776e497a2e2732 27-May-2016 Jeff Sharkey <jsharkey@android.com> Merge "Delay PACKAGE_RESTARTED until after data cleared." into nyc-dev
am: d6ee899397

* commit 'd6ee8993973050befff3a5f10f273ef9e8a050e2':
Delay PACKAGE_RESTARTED until after data cleared.

Change-Id: I8bb3f31a6de42da81a44c9aaf121769ed96b6a3b
27deabaf61db22862748e7581286e646f99dc1b8 27-May-2016 Jeff Sharkey <jsharkey@android.com> Merge "Careful process validation for unaware providers." into nyc-dev
am: 678dba737b

* commit '678dba737bed94eb5eeeed63db74aa811ee896cb':
Careful process validation for unaware providers.

Change-Id: I7856be9d44587869ee73533072aaf26d8a7908ab
20237bc68fa32422fe256f75e331a4a3bdc3fd24 27-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Only make Recents activity invisible if not focused on TV devices." into nyc-dev
ca2af9e38c31c823f72a6060c45b27fc968e6bd8 26-May-2016 Wale Ogunwale <ogunwale@google.com> Only make Recents activity invisible if not focused on TV devices.

Change was introduced in b/28246419 to fix Recents activity visibility
issues on TV, but was causing other issues on phones. So, only apply
rule on TV devices.

Bug: 28246419
Bug: 28943853
Change-Id: Icd19eae4ffa5e0a798bc9f63bc7a6c9a60422236
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d6ee8993973050befff3a5f10f273ef9e8a050e2 26-May-2016 Jeff Sharkey <jsharkey@google.com> Merge "Delay PACKAGE_RESTARTED until after data cleared." into nyc-dev
678dba737bed94eb5eeeed63db74aa811ee896cb 26-May-2016 Jeff Sharkey <jsharkey@google.com> Merge "Careful process validation for unaware providers." into nyc-dev
4670d3efe26e500b4c06b2e436bff11e7b9200ae 26-May-2016 Jeff Sharkey <jsharkey@android.com> Delay PACKAGE_RESTARTED until after data cleared.

Some system internals are using the PACKAGE_RESTARTED broadcast to
rebind to services, which would fail if the package was still frozen
due to a long-running clear data operation. To avoid this, delay both
the PACKAGE_RESTARTED and PACKAGE_DATA_CLEARED broadcasts until after
the clear operation has finished.

Bug: 28964281
Change-Id: I18ac36c39ba90498b1eb0cc495da1f16c24614bf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
585d8b28f5d174d0f50d0c7c3e5e7202f6cd36a1 25-May-2016 Jeff Sharkey <jsharkey@android.com> Careful process validation for unaware providers.

When unlocking a user, install any direct boot unaware providers into
processes that were started before unlock. Mirror the conditional
logic used in all other provider locations.

Bug: 28708253
Change-Id: I2044558456d7f8e509374659f7c89abf01869cd9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a0cb2c49316ed518377ed638ddf7364d0b31c425 26-May-2016 Seigo Nonaka <nona@google.com> Merge "Fix system locale propagation during user creation." into nyc-dev am: ce9f5e3657 am: b03e7217f3
am: d34ca400c6

* commit 'd34ca400c6f8cd25827e0278dd9062d82b0fbf08':
Fix system locale propagation during user creation.

Change-Id: I41229dce52266d59c3b3334e2d4ae390b75bbe20
d34ca400c6f8cd25827e0278dd9062d82b0fbf08 26-May-2016 Seigo Nonaka <nona@google.com> Merge "Fix system locale propagation during user creation." into nyc-dev am: ce9f5e3657
am: b03e7217f3

* commit 'b03e7217f3fa3144f69119a4e109cce934d6065a':
Fix system locale propagation during user creation.

Change-Id: I6955bad489926525f6b50709bcf14b829ca9392d
005ef10518adb9768ad6569f0c6b42db949083d4 26-May-2016 Seigo Nonaka <nona@google.com> Merge "Fix system locale propagation during user creation." into nyc-dev
am: ce9f5e3657

* commit 'ce9f5e3657b7a8fb68c6c65a2cd5a27eaf556cc8':
Fix system locale propagation during user creation.

Change-Id: I020babcf2ce1aa632099457f2baf3497f5ac2946
ce9f5e3657b7a8fb68c6c65a2cd5a27eaf556cc8 26-May-2016 Seigo Nonaka <nona@google.com> Merge "Fix system locale propagation during user creation." into nyc-dev
1e0ae3388af16c727bed690b987116e9eda325b2 26-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28964589: Binding dies when (unrelated) component is disabled in package" into nyc-dev am: dbcca24f8e am: ce60320848
am: bd8421e305

* commit 'bd8421e3059350872cc4e26726afa6830b0d2cd1':
Fix issue #28964589: Binding dies when (unrelated) component is disabled in package

Change-Id: I73bd2a2cc996d5e6f958fcca8097421c076d0658
bd8421e3059350872cc4e26726afa6830b0d2cd1 26-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28964589: Binding dies when (unrelated) component is disabled in package" into nyc-dev am: dbcca24f8e
am: ce60320848

* commit 'ce60320848d8515e6a91f3f3a3cb1216107726de':
Fix issue #28964589: Binding dies when (unrelated) component is disabled in package

Change-Id: Iddb62c3079bef31acac4d1698242711a27c5dbb6
2198f8f5841d3e7df7cd78d189fecdfc60a4eba0 26-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28964589: Binding dies when (unrelated) component is disabled in package" into nyc-dev
am: dbcca24f8e

* commit 'dbcca24f8e239a34ededaef8a7fc924c196f98cb':
Fix issue #28964589: Binding dies when (unrelated) component is disabled in package

Change-Id: Ie6041e1284ec6824f3b8c01f751f1555f55bc69e
47fb83a1e256e5137b9830e044bf2acdf89e2ee0 26-May-2016 Dianne Hackborn <hackbod@google.com> Fix issue #28964589: Binding dies when (unrelated) component is disabled in package

We go through the same path for uninstalling and changing an app...
both of which would do a full force stop. That is only appropriate
for uninstalling; for changing, we should just be killing its processes.

Change-Id: Ia87750d96d3e3eb7ee30841429eb926c20c5ad78
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ea833e898e6598be75d2b8bae0a368b69301235f 25-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28931042: wtf in system server" into nyc-dev am: 7a1aa92610 am: 9bebd9edb0
am: caf8c3c160

* commit 'caf8c3c160952aff4b4197c1e0282489583a942d':
Fix issue #28931042: wtf in system server

Change-Id: I86bf73a1294ccf4ef7ef63188e72942b17e61b0c
caf8c3c160952aff4b4197c1e0282489583a942d 25-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28931042: wtf in system server" into nyc-dev am: 7a1aa92610
am: 9bebd9edb0

* commit '9bebd9edb0ca6131da4b0e34dc58328f9e5b26cf':
Fix issue #28931042: wtf in system server

Change-Id: Ic42f1fbaff38f96f5215aa959a5bad209052eba2
31ed6e646bebdaf2928fc739874ae7e1c1d5094d 25-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28931042: wtf in system server" into nyc-dev
am: 7a1aa92610

* commit '7a1aa926109b090251d193426ba9fdc699e6f3b7':
Fix issue #28931042: wtf in system server

Change-Id: I84142fe627ae93b680577bff91327419715db4bb
7a1aa926109b090251d193426ba9fdc699e6f3b7 25-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28931042: wtf in system server" into nyc-dev
a8e6f875bc07dc12d3c8284cef5b5d83d93ff743 24-May-2016 Dianne Hackborn <hackbod@google.com> Fix issue #28931042: wtf in system server

More broadcasts (from telephony) that should be protected.

Also put a little more information in the wtf message to
help determine where broadcasts from out of the system process
are coming from.

Change-Id: Ie3df25c883482ca54c7a7c5db57ca609950f5cbc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e8015358d0320ec2c6dff9fed1eede2ad7368d76 24-May-2016 Amith Yamasani <yamasani@google.com> Merge "Don\'t deliver broadcast to apps that are being backed up" into nyc-dev am: fc2a7ce7ac am: b475c89a7b
am: 02351ca3c4

* commit '02351ca3c4b36b905d366fa2a9ecd19160518930':
Don't deliver broadcast to apps that are being backed up

Change-Id: I6782f3aec13d58139d760e3e2d13f7b3495b60f7
b475c89a7b6b46688cd44f18d53ffe8891c81757 24-May-2016 Amith Yamasani <yamasani@google.com> Merge "Don\'t deliver broadcast to apps that are being backed up" into nyc-dev
am: fc2a7ce7ac

* commit 'fc2a7ce7acc5ede8b26f35819c8287df1fed135c':
Don't deliver broadcast to apps that are being backed up

Change-Id: Ia6f492cb909603e1741e09c5138ea3a7160a97a6
534881d8fa17e0f5c99e1c648cb97a9f43660ef5 24-May-2016 Adam Lesinski <adamlesinski@google.com> Merge "Improve performance of LocaleList with Resources" into nyc-dev am: bb26248bbb am: 5e106dea45
am: 9ed84d8612

* commit '9ed84d86120dd6487eacba503f45f6d147f05fbf':
Improve performance of LocaleList with Resources

Change-Id: I7c1694545f9eee940ca7065f3ac5aee5e2a7b27c
fc2a7ce7acc5ede8b26f35819c8287df1fed135c 24-May-2016 Amith Yamasani <yamasani@google.com> Merge "Don't deliver broadcast to apps that are being backed up" into nyc-dev
9ed84d86120dd6487eacba503f45f6d147f05fbf 24-May-2016 Adam Lesinski <adamlesinski@google.com> Merge "Improve performance of LocaleList with Resources" into nyc-dev am: bb26248bbb
am: 5e106dea45

* commit '5e106dea4545547f3f7c50dad30f792809659b96':
Improve performance of LocaleList with Resources

Change-Id: I733cdad0b30069ac7830fa91ef0188dd0f0cfac9
5e5e871fdc0b51ba5b0903169451e9401b98f1f3 24-May-2016 Adam Lesinski <adamlesinski@google.com> Merge "Improve performance of LocaleList with Resources" into nyc-dev
am: bb26248bbb

* commit 'bb26248bbba6e4014ea89a97b86618b7289a5f29':
Improve performance of LocaleList with Resources

Change-Id: I307b4a7c78ff04797fda041afa8106b082951bc9
b61e405397200f78b1c652143cba7c751df05a00 20-May-2016 Adam Lesinski <adamlesinski@google.com> Improve performance of LocaleList with Resources

We allow each individual Resources object to select the best
Locale for the given APK. This allows one update to the configuration
instead of multiple updates, once the locale is chosen.

The Java locale is selected from the app context's locale.

Bug:28625993
Bug:27325465
Change-Id: I99e1e53f522e560f3b80bbd1e1c605f552dbdff0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b5f3b5c2e5108b875fdb21726eeca41f58d59d49 16-May-2016 Amith Yamasani <yamasani@google.com> Don't deliver broadcast to apps that are being backed up

When doing a full backup, mark the process as being in
backup and don't deliver any broadcasts to an app in
that state.

Bug: 25350780
Change-Id: I1adc95431f709495d3c1141c7c5d3616cf9cc1f0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d9814a2f142dcf5082c9f07043c870555ab6b36e 24-May-2016 Suprabh Shukla <suprabh@google.com> Merge "Adding RetailModeService to handle retail mode" into nyc-mr1-dev am: a09c9e0fc4
am: 99a233ac8a

* commit '99a233ac8a949481e74a93d2288a4ffbaaae9a6e':
Adding RetailModeService to handle retail mode

Change-Id: Ic97ceacb0719a5f33dc025101df7cf458e99df96
a09c9e0fc48816096349aac8960a3b49101d90a3 24-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adding RetailModeService to handle retail mode" into nyc-mr1-dev
cc30b0e7901f753fabbfa08f10d0b3f9b5a54144 20-May-2016 Suprabh Shukla <suprabh@google.com> Adding RetailModeService to handle retail mode

The service listens for the global setting DEVICE_DEMO_MODE and switches
device to demo mode when it is changed to 1. Also, acquires the wakelock
to
keep the screen on and puts up a notification to wipe and reset the demo
session when in demo mode.

Bug: 27280140
Change-Id: If1843016889ec2c50818c67432d60f33063e0986
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1eef8d615c7fc6b88682366fe11bf871a2321c3b 23-May-2016 Sid Soundararajan <ssoundar@google.com> Merge "Add a check to adjust thumbnail scaling for full screen shots on TV" into nyc-dev am: 0513125c92 am: 809bb0f195
am: 20c4aea8c5

* commit '20c4aea8c52fbb6ad1ea3ef74aee6ffc532749a4':
Add a check to adjust thumbnail scaling for full screen shots on TV

Change-Id: I8372ba24c7bb352d6a7e1cee6364db7f8f1ae683
20c4aea8c52fbb6ad1ea3ef74aee6ffc532749a4 23-May-2016 Sid Soundararajan <ssoundar@google.com> Merge "Add a check to adjust thumbnail scaling for full screen shots on TV" into nyc-dev am: 0513125c92
am: 809bb0f195

* commit '809bb0f1957d92e9fc3a84c56573dddd6ce50162':
Add a check to adjust thumbnail scaling for full screen shots on TV

Change-Id: Icd9595a35f31b4e669bf6e66afd2073fc170e274
7f2654042655d32714cc59fd857f24fc7b284f77 23-May-2016 Sid Soundararajan <ssoundar@google.com> Merge "Add a check to adjust thumbnail scaling for full screen shots on TV" into nyc-dev
am: 0513125c92

* commit '0513125c92789912214235faad26e7a97184a53a':
Add a check to adjust thumbnail scaling for full screen shots on TV

Change-Id: I057727feb949fc864c3396ef53f9fba331f65ba8
4332dda9a76191b0f055dedbea8d509a20d5c455 12-May-2016 Sid Soundararajan <ssoundar@google.com> Add a check to adjust thumbnail scaling for full screen shots on TV

This should let us get away with taking smaller bitmaps for TV.

BUG: 28371792
Change-Id: Ia5d43dd48c57c4dd519b46f0c0d0ec94df5f42a9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8ae0898982d2c4303181f12f4c8b34919461dfa7 20-May-2016 Alan Leung <acleung@google.com> Merge "Enable boost-locked-region-priority" into nyc-dev am: 430894d1bb am: 1969c9cf17
am: b223d4b198

* commit 'b223d4b198adaca7d42315c3fbee7816b9e4f1c0':
Enable boost-locked-region-priority

Change-Id: I2ebae6ae0aca932178cc50ba6601804ad9e4d2de
b223d4b198adaca7d42315c3fbee7816b9e4f1c0 20-May-2016 Alan Leung <acleung@google.com> Merge "Enable boost-locked-region-priority" into nyc-dev am: 430894d1bb
am: 1969c9cf17

* commit '1969c9cf1730f90e1cc4355486a3e42c0b43d6c3':
Enable boost-locked-region-priority

Change-Id: I10026d34d777de090afa07e7e0bdd920b6f8b75e
8cbec3de0fe81f1b9b5379f87167cd23f3926225 20-May-2016 Alan Leung <acleung@google.com> Merge "Enable boost-locked-region-priority" into nyc-dev
am: 430894d1bb

* commit '430894d1bbac3ceb94dc2f57334858178fa53e97':
Enable boost-locked-region-priority

Change-Id: I26257eae8b8d0dfdf604c2e8e7350ff415d8433f
880721b38b861d44af25b3384efffd69bbe47d0c 17-May-2016 Alan Leung <acleung@google.com> Enable boost-locked-region-priority

Enable jack.transformations.boost-locked-region-priority compiler pass
that had shown to increase performance in AmSlam by 10% or so.

bug: 28610549
Change-Id: If1b76787acd272882647ede7e831cb1ba376e578
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ea906b37dfd6f84a74ab15f85f5f13d41cda6bb6 18-May-2016 Seigo Nonaka <nona@google.com> Fix system locale propagation during user creation.

Since Android N, the system locale is stored in Settings.System. Because
of this change, we need to propagate the previous user's system locale
to the newly created user.

When the user switch happens, updateUserConfigurationLocked is called
for the next user. Usually, some configuration values (font scale and
system locale) are overwritten by the next user's settings. However,
the first time the next user logs in (and only the first time), the
settings value is empty. So, we need to decide between keeping the
passed configuration's value or resetting to the default. For the
fontScale, it is reset to the default (issue 27187556). For the system
locale, the previous user's locale should be used. This CL addresses
this.

At the same time, the inherited configuration should be stored to the
settings, otherwise the inherited configuration is lost the next time
the second user logs in.

Bug: 27803966
Change-Id: I4632671316d26e00ab6fe80ff3433f097f0e0954
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9576535c8096643313c78acdcf541a7e4cef39f2 18-May-2016 Robert Sesek <rsesek@google.com> Merge "Split the zygote logic out of android.os.Process into a new ZygoteProcess class."
1e3404d112f2a82fca5c189b1969adf216084df0 18-May-2016 Jeff Sharkey <jsharkey@android.com> Merge "Check processName when starting providers." into nyc-dev am: 6bd012a799 am: 9208ed4c91
am: 5d25ac90d2

* commit '5d25ac90d2e1d3a32aa3182e7f43b00aab70538c':
Check processName when starting providers.

Change-Id: I7f1db78686332805d4cc097f0aa05ec2e7d1e93a
5d25ac90d2e1d3a32aa3182e7f43b00aab70538c 18-May-2016 Jeff Sharkey <jsharkey@google.com> Merge "Check processName when starting providers." into nyc-dev am: 6bd012a799
am: 9208ed4c91

* commit '9208ed4c91220e2e76320bd4d8cfd8bc0a889754':
Check processName when starting providers.

Change-Id: I509d197eaff9149a3c5db91870e4841c11cf9d62
11c68e8cc941b38cbb4d44c1337cfcf306b498a8 18-May-2016 Jeff Sharkey <jsharkey@android.com> Merge "Check processName when starting providers." into nyc-dev
am: 6bd012a799

* commit '6bd012a799f1dfd3d40dc3d581d18fb36618f0b1':
Check processName when starting providers.

Change-Id: I5a7bfd0756d0e84288ae69ce2f2263d5a51ea045
6bd012a799f1dfd3d40dc3d581d18fb36618f0b1 18-May-2016 Jeff Sharkey <jsharkey@google.com> Merge "Check processName when starting providers." into nyc-dev
af15c8bcaec3f301b9e646d9702d90b43ceb23a0 18-May-2016 Yohei Yukawa <yukawa@google.com> Merge "Move LocaleList to avoid layering violation." into nyc-dev am: 31884efd13 am: ddaf3f4681
am: bf4c8f730b

* commit 'bf4c8f730b167e5ee65ed7c59dfa1d7867b63fcc':
Move LocaleList to avoid layering violation.

Change-Id: I78fee5269f7428e34b196573575784fc15cb1372
bf4c8f730b167e5ee65ed7c59dfa1d7867b63fcc 18-May-2016 Yohei Yukawa <yukawa@google.com> Merge "Move LocaleList to avoid layering violation." into nyc-dev am: 31884efd13
am: ddaf3f4681

* commit 'ddaf3f468195e5aa47617317c08e9e2c35bcfeee':
Move LocaleList to avoid layering violation.

Change-Id: I7dbe5c3d552a7350ab61c929f431e2a3cffdee5b
13fa6b7c4811ca19f86c40ad7bfab86abafa4887 18-May-2016 Yohei Yukawa <yukawa@google.com> Merge "Move LocaleList to avoid layering violation." into nyc-dev
am: 31884efd13

* commit '31884efd13b3ac60078edaa0b7e8a4b75d995538':
Move LocaleList to avoid layering violation.

Change-Id: I45e9b7e834d2c5e515eb6c60885296358e7d786e
23cbe85610f780134cc77dd4a54732a22ed6e86e 18-May-2016 Yohei Yukawa <yukawa@google.com> Move LocaleList to avoid layering violation.

Since LocaleList needs to depend on android.os.Parcelable, we cannot let
that class belong to "android.util" package, which causes layering
violation.

Bug: 28819696
Change-Id: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9b58317a39036d6cbc7cf0cef93d46b961712352 18-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #28689719: Runtime restart" into nyc-dev am: 77ad5f1657 am: ab82de14b1
am: a648b098f8

* commit 'a648b098f8eb68a52d878122ee3070b67b2e8075':
Work on issue #28689719: Runtime restart

Change-Id: I77448a9fd570fb20b9f7c82c1f420f53afd61bae
ab82de14b1c6bdf44fa2cac96c37620f0f2319f0 18-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #28689719: Runtime restart" into nyc-dev
am: 77ad5f1657

* commit '77ad5f1657a8bef6b28f69f9bd8a2d1978c88a57':
Work on issue #28689719: Runtime restart

Change-Id: Ic44a4f56be67e3a50932d6bfbb58cdca6536e501
2675616719734ce069db47bd8b563f775351dd38 17-May-2016 Dianne Hackborn <hackbod@google.com> Work on issue #28689719: Runtime restart

There are few paths I can see to get a null intent down into
the framework at this point. Add in some checks and reports
at those places to mitigate and report such problems.

Change-Id: If235bf342558321d3fabe9363fcebb2bcea18df1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f5c5ac231dea02c8041d84ac006e0df878e3f28b 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28641630: Service client dumps are timing out for no reason" into nyc-dev am: 8f359afdc3 am: 16f6215ef5
am: ef285135af

* commit 'ef285135af3772425be4e15e3f5a089f1ef9d1ae':
Fix issue #28641630: Service client dumps are timing out for no reason

Change-Id: If6fe5fa7e4012eb807891f5d03561e1df8ba5dbf
fab87630f3d142fa733baf0e67453637ed374f5b 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #27532364: Security Vulnerability in IIntentSender.send" into nyc-dev am: 607844efa5 am: a24af982ff
am: ae5664af28

* commit 'ae5664af28e78c685c4ffec671254d75f1c932fb':
Fix issue #27532364: Security Vulnerability in IIntentSender.send

Change-Id: I96430b2073f2aafba489e5d2a0d11822709f4206
ef285135af3772425be4e15e3f5a089f1ef9d1ae 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28641630: Service client dumps are timing out for no reason" into nyc-dev am: 8f359afdc3
am: 16f6215ef5

* commit '16f6215ef5623e66fc9c8f401e6706831de0250c':
Fix issue #28641630: Service client dumps are timing out for no reason

Change-Id: I27fea32d69f9d26644dd4fb9106012c450208872
ae5664af28e78c685c4ffec671254d75f1c932fb 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #27532364: Security Vulnerability in IIntentSender.send" into nyc-dev am: 607844efa5
am: a24af982ff

* commit 'a24af982fffeeb6d3d4919907b5c27064c5a8ff1':
Fix issue #27532364: Security Vulnerability in IIntentSender.send

Change-Id: Iea2b8a6b86f10122ea763e93e1516fce43e58dfa
f2ddee263662fd5d5854c86a49d53407a43ccffc 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28641630: Service client dumps are timing out for no reason" into nyc-dev
am: 8f359afdc3

* commit '8f359afdc3ce3f243d508e81831ed5f274b65534':
Fix issue #28641630: Service client dumps are timing out for no reason

Change-Id: I67af48d0e861e77e3bca389970aed1601567f2c7
4d7e92b56bcf02e96e474ce44ff6f019d4fa5a08 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #27532364: Security Vulnerability in IIntentSender.send" into nyc-dev
am: 607844efa5

* commit '607844efa59f79bd9fab55eb75f217d21cd15f5f':
Fix issue #27532364: Security Vulnerability in IIntentSender.send

Change-Id: Iaf3102ba03cf2242b02030aa24df8282ed3fbdc8
8f359afdc3ce3f243d508e81831ed5f274b65534 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28641630: Service client dumps are timing out for no reason" into nyc-dev
607844efa59f79bd9fab55eb75f217d21cd15f5f 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #27532364: Security Vulnerability in IIntentSender.send" into nyc-dev
777a06d3c932277649ebeb6ccb3f20e80aa867b3 17-May-2016 Dianne Hackborn <hackbod@google.com> Fix issue #28641630: Service client dumps are timing out for no reason

Actually, no reason. The reason is that to do the dump we are doing
synchronous calls out to each service, but that is with the activity
manager lock held, so they can get blocked if their main thread does
any call back in to the activity manager.

To fix this, re-organize the dumping code so that the "with client"
path is separate, and doesn't require holding a lock the entire
time.

Change-Id: Ia96861c10da81048b3d2ac93a25760b68623cf34
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
94e824bc1b5f83024b7c9a228a8f2d0cd1347d11 18-Mar-2016 Robert Sesek <rsesek@google.com> Split the zygote logic out of android.os.Process into a new ZygoteProcess class.

There is no functional change. This is to support adding new types of zygotes
that all operate using the same protocol.

Bug: 21643067
Change-Id: Ie673ee816cae34ac20ffb8c774ec3e6461c3fd0a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e89477964f20764ad251f1fea6f6d0dc0bc20ace 17-May-2016 Amit Mahajan <amitmahajan@google.com> Merge "OMADM intent sent by both system and apps." into nyc-dev am: 65ca16ebab am: db4c3aff33
am: 1a4329a9b2

* commit '1a4329a9b28cb6f6fdb7b492117a659d52bff987':
OMADM intent sent by both system and apps.

Change-Id: I779503bbaf90c2c43a56c846875c6ea93a3a9b00
db4c3aff334c0cebea1e337fadb4b535e8ccaffa 17-May-2016 Amit Mahajan <amitmahajan@google.com> Merge "OMADM intent sent by both system and apps." into nyc-dev
am: 65ca16ebab

* commit '65ca16ebab701c82895a0f1bf5ba0344aff44e50':
OMADM intent sent by both system and apps.

Change-Id: Ifda48558713ea89d0d1b2de54b1abb738ca187e8
65ca16ebab701c82895a0f1bf5ba0344aff44e50 17-May-2016 Amit Mahajan <amitmahajan@google.com> Merge "OMADM intent sent by both system and apps." into nyc-dev
964cc9dc3f499debf0f0b3fb0ee6c81bc4cfb717 17-May-2016 Tim Murray <timmurray@google.com> Merge "Make persistent apps become top correctly." into nyc-dev am: 29af3cab29 am: 03a357f8e9
am: 0f6d5f8a04

* commit '0f6d5f8a04a373c893fd59e0506e274751c53d04':
Make persistent apps become top correctly.

Change-Id: I10c57a404927ef4792d2afbd6649ebd96902b70c
0f6d5f8a04a373c893fd59e0506e274751c53d04 17-May-2016 Tim Murray <timmurray@google.com> Merge "Make persistent apps become top correctly." into nyc-dev am: 29af3cab29
am: 03a357f8e9

* commit '03a357f8e950aa60c67195844e6e382f0ad4b3b8':
Make persistent apps become top correctly.

Change-Id: I4164ac2d6eaebf845f00a493187986ca9687fe7b
b9e8a87240c7abc3bb65fb7d6e58bddc278ee9b9 17-May-2016 Tim Murray <timmurray@google.com> Merge "Make persistent apps become top correctly." into nyc-dev
am: 29af3cab29

* commit '29af3cab293dc7a19ca3b387c5507e521f66d0b7':
Make persistent apps become top correctly.

Change-Id: Ic022afa3fa2004735b371dce4738da8d7dfeb008
29af3cab293dc7a19ca3b387c5507e521f66d0b7 17-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Make persistent apps become top correctly." into nyc-dev
9e2e1d56f468c108ac9bf5f94bfdb439ad76c35b 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28794831: meminfo considers cached processes to be services" into nyc-dev am: 0cb1cc74b8 am: 8a434c8052
am: fb6e3c6b82

* commit 'fb6e3c6b8245e6c889cc562c6c6f01fd7d8ea462':
Fix issue #28794831: meminfo considers cached processes to be services

Change-Id: Icbd1cb8d0c323cd676a8953e35be7d6884c07bdd
c4f497694fed7eee4140ae00f06a015c306c77b0 17-May-2016 Michael Kwan <mkwan@google.com> Merge "Allow ANR dialogs for Watch eng builds." into nyc-mr1-dev am: 0092f82d4c
am: c995c6329a

* commit 'c995c6329ad00350dc7f093f3a8082abeffbe608':
Allow ANR dialogs for Watch eng builds.

Change-Id: Ia58055d661918bdbd89a418502f5c58ee38500b8
fb6e3c6b8245e6c889cc562c6c6f01fd7d8ea462 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28794831: meminfo considers cached processes to be services" into nyc-dev am: 0cb1cc74b8
am: 8a434c8052

* commit '8a434c805231d39a7dd23463f653e2cf565f65ec':
Fix issue #28794831: meminfo considers cached processes to be services

Change-Id: Ic1886f671c4efb4cafcf71d903f9b168db6d395c
c5d784caf358621823acab85c1d19840571a7556 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28794831: meminfo considers cached processes to be services" into nyc-dev
am: 0cb1cc74b8

* commit '0cb1cc74b851f995110b8231f754c9f84122c816':
Fix issue #28794831: meminfo considers cached processes to be services

Change-Id: I2d9ab20344f982e97d91422e89e56a27420233bd
0cb1cc74b851f995110b8231f754c9f84122c816 17-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28794831: meminfo considers cached processes to be services" into nyc-dev
666212b75c3acf41fffaad7c7199eda469a6edcf 16-May-2016 Tim Murray <timmurray@google.com> Make persistent apps become top correctly.

Sometimes, a persistent app should be the top app (recents). Make sure
such an app can use the top-app cpuset.

bug 28317812
bug 28794389

Change-Id: I756cec3fbab8cc552a6d90c007aa2e07f6b78dbc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2ebd57ff9495aa9a341ec257fd018cbe703691de 16-May-2016 Dianne Hackborn <hackbod@google.com> Fix issue #28794831: meminfo considers cached processes to be services

Uh how did this ever actually work??

Change-Id: I9823f88847ccda6984bc95227fac90b994c22462
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
09c3f2d0025985293b1176b49b1df2ca27bbec85 16-May-2016 Michael Kwan <mkwan@google.com> Allow ANR dialogs for Watch eng builds.

Bug: 20024319
Change-Id: Idf966155c2b1e081f59d55b09e544d2c2adfbd2b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
15e66cd5af7a08dc603de11cba40eac36d1ed580 14-May-2016 Jeff Sharkey <jsharkey@android.com> Check processName when starting providers.

Bug: 28708253
Change-Id: I346441021295273c356619c60caa6086ef165363
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d375a04d2ec4edacb323ec86a2f310153fa4547c 14-May-2016 Amit Mahajan <amitmahajan@google.com> OMADM intent sent by both system and apps.

Adding an exception for "com.android.omadm.service.CONFIGURATION_UPDATE"
as it is sent by both system and OEM apps.

Bug: 28757729
Change-Id: Ic89d38bbd78e436ca3c259f1aa61be450033a232
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0c4e6a8da3405f742e5cef8afdf579d58b6f1246 14-May-2016 Dianne Hackborn <hackbod@google.com> Fix issue #27532364: Security Vulnerability in IIntentSender.send

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

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

Change-Id: I4096e5b00063e8dba66230585a2dfe67e35e8092
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6f57d04dfccc89cd152cc13e5e23fbb1fa299ca1 14-May-2016 Joe LaPenna <jlapenna@google.com> Merge "Do not show error dialogs on watch builds." into nyc-mr1-dev am: 50beaa02f8
am: 619d484912

* commit '619d484912506f3ae553f0a03c1aa6ea22dd833d':
Do not show error dialogs on watch builds.

Change-Id: Ie9ffbf5472223402d0e862da6fd774e726a170d1
50beaa02f89826cfca84273a7e8140b5e6f6a234 14-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Do not show error dialogs on watch builds." into nyc-mr1-dev
407418da085c1837b173b488cb0e95c1339e4b75 14-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28728838 java.lang.ClassCastException: android.os.BinderProxy..." into nyc-dev am: 7dedfd0c04 am: 7f80882820
am: c89bf2bc5b

* commit 'c89bf2bc5b8f45fa9e68bc597fc9424f42e9482d':
Fix issue #28728838 java.lang.ClassCastException: android.os.BinderProxy...

Change-Id: I9324ece3e6e3208e09eff5a5f97ffd1f2ea62619
4502ce2d498e6173f69b5af88cb2b81b76de990f 13-May-2016 Dianne Hackborn <hackbod@google.com> Fix issue #28728838 java.lang.ClassCastException: android.os.BinderProxy...

...cannot be cast to LocalBinder after a crash

Turns out, if you called removeProcessLocked() with an old ProcessRecord,
we could get in to a bad state -- if we had a new process with that same
name already running, we would kind-of blow it away as a process name,
but not as much else. So the next time we wanted to run a new thing
in the process, we would start a new second process and the two could
get mixed together.

Change-Id: I05e0463bd55f57f5e07f0b804ed9fd8c4f98a5a5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6c0b89dfd73b77fee33df51fda3367dbe168c899 11-May-2016 Joe LaPenna <jlapenna@google.com> Do not show error dialogs on watch builds.

BUG: 20024319

Change-Id: Iadf4ef9c7999db47423020fec87ee3b145ef6fb0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d99b6fde12386d6ebb3e72baafc6887441120dab 11-May-2016 Amith Yamasani <yamasani@google.com> Merge "Fix multi-window assiststructure trashing" into nyc-dev am: a66d395490 am: 0ce0116338
am: 9165f15e7d

* commit '9165f15e7d171db6d8c91be84e6bacd99d672e6f':
Fix multi-window assiststructure trashing

Change-Id: I6a323c1c75a8ff9fe9f891ee1ecb6b0f25e1b034
4f128e4d968b376bb7c3fa209d27b0a30202e604 10-May-2016 Amith Yamasani <yamasani@google.com> Fix multi-window assiststructure trashing

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

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

Bug: 28348867
Change-Id: I07efcd933db7e48aefd25a1c95493b71bbcffe4b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d74587fb4ca76e5a39824034566c57ccbd6e4b0b 06-May-2016 Christopher Tate <ctate@google.com> Merge "Move the \'pretend idle jobs can run now\' broadcast into AMS" into nyc-dev am: 0588954071 am: 2591ee2b0b
am: ad2b44c8c7

* commit 'ad2b44c8c7907a971e7437c5ccd0f823caec53fd':
Move the 'pretend idle jobs can run now' broadcast into AMS

Change-Id: I50b6ca257b7995d6a50fe938f8d4c788f739001a
058895407140de0e513b82150c3acb6131e971a2 06-May-2016 Chris Tate <ctate@android.com> Merge "Move the 'pretend idle jobs can run now' broadcast into AMS" into nyc-dev
e87b5750466508e3e6a28f95ef035865d022d0b9 06-May-2016 Wale Ogunwale <ogunwale@google.com> Merge "Dismiss docked stack if an activity is shown on top of the lock screen" into nyc-dev am: 5d6a218d9e am: d9125edb98
am: 94d93dd38f

* commit '94d93dd38fbab0ff8f9a9ce397a522cf2fcd6429':
Dismiss docked stack if an activity is shown on top of the lock screen

Change-Id: Iaaf1dc4cd6f4008bf4bc571bb70365d431ea30ed
27d92e4e397728d56f4f951dd4ce99668c7c447b 06-May-2016 Christopher Tate <ctate@google.com> Move the 'pretend idle jobs can run now' broadcast into AMS

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

Bug 28406044

Change-Id: I101915a8c6f19454330a8db2079a75023c112582
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
99732940809058fae558618399323c36b8a0e856 06-May-2016 Wale Ogunwale <ogunwale@google.com> Dismiss docked stack if an activity is shown on top of the lock screen

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

Bug: 28195260
Change-Id: I29a0350993ce8fe548d4a465b06d877cde151c78
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0f18e61c80718bc81064a93886ade2ce0fb8b138 05-May-2016 Makoto Onuki <omakoto@google.com> Merge "Fix reboot loop when "password to boot" is enabled on ..." into nyc-dev am: 8318223a6e am: 30ead05624
am: b673fcf020

* commit 'b673fcf020cd618ecb1ef6bb8ce2b280202a5ce9':
Fix reboot loop when "password to boot" is enabled on ...

Change-Id: Iebee0e188b2cb26d2215de838c68e11d5005744c
8ac7f2134cc34e8be20049aad50761aef41039d0 05-May-2016 Makoto Onuki <omakoto@google.com> Fix reboot loop when "password to boot" is enabled on ...

a non english locale.

Bug 28607673

Change-Id: I316f348305238616e8254bb878b66099015a3793
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d0ed6043a1aa179c64e3d23a25fa253deaa7e461 04-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #28200735: AcitvityManagerService lock held for..." into nyc-dev am: e76ffd19a4 am: 95f1eb67d5
am: 220d470e80

* commit '220d470e80cecd5c97a78e0fc1d469e2334796f4':
Work on issue #28200735: AcitvityManagerService lock held for...

Change-Id: I3cd3df68fb54a5d2818951bd25ff8afb1fbd7bb8
e76ffd19a4fec84c11bf91dfc131098d57243303 04-May-2016 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #28200735: AcitvityManagerService lock held for..." into nyc-dev
b0a5aa67f16ff57a25a33be55b2a9923f9847687 03-May-2016 Andreas Gampe <agampe@google.com> Merge "ActivityManager: Make bootcomplete marker failure a warning" into nyc-dev am: 65e22a20ac am: 6f2f049d13
am: 78683061a5

* commit '78683061a519bbdb4a0d8acbb294158ca66120cd':
ActivityManager: Make bootcomplete marker failure a warning

Change-Id: Ic99cb484ec611c309efd6edf5c409673c33d2026
65e22a20acd50876602f25b9b607aeea57682971 03-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "ActivityManager: Make bootcomplete marker failure a warning" into nyc-dev
d1bc17aacd2fcf45a67cf35adf78eca5c2bd708e 03-May-2016 Makoto Onuki <omakoto@google.com> Merge "Merge "ShortcutManager: finishing touches" into nyc-dev am: 7d164d35a4" into nyc-mr1-dev am: 59cfcb502d
am: 2c0af8597d

* commit '2c0af8597dd3edb155893453dbb03027dc95135e':
ShortcutManager: finishing touches

Change-Id: Id54d01e50b8120b898263a674b1886e2f5c16ac4
0e11a4cd9ddfb53ff2f246c4674188e80dd3fa04 03-May-2016 Andreas Gampe <agampe@google.com> ActivityManager: Make bootcomplete marker failure a warning

This isn't terminal, and currently even expected in some cases.
Make it a warning instead of an error.

Bug: 26978865
Change-Id: Ieb7f29e340f5b08f69887b9f094554858fb72786
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7d164d35a41d2aa351f0a27faf05fc67ba262c07 03-May-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: finishing touches" into nyc-dev
3765e0aa6a1e0fbfe9a53615714ab9e044992168 03-May-2016 Jeff Sharkey <jsharkey@google.com> Merge "Merge "When fork() fails, clean up data structures." into nyc-dev am: f10640adef am: 01e97ab88e" into nyc-mr1-dev-plus-aosp
am: 69f17e7053

* commit '69f17e70531a77f9637ecaf7c0a42efd04172252':
When fork() fails, clean up data structures.

Change-Id: I7820d4431877949e53543c929991b8175b951159
a6c8abb25b1e348f051bb799beb11ed73c06c0ff 03-May-2016 Jeff Sharkey <jsharkey@android.com> Merge "Yell when no home app was found." into nyc-dev am: dba83f1289 am: be19162ae3
am: bacf3c8c47

* commit 'bacf3c8c474102a28a7b145a031bc08926be89aa':
Yell when no home app was found.

Change-Id: Iabcd75a66af46edcee752f2bf2607ffe51814ed4
f10640adef2ca62204d802029e65f12d61908e7b 03-May-2016 Jeff Sharkey <jsharkey@google.com> Merge "When fork() fails, clean up data structures." into nyc-dev
dba83f128999708d15a3172cdfaf0b596e4e7048 03-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Yell when no home app was found." into nyc-dev
1e83cb77d0b50c9c7eeecb29d76619d031929c9d 02-May-2016 Wale Ogunwale <ogunwale@google.com> Merge "Use existing bounds when pinning an activity if there is already pinned stack" into nyc-dev am: b420612696 am: 6044f8dfed
am: 355152289f

* commit '355152289f911aa444daf033b66ebbed61f64ad5':
Use existing bounds when pinning an activity if there is already pinned stack

Change-Id: Ie93b206a07929454b285f8b2fba688ca04b0138a
b42061269617b3ad84882749031413c223d6cb8c 02-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Use existing bounds when pinning an activity if there is already pinned stack" into nyc-dev
65790f215eacc5893cbcc7159bc18756b4184561 02-May-2016 Jeff Sharkey <jsharkey@android.com> Yell when no home app was found.

If we didn't find a home app, the boot just appears to be wedged
and it's hard to investigate what the root-cause is. Let's log to
make it more obvious.

Bug: 28465914
Change-Id: I9697af83eb27efb54f1f703506d4f148c96425b0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8a734880d83cea122980afd8a9c96c87e706ff53 02-May-2016 Wale Ogunwale <ogunwale@google.com> Merge "Dont relaunch activity in fullscreen stack when entering split screen mode" into nyc-dev am: 53482cb6c0 am: 975c75bc92
am: 9e29cbdb0b

* commit '9e29cbdb0b6f83dd183ad148b81474f5dce433f0':
Don’t relaunch activity in fullscreen stack when entering split screen mode

Change-Id: Iaf24c64e9e5cec9f02dd10f803c1b6c9c556b4a0
4d36b3a8c5ba1289d851ef337e46709bba333100 27-Apr-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: finishing touches

- Change back the throttling quota to 10 calls / day
- Foreground apps are no longer throttled, and when an app comes to
foreground the call counter will be reset.
- When the system locale changes, reset throttling for all packages
for all users.
See LocalService.onSystemLocaleChangedNoLock() for how it's performed.
Because the reset must happen before any other apps have a chance to
publish shortcuts, the logic is not straightforward.

- Added an internal API to reset the throttling upon inline-reply
from a notification.

- Stop supporting icons from "content:" URIs
- Improved javadoc on several APIs.

Also internal refactor needed to this:
- ShortcutUser.getAllPackages()/getAllLaunchers() are no longer
accessible to outer code to prevent accidentally adding/removing the
content. Outer code should use forAllPackages() / forAllLaunchers().

Bug 27923857

Change-Id: I002511193d1d33718163bb1dabe77610bde58198
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
132daa9679a58102c3906e33caa74265b2d67c92 02-May-2016 Wale Ogunwale <ogunwale@google.com> Use existing bounds when pinning an activity if there is already pinned stack

Using null will take the pinned stack to fullscreen. We need to use
the existing bounds when pinning an activity if pinned stack already exist.

Bug: 28517964
Change-Id: I9a15a2e4477a2ee0e2f09cf052627034f9ff6023
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9540ca4fc47ac5448826c43912aa573caecc746c 02-May-2016 Jeff Sharkey <jsharkey@android.com> When fork() fails, clean up data structures.

There are a number of different conditions that could cause
ActivityManager to fail to fork() a process. One of the most common
ones is a package being "frozen" during a PackageManager operation.

When this happens, use the common forceStopPackageLocked() method
to cleanup any internal bookkeeping structures. (It's slightly
misnamed, since it doesn't actually "force stop" the app.) It's
also the same method that we called moments earlier when the package
was first frozen through KILL_APPLICATION_MSG.

Bug: 28395549
Change-Id: I7b1623c5f66fc1de24cad5360c977ea764d09244
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a4d92a01521e560d00616b483143f2d07ebd755b 02-May-2016 Wale Ogunwale <ogunwale@google.com> Don’t relaunch activity in fullscreen stack when entering split screen mode

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

Bug: 28470261
Change-Id: Icfd85e932fe913dfb498752b5878cc7c690fd559
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0d3c578a80a72d902963408908eda6fdeb7d6c8c 30-Apr-2016 Dianne Hackborn <hackbod@google.com> Work on issue #28200735: AcitvityManagerService lock held for...

...300mS in bindService

Make the "slow proc start" debugging more aggressive, so it will
catch cases where it is taking more than 50ms to start.

Change-Id: I6f6eb749cf205f9890946b3ec562b7653674c3d9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c7a5b7c31c4bd3038d46f7c54e41dab362cdd766 29-Apr-2016 Sungsoo Lim <sungsoo@google.com> Merge "Merge "Another intent sent by both system and apps." into nyc-dev am: 71619aa437 am: 060676de3e" into nyc-mr1-dev-plus-aosp
am: dbff7eed8b

* commit 'dbff7eed8b35dbc9de15aef288935202a067bd91':
Another intent sent by both system and apps.

Change-Id: Ie5787bd0d7de37b238dbfb85456e20a9c291bbf4
71619aa437f40e5b4e760111852883cdca055d0b 29-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Another intent sent by both system and apps." into nyc-dev
f9f6e7c354b810b54c606409febd3e7652d635cf 29-Apr-2016 Amith Yamasani <yamasani@google.com> Merge "Stop user faster and clear stale broadcasts" into nyc-dev am: ec6faca007 am: 8dc73a6bc6
am: d229a3fdfd

* commit 'd229a3fdfdb3f028b3a39cfaee785b39b2729541':
Stop user faster and clear stale broadcasts

Change-Id: I5b69b7432f7cedd92f6891734643809e0170b3cc
ec6faca0078263dfbf2b41d11cdb14586e40fd75 29-Apr-2016 Amith Yamasani <yamasani@google.com> Merge "Stop user faster and clear stale broadcasts" into nyc-dev
23d8cb4a2595f1bf75be5466f4ab9a6bfccc57ba 28-Apr-2016 Jeff Sharkey <jsharkey@android.com> Merge "Introduce "unlocking" vs "unlocked" nuance." into nyc-dev am: 8c2fb9edae am: 35c6f6c70a
am: c68126587a

* commit 'c68126587aab22d27cf6ad19a05cb58b5d1bad50':
Introduce "unlocking" vs "unlocked" nuance.

Change-Id: I9a24147c091c7f370923e43148b78a855fcb43be
ad2e4bf9f36cf612db6c397feca8effb125ee541 26-Apr-2016 Amith Yamasani <yamasani@google.com> Stop user faster and clear stale broadcasts

Moved several USER_STOPPING registered receivers to listen
to USER_STOPPED, since they don't need to be blocking the
shutdown of the user.

Clear all stale broadcasts when stopping a user, so that we
don't unnecessarily start up processes and deliver stale
broadcasts. This was causing code to run when the user was
already stopped and resulted in crashes when other providers
and services couldn't be started anymore. Hopefully this fixes
many of those races.

Bug: 28371487
Change-Id: Ic35a7a23fa8fe009a53f8bf7545d4dad5fa34134
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
ed69570795b25835687986cd5c48df4baedd8723 27-Apr-2016 Sungsoo Lim <sungsoo@google.com> Another intent sent by both system and apps.

Bug: 28375541
Change-Id: Ia0302af28647c3d76020a22c8218963c0beb1600
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
dd7856489222d5411eee96e17ac6f90f1edfc4a2 25-Apr-2016 Amith Yamasani <yamasani@google.com> Merge "Fix NPE when assist data request times out" into nyc-dev am: bc6d96e am: 9af762c
am: 9286d51

* commit '9286d5103f37f261e00d0caed0484ef9e955c22f':
Fix NPE when assist data request times out

Change-Id: I91e5cae91061144039973a09fc04002f0fbfed24
bc6d96e4d09ec71a2844ea4e9281b7e849a00f80 25-Apr-2016 Amith Yamasani <yamasani@google.com> Merge "Fix NPE when assist data request times out" into nyc-dev
6e267d3d2367dc5fafb61f32a0abe4e5eb876358 25-Apr-2016 Amith Yamasani <yamasani@google.com> Fix NPE when assist data request times out

Bug: 28329835
Change-Id: I032e20ea1008512954b97519a4abb6fe4d65c673
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
879f5ba3f7eecda7c204751efc3fbfa58e7001ae 23-Apr-2016 Svet Ganov <svetoslavganov@google.com> Merge "Cleanup of the PackageInstaller API - Frameworks" into nyc-dev am: c947ebd am: 70d720c
am: 13da561

* commit '13da5613e2fce0ca2d5682fd202234856d2206e9':
Cleanup of the PackageInstaller API - Frameworks

Change-Id: Ibe4a6258c6437a9e86ed25e242301ca6d6635d26
dd5222d3148600e63652f3a265b879d61adc31f6 22-Apr-2016 Sudheer Shanka <sudheersai@google.com> Merge "Remove debug flag for some important logs." into nyc-dev am: b7ba766 am: 9a4711a
am: 02a42d5

* commit '02a42d5e377bb7e696e53e30182976862e4f5312':
Remove debug flag for some important logs.

Change-Id: Ie547b549138eeee3a4fe25718c75cf5d0ef38849
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/services/core/java/com/android/server/am/ActivityManagerService.java
b7ba766352ca78784831e7332dd59aa2f0e2a314 22-Apr-2016 Sudheer Shanka <sudheersai@google.com> Merge "Remove debug flag for some important logs." into nyc-dev
514316e76c8869557d3581a318a6bc1497c21851 22-Apr-2016 Sudheer Shanka <sudheersai@google.com> Remove debug flag for some important logs.

Bug: 27689631
Change-Id: I23c1396f3b29093e6d23ec06f90a382b6ce458d3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
203ae48ff76c9fb9bd5d7fe091aa6e2f2faf48a3 22-Apr-2016 Andrei Stingaceanu <stg@google.com> Merge "Keyboard shortcuts: dismiss when activities start via shortcut" into nyc-dev am: 1a83df8ba7 am: 9e16d11683
am: e0ea2e06ab

* commit 'e0ea2e06abafdde2974b8976ececd727e590060c':
Keyboard shortcuts: dismiss when activities start via shortcut

Change-Id: Ic86b86c3254318d17059b4650a9c7bcb652bddf3
1a83df8ba716d027ac26c9198ed3d3b8d2b98ad1 22-Apr-2016 Andrei Stingaceanu <stg@google.com> Merge "Keyboard shortcuts: dismiss when activities start via shortcut" into nyc-dev
105c937ee30c7f83a9ba27f93f36135575e75329 22-Apr-2016 Andrii Kulian <akulian@google.com> Merge "Show recents when task moves to docked stack" into nyc-dev am: 82e5288ee6 am: 58f060d62a
am: 367d9248a6

* commit '367d9248a67b5bc6c0228a233b7d8da1f4c83a41':
Show recents when task moves to docked stack

Change-Id: I828dfc14c95915e8fcb924c068236d06d611839d
82e5288ee63c92d3a610fd5c50bad510917fbf63 22-Apr-2016 Andrii Kulian <akulian@google.com> Merge "Show recents when task moves to docked stack" into nyc-dev
bf71968f893a8d556a03636109cb3bed4178a624 21-Apr-2016 Andrii Kulian <akulian@google.com> Show recents when task moves to docked stack

When task was moved to docked stack using adb command,
recents didn't show and docked stack was minimized when
home task obtained focus.
This CL shows recents if needed when task is moved to
docked stack.

Bug: 28215216
Change-Id: If1cfb9d24bd77cc9c3c8fad3479f115d7aca1301
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0bf096f1b45959e260b09b2483e79187c1991f54 14-Apr-2016 Andrei Stingaceanu <stg@google.com> Keyboard shortcuts: dismiss when activities start via shortcut

* introduced a new intent DISMISS_KEYBOARD_SHORTCUTS and
and new public API in Activity (which sends a broadcast
to KeyboardShortcutsReceiver) which applications can
use to dismiss the keyboard shortcuts.

* plumbing and implementation for a new call to dismiss
keyboard shortcuts from PhoneWindowManager and used it:
** when starting activities invoked via Search+key
** when starting activities invoked via META
** when starting activities via application launch keys

* removed unused variable in
Activity#onProvideKeyboardShortcuts

Note that for apps started via touch (aka non-shortcut)
like tapping the Settings gear icon from the notification
bar the menu is not automatically dismissed.

Bug: 28012198
Change-Id: I83a8d4f342bb8a08115a648648834d0d2bac19fd
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
30d90d1af56fc04dded25c4e7914593ceea4537f 22-Apr-2016 Brian Carlstrom <bdc@google.com> Merge "Add reasons to notifyPackageUse calls" into nyc-dev am: 6894199054 am: eca1026d72
am: 280ca7b83a

* commit '280ca7b83a84f51a80a034c3d28b5185db4c2693':
Add reasons to notifyPackageUse calls

Change-Id: I89ef19f3278dad1b8dcde147596ec52ef048e5fe
ca82e616d3131570bf2ee29778f4796f343720d5 20-Apr-2016 Brian Carlstrom <bdc@google.com> Add reasons to notifyPackageUse calls

This is so we can record more specific times in PackageUsage.
If file with only one timestamp per package is found, the value is
copied to all usage slots.

Bug: 27902702
Change-Id: I8affe43c735e54620a9204433aad367cfddfded7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cf963dcd7b583448229e4d31bac33c9766eaf89f 21-Apr-2016 Xiaohui Chen <xiaohuic@google.com> sys user split: fix default HOME activity

Only enable default HOME activity after user setup is complete.
When setup is not complete, it should be handled by setup
wizard.

Bug: 28275485
Change-Id: Ibc907a7252331a7315d0b70eda64dfb65d6c4dfe
(cherry picked from commit f01d63b35065654f8186daaf719ddb3065946bfa)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d3589ee715e397e61025265adc883c9ed3be4f56 21-Apr-2016 Tony Mak <tonymak@google.com> Merge "Fix wrong app is launched after solving challenge from tapping notification" into nyc-dev
646fe9913e5f5dda3d03d54ed6c6e9463a4161d0 21-Apr-2016 Tony Mak <tonymak@google.com> Fix wrong app is launched after solving challenge from tapping notification

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

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

Change-Id: I2d9e5923ad5d4d012f10057c409c666c8ca299a3
Fix: 28309964
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c043ebee4b4b5851898667a92fdfca34a4d64e52 15-Apr-2016 Clara Bayarri <clarabayarri@google.com> Fix silent errors when launching Keyboard Shortcuts from Settings

The following error was thrown, given that Activity is generating a
protected broadcast:
Sending non-protected broadcast
android.intent.action.SHOW_KEYBOARD_SHORTCUTS from system

Bug: 28138503
Change-Id: I50d5212d7776d33ffe6e9df1c5f080205ac4a29d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b965ced011bdd7a3ec5450f93d1c58b889514f11 20-Apr-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of 44e07e0 to mnc-dev am: 825b713 am: 8c635e7
am: 343600c

* commit '343600c3ecff31826e50d40821927e446adb9b0a':
Kill the real/isolated uid group, not the ApplicationInfo uid

Change-Id: I68dbf8f280672ec9770b6c57b9a17313f448e14a
8c635e73c698302ce6661f227c274164972f048e 20-Apr-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of 44e07e0 to mnc-dev
am: 825b713

* commit '825b7134699fbaaa16423c52b7b424d4a9afefb1':
Kill the real/isolated uid group, not the ApplicationInfo uid

Change-Id: I0c120c8dbf76857985ebea04eadca81fa6470cb2
825b7134699fbaaa16423c52b7b424d4a9afefb1 20-Apr-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of 44e07e0 to mnc-dev

Change-Id: Ibc446c82a3d1446ccd81630743f82d1fd58fbd47
44e07e07a1a1ec269ee0ef0963b452ea9a7c7158 20-Apr-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of 5e380f0 to lmp-mr1-ub-dev

Change-Id: Ie8d3c154f4c98bb1c2a1954ff1dabc8f5bc20b71
49425d612cee3864a316e9ecb6ec3faeae519b1e 20-Apr-2016 Rubin Xu <rubinxu@google.com> Merge "Kill foreground apps when turning off work" into nyc-dev
e23f581081b834d6928a4e8924432e0109391387 20-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Don't block while dispatching PRE_BOOT." into nyc-dev
cebcde3b5a1e406d953629d5b4c87347921a17de 20-Apr-2016 Christopher Tate <ctate@google.com> resolve merge conflicts of 7641889 to lmp-mr1-dev

Change-Id: Ie162907d7388d0e388ab39bcf2471d19e2ce7020
fd24108ca9876ac4f3598cf06464b78b61f32a96 19-Apr-2016 Jeff Sharkey <jsharkey@android.com> Don't block while dispatching PRE_BOOT.

While we're waiting on the final UX around PRE_BOOT_COMPLETED, don't
frustrate users by giving them a lockscreen that appears frozen
for several seconds.

Bug: 28164677
Change-Id: I54b62cea9bb83bc0f82fdf7e6e46a4640e1a30de
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a7f46b3ca6aa784b1456735c421922fd4c31626d 19-Apr-2016 Joe Onorato <joeo@google.com> Merge "Add an event log for when the memfactor changes." into nyc-dev
1dbff801aeac52a4525f085d1346cc8741c00d30 15-Apr-2016 Joe Onorato <joeo@google.com> Add an event log for when the memfactor changes.

Bug: 28113068
Change-Id: I84902d5f7f811fd49fa85ff4847cf21b258b62c0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9c211a339689a2e54da3315ccdbf22add472c76a 19-Apr-2016 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #28221912: Starting service as foreground might..." into nyc-dev
e896090caf761afd8c443bcf4732e38e43b4baa9 19-Apr-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #28250286: Missing equals!" into nyc-dev
89fa73fd7abe0f87634d2914163a8fc79ba2f738 19-Apr-2016 Jeff Sharkey <jsharkey@google.com> Merge "Unlock should always wait for pending PRE_BOOT." into nyc-dev
f8451b98150564b340207327d0951f44753338d1 01-Apr-2016 Rubin Xu <rubinxu@google.com> Kill foreground apps when turning off work

While work apps will all be killed as we stop the profile user when
turning off work, this can sometimes take a while. So let's kill the
foreground apps as soon as work profile is being turned off to make
the user experience nicer.

Bug: 27631526
Change-Id: Icdd3799385a98ee531b0b4247e8ede78f6f10da8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
882a0802a7f7268750b15adb8747dd3904f935b0 19-Apr-2016 Tony Mak <tonymak@google.com> Merge "User action should only stop lock task mode if it is in pinned mode" into nyc-dev
d96d436324afa635719ab092251ecaf80c1356f6 19-Apr-2016 Dianne Hackborn <hackbod@google.com> Fix issue #28250286: Missing equals!

Change-Id: I85073a1a8a0a37362a0c73a71d0e7c12ce9cfeef
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
76418899e66a144a257ee3489404dcb390552c18 19-Apr-2016 Christopher Tate <ctate@google.com> Kill the real/isolated uid group, not the ApplicationInfo uid

This is a direct reimplementation in L of fixes applied to N in
these two commits:

8dc8d37c1d7d694016f1ec2b3cea5fb723567be8
e8741d23d2dd05c4cb3fed5ee6a4040ee96a60e3

Bug 19285814

Change-Id: I59bcc8f1d41c426e9da635bea9ad1d7c6756d5aa
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
67324c990c4fbad238119a4667341d5618b2bea2 18-Apr-2016 Dianne Hackborn <hackbod@google.com> Work on issue #28221912: Starting service as foreground might...

...kill previous notification.

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

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

Change-Id: I3bb46d9cd3db7f73716c8ced19c20fea800eb30d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
84a4c971c484f05f2a2494d6353f36f4d954a5e0 18-Apr-2016 Jeff Sharkey <jsharkey@android.com> Unlock should always wait for pending PRE_BOOT.

While processing an unlock request, we might go async to handle
long-running operations like dispatching PRE_BOOT_COMPLETED. This
change ensures that all unlock requests for a particular user wait
in line behind any pending async operations.

Without this CL, any subsequent unlock requests would immediately
return successful, even though PRE_BOOT_COMPLETED events were still
being processed.

Bug: 28240584
Change-Id: I307d6aaebfb8f38028f3666a2e19e4399b7cf3a7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
77ca3629f60dd9a416938e625959d0bd750d1acd 18-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Reduce activity lifecycle churn when exiting split-screen mode." into nyc-dev
853304c0b11921db142a3945ab66fae5f0cc7d8a 18-Apr-2016 Tony Mak <tonymak@google.com> Show work challenge in if user in docked stack is locked

Register docked stack listener in ActivityManagerService.
If the docked stack is leaving minimized state, check whether the user
of the docked stack is locked. If yes, show credential confirmation.
Also, we now show work challenge in home task.

And we now scan the entire top task to handle the case the work app is
somewhere in the middle of the task. (eg: open personal camera in work app)

Bug: 27565539
Bug: 28094505

Change-Id: Iaf0738f43ae916a535b17949ec0f322bbfb194dc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2c11dc99632354836281cbe3000b911e72a30d14 18-Apr-2016 Tony Mak <tonymak@google.com> User action should only stop lock task mode if it is in pinned mode

There are two lock task modes: pinned and locked.
Pinned mode is the one that one that need users action to accept the pinned
request. For locked mode, it is triggered by DPM.
We should not allow user to stop locked mode by user action.
Please notice that it does not happen before because the action to dismiss
lock task mode is pressing both back and recents button and recents button
is hidden in locked mode. But it becomes a problem after the user action
is changed to long pressing back button.

So changes are as follows:
1. Only stop lock task mode if it is pinned mode in
stopLockTaskModeOnCurrent
2. Remove the permission checking in stopLockTaskModeOnCurrent. I can't
see the reason we are having this because there is no permission
checking to in stopLockTaskMode when it is in pinned mode. So you
can always stop pinned lock task mode anyway by calling
stopLockTaskMode directly.

Bug: 28184751
Change-Id: I610cc1dfade7737e0b08fc9a13dad29e62e09a32
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c8da41e2f4f6087b5ae0e08a30962d8f5231b01c 16-Apr-2016 Wale Ogunwale <ogunwale@google.com> Reduce activity lifecycle churn when exiting split-screen mode.

- Ignore calls to resize the docked stack due to it detaching while we are
already resizing stacks due to the docked stack switching to fullscreen mode.
- Defer resuming activities in a stack we are resizing to fullscreen when the
docked stack is going away. The activities may not be the top most activity
anymore since the activity in the docked stack might be moved on top of it.
- Removed call to ensure configuration in ASS.positionTaskInStackLocked.
This isn't needed as the ensure activities visible call will make sure
the activity is in the right configuration if it is going to be visible and
we don't want to be relaunching it if it isn't going to be visible.

Bug: 28196862
Change-Id: I26460dd9c649b8ec1bf296d5182e9ff6cafe6df0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fc465bf6bf456f5be1790b2ba60ea3da9c671d71 15-Apr-2016 Craig Donner <cdonner@google.com> Merge "Fix VR mode handling when the screen blanks and unblanks." into nyc-dev
b6ccae999fe285eb9c0c17ca88c271046afdfc20 13-Apr-2016 Craig Donner <cdonner@google.com> Fix VR mode handling when the screen blanks and unblanks.

When blanking the screen, turn off VR mode if it's enabled, and when waking up
after the keyboard goes away, turn it on if the top activity has requested VR
mode.

Bug: 26751056
Change-Id: Ib57b1c59e083e3615a02408d922c8c7be645ce92
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5981b8c2e8f6363d1f3bf09e7f1b3b5fb9a3846a 15-Apr-2016 Andrii Kulian <akulian@google.com> Merge "Remember task which is being locked" into nyc-dev
0f051f5abdb31024d862a954cc4c4716b1dde616 14-Apr-2016 Andrii Kulian <akulian@google.com> Remember task which is being locked

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

Bug: 27876860
Change-Id: Ie8e607df4380dd33ea9b3474afc247b02e31de07
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0d723a2a4d83db5f01aa5a21f3cbd9d2b608bced 14-Apr-2016 Amith Yamasani <yamasani@google.com> Merge "Multi-window assist callback" into nyc-dev
0e5da8c50681e4cc8693d885c5f4e89f3b039f07 14-Apr-2016 Dianne Hackborn <hackbod@google.com> Fix issue #28156248: Receiving connectivity receiver...

...broadcasts in Android N

Ooops.

Change-Id: I91ae6d3993e5e295965d8825e07993e67d10b357
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e8222e551f8abd2d82ca4f77ddb275e2e509751e 09-Apr-2016 Amith Yamasani <yamasani@google.com> Multi-window assist callback

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

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

Bug: 27718385

Change-Id: Ib4427c304611b75c2078dcb54f1f7e47ae7d9cfa
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bae147f174116dab43d7fb50179a9c8b213c6089 13-Apr-2016 Andrii Kulian <akulian@google.com> Merge "Make task fullscreen when locked" into nyc-dev
c27916642d59c9d13a5e33019871149971e5fe57 13-Apr-2016 Andrii Kulian <akulian@google.com> Make task fullscreen when locked

Previously if we were in multi-window mode and some task called
startLockTask() or kiosk mode was started - other tasks remained
on screen. User could still interact with other tasks, locked or
pinned task could be removed.
This CL makes tasks move to fullscreen when they are locked.

Bug: 27876860
Change-Id: I547a94be50276c7f418343600877e51b6b40c7a7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
29379ec859bf7118dec9f3248c63ee369218ad6b 12-Apr-2016 Jorim Jaggi <jjaggi@google.com> TRON refinements for multi-window

Bug: 26013430
Change-Id: I89b139b4ca3e7b6a06d8b5b351d67ffac240f73f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9323df6e469de5002cae168d24d776e79d7f6f4c 12-Apr-2016 Jeff Sharkey <jsharkey@android.com> Use callerPackage instead of callerApp.

When AlarmManager sends a broadcast, it only knows the packageName
that requested the broadcast, and the callerApp may not even be
running anymore. Since we only need the package name for enforcement,
use that instead of the possibly null callerApp.

Bug: 27397019
Change-Id: I8a52d73b4a83eebf85aa1adbfe06bd8886814d4b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5cbcb52b96b5a2b97234381af59002fbe32593cd 11-Apr-2016 Jeff Sharkey <jsharkey@android.com> Rate-limit how often we collect wtf() logs.

We've seen that aggressive Log.wtf() calls can DoS the system
process, since we fork and collect recent logcat output for each
call. After this CL, we rate-limit to only perform this heavy
lifting 5 times during any given 10 second window of time.

We still log the wtf() message to the binary event log.

Bug: 28117774, 28052546, 27994717, 27381069
Change-Id: Ic91b23fe7ee26818083a8d40fd4850fcb9d93643
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
656e6afed33242e072eb6ee9b48b1d6fe75ee179 08-Apr-2016 Thierry Strudel <tstrudel@google.com> Merge "am: do not account totalSwapPss as used RAM" into nyc-dev
7c3912e4abc71886ad41e7be67d4eff41974d21f 08-Apr-2016 Jorim Jaggi <jjaggi@google.com> Merge "Dismiss docked stack when opening non-resizable activity" into nyc-dev
319e7d9bccf6b726845cd5c53871d003ad2c25b5 07-Apr-2016 Thierry Strudel <tstrudel@google.com> am: do not account totalSwapPss as used RAM

Process PSS swapped is accounted as part of total process Pss to
get similar Pss values whether the device is using ZRAM of not.
But SwapPss is compressed in RAM so should not be accounted as
direct RAM contributor but though getZramTotalSizeKb already
taking into account.

Change-Id: I944850fb2a2b3a7342c850f8b9d69f304b53db46
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d53f09254ed48365d3a5149d640437d76aed2e5d 07-Apr-2016 Jorim Jaggi <jjaggi@google.com> Dismiss docked stack when opening non-resizable activity

- Also move the toast to SysemUI as a cleanup.

Bug: 27341740
Bug: 28026841
Change-Id: Ic6196ed75511751c6fadb12fa24574c881100f65
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
76cda85895b7b18b7e13d1cc02c665a15b9cc2b4 07-Apr-2016 Svetoslav Ganov <svetoslavganov@google.com> Merge "Fix a NPE" into nyc-dev
819c2f8fdac9fd16f03f43f8c002c9cd68d9888d 07-Apr-2016 Svet Ganov <svetoslavganov@google.com> Fix a NPE

bug:27999133

Change-Id: Icacb8f440bca2f720c15ee5548495fad50502fa0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fe523c67bc8b06920e4d8ca3a32b202c360c08a3 06-Apr-2016 Jeff Sharkey <jsharkey@android.com> Wrap logcat invocations with timeout.

We've seen evidence that the logcat binary can end up wedged, which
means we can eventually starve system_server for FDs. To mitigate
this, wrap logcat using the timeout utility to kill and clean up if
it takes too long to exit.

Bug: 27994717, 28021719, 28009200
Change-Id: Ieed1460d89598628a5db868645fd305d0e9054ed
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
854dcfd1922c03bed761d736291fc2cba0b7616f 05-Apr-2016 Chong Zhang <chz@google.com> Fix meminfo accounting for visible apps

Visible apps could have sub levels within the visible category.
Scores between 101 and 199 should be attributed to visible
category instead of perceptible.

bug: 27987575
Change-Id: I2dbe8af65e6829bafc86ffb5222a5f1aeac2d8b4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7d718bb252fe2bdee0c9c728a1e6e4892deb8ac7 03-Apr-2016 Jeff Sharkey <jsharkey@google.com> Merge "Support direct-boot tests." into nyc-dev
b5e89c6debca90be92bf5bc2e0e79d109de6d08f 02-Apr-2016 Jeff Sharkey <jsharkey@android.com> Support direct-boot tests.

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

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

Bug: 26498834
Change-Id: Ib4dfb9350925e5413f93a09baacf84c62f2ba0ea
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fbe10f175fa3cb2083d15b4dbfb05c6f223d7f2c 01-Apr-2016 Chong Zhang <chz@google.com> Merge "Avoid extra relaunch when rotating side-by-side apps" into nyc-dev
167bbfac24b1e78576b18c0522218838dfdf57bb 31-Mar-2016 Chong Zhang <chz@google.com> Avoid extra relaunch when rotating side-by-side apps

Update configuration with WM first and check if the stacks need to be
resized due to the update. If so, let activity manager resize the stacks
inline, instead of letting WM schedule another pass of resizeStack. This
way the configuration will be updated to the latest before ensureActivity-
ConfigurationLocked, and we don't need another relaunch there.

bug: 27834014

Change-Id: Ib761a96cada0c3247b0480f18370670c593159da
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f8c07d68c1813c6d9a05eb05951a320ace866168 01-Apr-2016 Russell Brenner <russellbrenner@google.com> Merge "Add new permission for am.updateLockTaskPackages()" into nyc-dev
b3ad567624475d3ad33fa0007e5ec5967b879cec 25-Mar-2016 Russell Brenner <russellbrenner@google.com> Add new permission for am.updateLockTaskPackages()

Adds android.permission.UPDATE_LOCK_TASK_PACKAGES, available only to
the system and setup wizard, providing access to
updateLockTaskPackages() without registering with the device policy
manager as a device owner.

Bug: 20016740
Change-Id: I6eceb5cece9407c84eabf3a818bb908f95989b91
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d0f83b7bcadc6cfa4f39ee99ea96e48591fd6539 31-Mar-2016 Joe Onorato <joeo@google.com> Merge "Include process state in association tracking" into nyc-dev
ac945867145c571506a211ccb0a87a3402c4d745 31-Mar-2016 Andrii Kulian <akulian@google.com> Merge "Refactor usages of Picture In Picture and Multi Window (1/4)" into nyc-dev
05c9ecc08a770e887d2c3d5da7153e252fdd8655 31-Mar-2016 Joe Onorato <joeo@google.com> Include process state in association tracking

Bug: 26165863
Change-Id: Ic1f3237d85dd9f9b55a412bc8609e60e6c2f3fd2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2040088ae1cd8e29ccf3c5c25237a8f779b4852c 30-Mar-2016 Felipe Leme <felipeal@google.com> Merge "Added activity cmd to display current process state of an app." into nyc-dev
933076d80561751618f462b26309ce9e4c3ff3bf 30-Mar-2016 Andrii Kulian <akulian@google.com> Refactor usages of Picture In Picture and Multi Window (1/4)

Bug: 27365860
Change-Id: I1590e430a12ceb84cb83da295e0bf7e4378fea96
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2f1b22727fd2d677b1f6e38643dd134ed78c156d 26-Mar-2016 Felipe Leme <felipeal@google.com> Added activity cmd to display current process state of an app.

BUG: 26776313
BUG: 27324964

Change-Id: I901cfdcc6fcd14548266e8ca3e2201508d7b14cb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ea33b945b18bad507fd0142f053910f2a9e228a6 30-Mar-2016 Christopher Tate <ctate@google.com> Offload killProcessGroup to a worker thread

It can take ~hundreds of ms to complete, so we want to avoid
blocking callers or monopolizing locks while waiting for it.

Bug 27821754

Change-Id: I522cadae7cfda9cce7c3d1a230cfd91cf4f9e730
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b52a461851f322b0edf3cb9383da5f449b533311 21-Mar-2016 Michal Karpinski <mkarpinski@google.com> Moving app process logging from AMS to PMS

Bug: 26796347
Change-Id: I21894c2edb41929f6ecd3880667c53e00acef677
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cba327969782e022882ef87f74a40003bce6246e 28-Mar-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #27776639: Background Check: Conn_Change..." into nyc-dev
0caf007b3f0b4cd21be285820c270c51a8e502b7 28-Mar-2016 Joe Onorato <joeo@google.com> Merge "Refactor ProcessStats." into nyc-dev
ddfc6f7dc9e2b2a5b5c2cab033bf894c5cf1a59b 28-Mar-2016 Wale Ogunwale <ogunwale@google.com> Merge "Show non-top tasks in the docked stack in recents." 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/services/core/java/com/android/server/am/ActivityManagerService.java
e91f3e7e8d8aec8b880e6ed284a3889f849dfd91 26-Mar-2016 Dianne Hackborn <hackbod@google.com> Fix issue #27776639: Background Check: Conn_Change...

...shouldnt be received when app is awake

(Really any implicit broadcast.)

Fix up a few things so we are more strict when not in lenient
mode.

Change-Id: I3c711525787e07ea7c604d0f9bc123e02448fa68
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c9b329ed8e422d7be0717b41efc2007493d71504 28-Mar-2016 Jeff Sharkey <jsharkey@android.com> Freeze apps during upgrade, check if uninstalled.

When an app is actively being upgraded, mark it as being "frozen"
to prevent it from being launched in a weird state. Also verify that
app is actually installed before letting Zygote fork it, working
around race conditions during user setup.

When the ProcessRecord of an ActivityRecord is inconsistent,
warn about it, but correct it and keep moving if the UIDs match.

Bug: 27200022, 26205678
Change-Id: I6628cf1cece5613f07647e0acc2d49265e69dc69
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bd91e2f3f6aca512a02be645b2515b5e3331e177 22-Mar-2016 Jeff Sharkey <jsharkey@android.com> Update PRE_BOOT_COMPLETED for FBE.

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

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

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

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

Bug: 27220885
Change-Id: I349439776b885acd32f6a578d8951ffd95640be2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c69bd2246f4ec5000591fdc381f84cd90be85b7f 15-Mar-2016 Jorim Jaggi <jjaggi@google.com> Implement transition for docking task in recents #6

- Use a future to provide the app thumbnail so the app can restart
in parallel when recents draws the bitmap (extremely expensive).
- Don't call startRecents from AM when recents is already running - this
messes up the transition information.
- Make sure to put the task into resizing mode if it needs to be restored
from the disk.
- Some minor fixes for the transition animation spec.
- Add NO_MOVE_ANIMATION to recents flags to prevent wallpaper
flickering.

Bug: 27607141
Change-Id: I7d0c75b88775ab467927b8cf94303ddb60222e7f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0b46f3c72c324bc9b8890ed9b81951bbeec70fdd 14-Mar-2016 Jorim Jaggi <jjaggi@google.com> Implement transition for docking task in recents #2

- Put window into resizing mode when docking it from recents,
so it fills the "void".
- Send whole task bitmap window as the thumbnail, to make
the transition smoother.

Bug: 27607141
Change-Id: Ib647d44d9777f1155deab818d1fd5425c1bdd3d1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
192086eb8aff3fb873a7e03ade0b81652aacf25f 11-Mar-2016 Jorim Jaggi <jjaggi@google.com> Implement transition for docking task in recents #1

- When the docking transition is happening, defer updating
the bounds of the home stack until the transition is done.
This is to preserve the scrim which is drawn in the recents
activity.
- Use the PROLONG_AT_START infrastructure to hide the task
in recents when starting the app transition.
- When recents finally get resized at the end of the transition,
reset it's draw state so we don't move the old surface around,
and the new surface gets drawn at the new position, to avoid
flickering.
- Remove hack around not layouting docked divider if it's not
visible, it's not needed anymore and resulted in a wrong
initial position.
- Fix animation selection for docked stack divider.
- Make sure win.moved() always gets called.

Bug: 27607141
Change-Id: I76c35f09461f044a90e2c88335008284b5839cc0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2adba07d75419462873dfeef40d4c983d832ed99 03-Mar-2016 Jorim Jaggi <jjaggi@google.com> Show a scrim activity if task is not resizable

Add a callback to TaskStackChangeListener which gets fired when the system
might need to inform the user that a specific app might not work in
multi-window.

Use that callback in SysUI to show a translucent activity which scrims the
activity behind to inform that it might not be resizable.

Debounce the information to once per multi-window session, to not make it
annoying.

Introduce launchTaskId to start an activity in an existing task, and protect
that with START_TASKS_FROM_RECENTS permission.

Bug: 27327287
Bug: 27431869
Change-Id: I89e8d653872ab01ba3c1e252b426e5481da0e6ca
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
941a1f81b0f50ff219a38476ffdba062b81d2fc4 25-Mar-2016 Winson Chung <winsonc@google.com> Merge "Don’t scale task thumbnails." into nyc-dev
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/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
0effee88499cc0b5f458e112eeb71cf3f7a957f3 24-Mar-2016 Tony Mak <tonymak@google.com> Merge "Use FLAG_ACTIVITY_TASK_ON_HOME to make sure back button brings user to home" into nyc-dev
4291c76e8097af550972b51aeda1b0b1dcf4fb5b 24-Mar-2016 Tony Mak <tonymak@google.com> Use FLAG_ACTIVITY_TASK_ON_HOME to make sure back button brings user to home

In work challenge, we want to show home when user taps back button.
Previously, we do this by launching launcher before showing work challenge.
We now use FLAG_ACTIVITY_TASK_ON_HOME instead.

Bug: 27826548
Change-Id: I74cca611bf00c6f53b4752f2967a0c729ddf2d61
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8dc8d37c1d7d694016f1ec2b3cea5fb723567be8 24-Mar-2016 Christopher Tate <ctate@google.com> Kill the real/isolated uid group, not the ApplicationInfo uid

Bug 19285814

Change-Id: I9921b71e50f1c20ff7b1394cbe4be94873de4f65
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
895314740072c4ccd317f646b5e8a226ae91afbf 21-Mar-2016 Jeff Sharkey <jsharkey@google.com> Merge "Mark even more Bundles as defusable." into nyc-dev
85941cff0c65bc023e4ca29c0eac8548c8f61be6 21-Mar-2016 Wale Ogunwale <ogunwale@google.com> Merge "Added support to specify animation duration when resizing stack" into nyc-dev
f0ec2e005083808bf68f9f0049b801276c290ae2 21-Mar-2016 Jeff Sharkey <jsharkey@android.com> Mark even more Bundles as defusable.

Bug: 27766193
Change-Id: Ib027ac7b40c7a575a76f289faabde9655338865e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e75a9adfbd37f9ec1a9324caceb9d5d7ceed217c 19-Mar-2016 Wale Ogunwale <ogunwale@google.com> Added support to specify animation duration when resizing stack

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

Bug: 27674339
Change-Id: I7bad27aaa19755a73c594e88b88b56db033e1a45
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8c536f91f1a72f671d41d54b3aeda4d70ee90d49 21-Mar-2016 Tony Mak <tonymak@google.com> Show work challenge directly when there is no device lock

The trick is to switch to home stack first and then start the activity
of the targeted task again to trigger the intercepting code.
And back button in the lock screen page brings user to launcher
instead of the work app.

Change-Id: Ic0305dbcb63fec2a8287b12f3e76e70d4268d423
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
03bdd9fa0e79aa7d4da5bc3704c74f575ab1bfa6 21-Mar-2016 Tony Mak <tonymak@google.com> Merge "Show launcher when profile is locked immediately" into nyc-dev
9c6e8ced9b6913657f48c38c208b1b594500c0e1 21-Mar-2016 Tony Mak <tonymak@google.com> Show launcher when profile is locked immediately

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

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

Bug: 27241680
Bug: 27673460
Change-Id: I765aa22d4c8ae5017c1611f5a340a4b33d463b1e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c7354fe2d4d73808929d2087f2d18ee3d8fa47fc 08-Mar-2016 Ruben Brunk <rubenbrunk@google.com> Notify VrListenerService when VR activity changes.

Bug: 27536964
Bug: 22855417

Change-Id: I67e1f8e6595332b3d768a99735bbd5fd38dffdc9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8a372a0a280127743ce9a7ce4b6198c7a02d2a4f 16-Mar-2016 Jeff Sharkey <jsharkey@android.com> Refactoring FBE APIs based on council feedback.

Mostly consists of removing the word "encryption" from most APIs,
since we can't actually make promises about the data being encrypted.

Bug: 27531029
Change-Id: Iace9d7c4e64716abf86ed11847c40f3947e1d625
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d136e51a99df5275eaafdde407e89e78c02b829b 10-Mar-2016 Jeff Sharkey <jsharkey@android.com> Defuse Bundles parsed by the system process.

It's easy for apps to throw custom Parcelables into Bundles, but
if the system tries peeking inside one of these Bundles, it triggers
a BadParcelableException. If that Bundle was passed away from the
Binder thread that delivered it into the system, we end up with a
nasty runtime restart.

This change mitigates this trouble by "defusing" any Bundles parsed by
the system server. That is, if it encounters BadParcelableException
while unpacking a Bundle, it logs and delivers an empty Bundle as
the result.

Simultaneously, to help catch the system process sticking its
fingers into Bundles that are destined for other processes, a Bundle
now tracks if it's "defusable." For example, any Intents delivered
through ActivityThread are marked as being defusable, since they've
arrived at their final destination. Any other Bundles are considered
to be "in transit" and we log if the system tries unparceling them.

Merges several Parcel boolean fields into a flags int. Add better
docs to several classes.

Bug: 27581063
Change-Id: I28cf3e7439503b5dc9a429bafae5eb48f21f0d93
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0b312332772ab53046865d4c9eef795875d6c425 15-Mar-2016 Amith Yamasani <yamasani@google.com> Merge "Removed an unnecessary log message" into nyc-dev
c0f7e5dbfaca252bab4fb8d4ef30435ab8ce02e7 15-Mar-2016 Amith Yamasani <yamasani@google.com> Removed an unnecessary log message

Change-Id: I381c46fd355fc5697531d0d6931a60def4ee1b89
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7400f82699c76618d5ca24d6528580afb4695dbf 15-Mar-2016 Adrian Roos <roosa@google.com> Merge "Don't show wallpaper when backdrop is visible" into nyc-dev
d5c2db630fc816e2d9154a61ccbd6770bc57cff8 09-Mar-2016 Adrian Roos <roosa@google.com> Don't show wallpaper when backdrop is visible

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

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

Bug: 27533740
Change-Id: I667c6f7ca6c0e1ff7e9f793c6ddc13f6da8387b1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8731408b11a24e3a92188653548f2c90bf866a32 12-Mar-2016 Jeff Sharkey <jsharkey@android.com> Offer to cache ContentResolver-related Bundles.

There are a handful of core system services that collect data from
third-party ContentProviders by spinning them up and then caching the
results locally in memory. However, if those apps are killed due to
low-memory pressure, they lose that cached data and have to collect
it again from scratch. It's impossible for those apps to maintain a
correct cache when not running, since they'll miss out on Uri change
notifications.

To work around this, this change introducing a narrowly-scoped
caching mechanism that maps from Uris to Bundles. The cache is
isolated per-user and per-calling-package, and internally it's
optimized to keep the Uri notification flow as fast as possible.
Each Bundle is invalidated whenever a notification event for a Uri
key is sent, or when the package hosting the provider is changed.

This change also wires up DocumentsUI to use this new mechanism,
which improves cold-start performance from 3300ms to 1800ms. The
more DocumentsProviders a system has, the more pronounced this
benefit is. Use BOOT_COMPLETED to build the cache at boot.

Add more permission docs, send a missing extra in DATA_CLEARED
broadcast.

Bug: 18406595
Change-Id: If3eae14bb3c69a8b83a65f530e081efc3b34d4bc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
95b69f82316220bc40d227bf7208920eb6ed9283 11-Mar-2016 Jorim Jaggi <jjaggi@google.com> Merge "Add ability to swap docked/fullscreen stack" into nyc-dev
d47e7e1176dcf6961c7c9fce215f48f03a5098d1 01-Mar-2016 Jorim Jaggi <jjaggi@google.com> Add ability to swap docked/fullscreen stack

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

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

Bug: 27358134
Change-Id: I34f39c53cacc0b9c00f87a792b88c3f64a5f61e1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d7924b60635d62f2df888b53dc3ef27d9947133c 09-Mar-2016 Suprabh Shukla <suprabh@google.com> Merge "Calling method in DPMS after resolving userId" into nyc-dev
8bea73e5c104670bf203d233167dafc14045683b 09-Mar-2016 Suprabh Shukla <suprabh@google.com> Calling method in DPMS after resolving userId

ActivityManagerService was calling
hasDeviceOwnerOrProfileOwner in DevicePolicyManagerService.LocalService
before resolving negative userIds to a real user. Moved the call to a point
when userId is already resolved.

bug: b/27538249
Change-Id: I760412978b3260523e9abcfe59d8e100ec4af12f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2d57bd2342b9a60ca9f65d61ee7ce43fa31949d3 09-Mar-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #27408705: Runtime restart: WATCHDOG KILLING SYSTEM PROCESS..." into nyc-dev
d5a3f3df4097e4a57e0d31fba994c91d8996abf8 09-Mar-2016 Paul Lawrence <paullawrence@google.com> Merge "Add API to IMountService to get encryption state" into nyc-dev
6e3eb8e5fd07c7396104f398966ad2be71caf8ee 08-Mar-2016 Dianne Hackborn <hackbod@google.com> Fix issue #27408705: Runtime restart: WATCHDOG KILLING SYSTEM PROCESS...

...Blocked in monitor com.android.s

There was a change awhile ago to make the IInstrumentationWatcher
callbacks synchronous, to avoid issues with them spamming non-responsive
watches and filling the binder transfer buffer. However, you can't
just do this, because the activity manager calls these with its
lock held.

To allow them to stay synchronous with the activity manager getting
blocked on the watcher, introduce a new thread for dispatching calls
to the watcher. This thread is created as needed, and dispatches
a queue of callback commands to make to instrumentation watchers.
The callback is still synchronous, so it won't dispatch a new one
until the previous completes.

Change-Id: I8384bd475a1a004c567a4ae20ea64385244f45c5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
20be5d62471d520eed3a52d90c11944464a71c07 26-Feb-2016 Paul Lawrence <paullawrence@google.com> Add API to IMountService to get encryption state

Bug: 18002358
Change-Id: If7d9c9a5ed38ac37849fcf638ec10c76d2f419a1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
943dedaf97eb0557cee4f639f2ffc050e2499ee2 08-Mar-2016 Suprabh Shukla <suprabh@google.com> Merge "Setting TaskRecord#mUserSetupComplete directly from Settings" into nyc-dev
7745c14aa0128da1358ec5d6e6ba4b609a5ac52b 08-Mar-2016 Suprabh Shukla <suprabh@google.com> Setting TaskRecord#mUserSetupComplete directly from Settings

TaskRecord#mUserSetupComplete flag was being set by checking
UserController#mSetupCompletedUsers which was being populated by a
callback which was getting delayed long enough for some tasks being
launched with mUserSetupComplete set to false, which is not expected for
any task other than Setup Wizard. This change checks the flag directly
from Settings before setting the property.

Bug: b/27455564
Change-Id: I9ae2e969b590a95f71002a54c7de224b26e9da79
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
984600566be81ffeb2e25b43c96f6d158e16fa99 08-Mar-2016 Chong Zhang <chz@google.com> Merge "Some fixes for black screen when pressing home button" into nyc-dev
d78ddb409a8499c391322dd1e2b2a97446f9603d 03-Mar-2016 Chong Zhang <chz@google.com> Some fixes for black screen when pressing home button

Pressing home button sometimes involves a rotation (eg. when app is
running in landscape mode but launch is fixed portrait mode). This will
trigger a screen freeze, which clears the transition. We still need to
add the opening app to the opening list even if transition is unset,
otherwise it doesn't wait for app to draw first frame.

Also during rotation, app, launcher and wallpaper all get relaunched.
The transition can't start until the first frame on the new launcher
window comes back. We can't start it based on the draw state of the old
window, because the old window could get removed and readded shortly
after we start the transition, and it shows up as a black frame.

bug: 27391256
bug: 27295820
Change-Id: I346685076657eef209d0fab68f272e218b55e011
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
875825d0c11f702cd17bd1086a031731d4795d58 08-Mar-2016 Ruben Brunk <rubenbrunk@google.com> Merge "Add a VR listener service." into nyc-dev
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/services/core/java/com/android/server/am/ActivityManagerService.java
2d4d61d3268a1f1af6b0835eb346bec587983050 06-Mar-2016 Jeff Sharkey <jsharkey@google.com> Merge "Skip publishContentProviders() when we have zero." into nyc-dev
3e1958936e9fbf853269200c00f8506d84d1a64d 06-Mar-2016 Jeff Sharkey <jsharkey@android.com> Skip publishContentProviders() when we have zero.

If the list of providers for the application being bound is empty,
don't bother trying to register them.

Bug: 27510621
Change-Id: I921fb70a4c97433fa123fa88e170745ee013ee35
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fdc5ba8f43e09cfbc8f5de0bf819b7684094953e 05-Mar-2016 Jeff Sharkey <jsharkey@google.com> Merge "Move more PM calls to ParceledListSlice." into nyc-dev
d5896630f6a2f21da107031cab216dc93bdcd851 05-Mar-2016 Jeff Sharkey <jsharkey@android.com> Move more PM calls to ParceledListSlice.

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

Bug: 27391893
Change-Id: Ie849ca30dbaaa91158da4c83675657715629a0ee
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e1fd7f09d5149055b8ad7bcf24846ecd8d87027a 04-Mar-2016 Suprabh Shukla <suprabh@google.com> Merge "Not clearing data for a package that is a DO or PO" into nyc-dev
2fad2ea0e622813ba153343e988da54ee1edbfc6 04-Mar-2016 Chris Tate <ctate@android.com> Merge "Don't use restricted backup launch mode for system-ish processes" into nyc-dev
d04525214b9a999339cd553a22b95b52debecde5 02-Mar-2016 Suprabh Shukla <suprabh@google.com> Not clearing data for a package that is a DO or PO

Added a check inside PackageManagerService to make sure data for a
package with a DO or PO for the running user is not cleared. Currently,
the 'pm clear' command goes through without any such checks.

Bug: b/27243904
Change-Id: I87d4ad2db031f47946f34627a5ee465ef144f85e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ac31e09ce919b0303f8c5ec9e6d68f858c98596e 03-Mar-2016 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #27381069: Master tracking bug: NYC is Sluggish" into nyc-dev
a49ad09c6f772fdbf829f85a6977fcde243c2b98 03-Mar-2016 Dianne Hackborn <hackbod@google.com> Work on issue #27381069: Master tracking bug: NYC is Sluggish

Have the activity manager us its own scheduling priority constants,
so that the new relative comparisons it is doing will work out
correctly.

Change-Id: I7bd1e5a3178ea491117bc497f87e4b75c92e0bc8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e8498cd0066113068f2b0294144837546f213bd1 03-Mar-2016 Todd Kennedy <toddke@google.com> Merge "Splits without restart" into nyc-dev
adef831761017d6d84d7bd4a388714a04fb73d66 03-Mar-2016 Rob Carr <racarr@google.com> Merge "Reimplement PIP animation to not use drag resizing." into nyc-dev
0d00c2e25bf8816dbd99f4fcd5c8221e80826a95 01-Mar-2016 Robert Carr <racarr@google.com> Reimplement PIP animation to not use drag resizing.

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

Bug: 26454664

Change-Id: Iac96619cefc075b1412cfeba3d3c9bcd7ce22f52
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
96700fc0dda2e09d18bcffd278bf888a3cb5b2ca 03-Mar-2016 Tim Murray <timmurray@google.com> Merge "Make sure perceptible services are in the default sched group." into nyc-dev
a8a6f6367e1f96c914736a37334c64aa7386b994 03-Mar-2016 Tim Murray <timmurray@google.com> Make sure perceptible services are in the default sched group.

bug 27381069

Change-Id: Ic3b9901a914020105bfa36a2c133a448f030da4f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9369efdf6a43d8fa0f82dcae651c76b85a5ea0ad 03-Mar-2016 Dianne Hackborn <hackbod@google.com> Work on issue #24403813: ANR traces are too heavyweight.

Most of the changes here are optional debugging output.

The actual functional changes:

(1) One of the ANR paths was not being dispatched on the activity
manager's handler, so it could execute concurrently with other
ANR collection, conflicting with the ANR file.
(2) Bumped up the timeout for trace collection from 200ms to
1000ms. This should fix problems where some process were not
being included, since once one of the collections times out we
can no longer keep synchronized with anything else after and
could end up with data getting corrupt or blown away.

Change-Id: If6828d2dea1a25cd6d2334a652b1b31654d9062f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3716e52be592482534943d32ba0f72309305a224 02-Mar-2016 Wale Ogunwale <ogunwale@google.com> Merge "config_supportsMultiWindow for device to specify multi-window support" into nyc-dev
57ef138cb7bfc24460369dc5aed70be8a8c49027 02-Mar-2016 Alan Viverette <alanv@google.com> Merge "Check process state when killing background processes for density" into nyc-dev
5d9de3ab6f768c9b9d5c4fa627ce019f74370531 02-Mar-2016 Chong Zhang <chz@google.com> Merge "Don't change resize mode if AM didn't dock the task as requested" into nyc-dev
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/services/core/java/com/android/server/am/ActivityManagerService.java
39bfee5e3674faea992c32204abc1c03429b8cda 24-Feb-2016 Todd Kennedy <toddke@google.com> Splits without restart

In specific cases [as determined by the installer], we can install
splits without restarting the application. The split must be purely
additive [i.e. it should not modify class(es)/resource(s) defined
in the base or other splits. Otherwise, the behaviour could be
inconsistent [e.g. if a modified class was already loaded, the
modified version won't be loaded until the process is restarted].
The platform does not perform any verification that the split is
purely additive.

Bug: 26463098
Change-Id: I3526c3b1b847a8e0afabc7a4787fa770422196b7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ecc41db6d278f84582f504c2527f46088d5bd97b 02-Mar-2016 Alan Viverette <alanv@google.com> Check process state when killing background processes for density

Previously, we were not killing many processes because we weren't in an
actual OOM condition. This CL moves the background killing rules to a
separate method and checks the process state. This removes the OOM
adjustment check and *will* kill persistent processes.

Bug: 27397233
Change-Id: Ibc21e97cfc729a0835e613095acd9a4b648906d8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f7d47f91feeffb75761b339cb14c631cc18d3728 02-Mar-2016 Jeff Sharkey <jsharkey@android.com> Start unaware persistent apps after user unlocked.

Otherwise we'll never start them. In particular, this fixes NFC.

Bug: 27360562
Change-Id: I9d430b1e377e63b35060b234f585ac180a369ad2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8e28443aa7263d4d7a78f39fab32176505e3506d 02-Mar-2016 Jeff Sharkey <jsharkey@google.com> Merge "Utility to detect lock inversions in system." into nyc-dev
e4fbd328f83ea0ee086731f852cd6c56a3deb733 01-Mar-2016 Chong Zhang <chz@google.com> Don't change resize mode if AM didn't dock the task as requested

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

bug: 27390258
Change-Id: I72d671ac015f93fde5aaa025fbade93acd9d9ca7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e5ad41bc022db99c4f6663da0a9e49356c006741 01-Mar-2016 Dianne Hackborn <hackbod@google.com> Fix issue #27317952: PendingIntent.getIntent() should be protected

Change-Id: Ib05135cd94f5251942a6fc6df542ed39083f7827
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4ebf6dd961bf4f5ee0577af0cf8221af65f8c017 01-Mar-2016 Christopher Tate <ctate@google.com> Don't use restricted backup launch mode for system-ish processes

We now impose restricted launch behavior and lifetime only on "ordinary"
apps' backup/restore operations. System-ish targets such as the telephony
provider continue to get their full Application instance and providers,
and won't get killed following conclusion of the data-moving operations.
Such customers of backup/restore are expected to be able to deal
gracefully with this sort of thing.

Bug 27362301
Bug 27076602

Change-Id: Ib62483b8469cc750a20f80b7c596ad486a397564
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
72041bb2c6cbdab53f00d23cd7f832acf2cbfb5d 01-Mar-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #27385109: control activity behavior without triggering..." into nyc-dev
414c529a4f3d8aa50df6e3615d2084ac1089de85 29-Feb-2016 Colin Cross <ccross@android.com> Merge "Add dumpsys meminfo --unreachable" into nyc-dev
4a18c26609df2c4230885acb64e92fb51aba70df 27-Feb-2016 Dianne Hackborn <hackbod@google.com> Fix issue #27385109: control activity behavior without triggering...

...isUserAMonkey for testing purpose

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

Change-Id: I0e149a8d78776abaf07517bd4ae886047b7f4252
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3d1cb6a2b6882a9b702fc97aa50b2d5779956492 28-Feb-2016 Jeff Sharkey <jsharkey@android.com> Utility to detect lock inversions in system.

This change adds a new LockGuard utility class that can be used to
detect lock inversions across the system server. For example, if a
thread is trying to acquire the ActivityManager lock while holding the
PackageManager lock, it will yell.

This class requires no prior knowledge of locks or their ordering; it
derives all of this data at runtime. However, this means the overhead
is substantial and it should not be enabled by default.

Adds overrides to ArrayMap and ArraySet to use identityHashCode()
instead of the hashCode() provided by the object.

Bug: 27336728
Change-Id: I26c31bc99fe8d61ff13c3455aaeddd5517e44433
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
a8914a00969b6942211d29fd923b0692a1b70f9a 26-Feb-2016 Jorim Jaggi <jjaggi@google.com> Merge "App transition delay tracking" into nyc-dev
275561a74677f9d6c8f3f2cebc3cfea416ca586d 23-Feb-2016 Jorim Jaggi <jjaggi@google.com> App transition delay tracking

Add TRON logging for all kinds aspects when we execute an app transition.

Bug: 27295491
Change-Id: Icb0cbdb92d4d5fbfedadd40a017a50eb217058aa
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
970510b9c5299d480b3ec7f8403afd8265456f87 25-Feb-2016 Dianne Hackborn <hackbod@google.com> Work on issue #26390161: Throttle syncs/jobs when system is low on RAM

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

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

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

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

Also improved some of the dumpsys output.

Change-Id: Icc95e42231a806f0bfa3e2f99ccc2b85cefac320
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4afad11ac84f9aa2efed30402bd9e4b792f9a44b 24-Feb-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #27289462: Alarm clock not working on NRC49C" into nyc-dev
1ddda4793c26fd249590fd3549cf060ecb7c157b 12-Feb-2016 Lenka Trochtova <ltrochtova@google.com> Prevent ephemeral user from being re-entered after stop.

Once the ephemeral user stops, the user's deletion is scheduled.
It takes a while before the user actually disappears and it is not
desirable for the user to be re-entered in the meantime.
Mark the user as disabled on stop and check this flag
in the activity manager to prevent the user from being switched
to again. Also hide the user from user-switching UI.

BUG: 26795729
BUG: 26780152

Change-Id: I83a61674958954b5a210114b88ffa5ae55922c1f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
99fbf926d977740e7cf64e136cab39d4c7da760d 24-Feb-2016 Dianne Hackborn <hackbod@google.com> Fix issue #27289462: Alarm clock not working on NRC49C

Don't really want the system to crash.

Change-Id: I4b8ebca00a4e6a7d67717baf7267165de9e8afb3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5dea9e79c240064526a2a20931e1fc9e0eea89f0 23-Feb-2016 Jorim Jaggi <jjaggi@google.com> Merge changes I78305f7f,I6faf0167 into nyc-dev

* changes:
Fix disappearing windows after moving divider to side
Recents transition fixes
8fa4522b24065d15535e17eed7cd5370b878a4c5 20-Feb-2016 Jorim Jaggi <jjaggi@google.com> Recents transition fixes

- Make sure to destroy the saved surfaces while we resize a task. The
usual destroying mechanism doesn't work here because we don't add the
windows to WMS.mResizingWindows.
- Make sure not to save the surface when a resize happened after the
window has been marked as gone (exiting). In this case, we resize the
task, so we add the window to mResizingWindows, but then when we don't
layout the window because win.isGoneForLayout() == true, so it would
save a surface that has the wrong size.
- Ensure the configuration of the top task when dismissing the docked
stack. First, this speeds up when the user navigates to it in the
fullscreen stack. Second, it fixes some other weirdness with saving
surfaces.
- Only exclude windows from layout when hidden is requested, so when
transitioning from hidden -> shown, the app immediately gets the
updated size when the task was resized when the window was hidden.

Bug: 27276087
Change-Id: I6faf016724136d984b259d184af58d41684f3425
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
76c970de3ce83609f48531e8ea23e7973544b179 23-Feb-2016 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #26695393: Remove NEW_PICTURE and NEW_VIDEO broadcast" into nyc-dev
827d0d06e6904a0ca09354a030e6e4bbe66354d3 23-Feb-2016 Suprabh Shukla <suprabh@google.com> Merge "Moving recent tasks and images to /data/system_ce" into nyc-dev
ba212c6bef6bc3601e95b0360088573097e52401 18-Feb-2016 Tim Murray <timmurray@google.com> Bind background services to the top app correctly.

bug 27187310

Change-Id: I7d1ff989d7d36319b12dc20e3b25a47303729600
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
45ecf29484b7919886eaf62e39622cf557cc915b 22-Feb-2016 Dianne Hackborn <hackbod@google.com> Fix issue #26695393: Remove NEW_PICTURE and NEW_VIDEO broadcast

Ignored! Removed! A non-broadcast!

Any attempt to send these will be silently (except a log)
ignored.

Change-Id: Ia19357d4c90fdcd18e45f2b41c57e654ef94edb1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4bccb46554d9fd0d7de44e069d67af970d178a0b 11-Feb-2016 Suprabh Shukla <suprabh@google.com> Moving recent tasks and images to /data/system_ce

Moved user sensitive recents data to the credential encrypted directory
/data/system_ce. Since this directory is not available before the user
is unlocked, and unavailable task ids are needed to be known before
assigning an id to a new task, this change adds a file in /data/system_de
for each user, to store the ids of the tasks present in /data/system_ce.

Bug: b/24569398
Change-Id: I340d1abe23e2594e2cee4bff89a697bd8dc61fc7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b2117d15d196dc29e4fc50d70cd8a10a04492e9c 17-Feb-2016 Dianne Hackborn <hackbod@google.com> Implement lenient background check option.

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

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

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

Change-Id: I7f5a50b52881b5c8f9d8b6c8c622d3652a769fd7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
935dafbf0d69e183cfdbd5f24e53ee925bd072f5 20-Feb-2016 Jeff Sharkey <jsharkey@android.com> Relax protected broadcast check to allow shell.

The shell is often used for developer testing, so we shouldn't
require all of its broadcasts to be protected.

Bug: 27273532
Change-Id: Ic6f262dd11223dee5655614aad30365d51e180c5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c4fb5f9d4b8012bc007f0c7e472d4ff4801254f5 03-Feb-2016 Colin Cross <ccross@android.com> Add dumpsys meminfo --unreachable

dumpsys meminfo --unreachable will search the native heap for
allocations that are unreachable.

Bug: 27208635
Change-Id: I40ab1c261cb222ca71d04ab8408f355bcb18ed94
(cherry picked from commit 84b1e3554b36b7fbccf57330c93bf484985ae3d6)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b3cbbde740e4f1a75d8190ca547be906b08d0195 18-Feb-2016 Tim Murray <timmurray@google.com> Fix TOP_APP description in dumpsys activity.

bug 27187310

Change-Id: I65ae24ba04ab3d13ca2fc9ba4088e57d8935b924
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7998e48ce3240d09f28cd365fb6ba58f8987470f 13-Feb-2016 Jorim Jaggi <jjaggi@google.com> Fix unlock transition when docked stack is visible

- Keep surface of docked divider when lockscreen is showing, like
all other apps, so we don't run into synchronization issues when
unlocking. We do this by setting policy visibily to false, but
keep clientVisibility=true
- Update docked stack visibility when starting unlock sequence to
visible.

Bug: 27154882
Change-Id: I6def5c18831e23579fcfc904133749f149eaf376
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7367ed84a5508b4190858191a975783744a76a1d 16-Feb-2016 Michal Karpinski <mkarpinski@google.com> Whitelisting remote bugreport finished broadcast

Allowing remote bugreport broadcast to be delivered even if
DISALLOW_DEBUGGING_FEATURES user restriction is enforced.

Bug: 26814173
Change-Id: I2f574de261398adbd71d5f75b3c237c92aeb076c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5a21494d6eafce44adc95e1bf2a67658fa752196 16-Feb-2016 Wale Ogunwale <ogunwale@google.com> Merge changes from topic 'flaky-test' into nyc-dev

* changes:
Fixed issue with losing window name when copying WindowManager.LayoutParams
Added AM API to remove a stack
Don't resume activity on start if there are activities pausing.
06e8ee0c8ad2527add3db3dd1a1d4eee9d8631f8 12-Feb-2016 Wale Ogunwale <ogunwale@google.com> Added AM API to remove a stack

Use the new API when closing Pip.

Bug: 26982752
Change-Id: I074d23b5535a4534626183ab77142d3932a803f0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
37fc7a7fc0aefc44162fa38d49d3079ced899f26 16-Feb-2016 Jeff Sharkey <jsharkey@android.com> More protected broadcasts.

These actions are owned by the system and should not be sent by
third-party apps for security reasons.

Bug: 27171917, 27169730, 27172357, 27163393
Change-Id: I3161cd3c1c37d26a92723b22878dc5aef6f30c47
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c2ba290716a17474eb50b853158516712ba36dd8 11-Feb-2016 Gustav Sennton <gsennton@google.com> Merge "Allow using USER_ALL as user id when killing package dependents." into nyc-dev
b7521b31748af4e1932f45fb9e711bfde0c074b1 11-Feb-2016 Wale Ogunwale <ogunwale@google.com> Fixed permission issue with AM.setFocusedStack/Task APIs

- Check for MANAGE_ACTIVITY_STACKS permission when AM.setFocusedStack
or AM.setFocusedTask is called.
- Clear calling identity when AM.setFocusedStack is called.

Bug: 27135250
Change-Id: Ib082bc6cd03411c4cbf741e5bdcec54679441eff
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0489c1459efdfd65586d4a70bed2e11b308d7fd2 10-Feb-2016 Wale Ogunwale <ogunwale@google.com> Merge "Reduce jank during pinned stack animation" into nyc-dev
950b30426e24bb38b7b2ffb461dc0b46e79b35d1 10-Feb-2016 Jeff Sharkey <jsharkey@google.com> Merge "More encryption-aware triaging." into nyc-dev
c7bacab20fa8a0e603726f4f8ebafd3a96babeb1 09-Feb-2016 Jeff Sharkey <jsharkey@android.com> More encryption-aware triaging.

Most of these callers are okay having results omitted when a package
is uninstalled or encryption unaware. For example, jobs and
notifications can only be enqueued by already running apps.

When clearing zen rules, keep around rules inserted by apps on
ejected external storage devices.

Make ServiceWatcher stricter by requiring that the matching package
be in the system image.

Bug: 26471205, 27105254
Change-Id: Ie41ea8042ac1a54e9cbe0c35cec89e70521e9bed
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
480dca0d1b08f8895f66f857e9bd341033fab2d9 06-Feb-2016 Wale Ogunwale <ogunwale@google.com> Reduce jank during pinned stack animation

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

Bug: 25672053
Change-Id: I82399c10f1b8c675ea3861ba973dc8ecfbfbe50f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
23875b2657b24864cf5e5e8e22dfb409cde4f2a0 09-Feb-2016 Gustav Sennton <gsennton@google.com> Allow using USER_ALL as user id when killing package dependents.

Don't check package uid when trying to kill app dependents for all users
since that check will always fail.

Bug: 26973351
Change-Id: I52b28fe82791887e2af5f937afdfff6e5d565d6e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c61e102474c1fe0e16503856531106f8bff9e36b 09-Feb-2016 Martijn Coenen <maco@google.com> Merge "Fix dumpsys meminfo -c output." into nyc-dev
faeb3eb0ba190e6d6cfe2b82ce20af587848de57 08-Feb-2016 Paul Crowley <paulcrowley@google.com> Password security for FBE disk encryption keys

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

Bug: 22950892
Change-Id: Ie13bc6f82059ce941b0e664a5b60355e52b45f30
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6f4a2ce5a542020572808d26a2a8e6c7186080ef 05-Feb-2016 Martijn Coenen <maco@google.com> Fix dumpsys meminfo -c output.

Also, this is supposed to be a "machine-parseable" format,
but it's not versioned at all. Added a version field so we
can change the format in the future if desired.

Change-Id: I6aa8ea46e030def04dc10634d01557a044545a9b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b7289330e1ae201691dc5b2aa2b6b3a65795e4cb 07-Feb-2016 Jeff Sharkey <jsharkey@android.com> Another intent sent by both system and apps.

Bug: 26219772
Change-Id: I4e52c6836e65b983800ef59ad7a1ade5b3a2bea2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
25222f55f28221d49a984db465f94e9716635ad8 06-Feb-2016 Tamas Berghammer <tberghammer@google.com> Merge "Add flag to "am start" to enable native debugging"
39d1b5b0f74962a4f2a6b8125f841ecf6e7cb2ee 05-Feb-2016 Wale Ogunwale <ogunwale@google.com> Merge "Exclude tasks manipulated before user setup is complete from Recents"
9884eaadd36907f2510d2ebbe0830e59efd84a75 05-Feb-2016 Wale Ogunwale <ogunwale@google.com> Merge "Do not recursively call setFocusedActivityLocked()"
c9088c5d1b1fdba84c151355d95715e86d72b688 05-Feb-2016 Roozbeh Pournader <roozbeh@google.com> Merge "Various LocaleList cleanups"
3aa28b28fdc33c08d75fe7c75e77a1b4c32b89ba 05-Feb-2016 Chong Zhang <chz@google.com> Do not recursively call setFocusedActivityLocked()

This could potentially cause AM to set focus back to the top running,
and lead to inconsistent focus in AM and WM.

Also add some warnings to watch out for such cases.

bug: 26819496
Change-Id: Ie3fceeddedec4f2103a427989c9543cb3e9ff8f2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f80170f455c269b8e0264a5441770faf39e69416 05-Feb-2016 Wale Ogunwale <ogunwale@google.com> Exclude tasks manipulated before user setup is complete from Recents

We don't want any tasks manipulated before the user is done setting-up
their device included in the tasks list we give to the Recents activity.
However, the task can be included back in Recents if it is manipulated
after the user set-up is complete. E.g. you go into the gmail activity
during setup the task will be exclude, but if the user goes back into
gmail after setup then we start including the task.

Bug: 25959392
Change-Id: I421d48f0a9bcfc782d1ef19aa2f63e8b34a668e2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fee44846376c212114223fc4259382921e6dca7a 05-Feb-2016 Roozbeh Pournader <roozbeh@google.com> Various LocaleList cleanups

- Remove the LocaleList#getPrimary() API. It had become confusing
after locale negotiation was completely implemented. For example,
it could create the confusion that calling getPrimary() on the
default locale list would provide the default locale, etc.
- Use the adjusted locale list from LocaleList.getAdjustedDefault()
in Paints created with no locale list provided.
- Change LocaleList#get() to treat out of bound indexes from both
negative indexes and too large indexes the same way.

Bug: 26984092
Bug: 26193251
Bug: 26834387
Change-Id: I75f77aea6b75e38793ed8477e5e5a4420d5e6d85
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
067e817585524aeb0fb2c5ff4444c21fadc3f0d3 04-Feb-2016 Jorim Jaggi <jjaggi@google.com> Only treat "null" bounds as fullscreen

When long pressing on the recents button, we made it one pixel smaller
than fullscreen so we don't dismiss the stack immediately again.
However, this is a huge hack, and lead to problems with navigation bar
background because there we actually rely on the fact whether
the window is fullscreen or not to determine whether to draw the
navigation bar background, which lead to flickering.

Bug: 26777526
Change-Id: Ifdfcf3ad4138bc88c5164177cd20f1ff1635085f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3db779646151123073db918869125bd66135fcbb 04-Feb-2016 Alan Viverette <alanv@google.com> Use correct condition for killing background processes

Bug: 26881641
Change-Id: Iccb0f48497e5a2023543d73b5c2067e5edaf717e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2aa46d43257ed724298faece0726cebbaff4cbe3 04-Feb-2016 Alan Viverette <alanv@google.com> Kill background processes targeting SDK < N on density change

Bug: 26881641
Change-Id: Iea8e95e550e2ca32f15c2bdaa14b6bf81f06a477
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
086e09ff605f7ca26c6562f4c00b1fe0c647909f 02-Feb-2016 Tim Murray <timmurray@google.com> Merge "Add specific category for TOP_APP in ActivityManager."
9349e65a2d7741816f9abf41a966f20aa12fb42d 30-Jan-2016 Jorim Jaggi <jjaggi@google.com> Reset create state in moveTaskToStack

One could call moveTaskToStack with DOCKED_STACK as argument. In that
case, we also need to set the create state so it resets it to
something sane.

Change-Id: Ie6c1ea33e4ec3c4cd2a935dc186d2b496289946f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3b93a4d351aeb154fba8a4b2fa66ca25a951993d 30-Jan-2016 Wale Ogunwale <ogunwale@google.com> Renamed Activity class multi-window APIs

As requested by API council.

Bug: 26507736
Change-Id: I2a87c5eb3c1b48d52703103c2a4f72c250a9a827
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
2e4089478f5c711340e3c5b43aba364ee6eb5de2 29-Jan-2016 Wale Ogunwale <ogunwale@google.com> Merge "Use resizeMode integer instead of resizeable boolean."
a481b48dcfadc0aeaabeed0d0e35c4117840365d 29-Jan-2016 Adrian Roos <roosa@google.com> Fix NPE when logging a WTF in unknown process

Bug: 26873463
Change-Id: I548c10b43f5784152b9227926aa37170fd9fd78f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b1faf60b896afe235175354ffd90290ff93a54b4 27-Jan-2016 Wale Ogunwale <ogunwale@google.com> Use resizeMode integer instead of resizeable boolean.

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

Bug: 26774816
Change-Id: I8cef46d9fba6bfdd21df7da63ed5d5330ad03d4b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f7d6fa4c47a7ecd606181049d0f6c5d1fc0d3870 28-Jan-2016 Adrian Roos <roosa@google.com> Merge "Add foreground status to crash report"
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/services/core/java/com/android/server/am/ActivityManagerService.java
1e7b0cdec760af6f6c1a03d57484586a12cda44a 27-Jan-2016 Adrian Roos <roosa@google.com> Add foreground status to crash report

Bug: 22692162
Change-Id: I9109968d69460359c0ab55eb55b271c1ac09cce6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
20d7df3c3ff0000678a208b25fcf7ddf90c5abe4 12-Jan-2016 Adrian Roos <roosa@google.com> Crash dialog improvements, move crash code to AppErrors

Factors out the crash and ANR handling code into separate
class and allows clearing cache and restarting app from
crash dialog.

Bug: 22692162
Change-Id: I2a08a4255ea02ab3c7441d351bf278128fcf5a5d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4ccec532d704725cd6115c220f56330edf101674 13-Jan-2016 Andrei Stingaceanu <stg@google.com> Hide suspended apps from recents

* Introduce a new boolean realActivitySuspended in TaskRecord to
keep track of the suspended state (this also makes sure the
information is persisted across reboots).
* Introduce a new method onPackagesSuspendedChanged
in RecentTasks which flips the realActivitySuspended for each
TaskRecord for the desired user and packages sent
* Register a new broadcast receiver (for SUSPEND/UNSUSPEND)
in ActivityManager#finishBooting which calls
RecentTasks#markPackagesSuspendedStateForUser
* In ActivityManagerService#getRecentTasks filter out
Taskrecords for suspended apps by checking realActivitySuspended

Bug: 22776761
Change-Id: I52e3593ccb2dae223d1ea11d017a6b1626646639
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cc25a8a24ea85409f440c052fdf36dc304cd7111 23-Jan-2016 Wale Ogunwale <ogunwale@google.com> Send notification we attempted to start an already running pinned acitvity

API will be used by Android TV sys-ui to decide what to do next with the
Pinned activity.

Bug: 26452296
Change-Id: I5411515d079468616422ba9e5093164a924cd6a2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
67a55fdb05b8f9b178de0f9e650a2ed1aa661b7f 25-Jan-2016 Adrian Roos <roosa@google.com> Merge "Prevent crash and ANR dialogs in VR mode"
86b867fd45ce97f7ebe374396e91e679adf8633d 30-Dec-2015 Casey Burkhardt <caseyburkhardt@google.com> Adds Settings.System.FONT_SCALE observer to ActivityManagerService

Changes to Settings.System.FONT_SCALE were not being handled by any service,
which required a device reboot for any changes to take effect. Changes to
this field by the Settings app worked as expected only because it is able to
poke ActivityManager with an updated configuration, whereas unbundled
applications cannot.

This also ensures the setting value is backed up and doesn't conflict with
a configured value from accessibility onboarding during restore.

Bug:23033258
Change-Id: I98d4aed2f9f5893d054e6b10c4dfda406de8eba2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0af6fa7015cd9da08bf52c1efb13641d30fd6bd7 18-Jan-2016 Amith Yamasani <yamasani@google.com> Voice Interaction from within an Activity

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

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

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

Bug: 22791070
Change-Id: Ib1e5bc8cae1fde40570c999b9cf4bb29efe4916d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
731bf243eef39e6a80d74927229abd4f3cd63dd6 22-Jan-2016 Suprabh Shukla <suprabh@google.com> Merge "Minor fixes"
ece6a22f00de4ab815588e2f7951203adcd2b9c4 14-Jan-2016 Tim Murray <timmurray@google.com> Add specific category for TOP_APP in ActivityManager.

Differentiate the top app from other foreground apps in
ActivityManager. This lets us place the top app in its own cpuset, where
it can have its own exclusive core.

Change-Id: I90f5c39272724db37f0da226785b03d08e2e04c4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b3ced57764613d050050284049d14fcb0b252330 21-Jan-2016 Clara Bayarri <clarabayarri@google.com> Fix missing clear identity in AMS.AppTaskImpl#moveToFront

Bug: 26683257
Change-Id: Ic70864aa3e33a5362278b498e2763ce8a70e8fe4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7f70d43885fe9444fc8b0e9b0ddb3dcf050a1613 11-Jan-2016 Rubin Xu <rubinxu@google.com> Log app process start from ActivityManagerService

Information about app process start is logged to the security buffer
as part of the device owner process logging feature.

Bug: 22860162
Change-Id: I752fd3196845577c7c39d9d6b109e7d18b197322
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f5bf0cb2019d25de1a514206caca3fee0f3f8bc7 20-Jan-2016 Suprabh Shukla <suprabh@google.com> Minor fixes

Added a synchronized block around a locked method call, updated javadoc
for a method in RecentTasks.

Change-Id: Ie58ac1d1755485902dbb453eb72a1291f9e65861
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4752ab714dc721c2f17a8104cc327e1c711a2640 19-Jan-2016 Gustav Sennton <gsennton@google.com> Merge "Change API for killing app-depentents to also kill main app."
f0649ceb809ac543c6c38a21ac521a162477d927 14-Jan-2016 Clara Bayarri <clarabayarri@google.com> Work Challenge unlock to home instead of locked app

When a Work Challenge is in place and we are unlocking the device
to a foreground work app that should be locked, take the user to the
home screen instead to avoid them seeing two lock screens in a row.

Bug: 26579952
Change-Id: I6220aac730fbb1da3c3042d0f232cb9cbb18ec4b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3ee3b9d17b2aec84e791f3efa6b9453cab0d9c9b 16-Jan-2016 Suprabh Shukla <suprabh@google.com> Merge "Keeping only running users recents in memory"
09a88f5f3e7d4a3bbfce04ac06594ac590c67d27 02-Dec-2015 Suprabh Shukla <suprabh@google.com> Keeping only running users recents in memory

Currently, all the users' recent tasks are loaded into memory and kept
in sync with the persistent storage. This changes the system so
that it loads a users recents into memory lazily (i.e. when
getRecentTasks is called for that user) and unloads them from the
memory as soon as the user is stopped. This also required bucketizing
the taskIds per user, so that the next available taskId can be assigned
without having knowledge of all the tasks that are stored away in
persistent storage but are not available in memory.
Bug-Id: b/24569398

Change-Id: Ia5cb64d9f4ee727225dce34e45ca63e946ac27a8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
12cde00dc03ec802801b8fd7611c1706ab7d4363 16-Jan-2016 Jeff Sharkey <jsharkey@google.com> Merge "Prepare app data only when storage is available."
0e62384ccbd00e9f78851929ca88b919679ee32e 14-Jan-2016 Jeff Sharkey <jsharkey@android.com> Prepare app data only when storage is available.

Before this change, scanning a package aggressively tried checking
to ensure that private app data was prepared. However, in an FBE
world we may not have access to that data at scan time. So this
change shifts the preparing of private app data until later: it
prepares DE storage when a user is started, and CE storage when a
user is unlocked. Wire ourselves into the user lifecycle so we can
prepare storage at both user start and unlock.

When DE/CE storage becomes available, this change reconciles any
found packages against known installed apps, and deletes any orphaned
data directories.

We now need to store the last-restorecon hash in an xattr on a
per-user directory basis, since we can't restorecon CE storage until
it's unlocked, or adopted storage until it's mounted. Remove a
bunch of used logic for loading dynamic SELinux policy at runtime;
our policy always comes from the system image.

Bug: 26466827, 26544104
Change-Id: I8d0a4ef862c35f4e4ef5c7f20d3bb8f12ba3fd4b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2fd3f122bfb3557f3324a480e09c8777eaf53b6f 15-Jan-2016 Wale Ogunwale <ogunwale@google.com> Merge "Allow AMS.moveTasksToFullscreenStack moving tasks onTop"
9101d2664388e234de1a2b3fd9e82fd777c1c407 15-Jan-2016 Wale Ogunwale <ogunwale@google.com> Allow AMS.moveTasksToFullscreenStack moving tasks onTop

Bug: 26573473
Change-Id: I4517ac2b3e803637971c329be2511ba66412d815
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c30647736b012d11e56653d5d1b4cff930fa1c9e 12-Jan-2016 Adrian Roos <roosa@google.com> Prevent crash and ANR dialogs in VR mode

Bug: 22692162
Change-Id: I81a3653113f5af744da67e49cb0efc3808783299
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1c7e9ff4a7f11a9f73db0b8e2eb667a049611e49 15-Jan-2016 Gustav Sennton <gsennton@google.com> Change API for killing app-depentents to also kill main app.

In the case where we switch WebView provider we also want to kill the
provider itself in the cases where we want to kill its dependents. This
so that the provider's processes are consistently loading code in the
same way (i.e. either all processes use the webview implementation, or
none of them do).

Bug: 25338573

Change-Id: I2baf7ce1204fb6312a6ad10fa006b789c8ece176
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
63fec3ef1adb6c447cd505679714a8e780d18263 12-Dec-2015 Christopher Tate <ctate@google.com> Don't full-data back up apps in foreground-equivalent state

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

Bug 25960428

Change-Id: I576f25c6fb07545565f59bd685624c612b9c5ffd
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c1a1823cb89052be3c7c941ca3d0279616b15783 13-Jan-2016 Thierry Strudel <tstrudel@google.com> Merge changes I96415ec6,I5d3aa7f9,I6294915e,I361928c0

* changes:
Report SwapPss in dumpsys meminfo when requested and available
Report SwapPss in am_pss reports
Add Swap and SwapPss to meminfo checkin dump.
Report SwapPss usage if available as part of Pss
fdeeeea6cfdebdb98dd70a7dd48965743af01750 12-Jan-2016 Jeff Sharkey <jsharkey@android.com> Follow installd changes, throw exceptions.

Start by passing down flags to work on both CE and DE storage areas;
a future change will refine this further.

Force consistent argument checking and null handling for all
installd callers. Throw explicit exceptions instead of returning int
values that can accidentally be ignored.

Bug: 26466827
Change-Id: Iddb591f6b3c7786d210d3f132ff7f9886a97b749
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b5f07f868b13ff59c7fe882ff711492a77f8b310 12-Jan-2016 Jeff Sharkey <jsharkey@android.com> Don't spin up encryption unaware providers twice.

Bug: 26503591
Change-Id: I31b92f3a31103dffb17de8ac8d887d864cb0de28
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5aa3c441cf14a3fa436a0c3760a3922b50e3ea13 19-Dec-2015 Thierry Strudel <tstrudel@google.com> Report SwapPss in dumpsys meminfo when requested and available

When requested (-a or -S options), add to the meminfo dump the
proportional swap when available to the system. The reported amount is
the PSS memory not having being accessed recently and being swapped out
of memory.

Total PSS by process:
76,265K: system (pid 912) ( 290K in swap)
67,080K: com.android.systemui (pid 3133) ( 270K in swap)
...
Total PSS by category:
287,803K: .dex mmap ( 0K in swap)
264,575K: Native ( 25,184K in swap)
241,077K: Dalvik ( 9,391K in swap)

Bug: 26190445
Change-Id: I96415ec65b60c9f60e397d2b3acca9a6e1399aba
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f0a44183cd49cd937bf6c4f17f20fd615e441dc4 08-Jan-2016 Thierry Strudel <tstrudel@google.com> Report SwapPss in am_pss reports

Change-Id: I5d3aa7f9d4b7b0b167ec214fa50fdf665cdc328f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
41f94edd5af600bff9856b6a5471a1e61935f78b 14-Dec-2015 Martijn Coenen <maco@google.com> Add Swap and SwapPss to meminfo checkin dump.

And make --checkin an accepted argument.

Change-Id: I6294915ec02c49415c7071f54ad995aa76b67e6c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
951bc3b5141cdc0ae7993d88e1ab249e699bcbba 12-Jan-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "Update Activity Manager to prevent popups while driving."
9229ee595988c66f1c59409a963fef88b2c30e03 12-Jan-2016 Jeff Sharkey <jsharkey@google.com> Merge "Install non-EA providers once user is unlocked."
303210bbdd2740a9b94ba9a9c10188acd950068f 09-Jan-2016 Filip Gruszczynski <gruszczy@google.com> Start recents when bringing docked task to the front.

We don't want the docked activity to be on top by itself, so we need to
force the recents to come up to.

Bug: 25838525
Change-Id: Icb8184db5cc67e536561674b887bf481595257cc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2bd31dbd023a11d90061c7b6831dd06454c928af 10-Jan-2016 Jeff Sharkey <jsharkey@android.com> Install non-EA providers once user is unlocked.

When starting encryption-aware apps while the device is locked, we
can only spin up ContentProviders that have been marked as
encryption-aware. Once the user is unlocked, we need to go back and
install non-encryption-aware providers in already running apps.

Fix bugs in getPackageInfo() where only one of the various MATCH_
flags was being consulted (!). Move matching logic to single unified
location in PackageUserState so we have consistent behavior.

Fix another class of bugs where Safe Mode wasn't correctly filtering
package details (!). These bugs are fixed by splicing in the new
MATCH_SYSTEM_ONLY flag as part of state-based flag mutation that was
added for encryption.

Bug: 25944787
Change-Id: I39c8da74b1f9ba944cc817176983f50ba322329c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cd65448ccd13c4c2d0fe9e9623fec3a898ab9372 09-Jan-2016 Jeff Sharkey <jsharkey@android.com> Even more PackageManager caller triage.

Finish moving all UID/GID callers to single AIDL method that requires
callers to provide flags.

Triage AppWidgets and PrintServices, which currently can only live on
internal storage; we should revisit that later.

Fix two bugs where we'd drop pending install sessions and persisted
Uri grants for apps installed on external storage.

Bug: 26471205
Change-Id: I66fdfc737fda0042050d81ff8839de55c2b4effd
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0ab0bdde2b39c77175d9e0d69d6631e130e4b5ac 09-Jan-2016 Jeff Sharkey <jsharkey@google.com> Merge "More progress on triaging PackageManager callers."
c5967e9862489024c932b0c7fcb84ed0af2a7fd7 08-Jan-2016 Jeff Sharkey <jsharkey@android.com> More progress on triaging PackageManager callers.

Catch a bunch of simple cases where the PackageManager flags are
obvious. Add the ability to use the MATCH_SYSTEM_ONLY flag on
PackageInfo and ApplicationInfo queries.

Re-examine recent tasks after a user is unlocked, since some of the
activities may now be available and runnable.

Bug: 26471205, 26253870
Change-Id: I989d9f8409070e5cae13202b47e2c7de85bf4a5b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8e25f731d32c8623b5518be1b1529faeebffa1e8 08-Jan-2016 Filip Gruszczynski <gruszczy@google.com> Short-circuit AMS.setFocusedTask if the task is already focused.

Bug: 25236192
Change-Id: I369d3815c171ccef99d7dbe68dfb2b1f61be65dc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
42efc5860ffd130d28b780125e13c44a19848154 08-Jan-2016 Michal Karpinski <mkarpinski@google.com> Merge "Adjusting AMN#requestBugReport() to be able to invoke 3 types of bugreport services"
1a7d98b76c96a1214630b643c5519affe62badde 08-Jan-2016 Felipe Leme <felipeal@google.com> Merge "Added new API for URI permissions management."
3da5c97460d859ec6d9e5fffb3902a3242d32bf4 11-Dec-2015 Michal Karpinski <mkarpinski@google.com> Adjusting AMN#requestBugReport() to be able to invoke 3 types
of bugreport services

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

Bug: 26152603
Change-Id: Ife9bbef4691e172fb56b72b256880f0d4ad4d198
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
66d298cab52377c9880fe19ce2dc65889692817d 08-Jan-2016 Thierry Strudel <tstrudel@google.com> Merge "Do not account ZRAM physical memory as Lost RAM"
8dcf59d67bcf97be40ceffd185d4fd7b59b11a58 21-Dec-2015 Thierry Strudel <tstrudel@google.com> Do not account ZRAM physical memory as Lost RAM

Bug: 26039328
Change-Id: I0f28ed777e10a90186700b4879c69f827a3c0495
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
411c06fbf9040f20778de1ae612e6ab5d6a5a3d4 07-Jan-2016 Filip Gruszczynski <gruszczy@google.com> Only allow activities to move to full screen stack.

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

Change-Id: I04de9bbf18cf4431d7bd34d6c727de82802661ef
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
3a939da931d15ceb60f8c0d93d0d183c470b1956 08-Jan-2016 Filip Gruszczynski <gruszczy@google.com> Allow specifying packages for which we don't report crashes and anrs.

Bug: 22472592
Change-Id: I7b103a6cc26166983b6ae3d74e3291ced810d75c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ba75a9b6bab16114a8206015a4d2c7ce3bd70f2a 07-Jan-2016 Jeff Sharkey <jsharkey@android.com> Instrumentation targets must have code.

If they don't have code, give the developer a somewhat helpful error
message instead of later falling into a weird classpath failure.

Change-Id: Iebda10173ff99943cbbd71127ae24aa455b709f4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
51f3908c6a788f82d8188762c0680594a54b17ae 06-Jan-2016 Jeff Sharkey <jsharkey@google.com> Merge "Consistent naming for PackageManager methods."
e06b4d1d9f718b9fe02980fea794a36831a16db2 06-Jan-2016 Jeff Sharkey <jsharkey@android.com> Consistent naming for PackageManager methods.

When hidden PackageManager methods take a userId argument, they
should be named explicitly with the "AsUser" suffix. This fixes
several lagging examples so that we can pave the way to safely
start passing flags to new methods without scary overloading.

Also fix spacing issues in various logging statements.

Change-Id: I1e42f7f66427410275df713bea04f6e0445fba28
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8819c61bcfb25bea07cb4f285e7a5220ff43b0b2 06-Jan-2016 Clara Bayarri <clarabayarri@google.com> Merge "Work Challenge: Handle Recents launches"
ea9b10e64419edbd5d3ed13f82007ffed97af418 04-Dec-2015 Clara Bayarri <clarabayarri@google.com> Work Challenge: Handle Recents launches

Intercept calls to start activities from the recents
stack and show the Work Challenge if needed. This requires
passing the taskId to ConfirmDeviceCredential so it can
launch the recents task itself when the credentials are
confirmed.

Change-Id: I013b134f3f31a35b551ad683c68cc89b8af44499
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
34c4756e2d1b46b0f848d4b6e9c571928157c896 05-Jan-2016 Roozbeh Pournader <roozbeh@google.com> Merge "Optimize locale negotiation when there's only one locale"
6f2efd3d8c114f9a4b472ef699bbd844323cd82c 23-Dec-2015 Jorim Jaggi <jjaggi@google.com> Add developer option for freeform window support (1/2)

Also disable default force-resizable on non-user builds.

Bug: 25276672
Bug: 24815256
Bug: 26294625
Bug: 26294534
Change-Id: I5b31e494c993d2d9dad175b94b4f30637e8f3718
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fe89d122e5b6b129b25d5d5316f690bd4ab93fbb 22-Dec-2015 Jorim Jaggi <jjaggi@google.com> Add infrastructure to track activitiy relaunches

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

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

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

Bug: 25015474
Bug: 26311778
Change-Id: Id5c9277dd908ccc28f95dab023efc914757a50d0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
03ce863860e3e45781e44317d8b2f42a08f40512 30-Dec-2015 Wale Ogunwale <ogunwale@google.com> Added support for notifying listeners when an activity is pinned.

Also, protected AMS#registerTaskStackListener call with
MANAGE_ACTIVITY_STACKS permission.

Bug: 26273032
Bug: 25928537
Change-Id: Ic5e663e373978e0429ecdcc6934a51a295c18268
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9ae46d8ee28cd709d81d2b48c44c47f4e4f485e8 05-Jan-2016 Roozbeh Pournader <roozbeh@google.com> Optimize locale negotiation when there's only one locale

Previously, we were finding the list of locales supported by the
system in all cases, costing us a JNI call, which was not necessary
when there was only one locale (which is expected to be quite
common).

Change-Id: I2f752a71a46b66ac2abb553a5939eddf0f761698
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
854809c074aabebf5b6520c361d1d3c7c22066d2 28-Dec-2015 Wale Ogunwale <ogunwale@google.com> Added hidden API for specifying launch stack in ActivityOptions

Bug: 26273032
Change-Id: Ifb9c70e6783b0426613709693e11742d80ba2fc3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6cae765b67d3a3b37e2cacbc9816665b5bc080b9 26-Dec-2015 Wale Ogunwale <ogunwale@google.com> Added support for android.R.attr#alwaysFocusable

Allows an activity to always be focusable regardless of if it is in a
stack whose activities are normally not focusable. For example, activities
in pinned stack aren't focusable. This flag allows them to be focusable.

Also, changed ActivityInfo.#{resizeable, supportsPip} to use flags.

Bug: 26273032
Bug: 26034613
Change-Id: I8c63e6d3256757e2e6931e08b8a65269f5169d35
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
46ca282851ef12755a64810658a6043e70d6db5d 04-Jan-2016 Wale Ogunwale <ogunwale@google.com> Merge "Don't allow unfocusable activity/stack to gain focus"
40700726699803416a77d4d116129994cb424ccf 04-Jan-2016 Jeff Sharkey <jsharkey@google.com> Merge "More work towards triaging missing app behavior."
4cea0f5bfc7d34299f5f645d37f94b14ac3dc22a 25-Dec-2015 Wale Ogunwale <ogunwale@google.com> Don't allow unfocusable activity/stack to gain focus

Prevents them from being resumed since we always want to resumed
activity to be a focusable acitvity.

Bug: 26273032
Change-Id: Ied832e100d9a2d8915762db53c9230774be21d1c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2f3e35376ada0327b34a71d7c45ac6e6d955d7dc 21-Dec-2015 Jeff Sharkey <jsharkey@android.com> More work towards triaging missing app behavior.

Many places across the platform query package details without
gracefully handling packages or components that go missing for
various reasons. This can cause annoying user data loss, such as
resetting back to built-in apps or dropping of accounts, etc.

This change verifies that system callers have thought about these
edge cases by logging if they use default matching behaviors without
explicitly marking themselves as being "triaged." (The logging is
currently disabled by default.)

Also creates explicit definitions of supported flags for various
incoming PackageManager calls, and defines a clear distinction
between flag types:

-- GET-style flags are used to request additional data that may have
been elided to save wire space.

-- MATCH-style flags are used to include components or packages that
would have otherwise been omitted from a result set by current system
state.

There are a handful of existing GET flags that better fit under the
MATCH definition, so this change clones them to new constants and
marks the old ones as deprecated.

Fixes bug in JobSchedulerService to consider jobs from apps on
external storage. Revert some dialer behavior back to being
untriaged.

Change-Id: I9b6ab0968241e3479bddbd78de0c51e3b9917318
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d046a013921c2ac67318c1543a8b7b9c83b40d65 24-Dec-2015 Wale Ogunwale <ogunwale@google.com> Consolidate resume activity code around focused stack.

Cleaned up the code to make it obvious that only the top
activity in the focused stack should be in the resumes state.

Bug: 26273032
Change-Id: I8d60270f707fe022007c59d25f5678b33a005acf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b23a757aa2f3088c9e9fd226e806aa5963b68d93 18-Dec-2015 Vladislav Kaznacheev <kaznacheev@google.com> Bind DropPermissions life cycle to Activity

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

Change-Id: Ic8f8fc3f56f57e83b9bc34ae8c96d82c2c9c4e1d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2a9e3f8e6813716ab88ca54fd04ae047dc9aaaeb 18-Dec-2015 Jeff Sharkey <jsharkey@android.com> Better named encryption flags, start triaging.

Create distinct flags for encryption aware, unaware, and both, and
name them like the other MATCH_ flags.

Start adding logic to help triage all system internal callers to
verify that they've done their homework and thought about how to
handle apps while locked. Call sites in the system should either
ask for explicit matching behavior, or explicitly use the DEFAULT
match flag to indicate that they've been triaged to use the
default state-based matching.

Bug: 26250295
Change-Id: I86214e5c4f71a6dc72f06930800388713aecd107
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
55bed957788e853d3ee3f674dd6eea79ad3a193b 18-Dec-2015 Ruben Brunk <rubenbrunk@google.com> Merge "Add a framework service tracking VR mode state."
07a0e4980b43d7f3ef8cf7a62592baca0d78a853 17-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Collect activity starting logic into ActivityStarter class.

Change-Id: If1c074d6c278647ec55f2313483945f24aca8b3b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0583d3d18812d31d50228a6f29cb15b3219c9e94 18-Dec-2015 Winson Chung <winsonc@google.com> Hiding pinned stack tasks from overview

Bug: 25381158
Change-Id: Iad442b7f5dc49109529cb5dab2168b19837af6e3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
af6ec296ec200726ac86ff53efc64e221ed6f2f6 17-Dec-2015 Jeff Sharkey <jsharkey@android.com> Make AppWidgets encryption-aware.

Only parse and load AppWidget configuration details after a user has
been unlocked. Yell loudly if someone accidentally tries loading
data for a locked user.

Tidy up protected broadcast logic a bit more to handle persistent
processes. Add backwards compatible behavior for APPWIDGET_UPDATE
broadcast simliar to APPWIDGET_CONFIGURE, since some apps are sending
it to themselves.

Add hidden USER_HANDLE extra to a handful of broadcasts to make
logic more consistent.

Bug: 26247049, 26219971
Change-Id: I54e4f2e343488571f9baa1a316962f41186c1a2c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
dd18a0b69537954d1cc34929a1386deb54f12b14 05-Dec-2015 Ruben Brunk <rubenbrunk@google.com> Add a framework service tracking VR mode state.

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

Bug: 22855417
Bug: 25479708

Change-Id: I1ac8692bbb5521bb6c7cfb9d2b56b98b720f8568
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d88f651da8fc1beac6784696586c21c1b211e0ff 07-Dec-2015 Wale Ogunwale <ogunwale@google.com> Added config_defaultPictureInPictureBounds

Allows device to specify the default launch bounds
for the pinned stack.

Bug: 25580820
Change-Id: I477781aec910553d3b3645a0ac6106cf616949ed
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9c604c7c1db8f3dc5738b931805fc2d996135580 07-Dec-2015 Wale Ogunwale <ogunwale@google.com> API for an Activity to enter picture-in-picture mode.

Bug: 25580820
Change-Id: I5c1bf17dd5dd92622458a61517bc9941e4ee5277
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
caf9f4926662558e030db68df89775de2a5653bd 16-Dec-2015 Jeff Sharkey <jsharkey@android.com> Relax isUserRunning() when asking about self.

When a caller is asking about locked state of themselves, don't
require the INTERACT_ACROSS_USERS permission.

Bug: 26178790
Change-Id: I0f02ebfed87b2e1cddc1cb044a9f04272f85483b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bce711ea0e1bdf1fe0b68715a63421973534a5b3 16-Dec-2015 Mark Lu <Mark_Lu@htc.com> Fix batterySendBroadcast not synchronized issue.

Symptom: system server crash.
Root Cause: batterySendBroadcast not sychrnized with AMS object,
caused system crash in broadcastIntentLocked()
when 2 threads access mParallelBroadcasts.get(i).intent but get null
in BroadcastQueue.replaceParallelBroadcastLocked().
Solution: add sychronization object.

Change-Id: I99f751a2cd3e6fa1dbe2812f5f129525013d6a7f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
80e29f1ccad2398e95d7b64bb89eb9c391a9da05 14-Dec-2015 Filip Gruszczynski <gruszczy@google.com> API for launching activities to the side in side-by-side mode.

This API is intended for side-by-side mode, so that when a new activity
is launched, it will show up on the other side instead of covering the
launching activity.

Bug: 26141281

Change-Id: I97d7f2f48d42a31cfb1a86821474582b9c5d9e45
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fbe12c4e0ff33f385704edd34aabe6eaa75fedbe 07-Dec-2015 Wale Ogunwale <ogunwale@google.com> Added PackageManager#FEATURE_PICTURE_IN_PICTURE

Indicating that a device supports picture-in-picture
multi-window mode.

Also allow activities to be in Pip mode if force resizeable
is enabled.

Bug: 25580820
Bug: 26187878
Change-Id: If80edfee39ece5a51d21040e4d3a8a9135aa1783
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4f7b035e34c64d25d4aa9ebc567547f2c2758869 15-Dec-2015 Todd Kennedy <toddke@google.com> Merge "Fix ephemeral post-install launching"
7440f177c3e70da0b883f8abffd6c8fc1d507bb8 09-Dec-2015 Todd Kennedy <toddke@google.com> Fix ephemeral post-install launching

Provide the ephemeral installer with some additional pieces of information:
1) instead of de-referencing the URL a second time, give the installer the
exact package name
2) instead of relying on ephemeral apps to define verified links, give the
installer a pending intent to launch when the ephemeral is installed
3) give the installer a pending intent to launch if the installer fails,
for whatever reason, to install the ephemeral app

Bug: 25119046
Change-Id: I45f50481caee09d5d09451e4b2492e64b0faae82
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ead5c0fc20e5c60a68cd017af0b8eacaf1167a1c 14-Dec-2015 Winson Chung <winsonc@google.com> Enabling history and paging by default

- Removing associated tuner flags

Change-Id: Ia69bf273489b0079c389e7feb1428071569092d5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
77d9448e2d6dd8a45c5fedef43c8a1cf4afd28b9 11-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Log window mode to tron.

Bug: 26013430
Change-Id: I45d397d956a66f407218047dc10581553f906077
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
88b3b57341e03fb4da2a798c547da40f2e1427c8 14-Dec-2015 Gustav Sennton <gsennton@google.com> Merge "Add functionality for changing WebView provider."
556718dbb2a136c7185d06393bb3350793f159c0 12-Dec-2015 Andreas Gampe <agampe@google.com> Frameworks/base: Avoid useless array allocation

Don't allocate an unused array.

Bug: 19797138
Change-Id: I40539e7659a21a34a7d49c48bbeb51acf9bfe235
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b3da834a914354741389e4dea16117b1d68c2ca4 11-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Move tasks to fullscreen stack when dismissing docked stack.

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

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

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

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

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

Main bug: crbug.com/546185

Bug: 25338573

Change-Id: I660fd1a40a5388f6569a06a7f0d029e8ff65945a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
022c748f54626f77f01079595a0100d1d145f383 04-Nov-2015 Dianne Hackborn <hackbod@google.com> Work on issue #25467052: System lagged out

Add a new mechanism where we retain previously used provided
processes in the "last activity" oom adj state for 20 seconds,
before allowing them to fall down to a regular cached process.
This should help reduce thrashing when something is acquiring
and releasing a provider repeatedly.

Change-Id: I889472de7bb4da574b46f07e36a99978813643cb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3d82ed6be671da98aaf3016d99f57aba56daa97c 10-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Fix activity not launching from recents after it was dismissed.

When activity was launched from recents and started at the same time, we
would first try resuming activities and then focus on the started
activity. That is wrong odering, as the previously focused activity will
be resumed (in this case recents). We need to first focus on the start
activity and then request resuming.

The CL also flag protects some logging that is being very frequently
printed from activity manager.

Bug: 25823213
Change-Id: I5311fb2bf316ce3d298b30fa90fb257978bacdca
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2591cc863018c3ca55f7725945a670f9f1c5e5fd 09-Dec-2015 Roozbeh Pournader <roozbeh@google.com> Revert "Fix Build: Revert "Implement locale matching in LocalesList.""

This reverts commit 9c2f0d751d16360a2cd857b1db752f0009481b21.

The original commit, 17b2b2d45854b56de7aa6d1581526e45991274d4, had
missed adding api/test-current.txt.

Change-Id: I26a6325b3cee4c2412ee599f002cc6addb35d36f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9c2f0d751d16360a2cd857b1db752f0009481b21 09-Dec-2015 Ian Pedowitz <ijpedowitz@google.com> Fix Build: Revert "Implement locale matching in LocalesList."

This reverts commit 17b2b2d45854b56de7aa6d1581526e45991274d4.

Change-Id: I93c010054648a7127172a16c6ef3eb5f13604fd7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
17b2b2d45854b56de7aa6d1581526e45991274d4 20-Nov-2015 Roozbeh Pournader <roozbeh@google.com> Implement locale matching in LocalesList.

The algorithm tries to find the first locale in the locale list
(usually from the user preference) that somewhat matches one of the
locales supported (usually from the list of locales supported by the
system or an app).

Locales match if both their language and their likely script is the
same. Otherwise they don't.

Bug: 25800576
Change-Id: I4fbc3f44ab16d41efebbf941e94a0bb30d598f82
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2639c4bf6b98fb60a47f7398966d184a0aea1950 04-Dec-2015 Dianne Hackborn <hackbod@google.com> New generic background restrictions.

This modifies the existing rigid background restriction to
a more moderate policy that we can (eventually) apply to all
apps:

- After N minutes no longer in the foreground, any background
services running in the app are stopped and no more can be
started.
- No manifest receivers for the application will be executed
if the broadcast is not being sent explicitly to that app and
the app is not running. (Eventually we should tighten this so
they won't be received if the app is past its N minute
background window.)
- Other non-background processes may still bind to services in
the background process, which will raise it to back to an
executing state... so things like syncs, jobs, live wallpapers,
accessibility services, etc still work.

Change-Id: I08ddbfdf640ef324a27b2eb9eecd9499f3ebddd9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
154a77e3bf43d4c3f848d18399eee4d37db77fd9 04-Dec-2015 Joseph Pirozzo <pirozzoj@google.com> Update Activity Manager to prevent popups while driving.

Addresses b/25262029 by detecting if the device ui is of type car.
If in car mode the activity manager will suppress popups in the same way
it does for devices that have no form of user input.

Change-Id: I5c6314236c145fbb52656d9746513c63af8aef8d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
39a275b3980b5ea75e060da540229b95a47333f7 04-Dec-2015 Jeff Sharkey <jsharkey@android.com> Better protection for system broadcast intents.

When the system sends broadcast intents, it's in a very authoritative
position, and many apps blindly trust the sender. This is why we've
historically had the concept of "protected broadcasts" which can only
be sent by the system.

However, it's far too easy to send new broadcasts from the system
without adding them to the protected list. This CL adds logic to help
catch those cases. Currently it just logs the error and continues
sending the broadcast.

Based on boot analysis of a typical device, add 36 new protected
broadcasts.

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

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

Bug: 25509834
Bug: 25683717
Change-Id: I4b8c316a49940bd6a8b31a93b345f9fd725a4721
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4cc863338d5e43b6189e05498d7cb53ebba135e1 05-Dec-2015 Felipe Leme <felipeal@google.com> Changed ActivityManager.requestBugreport() to take a 'progress' parameter.

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

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

BUG: 26034608
Change-Id: I21a6b5b092a85614e91d523b8f4df1fb00e49b3b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bedbaa9ea6e41eaa34a35098c913c096ddf2ce0f 03-Dec-2015 Jeff Sharkey <jsharkey@android.com> Flesh out user locked/unlocked lifecycle.

When a user is first started, we assume that they're "locked" meaning
that credential-encrypted data is unavailable. Once credentials have
been supplied, we can transition the user to a fully running state.

To facilitate this lifecycle, UserState now has two separate
RUNNING_LOCKED and RUNNING states. To ensure consistent events are
sent on all devices, we always step through RUNNING_LOCKED before
arriving at RUNNING. This consistency means that apps processing
data based on the new ACTION_LOCKED_BOOT_COMPLETED broadcast and
system services using the new onUnlockUser() event will be less
bug-prone over time.

If the user storage is unlocked (which is the case on the majority
of legacy devices), we immediately transition from the RUNNING_LOCKED
into the RUNNING state.

Add logging for all state transitions.

When we "recover" a user in the process of being shut down, return
to the last known state.

Bug: 25943941
Change-Id: I5fec980f10b0d0fb2c272a662d193dc15136f9b9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1be3a1cfb91eda8192692e00bffa520623d80b94 02-Dec-2015 Chong Zhang <chz@google.com> Merge "Add permission to prevent third-parth apps from querying OOM scores"
eb41dfb383ab208b5fbba31864323b0a2b2618ef 02-Dec-2015 Julia Reynolds <juliacr@google.com> Merge "Cleanup zen rule instances."
c8e54e8d5ec038ee6f520ee95948e2ef20490e97 30-Nov-2015 Julia Reynolds <juliacr@google.com> Cleanup zen rule instances.

1. When a user revokes zen access
2. When a user clears data

Bug: 25472361
Change-Id: Ia439a7c2bd6dc07a60a374caf4157508131e3578
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8e4f4b3d9409c5a5329aaa4caf0102167d5e610d 02-Dec-2015 Chong Zhang <chz@google.com> Add permission to prevent third-parth apps from querying OOM scores

bug: 25853091
Change-Id: Ic1cdbf155e1e930405773fd078dfc57fda2d9afa
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a864049aae717c0af8693b19822fe84d1102c08b 02-Dec-2015 Dianne Hackborn <hackbod@google.com> Merge "Fix reporting of uid state in battery stats."
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/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
9c165d76010d9f79f5cd71978742a335b6b8d1b4 02-Dec-2015 Svet Ganov <svetoslavganov@google.com> Add optional permission review for legacy apps - framework

For some markets we have to allow the user to review permissions
for legacy apps at runtime despite them not supporting the new
permission model. This is achieved by showing a review UI before
launching any app component. If an update is installed the user
should see a permission review UI for the newly requested
permissions.

To allow distinguishing which permissions need a review we set
a special flag in the permission flags that a review is required.
This flag is set if a runtime permission is granted to a legacy
app and the system does not launch any app components until this
flag is cleared. Since install permissions are shared across all
users the dangerous permissions for legacy apps in review mode
are represented as always granted runtime permissions since the
reivew requirement is on a per user basis.

Whether the build supports permission review for legacy apps is
determined by a build constant allowing us to compile away the
unnecessary code for markets that do not require a permissions
review.

If an app launches an activity in another app that has some
permissions needing review, we launch the permissions review
UI and pass it a pending intent to launch the activity after
the review is completed.

If an app sends a broadcast to another app that has some permissions
needing review, we do not deliver the broadcast and if the sending
app is in the foreground plus the broadcast is explicit (has a
component) we launch the review UI giving it a pending intent to
send the broadcast after the review is completed.

If an app starts a service in another app that has some permissions
needing review, we do not start the service and if the calling app
is in the foreground we launch the review UI and pass it a pending
intent to start the service after the review is completed.

If an app binds to a service in another app that has some permissions
needing review, we schedule the binding but do not spin the target
service's process and we launch the review UI and pass it a callback
to invoke after the review is completed which spins the service
process and completes the binding.

If an app requests a content provider in another app that has some
permissions needing review we do not return the provider and if
the calling app is in the foreground we show the review UI.

Change-Id: I550f5ff6cadc46a98a1d1a7b8415eca551203acf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e7f24e229143c2b94aa9223833b81e0f34446157 02-Dec-2015 Chong Zhang <chz@google.com> Merge "AMS: add API to IProcessInfoServive for retrieving oom scores"
58c270c01b51b3c40e2548857cbac4aee011d0ec 01-Dec-2015 Chong Zhang <chz@google.com> AMS: add API to IProcessInfoServive for retrieving oom scores

bug: 25853091
Change-Id: Ic915191b959afd34d31e8731a7e4aa631a78e45e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a8d10945a608ac6f85a6ab85b69b9a118d7853d8 20-Nov-2015 Dianne Hackborn <hackbod@google.com> Fix reporting of uid state in battery stats.

Now that the activity manager keeps track of per-uid process states,
we can push that already rolled-up data into battery stats to directly
track the times in those states.

The problem with the reporting was actually that we weren't dealing
correctly with negative process states, which is now fixed. (It was
interpreting them as FOREGROUND rather than not running.)

Also split out a number of new states -- TOP, FOREGROUND_SERVICE,
TOP_SLEEPING -- from FOREGROUND. This should allow us to get a much
better idea of how much an app has been actively in use: TOP is when
it is directly visible to the user or in use by such, FOREGROUND_SERVICE
is when it is running in the background in a way the user is aware of.
Also when reporting these numbers, they are no longer added together as
reported but kept as separate times.

Change-Id: I6d307503a4b4ad5c0d5d49305ef63f8eb858e2c9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f7e4ccd22e9051103494867076245d2ed3680f3c 02-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Merge "Fix cts ApplicationTest#testApplication failing."
01c2133bbf46ed9f5a7e6726e8fc7a7f9c0547bf 01-Dec-2015 Filip Gruszczynski <gruszczy@google.com> Fix cts ApplicationTest#testApplication failing.

We should ignore orientation change requests only when a resizeable
activity is not in a full screen mode.

Bug: 25935368
Change-Id: I53bada8bbf0b429b1d48707f65da488e0edeb799
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
b15758ab7a6481717d0d29612e870d7241061c31 17-Nov-2015 Chong Zhang <chz@google.com> Support scrolling for non-resizeable tasks in side-by-side mode

Display toast when a non-resizeable task is put into side-by-side mode.

Scroll the task upon a two-finger scroll gesture.

bug: 25433902

Change-Id: I69967056a564cfe7773afb80aa7e7ea7167a791a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9ea2f7ba3155a455724f64e2d6a964ad4e99dfa5 24-Nov-2015 Jorim Jaggi <jjaggi@google.com> Add ability to supply initial bounds when docking task

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

Change-Id: Ieb3c8c73b9e2a769a2ec6270bd76a713201a2aed
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8b1871d74137d7e36ba0fed5608772f51f62015b 20-Nov-2015 Winson <winsonc@google.com> Adding tuner params for paging and full screen thumbnails.

- Adding “focused” stack state to support paging
- Changing the paging to match UX spec (only auto-page after the first
tap)
- Removing old header focus animation

Change-Id: Id72825b8a1b1c0a2238ee184a6695b13c1d8cb1c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
edcfc1873a4f35c0e4e92fe4f13ff91f0141a779 24-Nov-2015 Suprabh Shukla <suprabh@google.com> Merge "Changing the message on user switching dialog."
4fe508b6d3ceb3c72a79471d3a3a424ffeb71a0a 21-Nov-2015 Suprabh Shukla <suprabh@google.com> Changing the message on user switching dialog.

On systems where primary user is different from the system user,
the message "Switching to Owner..." is displayed while logging out
from any user. Changing it to "Logging out <username>".

Bug: b/25749937

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

Change-Id: I1bb8ae4047e3de3a4ea159e7fad718914b9b5ba7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b2d8e4f0f365f03268b0ef4e6d135ab9e11abf92 20-Nov-2015 Guang Zhu <guangzhu@google.com> Merge "resolve merge conflicts of 723462eba9 to master."
d5502258356402213692118941c968a4bf6a56d1 20-Nov-2015 Guang Zhu <guangzhu@google.com> resolve merge conflicts of 723462eba9 to master.

Change-Id: I34f085ba12ab2602a144a2cbd933cfd5c030748f
723462eba9f3e421fb1c3955b0f45cb7c63d29bc 20-Nov-2015 Guang Zhu <guangzhu@google.com> add lost RAM info to compact meminfo dump am: 877c6c7742
am: b681ec0219

* commit 'b681ec02194039768767215b2479507742288c98':
add lost RAM info to compact meminfo dump
7f35036c95650ee5b66166ad4517f3cd352efdaa 20-Nov-2015 Fyodor Kupolov <fkupolov@google.com> Merge "Added a placeholder home activity for system user"
cf8c77464af10bc75b61d726300ab2dc34299abf 20-Nov-2015 Roozbeh Pournader <roozbeh@google.com> Merge "Support LocaleLists in ActivityManagerService."
8bca69858aefd2326b1bb7ead75796778ed54e93 19-Nov-2015 Roozbeh Pournader <roozbeh@google.com> Support LocaleLists in ActivityManagerService.

Also add a placeholder method for locale negotiation to LocaleList,
to be filled later.

There is no change in behavior expected by this CL yet. But once we
support setting the first locale to something the system doesn't
support, and implement the locale negotiation, this will cause the
system locale to be set to the first supported locale, instead of
just the default from Settings.

Change-Id: Iec983a5707daffb5bf54eac79ff0856a96631960
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c40e244b4a5f224d749be62e8fd512fadb568a85 18-Nov-2015 Fyodor Kupolov <fkupolov@google.com> Added a placeholder home activity for system user

Standard launcher can be uninstalled for system user. A low priority
placeholder home activity is used to make sure the system can always
boot. By default the component is disabled for all users, and is only enabled
for the system user at boot time.

Bug: 25726710
Change-Id: I97eed02c9e2bbd69a737cc1d203110bed837b803
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
027bea555dc2d4fb76cec917d403765130db7668 19-Nov-2015 Jeff Sharkey <jsharkey@google.com> Merge "More file-based encryption work."
ba51235ef5c598d845b77fcf14491329493da34f 13-Nov-2015 Jeff Sharkey <jsharkey@android.com> More file-based encryption work.

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

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

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

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

Bug: 22358539
Change-Id: I6f58ea2d34b3a466d3775d614f8a13de92272621
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
76415ee5008a60e015a2861f75de3a44f60741cc 19-Nov-2015 Wale Ogunwale <ogunwale@google.com> Merge "Allow apps to set launch bounds for activities."
7a8fa60962110878ff4e5db67f3b2710189dffb9 19-Nov-2015 Wale Ogunwale <ogunwale@google.com> Allow apps to set launch bounds for activities.

unhide ActivityOptions APIs for setting launch bounds for
an activitiy so apps can use it. Only works on devices that
support PackageManager#FEATURE_FREEFORM_WINDOW_MANAGEMENT.

Bug: 25499677
Change-Id: I75424681f25cbb9fe92f2ed73e6afbab765dab29
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d93d481ea144bcf56f53b08fbedea2cd760463f4 19-Nov-2015 Suprabh Shukla <suprabh@google.com> Merge "Moving recent tasks information to a user directory"
b681ec02194039768767215b2479507742288c98 18-Nov-2015 Guang Zhu <guangzhu@google.com> add lost RAM info to compact meminfo dump
am: 877c6c7742

* commit '877c6c7742d60fae387e51a4257dd90010064a8a':
add lost RAM info to compact meminfo dump
5462e46d23800bc480d31d73c21d6089ce299d25 18-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Merge "Remove DEBUG_JIT from Zygote flags." am: cf49583bd0
am: 5485d81578

* commit '5485d815788e4037829d70d041fe4fc1a35416f3':
Remove DEBUG_JIT from Zygote flags.
245ec92b653ce51278498f10fddbb0f089404f1d 05-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Remove DEBUG_JIT from Zygote flags.

The flag is being obsolete by the move to JIT.

(cherry picked from commit 9abbf45c8dcdb2e5b13b615e5138ad996fe8afa3)

Change-Id: I3ce4577e81f91e9dd55d44116e0f9e2014bd00b8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
877c6c7742d60fae387e51a4257dd90010064a8a 18-Nov-2015 Guang Zhu <guangzhu@google.com> add lost RAM info to compact meminfo dump

Bug: 25756675

Change-Id: Ibfa37dac99268de8b482188eca9924c999e2b484
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3ea71cf2635bcd63b7d8f7d68be89e3bff90dc78 17-Nov-2015 Dianne Hackborn <hackbod@google.com> Fix issue #25727069: Top sleeping activity overrides foreground service

Change-Id: I9a085cd650604f9d6277ad343bf3c3852324cafc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7d1428d7f3005abe23328c629ad33998f23cb575 18-Nov-2015 Rom Lemarchand <romlem@android.com> resolve merge conflicts of 5032e49f9e to mnc-dr2-dev-plus-aosp.

Change-Id: If4a565a262befdc3d6e206c892e2be9711d52c0f
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/services/core/java/com/android/server/am/ActivityManagerService.java
8958c1effb5432a0cbf01acb8c578b616d76401b 17-Nov-2015 Dianne Hackborn <hackbod@google.com> Merge "Initial stab at background check."
0283d44c0856499b5aabc3212487a44d6f4b2f63 17-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Merge "Remove DEBUG_JIT from Zygote flags."
9c5ac7bf5ba1c5649ccc0357e570f504100e2cfb 17-Nov-2015 Rom Lemarchand <romlem@android.com> resolve merge conflicts of 152d353e87 to master.

Change-Id: Ida54b932d0a077d6eaeb2418a6cbf58f96035fff
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/services/core/java/com/android/server/am/ActivityManagerService.java
75603fb70741e8dd8b8454761f49b41fa7d6550f 02-Nov-2015 Martijn Coenen <maco@google.com> Stop setting swappiness.

We're re-enabling memory cgroups on Ariel
to use user-space lmkd. As a side-effect, this
code will start setting swappiness again. Since the
benefit of swappiness is unknown at this point
(see b/18248535 for details), disable it until
we have good data it helps.

Change-Id: I8e8b892ba0db27469f2d47615f71ce1d2712acbf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1682dad7ed303fc43a07e70d0bb5cb42103a7624 12-Nov-2015 Fyodor Kupolov <fkupolov@google.com> Moved system user apps whitelisting to PM

Previously applications where uninstalled for the system user at a later stage
in a boot process, when PM has already been initialized and registered as
a service. This was causing a flood of PACKAGE_REMOVED broadcasts.

Applications are now uninstalled at an earlier stage, when PM hasn't been
registered. Packages can simply be marked as not installed and broadcast
can be skipped.

Bug: 25626819
Change-Id: Ib64e7c45619809b0efb99cc566a9a2120ed48cd3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7a7619cc9ebee03f5cdad1945f3e28d1af089a0d 12-Nov-2015 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #25467052: System lagged out"
1a40564f3c2256f683c9a145487fc21a58093dc3 04-Nov-2015 Dianne Hackborn <hackbod@google.com> Work on issue #25467052: System lagged out

Add a new mechanism where we retain previously used provided
processes in the "last activity" oom adj state for 20 seconds,
before allowing them to fall down to a regular cached process.
This should help reduce thrashing when something is acquiring
and releasing a provider repeatedly.

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

Bug 25567963

This reverts commit 53de36f9c40c9a4ac1eb9cca8f458aa6c998c1fd.

Change-Id: I4faaa0b4c50d75e208f37b99bc1d6e2f0fff8127
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
183501e1aaee9584f8f0c6ea2d983e3fc17429d1 11-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Merge "Remove performBootDexOpt and am's ensurePackageDexOpt."
27c073796978106746e4a51f2100b29068ab37f6 05-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Remove performBootDexOpt and am's ensurePackageDexOpt.

Except common shared libraries and boot image, all compilations
are now done through BackgroundDexOptService.

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

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

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

Bug 25567963

Change-Id: I9f0d071c815a011be4f4c85c502c39d0fe0fe5e8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
974f55fa13358cd3f4ffebaf4d9fddbb4c9a3431 10-Nov-2015 Winson Chung <winsonc@google.com> Merge "Saving additional context when taking task screenshots."
6c5eb1c6fea1475bbc75a9f13317d039073ed1eb 10-Nov-2015 Wale Ogunwale <ogunwale@google.com> Fixed issue with not been able to dock task from recents after reboot

- Always set the docked stack mode when starting a task from recents
even if the task is already in the docked stack. The caller might want
to change the docked stack location.
- Return last persisted bounds for task that hasn't be restored into a
stack yet when AMS.getTaskBounds is called.
- Make sure there is a valid top activity when moving a task to a stack
before trying to preserve the window.

Bug: 25590206
Change-Id: Id115fc62c28913f999c62cdbbaccd887daa0fab5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
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/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
15447798a38d2b5acb1998731340255f4203f294 06-Nov-2015 Jeff Sharkey <jsharkey@android.com> Initial file-based encryption public APIs.

Define two explicit directories where device-encrypted and
credential-encrypted data will be stored. Third-party apps only
need access to the device-encrypted directory, so that's the only
API exposed for now.

General cleanup in how ApplicationInfo details are derived.

Bug: 22358539
Change-Id: If0a0108721a4aa1c3052b4912e08604bbf24e1ae
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ea1e8ecf5eb988703cb4b5297b30b10561d07c29 06-Nov-2015 Jorim Jaggi <jjaggi@google.com> Don't kill process when dismissing stack

Also clear the binder identity to incorrect permission
checks, which lead to crashes when dismissing the docked
stack.

Change-Id: I53175769745e8bbdbc296806b9297eb3c53d4452
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9abbf45c8dcdb2e5b13b615e5138ad996fe8afa3 05-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Remove DEBUG_JIT from Zygote flags.

The flag is being obsolete by the move to JIT.

Change-Id: Ifb9fab7c561c7f5137aa78c34dd55c552a9505f5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
280d332bd4dbf13bb05102f86c70b7ee299e0704 04-Nov-2015 Chong Zhang <chz@google.com> Construct ActivityOptions near top level

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

Bug: 23755120
Change-Id: Ie8be54a2e4e84a6a1f3c51e4f2966f7fb0bf1c28
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b7243ae41df5b21214b3db86e3756c4ed174c1c3 04-Nov-2015 Wale Ogunwale <ogunwale@google.com> Merge "[ActivityManager] Fix NullPointerException in startNextMatchingActivity." am: 7810aed854 am: d89b76a58d
am: 8401a8d0c5

* commit '8401a8d0c5bad075a7d46a68a30cd9af4c0d4413':
[ActivityManager] Fix NullPointerException in startNextMatchingActivity.
8401a8d0c5bad075a7d46a68a30cd9af4c0d4413 04-Nov-2015 Wale Ogunwale <ogunwale@google.com> Merge "[ActivityManager] Fix NullPointerException in startNextMatchingActivity." am: 7810aed854
am: d89b76a58d

* commit 'd89b76a58dcffa7dbc5974d14c7914f44233bef3':
[ActivityManager] Fix NullPointerException in startNextMatchingActivity.
24937d235da1648ece1866ce326da539c0ccb4bf 03-Nov-2015 Dianne Hackborn <hackbod@google.com> resolve merge conflicts of 3aee38c86e to master.

Change-Id: I9ff3f92b37e24f5f0527a0034b159920f6d7ffe1
92fe44e966b9622c24a6810aaf9c2d8e2b1f9d92 03-Nov-2015 Fyodor Kupolov <fkupolov@google.com> Merge "UserController refactoring"
3aee38c86e1a1dbc62b7ad5f4d08dd7d3db6d496 03-Nov-2015 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #25357209: Could not send SMS or MMS messages, had to reboot" into mnc-dr-dev am: 71e4984505 am: 9a13cc6992
am: a09ac2d998

* commit 'a09ac2d998fdc901fb65b57a061cc445922e081f':
Fix issue #25357209: Could not send SMS or MMS messages, had to reboot
f63b89c0a10b4e3220b0a4aa1703be3aed0c5a98 28-Oct-2015 Fyodor Kupolov <fkupolov@google.com> UserController refactoring

Addressed comments from the previous cl. Added getters for UserController
fields, direct access is no longer allowed. Moved the following methods:
- getUserManagerLocked. Became getUserManager() - because locking is not
necessary, double checked locking will suffice.
- startUserInForeground /showUserSwitchDialog/sendUserSwitchBroadcastsLocked
- handleIncomingUser/unsafeConvertIncomingUserLocked/isUserRunningLocked/
getUsers/getProfileIds

Bug: 24745840
Change-Id: Id5a5cfb9604e08add29bd9a03c8fe5200bc51fef
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d89b76a58dcffa7dbc5974d14c7914f44233bef3 03-Nov-2015 Wale Ogunwale <ogunwale@google.com> Merge "[ActivityManager] Fix NullPointerException in startNextMatchingActivity."
am: 7810aed854

* commit '7810aed85408bddc4cc0c65e5be8d082c638d995':
[ActivityManager] Fix NullPointerException in startNextMatchingActivity.
a084fb7b93de763a28349498f7a1d4ec4ddfd28b 01-Nov-2015 joanne_chung <joanne_chung@htc.com> [ActivityManager] Fix NullPointerException in startNextMatchingActivity.

Symptom:
NullPointerException crash while call startNextMatchingActivity.

Root Cause:
Activity starts with FLAG_DEBUG_LOG_RESOLUTION for debug dump.
If the current Activity is the last object of resolves list,
we can not get the next Activity and aInfo is still null.

Solution:
Check null in debug log dump.

Change-Id: I4c5d14d9acd8d47768b36c95354763841579e050
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fcc95a6d2c749d6b77eca14bf301d665d858a840 02-Nov-2015 Dianne Hackborn <hackbod@google.com> Fix issue #25357209: Could not send SMS or MMS messages, had to reboot

I think what probably happened is that since we only report an app
going in to the "interaction" state as an interaction event to usage
stats, apps that sit around in that state forever will only see one
interaction at the start and never again. So usage stats could start
thinking they are idle.

Fix this by having the activity manager report an interaction event
for such long running applications at least once a day.

Also, because it is correct and for paranoia by protected us another
way, system uids should never go in to standby.

Change-Id: I8a3805bfca86cbe78560488a649ecd07427da99a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
2dd7694681b7256e136d7f4d060be2858c48e835 02-Nov-2015 Winson <winsonc@google.com> Reporting task bounds in RecentTaskInfo.

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

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

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

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

Bug 20157436

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

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

Change-Id: I8f8235c99e6eefcae178e8d61e79ad0c4d6f1144
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2e44107bf7d9ad97833933422ccd241bf53ff50c 29-Oct-2015 Dianne Hackborn <hackbod@google.com> Implement shell commands for battery and activity services.

The battery service just implements the existing commands that
are available through dump.

The activity service implements the small set of commands that
are available through dump (not the rest of the dump commands),
and also introduces some of the simple "am" shell commands as
a proof-of-concept of moving those into the service implementation.

Change-Id: If5ff80930dde787703e2682e43c36ce1dab05d69
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9147ce4cf99d8fd06be7fb88d280503dd214777c 28-Oct-2015 Fyodor Kupolov <fkupolov@google.com> Merge "Enable default system IMEs for system user"
b3b4f61525a3547920d642841202730f3cb16151 27-Oct-2015 Fyodor Kupolov <fkupolov@google.com> Enable default system IMEs for system user

Added GET_DEFAULT_IMES flag to AppsQueryHelper. Default system IMEs are now
enabled for system user.

Bug: 25276229
Change-Id: I38d74903951200e2207e1864bb3a815f8f2d572f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
90186c6d6e7589835db183f602fb48e23a759a87 26-Oct-2015 Filip Gruszczynski <gruszczy@google.com> Fix wrong task bounds when docking from recents.

When docking from recents we would move the task to the docked stack,
but we wouldn't run the resizing code that forces the task to be within
the stack bounds. We need to perform both operations and we can achieve
that using a more general method of moving tasks.

This also adds the passing of creation mode in the activity options, so
the task will be docked in the right spot.

Change-Id: Ia7f94a7e3677ed60ca2f4d889e548d80a3bc3df1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8ccdf3ac49b658737b8106bc921347a3d3e3bbbc 22-Oct-2015 Jorim Jaggi <jjaggi@google.com> Add development option to force everything resizable

Add a development setting to force all activites to be
resizable. Currently, a restart is required after changing
this setting. Also remove all the code that forced a single
task to be resizable, as we have a global option now.

Bug: 24815256
Change-Id: I3237c9b6ce96ff9aa9819592ab0c2807fde88dc4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
079a0044a366b5a6ab8026aca452676a6e1e7215 24-Oct-2015 Wale Ogunwale <ogunwale@google.com> API for moving top activity in a stack to pinned stack.

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

Bug: 25006507
Change-Id: I8392b4c39d8542153e691be7a627b7f35fd44884
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
610acda80a02317080ebaed79b0c1ce26835b8f9 20-Oct-2015 Fyodor Kupolov <fkupolov@google.com> Introduced UserController for multi-user functionality

The new helper class encapsulates user life-cycle management, provided by
ActivityManagerService.

Bug: 24745840
Change-Id: I8ebfa38febc4090390d1c45a9fc47398e52693ae
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fdcc4d4235c829a41b4d23043431bb8fa915a440 15-Oct-2015 Chong Zhang <chz@google.com> Assign different oom score to visible apps based on layer ordering.

Pass oom score in kernel's full range [-1000,1000] to lmkd directly

bug: 21411311

Change-Id: I0cab2aa46269a716ea613025d3b84fe7d04404bb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
63afb863815a80b05c6f1acd6b0e99a3508540f4 19-Oct-2015 Pablo Ceballos <pceballos@google.com> Merge "Remove GLTrace support"
468ae2dacafe3b87f26e8c6edbc4f9657bbac352 14-Oct-2015 Sasha Levitskiy <sanek@google.com> meminfo: Change size suffix to comply with iec, make it parseable with numfmt.

Re-factor to allow for future format flexibility
Add locale-specific large number thousand separator

Change-Id: If4b7c958b5f5fb7094dd4c10b4532e156e983935
Signed-off-by: Sasha Levitskiy <sanek@google.com>
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ffc11bb712343b634901fe2d0e0022e7e578dd5c 10-Oct-2015 Wale Ogunwale <ogunwale@google.com> Don't set incorrect stack bounds when rotating screen in docked mode

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

Bug: 24738105
Change-Id: I97356f008b676d2f58a8b54fdb08735ab51394af
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c29ecc86c277ab078a2263eb382efd2ea837573e 08-Oct-2015 Filip Gruszczynski <gruszczy@google.com> Don't remove task from recents if closed by caption button.

When the user clicks X in non client decor of a freeform task, we
don't want it to be removed from recents. The task gets finished,
but it will remain in recents.

Bug: 24718309

Change-Id: I8f47e310903ee7f839ec92f5c8ff3a9f1e09118c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
57b6ccecc07274884b425839691fa04274b832bc 06-Oct-2015 Filip Gruszczynski <gruszczy@google.com> Dismissing of docked stack by dragging to the side.

Bug: 24623909
Change-Id: Ic93b169442de1eb4dca9f65a87ae2b813bcef043
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
3e85ba293f00874d86998d650b54e580c454f3ae 06-Oct-2015 Filip Gruszczynski <gruszczy@google.com> Refactoring: Remove unused parameter from topRunningActivityLocked.

Change-Id: I350e9459af13858e4ed95fe6511383266f509cb8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7e8184b0ab2b04aa88eff84e5aad811b96536add 05-Oct-2015 Wale Ogunwale <ogunwale@google.com> Support for specifying stack to launch an activity from recents in.

Bug: 24668831
Change-Id: Iebd019d3a566a6d068253d8f566c1df88e9e64dd
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f98feb05f0bd0473a31d17250430780ae998a7b2 01-Oct-2015 Chong Zhang <chz@google.com> Merge "Do not change task's stack in resizeTaskLocked"
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/services/core/java/com/android/server/am/ActivityManagerService.java
515d40600e1f11c7cea3a2bfbbb49e7d86ff801f 28-Sep-2015 Amith Yamasani <yamasani@google.com> Delay cleaning user tasks until user is removed

Fixes #24301208 No recent apps shows when switching
between users.

Instead of cleaning up when stopping a user, we
should remove tasks when removing a user, since
recents tasks should be persisted across reboots.
Reboots are similar to stopping and starting users.

Change-Id: I9a250792077cca5f18ae1a10bc36f7b97e8ea867
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
83301a933ff28eed978b16b54bc569fbe76ef499 25-Sep-2015 Wale Ogunwale <ogunwale@google.com> Added am command to suppress config. changes during task resize.

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

This functionality will be reverted once we decide.

Bug: 24380097
Change-Id: I223c08bc939e564a78e70994b599770be9d4730d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a4490622207804ef85f39439ff7b9cb2470f6287 23-Sep-2015 Xiaohui Chen <xiaohuic@google.com> Cleanup USER_OWNER in activity and location services

Bug: 19913735
Change-Id: Ie2b7acb3fa53b1dcf7319de1eb5bdec585dbf78c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f387b2839926890f75eff7872c609f4040ffc1f6 23-Sep-2015 Filip Gruszczynski <gruszczy@google.com> Merge "Preserve windows during stack resize."
bc5a6c5f0c090852ae2c52328a82c69d680bad3f 22-Sep-2015 Filip Gruszczynski <gruszczy@google.com> Preserve windows during stack resize.

It also adds debugging information for configuration changes, so it's
easier to observe what exactly changes.

Change-Id: Ia2cd4df9a868a8cea216ce137d67a1bb8ed2e6c7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
64c71b72ad0e56d64e72af4147231b7fe8f796ee 22-Sep-2015 Baligh Uddin <baligh@google.com> am 0d78b164: am 2c08546a: am d2b597d1: Merge "Enforce a timeout for Content Providers to be published." into mnc-dr-dev

* commit '0d78b1644a7ca20ccec1201bc748d01be6a7ebd1':
Enforce a timeout for Content Providers to be published.
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/services/core/java/com/android/server/am/ActivityManagerService.java
64b5e1c4f9991cbd97050bd3f183bf510fce2077 17-Sep-2015 Robert Carr <racarr@google.com> Enforce a timeout for Content Providers to be published.

ActivityManagerService: In the case where we are launching
an application on behalf of a Content Provider request,
enforce a timeout inbetween the application attaching and
the content providers being published. Consider that a defective
content provider may block in ContentProvider::onCreate
indefinitely: in such a case the PROC_START_TIMEOUT has already
been removed as the activity manager must have called bindApplication.

In these cases, there will be nothing to wake threads blocking
on the (non timed) wait for provider to be published at the end of
ActivityManagerService::getContentProviderImpl. This can cause binder
threads to block 1 by 1 until eventually AMS runs out and becomes
unresponsive.

Bug: 22141958
Change-Id: I2226da5df5c79b37f0b896423b3c1eaa4a7ecbba
(cherry picked from commit da33c13434cb20a11b522374411a5b819503e4e0)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
da33c13434cb20a11b522374411a5b819503e4e0 17-Sep-2015 Robert Carr <racarr@google.com> Enforce a timeout for Content Providers to be published.

ActivityManagerService: In the case where we are launching
an application on behalf of a Content Provider request,
enforce a timeout inbetween the application attaching and
the content providers being published. Consider that a defective
content provider may block in ContentProvider::onCreate
indefinitely: in such a case the PROC_START_TIMEOUT has already
been removed as the activity manager must have called bindApplication.

In these cases, there will be nothing to wake threads blocking
on the (non timed) wait for provider to be published at the end of
ActivityManagerService::getContentProviderImpl. This can cause binder
threads to block 1 by 1 until eventually AMS runs out and becomes
unresponsive.

Bug: 22141958
Change-Id: I2226da5df5c79b37f0b896423b3c1eaa4a7ecbba
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a59ac9cd645d25f03e4e488100bd99f92e83a3a7 11-Sep-2015 Filip Gruszczynski <gruszczy@google.com> Preserve window during resize triggered relaunches.

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

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

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

Change-Id: Ie3d2878ed09c99ff343044bfe7a29a0ba07a265e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
8e89b31a62fb9ec5ad33908c5e8e9c7ab2fd949f 10-Sep-2015 Chong Zhang <chz@google.com> Move window moving and resizing handling to WindowManager

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

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

Change-Id: Ic7e8baba34e0aa27a43173e044ffb46e93e219e0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0fa656b95256b7ad6d3dce287107a79ace3abdb8 01-Sep-2015 Chong Zhang <chz@google.com> Allow apps to pass in launch bounds when moving/starting a task

Pass in bounds via ActivityOptions for moveTaskToFront and
startActivityFromRecents. Allow bounds to be overriden by rects
in starting intents.

Set bounds to null in RecentsView for full screen layout.

Change-Id: I0ff79fd75068f4ba82d5e2c0a21881fabebdadb8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0b65a9079edec71b28c64dff90d6e0debe8c69dd 03-Sep-2015 Wale Ogunwale <ogunwale@google.com> am c2f9e432: am 68025995: am 1942f8a7: am d4ef34ce: am 512141d5: Merge "Respect DONT_KILL_APP flag when bringing down a disabled service." into mnc-dev

* commit 'c2f9e4323cda3090cfa9197eb402f9279a72b224':
Respect DONT_KILL_APP flag when bringing down a disabled service.
c2f9e4323cda3090cfa9197eb402f9279a72b224 03-Sep-2015 Wale Ogunwale <ogunwale@google.com> am 68025995: am 1942f8a7: am d4ef34ce: am 512141d5: Merge "Respect DONT_KILL_APP flag when bringing down a disabled service." into mnc-dev

* commit '68025995632d2f4dc8e3fd9e7d518868c72d9e82':
Respect DONT_KILL_APP flag when bringing down a disabled service.
d4ef34ce8d9cfb351e1a063ce2ff354ee0b9c13b 03-Sep-2015 Wale Ogunwale <ogunwale@google.com> am 512141d5: Merge "Respect DONT_KILL_APP flag when bringing down a disabled service." into mnc-dev

* commit '512141d581133ad5c1712ac097dcee08d46bae2c':
Respect DONT_KILL_APP flag when bringing down a disabled service.
e3f920252e30d7601be5b03c4417b0acbfdf6420 03-Sep-2015 Tim Murray <timmurray@google.com> am 65052ba4: am e2565aec: am e20eff91: am 3491da4e: Merge "Enable migration to big cores for app launches." into mnc-dr-dev

* commit '65052ba4fa266dcf3a31c51317418301fe6d1a0a':
Enable migration to big cores for app launches.
65052ba4fa266dcf3a31c51317418301fe6d1a0a 03-Sep-2015 Tim Murray <timmurray@google.com> am e2565aec: am e20eff91: am 3491da4e: Merge "Enable migration to big cores for app launches." into mnc-dr-dev

* commit 'e2565aecca1c56dcf80bb0e88dfddeca25388ad6':
Enable migration to big cores for app launches.
2cb2dd40d6a84a3c113c1a858e85ca642d7faf77 02-Sep-2015 Wale Ogunwale <ogunwale@google.com> Respect DONT_KILL_APP flag when bringing down a disabled service.

Commit 540e123 introduce logic to clean up states when a component is
disabled. For services this included marking the process running the
service as removed so it can be killed later. However, this wasn't
respecting the Intent.EXTRA_DONT_KILL_APP flag where the caller
doesn't want the process of the disabled component to be killed.
This change now takes the flag into account.

Bug: 23491822
Bug: 15804187
Change-Id: I54a6e03cd66164dc8c4606a3c462114fe661ea8e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6d444185e55315a0111162609b1f619ee268bf3a 02-Sep-2015 Yasuhiro Matsuda <mazda@google.com> resolved conflicts for merge of fcf9ab5a to master

Change-Id: I69ad6e525430c5c4fc3c274b8bf6ebf653716124
fcf9ab5ab3e158cea2559ed4e7274dbfeb0a6e77 02-Sep-2015 Yasuhiro Matsuda <mazda@google.com> am ebf9465d: resolved conflicts for merge of ef57e5e0 to stage-aosp-master

* commit 'ebf9465d213336819b15e3b21d02afce64470d4f':
Add trace code to system server.
ebf9465d213336819b15e3b21d02afce64470d4f 02-Sep-2015 Yasuhiro Matsuda <mazda@google.com> resolved conflicts for merge of ef57e5e0 to stage-aosp-master

Change-Id: I1c31b38936dc74619dea27f0d5eecab43360bb8c
3491da4eb3714556ac908777be3a55f2e200bf0b 01-Sep-2015 Tim Murray <timmurray@google.com> Merge "Enable migration to big cores for app launches." into mnc-dr-dev
5abd431a87c2c4499dbc91312194d534c3ffb518 01-Sep-2015 Svetoslav Ganov <svetoslavganov@google.com> am 3007cc30: am d1c6dca6: am bbd723ce: am 144c4ff0: am 4cb113ed: Merge "Fix a NPE when shutting down instrumentation" into mnc-dev

* commit '3007cc30f224f560081091159c6f706b2ed0e4bc':
Fix a NPE when shutting down instrumentation
3007cc30f224f560081091159c6f706b2ed0e4bc 31-Aug-2015 Svetoslav Ganov <svetoslavganov@google.com> am d1c6dca6: am bbd723ce: am 144c4ff0: am 4cb113ed: Merge "Fix a NPE when shutting down instrumentation" into mnc-dev

* commit 'd1c6dca6219099ca73df04a65cc4e62b2d8102f6':
Fix a NPE when shutting down instrumentation
a95f468d1f74d1a5aeb9bbc4b1a35ea3276b8f3f 30-Aug-2015 Svet Ganov <svetoslavganov@google.com> Fix a NPE when shutting down instrumentation

bug:23657953

Change-Id: I7187c3d911de24abe20a2c462a10352dd741efed
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a326a116f7f9fb939fac3d28c80d32542016decc 25-Aug-2015 Tim Murray <timmurray@google.com> Enable migration to big cores for app launches.

Uses cpusets to move all foreground tasks to the big cores in order
to improve overall app launch latency. Big cores will be used for
three seconds, and then the cpuset assignment is reset, allowing
foreground tasks to fall back to the little cores as appropriate.

Associated system/core and device/* changes in order to enable
the boost cpuset and configure it per-device.

bug 21915482

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

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

Bug: 23179116
Change-Id: I672bfefa42dd85e962fe343aeb89167ce125f168
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1ab43d5978813f56899dbd3115fd7d9f96b4fe55 30-Jun-2015 Yasuhiro Matsuda <mazda@google.com> Add trace code to system server.

- Add TRACE_TAG_SYSTEM_SERVER for tracing system server code.
- Add a few more tracing code to the code paths related to boot.

BUG: 21739901
BUG: 22207144
Change-Id: I08b424d2f83783f512c3818394099909cd55f327
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2170ee43a176cdfa45dd4d9122a183023831d44b 27-Aug-2015 Fyodor Kupolov <fkupolov@google.com> Merge "Limit the number of apps running as system user"
7db5af124e551554f7a2f1abdd2a486c937910fe 01-Aug-2015 Fyodor Kupolov <fkupolov@google.com> Limit the number of apps running as system user

For the system user, enable apps based on the following conditions:
- app has no launcher icons or has INTERACT_ACROSS_USER_FULL permission
- app is whitelisted
- app is not in the blacklist

Bug: 23283899
Change-Id: I90fa266e8cfb28d002e5f792998fdddb6a1e6969
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4f5de340c9c7b12d7d67ca53bac863976b36fd32 25-Aug-2015 Fyodor Kupolov <fkupolov@google.com> Renamed primaryUserOnly to systemUserOnly

In the split mode, broadcast receivers and activities marked as
systemUserOnly will be running as system. This is a non-functional change for
non-split system user mode.

Bug: 22958572
Change-Id: I0f7d4f4a81275bc326bf630a776c695e8b5291a6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
02898359b9cadd44a07da7045c080d49dfb11ea8 22-Aug-2015 Chong Zhang <chz@google.com> Move stack focus and resumed activity when moving a focused task

Also do not force focus when moving an activity to a stack. Focus
will be moved if the task was in front before. Focus shouldn't
be moved if the task was background.

bug: 23041817
Change-Id: I8f15c51cd38fea8bd1845b5268a7f153c1476462
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4d832d7525a813081ca6eb96eab402dba3597076 21-Aug-2015 Rob Carr <racarr@google.com> Merge "ActivityManagerService: Rather than throw an exception, return INVALID_STACK_ID from getWorkspaceId when there is no associated workspace. This leaves the caller free to default."
49cbf6ba24a18c9c6dcfa907d282e45b55746579 18-Aug-2015 Robert Carr <racarr@google.com> ActivityManagerService: Rather than throw an exception, return
INVALID_STACK_ID from getWorkspaceId when there is no associated
workspace. This leaves the caller free to default.

PhoneWindow: Default to FULLSCREEN_WORKSPACE_STACK_ID in the case
of INVALID_STACK_ID returned from the ActivityManagerService.

Bug: #23171731

Change-Id: Id5132337459bd2ef81b2416434d7657b6f3d1855
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
afa9b6fd39fc4976eeb3684458a6ecf41ec7373a 20-Aug-2015 Dianne Hackborn <hackbod@google.com> am 8755f9eb: am 60931a78: am dc4442f1: am 2af6ec51: am c14cbac4: Merge "Fix issue #23361510: Increase assist timeout from 500ms to 1 second" into mnc-dev

* commit '8755f9ebb820007d8e568f2e664519ac8e4bc7d7':
Fix issue #23361510: Increase assist timeout from 500ms to 1 second
8755f9ebb820007d8e568f2e664519ac8e4bc7d7 20-Aug-2015 Dianne Hackborn <hackbod@google.com> am 60931a78: am dc4442f1: am 2af6ec51: am c14cbac4: Merge "Fix issue #23361510: Increase assist timeout from 500ms to 1 second" into mnc-dev

* commit '60931a784ff5c7659a432ed7b4f5ea5a22156637':
Fix issue #23361510: Increase assist timeout from 500ms to 1 second
0171f3829cf8b9257a77fca49b8326287c76b286 20-Aug-2015 Dianne Hackborn <hackbod@google.com> am c14cbac4: Merge "Fix issue #23361510: Increase assist timeout from 500ms to 1 second" into mnc-dev

* commit 'c14cbac4a3e76d924621b34367cc8b6bcf977908':
Fix issue #23361510: Increase assist timeout from 500ms to 1 second
cf836079cdea8411564a40740f3123d5e2aacf5a 20-Aug-2015 Dianne Hackborn <hackbod@google.com> Fix issue #23361510: Increase assist timeout from 500ms to 1 second

Actually, timeout is okay, but need to schedule it on UI thread.

Change-Id: I5b4ffa7caa33815a5223e3ddd08d4809bc7cf7b6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
98404fdc0b73e6563c19b863aa5ab605e092de29 18-Aug-2015 Xiaohui Chen <xiaohuic@google.com> Clean up USER_OWNER reference.

Bug: 19913735
Change-Id: I441672b360fa0fff5453f72c88f9577b5cc8eecf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
83eb8493b28ac44fdcac3b46051765644c52b851 16-Aug-2015 Dianne Hackborn <hackbod@google.com> am 0ce3a291: am 914eda00: am 574f9b42: am ac11522e: am 06f552cf: Merge "Add debugging for issue #23190084: [APPComm][Dev Test] {Unable to share photo..." into mnc-dev

* commit '0ce3a291fb4fdbfd041e605c0cb71dff4f681e8a':
Add debugging for issue #23190084: [APPComm][Dev Test] {Unable to share photo...
0ce3a291fb4fdbfd041e605c0cb71dff4f681e8a 16-Aug-2015 Dianne Hackborn <hackbod@google.com> am 914eda00: am 574f9b42: am ac11522e: am 06f552cf: Merge "Add debugging for issue #23190084: [APPComm][Dev Test] {Unable to share photo..." into mnc-dev

* commit '914eda0070cde26325db3d2a2e9bbf0a9e612107':
Add debugging for issue #23190084: [APPComm][Dev Test] {Unable to share photo...
b774ed20ec809cfb66a5e4cc43c452e8b43a9939 15-Aug-2015 Dianne Hackborn <hackbod@google.com> am 06f552cf: Merge "Add debugging for issue #23190084: [APPComm][Dev Test] {Unable to share photo..." into mnc-dev

* commit '06f552cf9a89cd129beda8318a4832bd56d00796':
Add debugging for issue #23190084: [APPComm][Dev Test] {Unable to share photo...
ae498721001c6cdcdb6cce1b2f3ba5abbce36f8a 14-Aug-2015 Dianne Hackborn <hackbod@google.com> Add debugging for issue #23190084: [APPComm][Dev Test] {Unable to share photo...

...from Camera360 to Hangouts }

In the short URI toString, include a small summary of the ClipData (instead
of just saying it has a clip data). This makes it a lot easier to understand
what is happening when you look at the log of activity starts.

Also separate out the activity manager dump of URI permission grants from
its dump of providers, so it is easy to just look at that state.

Change-Id: I68093d9f279944e1aa9a29347075f237f4f55ed3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ce2faa5871e3bf5ec8407506df18bed209dd824c 11-Aug-2015 Skuhne <skuhne@google.com> Adding API to access / change the task bounds

Bug: 21738328
Change-Id: I3aabcbe1dcc5caa70f66554157f41fbfacf4c50f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4f0c1e80062ee786046d6ddf151a94b65bd1abc0 10-Aug-2015 Filip Gruszczynski <gruszczy@google.com> Merge "Only relaunch activity on significant size configuration changes."
2349332f9f69189d7889692b9aafd6f80070e352 30-Jul-2015 Filip Gruszczynski <gruszczy@google.com> Only relaunch activity on significant size configuration changes.

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

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

Change-Id: Ie3cf0a172dc1ba0b865cf30c2962e7cfd9ad8436
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b30daaa86eab8babf3f4a0bfd04ba4d0e2309dec 08-Aug-2015 Wale Ogunwale <ogunwale@google.com> Have moveActivityToStack API set focus activity or stack.

Without setting the focus activity or stack, activity manager
is left in a bad set.

Also, fixed issue with resizeTask API not moving a previously
focused task new stack to the front.

Bug: 23041817
Change-Id: I6e1acc31e94e2c3d95fbbd3d5dc6bb66e5396c4a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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.
c9d502779832242914d70c956306faca6d97d193 07-Aug-2015 Svetoslav Ganov <svetoslavganov@google.com> am 38d30dc5: Merge "Immediately kill a shared user process on a permission revocation." into mnc-dev

* commit '38d30dc547825bdde2756f588692063a28749e8d':
Immediately kill a shared user process on a permission revocation.
38d30dc547825bdde2756f588692063a28749e8d 07-Aug-2015 Svetoslav Ganov <svetoslavganov@google.com> Merge "Immediately kill a shared user process on a permission revocation." into mnc-dev
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/services/core/java/com/android/server/am/ActivityManagerService.java
741a2cb9b16d502f544dd9cef2df9ea361fd8007 07-Aug-2015 Wale Ogunwale <ogunwale@google.com> am 606d1197: am 4aaafab5: am 10068894: am 60f7eb38: am a0ef49c4: Look for recent tasks in live stacks.

* commit '606d11977d3c5cea390dc3cb47b5e7c1754e18ed':
Look for recent tasks in live stacks.
606d11977d3c5cea390dc3cb47b5e7c1754e18ed 07-Aug-2015 Wale Ogunwale <ogunwale@google.com> am 4aaafab5: am 10068894: am 60f7eb38: am a0ef49c4: Look for recent tasks in live stacks.

* commit '4aaafab50ff2ce8e85a9bb854ff846d90d44efc0':
Look for recent tasks in live stacks.
6b415901155084fd4aaa3eba0ad3b3aa52a6a63f 07-Aug-2015 Wale Ogunwale <ogunwale@google.com> am a0ef49c4: Look for recent tasks in live stacks.

* commit 'a0ef49c44f7d845e3465591ea977d0c9996c4e5e':
Look for recent tasks in live stacks.
a0ef49c44f7d845e3465591ea977d0c9996c4e5e 07-Aug-2015 Wale Ogunwale <ogunwale@google.com> Look for recent tasks in live stacks.

It is possible for a tasks not to have been saved to the
persisted recent list yet for various reasons. This causes
some external calls to fail when they are trying to do
an operation on a task with a given id. We now use the
stack supervisor look-up for a task id that checks
everywhere a task might be including live stack. It this
fails then the task truly doesn't exist.

Bug: 22924782
Change-Id: I57c3df41d0b4f3ee3c5ae9b7d01eeb2b352062b4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
ba7881c89e7dd50aa537e70f0b96273e131dd08e 02-Aug-2015 Wale Ogunwale <ogunwale@google.com> Support finishing a task with any finishing activity in the task.

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

Change-Id: I3d41b5bd0ecdd97f8e563b061fc8648d2206bc31
6835ef095acdfbab93a939e0164beb3a0c925708 04-Aug-2015 Dianne Hackborn <hackbod@google.com> am d9b0f843: Merge "Fix issue #22860466: viapi security bug - rubber stamping in nested VIs" into mnc-dev

* commit 'd9b0f8435ba9b099512288729af24858a95fd013':
Fix issue #22860466: viapi security bug - rubber stamping in nested VIs
a7b8074191e6ab50184691df9cfeb96034717b4d 04-Aug-2015 Dianne Hackborn <hackbod@google.com> am 3011f645: Merge "Fix issue #22912704: "android.process.acore has stopped" dialog keeps popping up" into mnc-dev

* commit '3011f645abe8f976af6f876579a179d51c09bf30':
Fix issue #22912704: "android.process.acore has stopped" dialog keeps popping up
3fa5609d83339032d456bb51f0419adae756baed 04-Aug-2015 Dianne Hackborn <hackbod@google.com> am aa860fd8: am 35c68de9: am 5dd9ef04: am b0bc8368: am 3011f645: Merge "Fix issue #22912704: "android.process.acore has stopped" dialog keeps popping up" into mnc-dev

* commit 'aa860fd83ab3d3096c4bdf86297b7d8f36f5eec8':
Fix issue #22912704: "android.process.acore has stopped" dialog keeps popping up
d4b8064e420980a737d314171018b55a6a61c5e0 04-Aug-2015 Dianne Hackborn <hackbod@google.com> am 14bafef5: am 24922798: am b20a8ed9: am d9b0f843: Merge "Fix issue #22860466: viapi security bug - rubber stamping in nested VIs" into mnc-dev

* commit '14bafef5b050f14c0fed3bfed8b137862139e627':
Fix issue #22860466: viapi security bug - rubber stamping in nested VIs
aa860fd83ab3d3096c4bdf86297b7d8f36f5eec8 04-Aug-2015 Dianne Hackborn <hackbod@google.com> am 35c68de9: am 5dd9ef04: am b0bc8368: am 3011f645: Merge "Fix issue #22912704: "android.process.acore has stopped" dialog keeps popping up" into mnc-dev

* commit '35c68de93dfec0a237642cca56ade0ba3a6aff92':
Fix issue #22912704: "android.process.acore has stopped" dialog keeps popping up
d9b0f8435ba9b099512288729af24858a95fd013 04-Aug-2015 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #22860466: viapi security bug - rubber stamping in nested VIs" into mnc-dev
fb81d09d359480f9e43bbf300877b60de05f4816 04-Aug-2015 Dianne Hackborn <hackbod@google.com> Fix issue #22860466: viapi security bug - rubber stamping in nested VIs

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

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

Change-Id: Ie02d2458f16cb0b12af825641bcf8beaf086931b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
28ec27cbfa157c242fd9330a10c7c2b8ea838694 04-Aug-2015 Dianne Hackborn <hackbod@google.com> Fix issue #22912704: "android.process.acore has stopped" dialog keeps popping up

Slice 'em up!

Change-Id: Ibba3af7ec5b7f92e6d5e55a57aa838a7f7f936e1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5a5a1ca1764eeb99047b63cdc52b806afd0f998e 30-Jul-2015 Xiaohui Chen <xiaohuic@google.com> clean up UserHandle.USER_OWNER reference.

mCurrentProfileIds does not seem to need the initial value of USER_OWNER.

Bug: 19913735
Change-Id: I7eeff712fb366ccdffef4031f385416c165e7fd6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
a91dccdf576eeed67e160036f00d8fba58c1a524 30-Jul-2015 Billy Lau <billylau@google.com> am bafb5130: am ee2ee0f9: am be6bfb4c: am 83749ac9: am a6706627: Merge "Bug: 21589105 Rescope WRITE_SETTINGS permission (framework services perm check changes)" into mnc-dev

* commit 'bafb51305731fd837b12878fffabe8885239ea10':
Bug: 21589105 Rescope WRITE_SETTINGS permission (framework services perm check changes)
bafb51305731fd837b12878fffabe8885239ea10 30-Jul-2015 Billy Lau <billylau@google.com> am ee2ee0f9: am be6bfb4c: am 83749ac9: am a6706627: Merge "Bug: 21589105 Rescope WRITE_SETTINGS permission (framework services perm check changes)" into mnc-dev

* commit 'ee2ee0f92d6b18c9e09b32d6ceba9fe22db0565d':
Bug: 21589105 Rescope WRITE_SETTINGS permission (framework services perm check changes)
77bb814318e9ca89b7b614497deae72c64e39718 30-Jul-2015 Billy Lau <billylau@google.com> am a6706627: Merge "Bug: 21589105 Rescope WRITE_SETTINGS permission (framework services perm check changes)" into mnc-dev

* commit 'a6706627a9bf749cc591605272810e03983a9eea':
Bug: 21589105 Rescope WRITE_SETTINGS permission (framework services perm check changes)
6ad2d66072795dd9836350b273dcde52910ab4c3 18-Jul-2015 Billy Lau <billylau@google.com> Bug: 21589105 Rescope WRITE_SETTINGS permission (framework services perm check
changes)

AppOpsManager:
Changed the default operating mode for WRITE_SETTINGS to MODE_DEFAULT from
MODE_ALLOWED.

packages/SettingsProvider:
We no longer do static permission checks for WRITE_SETTINGS in early checks and
defer that to app op when MODE_DEFAULT is returned. For some operations,
checking against WRITE_SECURE_SETTINGS is sufficient.

ActivityManagerService & PowerManagerService:
Incorporated app op checks and handled the MODE_DEFAULT case.

provider/Settings:
Added helper function to do checks on whether app ops protected operations
can be performed by a caller. This includes checks for WRITE_SETTINGS and
SYSTEM_ALERT_WINDOW.
Also added a public API (with javadocs) for apps to query if they can modify
system settings.
Changed the javadocs description for ACTION_MANAGE_WRITE_SETTINGS and
ACTION_MANAGE_OVERLAY_PERMISSION.
Added public API (with javadocs) for apps to query whether they can draw overlays or not,
and also javadocs description on how to use that check.

Change-Id: I7b651fe8af836c2074defdbd6acfec3f32acdbe9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ed267cc75b3187efeb72306d0a425958e1f7d15b 29-Jul-2015 Dianne Hackborn <hackbod@google.com> am ad7923f1: am 5d4a5ccb: am 94d5e6b0: am 779ccbe3: am 5b009d52: Merge "Fix issue #22802617: APR: spurious wtf when restarting a persistent process" into mnc-dev

* commit 'ad7923f1403f7fcfec6b0a4c6bbdfcbd686cff37':
Fix issue #22802617: APR: spurious wtf when restarting a persistent process
ad7923f1403f7fcfec6b0a4c6bbdfcbd686cff37 29-Jul-2015 Dianne Hackborn <hackbod@google.com> am 5d4a5ccb: am 94d5e6b0: am 779ccbe3: am 5b009d52: Merge "Fix issue #22802617: APR: spurious wtf when restarting a persistent process" into mnc-dev

* commit '5d4a5ccbadb8d17a900297aa9e766824a0a0397c':
Fix issue #22802617: APR: spurious wtf when restarting a persistent process
cf887f5c91964ff939b5bcc635b3aeff88b796ed 29-Jul-2015 Dianne Hackborn <hackbod@google.com> am 5b009d52: Merge "Fix issue #22802617: APR: spurious wtf when restarting a persistent process" into mnc-dev

* commit '5b009d523c6ad89f946e4a19f3fdba3c63bcf1f5':
Fix issue #22802617: APR: spurious wtf when restarting a persistent process
a73b68fb856aa3563be7423e5f93314eddc7d144 29-Jul-2015 Dianne Hackborn <hackbod@google.com> Fix issue #22802617: APR: spurious wtf when restarting a persistent process

Just don't do a wtf here, it isn't really wrong (though it isn't really
right, but at this point in a release it is right enough!).

Change-Id: Ic38a2e27556224cf8868f1fa18b4810929d67fcc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a925f1897f9e8fa0db7cf8b72b53d7c56dc3921c 28-Jul-2015 Filip Gruszczynski <gruszczy@google.com> Allow disabling of crash dialog.

Bug: 22007110

Change-Id: I78cd234715c740347dda34e23617b22ae1d8d0a6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
aba7a0f3cba819af44fce3c633e40b822c679371 27-Jul-2015 Nick Kralevich <nnk@google.com> am fb2927df: am 73612fbb: am e942b459: Merge "ActivityManagerService: delete unnecessary mkdir"

* commit 'fb2927dfbc0b0cd43cad2be494ce46a9a447a6e7':
ActivityManagerService: delete unnecessary mkdir
fb2927dfbc0b0cd43cad2be494ce46a9a447a6e7 27-Jul-2015 Nick Kralevich <nnk@google.com> am 73612fbb: am e942b459: Merge "ActivityManagerService: delete unnecessary mkdir"

* commit '73612fbbc99af331f0345479231538b5f0f2452e':
ActivityManagerService: delete unnecessary mkdir
faf11661f07b18808674e60d2245337685982e3d 26-Jul-2015 Nick Kralevich <nnk@google.com> am 73612fbb: am e942b459: Merge "ActivityManagerService: delete unnecessary mkdir"

* commit '73612fbbc99af331f0345479231538b5f0f2452e':
ActivityManagerService: delete unnecessary mkdir
bd6b7e0973bf7d1011bb7d35a8739f067aea9c7e 26-Jul-2015 Nick Kralevich <nnk@google.com> ActivityManagerService: delete unnecessary mkdir

/data/anr is now created in init.rc. This code is unnecessary.

Bug: 22385254
Change-Id: Ide6c9749c27668523f9316049a1d40d961f2276d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e92c6226509bee36d7be58bfb243c337176e5692 25-Jul-2015 John Reck <jreck@google.com> am 2a548609: am f43f6c5a: am aad38f60: am 50aded0c: am 68fbd6a4: Merge "Use process state to filter >= UI_HIDDEN" into mnc-dev

* commit '2a5486090f06e7caaf7dec3e885bbc2a48a877da':
Use process state to filter >= UI_HIDDEN
2a5486090f06e7caaf7dec3e885bbc2a48a877da 25-Jul-2015 John Reck <jreck@google.com> am f43f6c5a: am aad38f60: am 50aded0c: am 68fbd6a4: Merge "Use process state to filter >= UI_HIDDEN" into mnc-dev

* commit 'f43f6c5a05791adc9a3da745d88ddd17d2c81f5f':
Use process state to filter >= UI_HIDDEN
a531ddcad9a02c657d36081a397e17c19f10bf1c 25-Jul-2015 John Reck <jreck@google.com> am 68fbd6a4: Merge "Use process state to filter >= UI_HIDDEN" into mnc-dev

* commit '68fbd6a4968eb6e5f3d74f471387c5e62981fba2':
Use process state to filter >= UI_HIDDEN
66a36750135789aa952f2543842aa2481aa2da03 24-Jul-2015 John Reck <jreck@google.com> am 0e5a5161: am d79117c4: am 9ba771bb: am c2db381e: am 6b66a4a8: use findProcess instead of getProcess

* commit '0e5a5161e6999a58a86acd404ee1a229e180647d':
use findProcess instead of getProcess
9bec9660a37dba700bcb15260b872d71d2025b81 24-Jul-2015 Svetoslav Ganov <svetoslavganov@google.com> am 7ddfc7b0: am 1c37dc81: am dd12420e: am f9044dcc: am 258e630a: Merge "Shut down UiAutomationConnection without a lock held" into mnc-dev

* commit '7ddfc7b0245d600605efc4d764378f40d6861437':
Shut down UiAutomationConnection without a lock held
0e5a5161e6999a58a86acd404ee1a229e180647d 24-Jul-2015 John Reck <jreck@google.com> am d79117c4: am 9ba771bb: am c2db381e: am 6b66a4a8: use findProcess instead of getProcess

* commit 'd79117c405fab2c7a64d7307a941df05a713814d':
use findProcess instead of getProcess
7ddfc7b0245d600605efc4d764378f40d6861437 24-Jul-2015 Svetoslav Ganov <svetoslavganov@google.com> am 1c37dc81: am dd12420e: am f9044dcc: am 258e630a: Merge "Shut down UiAutomationConnection without a lock held" into mnc-dev

* commit '1c37dc8197ca0f85ae32304930ec254d0ba9911e':
Shut down UiAutomationConnection without a lock held
c5dce0169bf1f93ef394215647f63bd48aefc67e 24-Jul-2015 John Reck <jreck@google.com> Use process state to filter >= UI_HIDDEN

Bug: 22701182
Change-Id: Ia192016397c8115a19a0dca409aa70dea154c41e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
549dfccc35ebf4b27eac9419eb451c6040c97bf2 24-Jul-2015 John Reck <jreck@google.com> am 6b66a4a8: use findProcess instead of getProcess

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

Bug: 22701182
Change-Id: I2ec56c55c49401f2f213bbd318e867fd73b37672
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bb8bdd71683140558fa39718b43900758af9f7cd 24-Jul-2015 Svetoslav Ganov <svetoslavganov@google.com> am 258e630a: Merge "Shut down UiAutomationConnection without a lock held" into mnc-dev

* commit '258e630a6bc876c57ac97c6da3e5414d0e7eb036':
Shut down UiAutomationConnection without a lock held
7bb48725debf53a1142e959907dae12b729ae531 23-Jul-2015 Svet Ganov <svetoslavganov@google.com> Shut down UiAutomationConnection without a lock held

bug:22599759

Change-Id: I90bca614960522269497127658c16b0bb6ec0476
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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...
86e56bb3713bce2e88ba56946e96697ea193673c 20-Jul-2015 Dianne Hackborn <hackbod@google.com> am 78ead58d: Merge "Fix issue #22531747: Assist info should declare if user has disabled..." into mnc-dev

* commit '78ead58df03e476d656c7e875fff9ade13b727c1':
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/services/core/java/com/android/server/am/ActivityManagerService.java
6648b73cb9d5985b6401af604c7a91de23c88305 17-Jul-2015 Dianne Hackborn <hackbod@google.com> am ee924ded: am 587f0c58: am 61f0aec4: am 9236af43: am aaee5b53: Merge "Work on issue #22516282: ChooserTarget URI grants not forwarded" into mnc-dev

* commit 'ee924dedcc36d64a72652bb3e5fb64d5d5c4c6a4':
Work on issue #22516282: ChooserTarget URI grants not forwarded
ee924dedcc36d64a72652bb3e5fb64d5d5c4c6a4 17-Jul-2015 Dianne Hackborn <hackbod@google.com> am 587f0c58: am 61f0aec4: am 9236af43: am aaee5b53: Merge "Work on issue #22516282: ChooserTarget URI grants not forwarded" into mnc-dev

* commit '587f0c58f506b167667c789c16292c4e405eac1f':
Work on issue #22516282: ChooserTarget URI grants not forwarded
628d4653d4a1c7264e5caa9c1304463da17b53c0 16-Jul-2015 Dianne Hackborn <hackbod@google.com> am aaee5b53: Merge "Work on issue #22516282: ChooserTarget URI grants not forwarded" into mnc-dev

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

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

Change-Id: Ie6b28807b96fef35ccdff93b0a01066cfd8fa307
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bebf8b3116e30fe15e2b599229c0d884dba40fa3 16-Jul-2015 Dianne Hackborn <hackbod@google.com> am cd917ecf: am 18587c55: am b5c44f90: am 709d013f: am 67e02e60: Merge "Fix issue #22487155: Device unresponsive (deadlock in system_server)" into mnc-dev

* commit 'cd917ecf0abb011916e9d90f526a2eff454bc1e7':
Fix issue #22487155: Device unresponsive (deadlock in system_server)
cd917ecf0abb011916e9d90f526a2eff454bc1e7 16-Jul-2015 Dianne Hackborn <hackbod@google.com> am 18587c55: am b5c44f90: am 709d013f: am 67e02e60: Merge "Fix issue #22487155: Device unresponsive (deadlock in system_server)" into mnc-dev

* commit '18587c5511ce3304070d5ac77c112fccdde68e3b':
Fix issue #22487155: Device unresponsive (deadlock in system_server)
b742acaaa0a36fafb242023947964ab7aff216ef 16-Jul-2015 Dianne Hackborn <hackbod@google.com> am 67e02e60: Merge "Fix issue #22487155: Device unresponsive (deadlock in system_server)" into mnc-dev

* commit '67e02e60ca58db95b397fde7bfeeebb012e8aff8':
Fix issue #22487155: Device unresponsive (deadlock in system_server)
16f3671620bab310f5ed4f9222d4a36a8dcef562 15-Jul-2015 Dianne Hackborn <hackbod@google.com> Fix issue #22487155: Device unresponsive (deadlock in system_server)

Using my magic potion, Deadlock-B-Gone!

Change-Id: If5c0a2b18134dc95444f3782ab5aa475414b5839
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b5143ecfeebfcf1424e599882e97c46881bb8c48 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am 1fa2a088: am 1281575c: am 41fac5e8: am 189f3136: am 98724126: Merge "Added sendBroadcastMultiplePermissions method" into mnc-dev

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

* commit '1281575c257d52f256f4a08559611e6ec0b6190e':
Added sendBroadcastMultiplePermissions method
29e8318cb4cca3da84bc3228962e4cc485af7c5e 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am 98724126: Merge "Added sendBroadcastMultiplePermissions method" into mnc-dev

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

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

Bug: 21852542
Change-Id: I27c9130e8f004b428452501ebc8a36aabde1f343
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9ac5983c7b43676f748816381904d4c62a168a3e 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am 7aeb1a5c: am cf4617cf: am 1aeceef4: am fc4acfd9: am 4a817924: Merge "Revert "Allow array of required permissions in sendBroadcast"" into mnc-dev

* commit '7aeb1a5c19a1226f2b0ca7b498bdad941d206808':
Revert "Allow array of required permissions in sendBroadcast"
7aeb1a5c19a1226f2b0ca7b498bdad941d206808 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am cf4617cf: am 1aeceef4: am fc4acfd9: am 4a817924: Merge "Revert "Allow array of required permissions in sendBroadcast"" into mnc-dev

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

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

* commit '7f006b52215634f37aa881157df6473b8e3dd803':
Allow array of required permissions in sendBroadcast
17e97b002af04f62715001535e7933dc24d47f09 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am 4a817924: Merge "Revert "Allow array of required permissions in sendBroadcast"" into mnc-dev

* commit '4a817924ecb282eef48b06b92f8e1914edd6cec2':
Revert "Allow array of required permissions in sendBroadcast"
4a817924ecb282eef48b06b92f8e1914edd6cec2 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Merge "Revert "Allow array of required permissions in sendBroadcast"" into mnc-dev
e37520b49da8fc2b7b7501c6dbbe1e6ac984dd9f 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Revert "Allow array of required permissions in sendBroadcast"

This reverts commit b4e7283c9afd9fb15ebd63f6ce9b75c9c1af658b.

Change-Id: Ie8390964bda5bdfa869cee8f46584043d8e7c664
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
76ff0acdad269d98a70dd08a4d7ff8fd606a8675 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am d69a82c1: Merge "Allow array of required permissions in sendBroadcast" into mnc-dev

* commit 'd69a82c107cea4aca87eecc3978e21ea9bc23c82':
Allow array of required permissions in sendBroadcast
d69a82c107cea4aca87eecc3978e21ea9bc23c82 14-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Merge "Allow array of required permissions in sendBroadcast" into mnc-dev
06f8ebb73f2362e0e4b99fb03df153d9c0dbc599 14-Jul-2015 James Cook <jamescook@google.com> Merge "Fix SysUI crash when launching Chrome from app shelf"
b4e7283c9afd9fb15ebd63f6ce9b75c9c1af658b 14-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Allow array of required permissions in sendBroadcast

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

Bug: 21852542
Change-Id: I3b8ff258fa9f3249c344bb8093b820b24eef00c0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fbb4a38c7cc8ddb313c588f8d29bfcda5c0609c2 14-Jul-2015 Ian Pedowitz <ijpedowitz@google.com> resolved conflicts for merge of 30efac5a to master

Change-Id: I0dad4cf10ed01cbf49e33f0c2ed1d6f8a1c893e0
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/services/core/java/com/android/server/am/ActivityManagerService.java
fa28d939ae657780854bbeb46ee7ef39195579f1 24-Jun-2015 James Cook <jamescook@google.com> Allow more transient icons in app shelf

* Build the icon views dynamically rather than having a fixed number
in the layout XML file
* Increase the maximum number of icons
* Keep the sort order stable as icons are added
* Infer when icons should be added and removed by observing recent
tasks.

Bug: 22031100
Change-Id: Ifa78695ab8b332a47ff116bb502d8d095881e3f0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
30efac5aac0b727fbbe2c5f7acaafc595afc635a 14-Jul-2015 Ian Pedowitz <ijpedowitz@google.com> am 80a4bfc2: am 80ea6c79: am d7be214c: resolved conflicts for merge of 8cee6587 to mnc-dr-dev

* commit '80a4bfc239ef107187005adf8041650995401dc9':
Teach storage appops.
325d7baef91bd12a9426c647156928e93a062bc4 14-Jul-2015 Svet Ganov <svetoslavganov@google.com> am 8cee6587: Merge "Teach storage appops." into mnc-dev

* commit '8cee6587e0efb2d8e63f1505b057a1e328525017':
Teach storage appops.
6ee871e59812fea4525c50231f677c4bd10c74b8 10-Jul-2015 Svet Ganov <svetoslavganov@google.com> Teach storage appops.

For modern apps targeting M SDK and up the external storage state
is deterined by granted permissions. For apps targeting older SDK
the storage access is determined by app ops correspning to the
storage permissions as the latter are always granted.

When app ops change we do not remount as we kill the app process
in both cases enabling and disabling an app op since legacy code
is not prepared for dynamic behavior where an operation that failed
may next succeed. Hence, we remount when we start the app.

For modern apps we don't kill the app process on a permission
grant, therefore we synchronously remount the app storage.

bug:22104923

Change-Id: I601c19c764a74c2d15bea6630d0f5fdc52bf6a5a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cc9648500c2d528c0bfe488ab7b5a5e0fd3cd66e 10-Jul-2015 Dianne Hackborn <hackbod@google.com> am 0e7d497c: Merge "Fix issue #22328792: Fix scalability issues in AssistStructure" into mnc-dev

* commit '0e7d497c10c4f5096cf4cd32a56784fd18ab0f2c':
Fix issue #22328792: Fix scalability issues in AssistStructure
b6fbe91a02c2d4a03ff65f37ec10d5b95a0792e7 10-Jul-2015 Dianne Hackborn <hackbod@google.com> am 782e31df: am 2dc2cdc0: am 1dfeb0b2: am d0e005de: am 0e7d497c: Merge "Fix issue #22328792: Fix scalability issues in AssistStructure" into mnc-dev

* commit '782e31dfcc448eaaab814fd76f42c3390a952037':
Fix issue #22328792: Fix scalability issues in AssistStructure
782e31dfcc448eaaab814fd76f42c3390a952037 10-Jul-2015 Dianne Hackborn <hackbod@google.com> am 2dc2cdc0: am 1dfeb0b2: am d0e005de: am 0e7d497c: Merge "Fix issue #22328792: Fix scalability issues in AssistStructure" into mnc-dev

* commit '2dc2cdc026e8494c09f0cc44205cf22f513b78eb':
Fix issue #22328792: Fix scalability issues in AssistStructure
782d49826862cbdc9d020fc9d85f8a6f64675dcb 09-Jul-2015 Dianne Hackborn <hackbod@google.com> Fix issue #22328792: Fix scalability issues in AssistStructure

We can now stream the AssistStructure across processes, avoiding
IPC size limitations for large structures. There is also a new
API that gets called on the VoiceInteractionSession if there is
a failure retrieving the assist data.

Also fix issue #22351981: Runtime restart due to ANR in system server,
getting rid of a deadlock.

And also tweak object lifecycles to try to avoid keeping around
in an app the previous AssistStructure after we request a new one.

Change-Id: Ifb136a0d31a14e56a8db6b90768d9fc65557a17f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
001c34761136c80a5cfc01ba3651197a49bc8f68 09-Jul-2015 Amith Yamasani <yamasani@google.com> am 3f661378: am 3219c234: am 73ea8117: am 0a9b6a52: am 5d21f416: Merge "Dispatch onUserSwitched callbacks on handler thread" into mnc-dev

* commit '3f6613787f5df4ac07a0b29ef45d1e85cfb2ba3d':
Dispatch onUserSwitched callbacks on handler thread
3f6613787f5df4ac07a0b29ef45d1e85cfb2ba3d 09-Jul-2015 Amith Yamasani <yamasani@google.com> am 3219c234: am 73ea8117: am 0a9b6a52: am 5d21f416: Merge "Dispatch onUserSwitched callbacks on handler thread" into mnc-dev

* commit '3219c2348aba92e0c01dab504f04b46516bb9ebf':
Dispatch onUserSwitched callbacks on handler thread
e437b1a9ff497fa650c7979149b072fb6357c25a 09-Jul-2015 Amith Yamasani <yamasani@google.com> am 5d21f416: Merge "Dispatch onUserSwitched callbacks on handler thread" into mnc-dev

* commit '5d21f4168e7e8625427eb2210e59b30bff5b3b85':
Dispatch onUserSwitched callbacks on handler thread
f64cb1803819d0f7f194adc6d1934e73c694d791 09-Jul-2015 Amith Yamasani <yamasani@google.com> Dispatch onUserSwitched callbacks on handler thread

This avoids multiple threads calling beginBroadcast on the observers
list.

Bug: 22339693
Change-Id: I78a154415ccd17c9460b25589d46dadcdb850941
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3bb8c854189591fcee16d2a6854fae862b02d1e8 07-Jul-2015 Jeff Sharkey <jsharkey@android.com> Merge commit '1db64c19' into merge3

Change-Id: I0aea6817876a5820a7d67a4de5bef0f86ce702a2
1db64c19386d0fc0245624b30bbbdf419623c3d9 06-Jul-2015 Jeff Sharkey <jsharkey@android.com> am ce0965e2: am 262c89dc: am d19555d9: am 38cae6c8: Merge "Reconcile private volumes when mounted." into mnc-dev

* commit 'ce0965e2fa97e8a6c0ce493276ec265ffac8c072':
Reconcile private volumes when mounted.
56aabbea00238f3cd905d10ddee3a21a4f7533dc 06-Jul-2015 Jeff Sharkey <jsharkey@android.com> am 38cae6c8: Merge "Reconcile private volumes when mounted." into mnc-dev

* commit '38cae6c8bcb86236b21d69f852473351c0c1d82a':
Reconcile private volumes when mounted.
6dce4964b4d1a13d276d95730b8fb09d6a5a8d04 04-Jul-2015 Jeff Sharkey <jsharkey@android.com> Reconcile private volumes when mounted.

Many things can happen while a private volume is ejected, so we need
to reconcile newly mounted volumes against known state.

First, user IDs can be recycled, so we store the serial number in the
extended attributes of the /data/user/[id] directory inode. Since a
serial number is always unique, we can quickly determine if a user
directory "10" really belongs to the current user "10". When we
detect a mismatched serial number, we destroy all data belonging to
that user. Gracefully handles upgrade case and assumes current serial
number is valid when none is defined.

Second, we destroy apps that we find no record of, either due to
uninstallation while the volume was unmounted, or reinstallation on
another volume.

When mounting a volume, ensure that data directories exist for all
current users. Similarly, create data directories on all mounted
volumes when creating a user. When forgetting a volume, gracefully
uninstall any apps that had been installed on that volume.

Bug: 20674082, 20275572
Change-Id: I4e3448837f7c03daf00d71681ebdc96e3d8b9cc9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e8ce8368fc65c3f5c54c44384be62cf228ceb10e 04-Jul-2015 Svet Ganov <svetoslavganov@google.com> am 55cd6f44: am 6fe87a56: am 68ffcf88: Merge "Teach receivers, activities, providers, and services app ops." into mnc-dev

* commit '55cd6f44fd1e49164a999e948bb91a03a3b9daf6':
Teach receivers, activities, providers, and services app ops.
19b16eb4539bd159edb69f543965141fe5cf9346 04-Jul-2015 Dianne Hackborn <hackbod@google.com> am b857216f: am ab33137d: am 6cc53743: Merge "Fix issue #20672970: Notifications are not dismissed on hot word detection" into mnc-dev

* commit 'b857216f75bf18e702ead1e201cbbbc36fba39c6':
Fix issue #20672970: Notifications are not dismissed on hot word detection
55cd6f44fd1e49164a999e948bb91a03a3b9daf6 02-Jul-2015 Svet Ganov <svetoslavganov@google.com> am 6fe87a56: am 68ffcf88: Merge "Teach receivers, activities, providers, and services app ops." into mnc-dev

* commit '6fe87a565be345c9455f610bbf26d5eaee593683':
Teach receivers, activities, providers, and services app ops.
b857216f75bf18e702ead1e201cbbbc36fba39c6 02-Jul-2015 Dianne Hackborn <hackbod@google.com> am ab33137d: am 6cc53743: Merge "Fix issue #20672970: Notifications are not dismissed on hot word detection" into mnc-dev

* commit 'ab33137d68fdb5615d9c6624276d648a0651b953':
Fix issue #20672970: Notifications are not dismissed on hot word detection
655b08c38a08d9adb35b75cf340d70068ba81204 02-Jul-2015 Wale Ogunwale <ogunwale@google.com> am b6f87997: am f54d1722: am 52034328: am 131e6b24: Merge "Prevent system uid component from running in an app process" into lmp-mr1-dev

* commit 'b6f87997cb6ea557dc84e77c18c5bb22f99411fc':
Prevent system uid component from running in an app process
68ffcf883c15b97d28e36c684d0db3da084727fc 02-Jul-2015 Svet Ganov <svetoslavganov@google.com> Merge "Teach receivers, activities, providers, and services app ops." into mnc-dev
99b6043dad9d215cf15810b885b6b8c215dd5b5a 27-Jun-2015 Svet Ganov <svetoslavganov@google.com> Teach receivers, activities, providers, and services app ops.

Perform app op check in addition to the permisison check for all four
paltform components - activities, content providers, broadcast receivers,
services - if they are guarded by a permssion that has an associated app
op. This ensures that legacy apps will behave correctly if the permission
of the caller has been revoked, i.e. the app op for that permission was
disabled.

bug:22199666

Change-Id: Ia22d1c38d58b3cd6aabdc655cb7c7bddd85da7a2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4e88bcd39918197c78b148afe40a08b6adcace1e 01-Jul-2015 Dianne Hackborn <hackbod@google.com> Fix issue #20672970: Notifications are not dismissed on hot word detection

Add new VoiceInteractionSession.closeSystemDialogs() API that closes
everything except the session itself.

Change-Id: If45f1e120d8ca095b6c8055b6485acb5e710820e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
94a20a2efd790cdff45e52d7c92b6cb525301787 29-Jun-2015 Benjamin Franz <bfranz@google.com> resolved conflicts for merge of 31706d99 to master

Change-Id: Ic3acad0d2d82ff8f0e5d31d3490c009d242d860b
31706d99218ff63909f9949c47159c033f2e476d 29-Jun-2015 Benjamin Franz <bfranz@google.com> am 635e4ffc: am b6fb3fe8: Merge "Block assist when screenshots are disabled by policy" into mnc-dev

* commit '635e4ffcf65bef9cde34a62583ee6dac49cb2592':
Block assist when screenshots are disabled by policy
b6fb3fe8f4fce5fda82a833247bd99ec435815f1 29-Jun-2015 Benjamin Franz <bfranz@google.com> Merge "Block assist when screenshots are disabled by policy" into mnc-dev
aedb56fd18487d7a34b8ea9f09e4a717afa75a1e 26-Jun-2015 Jeff Sharkey <jsharkey@android.com> Merge commit 'b02c73d5' into manualmerge

Change-Id: I3ec37c9d45d685c2393087bdefa6ab512cc70062
b02c73d582fbfc1f48425b2bd53ac26e9ea22cea 26-Jun-2015 Jeff Sharkey <jsharkey@android.com> am df6fd4c2: am d2c41457: Merge "Let\'s reinvent storage, yet again!" into mnc-dev

* commit 'df6fd4c2631e06f3469eb77b2ffdff0d3cc04a68':
Let's reinvent storage, yet again!
c200f44c46b7d6ddb104c0f09f2a4c679e218d0b 25-Jun-2015 Benjamin Franz <bfranz@google.com> Block assist when screenshots are disabled by policy

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

Bug: 21797707
Change-Id: Ib8716c6dd71d538a027c04e1e907c87e2afa0ac8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9527b223a9d4a4d149bb005afc77148dbeeff785 25-Jun-2015 Jeff Sharkey <jsharkey@android.com> Let's reinvent storage, yet again!

Now that we're treating storage as a runtime permission, we need to
grant read/write access without killing the app. This is really
tricky, since we had been using GIDs for access control, and they're
set in stone once Zygote drops privileges.

The only thing left that can change dynamically is the filesystem
itself, so let's do that. This means changing the FUSE daemon to
present itself as three different views:

/mnt/runtime_default/foo - view for apps with no access
/mnt/runtime_read/foo - view for apps with read access
/mnt/runtime_write/foo - view for apps with write access

There is still a single location for all the backing files, and
filesystem permissions are derived the same way for each view, but
the file modes are masked off differently for each mountpoint.

During Zygote fork, it wires up the appropriate storage access into
an isolated mount namespace based on the current app permissions. When
the app is granted permissions dynamically at runtime, the system
asks vold to jump into the existing mount namespace and bind mount
the newly granted access model into place.

Bug: 21858077
Change-Id: I62fb25d126dd815aea699b33d580e3afb90f8fd2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
80bea9cde179e37def61748ff0e68b4155b5360c 25-Jun-2015 Man Cao <manc@google.com> resolved conflicts for merge of 8fb82074 to master

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

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

* commit '0ebba0e1a66ddf912b9fb7c43727054cb2d63556':
Allow callers holding PACKAGE_USAGE_STATS permission to call ActivityManager#getPackageImportance()
dd673a63a6148bf19825153efd77628fe03c5099 11-Jun-2015 Wale Ogunwale <ogunwale@google.com> Prevent system uid component from running in an app process

Bug: 21669445
Change-Id: I11d0bc5301d7e2a64972221f54f3cbd611f8e404
(cherry picked from commit 44368567f840e3469b5fd2c9399ed444b6f46ebf)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5a487696e27ae91349f1d1f43faa9f38dc897141 11-Jun-2015 Wale Ogunwale <ogunwale@google.com> Prevent system uid component from running in an app process

Bug: 21669445
Change-Id: I11d0bc5301d7e2a64972221f54f3cbd611f8e404
(cherry picked from commit 44368567f840e3469b5fd2c9399ed444b6f46ebf)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
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/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
fbd5ef9546b39ea52843f9ec0164203e82c3aa19 23-Jun-2015 Dianne Hackborn <hackbod@google.com> am b4f4bbf6: am 3e933c48: am 0b50e56c: Merge "Fix issue #21753257: Stability: startActivity asks to run as user 0..." into mnc-dev

* commit 'b4f4bbf6b5b9e4488f3bf811cdb91eb8290b4a16':
Fix issue #21753257: Stability: startActivity asks to run as user 0...
8ee0c2cf24cc4de0abe7114c189051277568f7f1 23-Jun-2015 Rahul Chaturvedi <rkc@google.com> Merge "Add binder transaction tracking."
a825c084f81d9cfca353514ca6a11221e84a7c8a 23-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21753257: Stability: startActivity asks to run as user 0...

...but is calling from user 10

Change-Id: Ia4b8ace6ad140c1727fe944882e0d5b5c650260b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
52613f9084f40100021fbf21173bda329a2d5cc3 18-Jun-2015 Rahul Chaturvedi <rkc@google.com> Add binder transaction tracking.

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

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

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

Bug: 21398706
Change-Id: Ic0c9b3be757dd0662a2750a0d8447e2a5ef1fa90
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
69013970141f1b01541d7362a0447cae952ce117 22-Jun-2015 Yusuke Sato <yusukes@google.com> am 0e9d2374: am 885b251d: am a77ef4b8: Merge "Trace Process.killProcessGroup calls in server/am/" into mnc-dev

* commit '0e9d23743dccd3e28b07e9ff1a32e48506d67ae7':
Trace Process.killProcessGroup calls in server/am/
a77ef4b8b4c11a9fdfdca030462b7b055bf533bc 22-Jun-2015 Yusuke Sato <yusukes@google.com> Merge "Trace Process.killProcessGroup calls in server/am/" into mnc-dev
0c25fbde829a5bb5cecc74df01c14e75292cebfd 20-Jun-2015 Amith Yamasani <yamasani@google.com> resolved conflicts for merge of 5f1c2dbc to master

Change-Id: I4d08ad224c8cddd1d379c0f9ec326165a08dd651
b94761d0a48522b23c54f786445658bb58258da4 20-Jun-2015 Amith Yamasani <yamasani@google.com> Merge "App Standby : Association between content providers and their sync adapter" into mnc-dev
37a40c24deb02bca3868a8085069afae112f22e4 17-Jun-2015 Amith Yamasani <yamasani@google.com> App Standby : Association between content providers and their sync adapter

Set sync adapters to active if the associated content providers are used
at foreground process state.

Minimize how frequently published content providers are reported by
keeping track of last reported time.

Also cache sync adapters associated with an authority in SyncManager.

Bug: 21785111
Change-Id: Ic2c8cb6a27f005d1a1d0aad21d36b1510160753a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f32f7a3ffdbb80fb8d635c1aacaf0c7d2c2dde9f 19-Jun-2015 David Srbecky <dsrbecky@google.com> Merge "Replace --include-cfi with --generate-debug-info." into mnc-dev
035e29101dc494872513eaff8159447befa77a44 19-Jun-2015 Wale Ogunwale <ogunwale@google.com> am dd5cb9a8: am a52a95f4: am 8f4ccd6c: Merge "Reduce log noise." into mnc-dev

* commit 'dd5cb9a86f2f12ff66f618395b648499bf58812b':
Reduce log noise.
dd5cb9a86f2f12ff66f618395b648499bf58812b 19-Jun-2015 Wale Ogunwale <ogunwale@google.com> am a52a95f4: am 8f4ccd6c: Merge "Reduce log noise." into mnc-dev

* commit 'a52a95f405d7df90bd83798c39c8ca1969400e4e':
Reduce log noise.
08741e96ab0ae78e546e9f59e287993717cfc951 19-Jun-2015 Wale Ogunwale <ogunwale@google.com> Reduce log noise.

Bug: 21941219
Change-Id: Ic84719cf1b901c7e6befeca5c73685301e511db8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6c2a8e0da8856b1feb4e9cc495d60d5956a8ccc3 19-Jun-2015 Adam Lesinski <adamlesinski@google.com> am 9f0179cc: am a0578a02: am 00fac635: Merge "BatteryStats: Fix regression in wakelock power distribution" into mnc-dev

* commit '9f0179cc5f6f74a6b9957f60526353898f02ac0b':
BatteryStats: Fix regression in wakelock power distribution
5297c2fb7f6cc3e6e3421297856ec1c9450d0b4f 19-Jun-2015 Todd Kennedy <toddke@google.com> am bd626dd9: am 24cd7b03: am f29c4a07: Merge "Add getPackageImportance() system API" into mnc-dev

* commit 'bd626dd96d25033812e7d3aa528d63fafc96cb0d':
Add getPackageImportance() system API
9f0179cc5f6f74a6b9957f60526353898f02ac0b 19-Jun-2015 Adam Lesinski <adamlesinski@google.com> am a0578a02: am 00fac635: Merge "BatteryStats: Fix regression in wakelock power distribution" into mnc-dev

* commit 'a0578a025949b0759dbd6109b60c2c560b03b2d5':
BatteryStats: Fix regression in wakelock power distribution
bd626dd96d25033812e7d3aa528d63fafc96cb0d 19-Jun-2015 Todd Kennedy <toddke@google.com> am 24cd7b03: am f29c4a07: Merge "Add getPackageImportance() system API" into mnc-dev

* commit '24cd7b0302b52989236637a0a1451939e635b717':
Add getPackageImportance() system API
065075e1f993a68579ed7f8034ab09d96ec957a9 28-May-2015 David Srbecky <dsrbecky@google.com> Replace --include-cfi with --generate-debug-info.

This follows a change in dex2oat.

(cherry picked from commit f39477b592e6e17fe41ace2e18602a69b2dd1619)

Bug: 21924613
Change-Id: I46b61298ca00bee2e83080456b180d63efd95b8f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
00fac63575349df5ed8c399b83f1f9c7199ff070 19-Jun-2015 Adam Lesinski <adamlesinski@google.com> Merge "BatteryStats: Fix regression in wakelock power distribution" into mnc-dev
69810483c770e99b65f4fd01ad1973885969062c 18-Jun-2015 Todd Kennedy <toddke@google.com> Add getPackageImportance() system API

Callers must have the permission GET_PACKAGE_IMPORTANCE

Bug: 20642684
Change-Id: I6f3ef2ec810c884e0dee239e5909bcb314957302
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
72478f053f403e29223dba6cc7be9e5bf115f670 18-Jun-2015 Adam Lesinski <adamlesinski@google.com> BatteryStats: Fix regression in wakelock power distribution

We used to give 50% of the cpu time of each app to any app holding a wakelock
while the screen is off.
Since we switched to the new kernel module for measuring app's cpu time, this distribution
was lost.

Bug:21876567
Change-Id: I42c294547f63d150d9929271ca0e27fedaaa9d77
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cf4b2542fae9d6c5d3788c6a935824094fb1c1ea 17-Jun-2015 Yusuke Sato <yusukes@google.com> Trace Process.killProcessGroup calls in server/am/

to make it easier to find boot time regressions like 21813611
and 21861473.

Process.killProcessGroup is a blocking call and usually takes
about 50ms to finish on a recent device even when the process
group contains only one process. Since Process.killProcessGroup
tends to be called in a loop, the function can be a bottleneck.

Bug: 21813611
Change-Id: I9c1727c0c0b321a30c96321198cc02f438496ded
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
22afc5469efb924dea20902e3618735691e14f4a 18-Jun-2015 Dianne Hackborn <hackbod@google.com> am 2133afc7: am d21b695f: am 22433a33: Merge "Fix issue #21814207 and issue #21814212 (alarm manager)" into mnc-dev

* commit '2133afc77aa36f186b9e5c0ff9954d0d26848e3e':
Fix issue #21814207 and issue #21814212 (alarm manager)
2133afc77aa36f186b9e5c0ff9954d0d26848e3e 18-Jun-2015 Dianne Hackborn <hackbod@google.com> am d21b695f: am 22433a33: Merge "Fix issue #21814207 and issue #21814212 (alarm manager)" into mnc-dev

* commit 'd21b695f8b344b12e623694db86856a89642d934':
Fix issue #21814207 and issue #21814212 (alarm manager)
a750a63d639f6936af456df904fa6b9ba941885e 17-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21814207 and issue #21814212 (alarm manager)

Issue #21814207: AlarmManager.setAndAllowWhileIdle should also allow wake locks.

Introduce a whole new infrastructure for providing options when
sending broadcasts, much like ActivityOptions. There is a single
option right now, asking the activity manager to apply a tempory
whitelist to each receiver of the broadcast.

Issue #21814212: Need to allow configuration of alarm manager parameters

The various alarm manager timing configurations are not modifiable
through settings, much like DeviceIdleController. Also did a few
tweaks in the existing DeviceIdleController impl.

Change-Id: Ifd01013185acc4de668617b1e46e78e30ebed041
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
012e192dfceb899b1159813a18304782275bc916 17-Jun-2015 Dianne Hackborn <hackbod@google.com> am e9663b07: am 98d9710c: am f4c936a7: Merge "Fix to only do pre boot receivers on upgrade." into mnc-dev

* commit 'e9663b0748445b1701bc6b1d19795a32478a1425':
Fix to only do pre boot receivers on upgrade.
e9663b0748445b1701bc6b1d19795a32478a1425 17-Jun-2015 Dianne Hackborn <hackbod@google.com> am 98d9710c: am f4c936a7: Merge "Fix to only do pre boot receivers on upgrade." into mnc-dev

* commit '98d9710cf0481f135be86be88a51920b764cc206':
Fix to only do pre boot receivers on upgrade.
bd190a3da4e3eee173f0bf91dd57ed66965f382f 17-Jun-2015 Dianne Hackborn <hackbod@google.com> am 726d6993: am 1141dea8: am 9cc842f0: Merge "Fix issue #21816660 (app standby), work on issue #20882522 (voice interact)" into mnc-dev

* commit '726d6993aede9ae5e36dabaafe81266e0b276090':
Fix issue #21816660 (app standby), work on issue #20882522 (voice interact)
726d6993aede9ae5e36dabaafe81266e0b276090 16-Jun-2015 Dianne Hackborn <hackbod@google.com> am 1141dea8: am 9cc842f0: Merge "Fix issue #21816660 (app standby), work on issue #20882522 (voice interact)" into mnc-dev

* commit '1141dea8e074d1a0dd67673e26f54f950d60ba3e':
Fix issue #21816660 (app standby), work on issue #20882522 (voice interact)
505d62dd05fab80e5833e90954f832bcfaf535ef 16-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix to only do pre boot receivers on upgrade.

I mistakenly checked in a change that forced us to run
pre boot receivers during every boot, which was intended to
just be temporary for testing.

Change-Id: I7890432f2d42deccef934c1503c3af4b55f59494
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9cc842f0ee491aa7b4fcea02823c3aa273465ac1 16-Jun-2015 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #21816660 (app standby), work on issue #20882522 (voice interact)" into mnc-dev
0b3345f14a7d04fc190a6d0a794b9d065e2126ed 16-Jun-2015 Makoto Onuki <omakoto@google.com> am 3773eff5: am 2ae1caf9: am e43bf4bb: Merge "Allow killApplicationWithAppId() on secondary users" into mnc-dev

* commit '3773eff57e0760568e3890160f8507bd4a60d7ae':
Allow killApplicationWithAppId() on secondary users
3773eff57e0760568e3890160f8507bd4a60d7ae 16-Jun-2015 Makoto Onuki <omakoto@google.com> am 2ae1caf9: am e43bf4bb: Merge "Allow killApplicationWithAppId() on secondary users" into mnc-dev

* commit '2ae1caf984261113f2b6c1959b4a5ef54b3c16f3':
Allow killApplicationWithAppId() on secondary users
fa24bd8ab65ac34cc3393ab9a8aa0e24747c4072 16-Jun-2015 Makoto Onuki <omakoto@google.com> Allow killApplicationWithAppId() on secondary users

Bug 20949609

Change-Id: If0e766aeb3e8b4aa6aebed3b75bcedd75251e382
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b8004ff3d4be75f2d57ac757cd0b983eed4ae9c0 15-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21816660 (app standby), work on issue #20882522 (voice interact)

Issue #21816660: More app standby abuse prevention

We now apply the same rules for deciding when an app has counted
as active when the screen is on as when the screen is off; the only
change this really means is that we don't immediately count foreground
services as making an app active both screen on as well as the
existing behavior for screen off.

Also small fix to how we switch into voice interaction mode that
guarantees we immediately switch to the screen on state.

Issue #20882522 VI: voice interactor service not restarted

This fixes some problems in the framework, allowing it to be
correctly restarted (and rolled by to the default voice interactor
if appropriate). There are still some problems in system UI that
leave things broken in some cases.

Also small fix to how we switch into voice interaction mode that
guarantees we immediately switch to the screen on state.

Change-Id: Ie4fd098a2f5174a2c94f36d30427fb2a9db3d835
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ac3dd4d07611153d85c9d3341d6945918de57b16 12-Jun-2015 Chris Wren <cwren@android.com> am 604f6cf1: am 63cae6c8: am 17de4b2a: Merge "remove usage of deprecated method setLatestEventInfo" into mnc-dev

* commit '604f6cf11307f1be19fad05c40482fd792ab3162':
remove usage of deprecated method setLatestEventInfo
604f6cf11307f1be19fad05c40482fd792ab3162 12-Jun-2015 Chris Wren <cwren@android.com> am 63cae6c8: am 17de4b2a: Merge "remove usage of deprecated method setLatestEventInfo" into mnc-dev

* commit '63cae6c8caa77b6b1cdc45423ed6ec771f6c485b':
remove usage of deprecated method setLatestEventInfo
17de4b2a73996366ff3d7759793a6809654caebe 12-Jun-2015 Chris Wren <cwren@android.com> Merge "remove usage of deprecated method setLatestEventInfo" into mnc-dev
f8b32531801d87699b28e9454e81ebf96367a9bd 12-Jun-2015 Dianne Hackborn <hackbod@google.com> am ccd6d0c1: am d55860d9: am 8a435ced: Merge "Fix APIs." into mnc-dev

* commit 'ccd6d0c14decd111e7e12bf9844fa5ff75aa912e':
Fix APIs.
ccd6d0c14decd111e7e12bf9844fa5ff75aa912e 12-Jun-2015 Dianne Hackborn <hackbod@google.com> am d55860d9: am 8a435ced: Merge "Fix APIs." into mnc-dev

* commit 'd55860d990587509f0e9624c44494172f3e24714':
Fix APIs.
1ce4b6d3c6cb5b2eb9c9d00472be12245db92427 11-Jun-2015 Chris Wren <cwren@android.com> remove usage of deprecated method setLatestEventInfo

Bug: 18510449
Change-Id: I56a77991c729990e501f402e007dfa79ee57621e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
9407e4bf9f554991fd6ec24efc944396d8c4368b 12-Jun-2015 Adam Lesinski <adamlesinski@google.com> am 6b7d2ec1: am 9598abea: am 2e49bfa6: Merge "UsageStats: Change INTERACTION to SYSTEM_INTERACTION" into mnc-dev

* commit '6b7d2ec164961238af75779233b685a945c3ee28':
UsageStats: Change INTERACTION to SYSTEM_INTERACTION
6b7d2ec164961238af75779233b685a945c3ee28 12-Jun-2015 Adam Lesinski <adamlesinski@google.com> am 9598abea: am 2e49bfa6: Merge "UsageStats: Change INTERACTION to SYSTEM_INTERACTION" into mnc-dev

* commit '9598abea3160328bbf98ca5eb04f7b1502417469':
UsageStats: Change INTERACTION to SYSTEM_INTERACTION
deb00baa901c8a6a75f48c3f85b251491bc19e15 12-Jun-2015 Wale Ogunwale <ogunwale@google.com> am 9d26d9c1: am 6d38f269: am 42892ec6: Merge "Prevent system uid component from running in an app process" into mnc-dev

* commit '9d26d9c1e49e00a87d232eaf1a4a5c23c1da971b':
Prevent system uid component from running in an app process
9d26d9c1e49e00a87d232eaf1a4a5c23c1da971b 12-Jun-2015 Wale Ogunwale <ogunwale@google.com> am 6d38f269: am 42892ec6: Merge "Prevent system uid component from running in an app process" into mnc-dev

* commit '6d38f2695e79f96b9d3730af837ec935bfb798ac':
Prevent system uid component from running in an app process
2e49bfa6f02a4ab831a43453231888aa6d9c4ce1 12-Jun-2015 Adam Lesinski <adamlesinski@google.com> Merge "UsageStats: Change INTERACTION to SYSTEM_INTERACTION" into mnc-dev
c8e8729244d75584ce71a74d29c452fe538a22c5 11-Jun-2015 Adam Lesinski <adamlesinski@google.com> UsageStats: Change INTERACTION to SYSTEM_INTERACTION

SYSTEM_INTERACTION events are signals to the system for a package's
implicit actions (service bound, etc).

These should not affect the API visible stats like lastTimeUsed, etc.
USER_INTERACTION is for user initiated actions (notification interaction, etc).

Bug:21761781
Change-Id: I4585cf35fbb158612a3c737710108bec34e89183
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
42892ec6417e9acd14efb3e30d6dfe0baf0cbc2d 11-Jun-2015 Wale Ogunwale <ogunwale@google.com> Merge "Prevent system uid component from running in an app process" into mnc-dev
44368567f840e3469b5fd2c9399ed444b6f46ebf 11-Jun-2015 Wale Ogunwale <ogunwale@google.com> Prevent system uid component from running in an app process

Bug: 21669445
Change-Id: I11d0bc5301d7e2a64972221f54f3cbd611f8e404
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a7e5c589c6803d777c298aa565ed97910c397f08 11-Jun-2015 Benjamin Franz <bfranz@google.com> am 95b555fc: am 8b5c2e8a: am d168d184: Merge "Align the behaviour of different lock task modes" into mnc-dev

* commit '95b555fc90bcf73723aaee7757fc5aafd84adec4':
Align the behaviour of different lock task modes
95b555fc90bcf73723aaee7757fc5aafd84adec4 11-Jun-2015 Benjamin Franz <bfranz@google.com> am 8b5c2e8a: am d168d184: Merge "Align the behaviour of different lock task modes" into mnc-dev

* commit '8b5c2e8acd01c87204ba0b842a35c625be174e5b':
Align the behaviour of different lock task modes
d168d184c02c33863b4eda56fae431437f609e2c 11-Jun-2015 Benjamin Franz <bfranz@google.com> Merge "Align the behaviour of different lock task modes" into mnc-dev
098e4bf04063cd75f2acd0b2f1230dc1fe814691 10-Jun-2015 Dianne Hackborn <hackbod@google.com> am 45c75dea: am 549aacfe: am 47669522: Merge "Fix issue #21621920: VI: need mechanism to get current request" into mnc-dev

* commit '45c75dea7f1c03e4e899e5316785731b91daf85b':
Fix issue #21621920: VI: need mechanism to get current request
45c75dea7f1c03e4e899e5316785731b91daf85b 10-Jun-2015 Dianne Hackborn <hackbod@google.com> am 549aacfe: am 47669522: Merge "Fix issue #21621920: VI: need mechanism to get current request" into mnc-dev

* commit '549aacfe9a299a61b5bc5acc2b776ac545cd855b':
Fix issue #21621920: VI: need mechanism to get current request
ffa0f10ddda7895bf3898e997bb92e90275f85b3 09-Jun-2015 Dianne Hackborn <hackbod@google.com> am 51bcd672: am 1a18d087: am ea7438e4: Merge "Fix issue #21571700: Need to be smarter about how foreground..." into mnc-dev

* commit '51bcd6728b30bcef6f89e710fec25a9a081bb46b':
Fix issue #21571700: Need to be smarter about how foreground...
51bcd6728b30bcef6f89e710fec25a9a081bb46b 09-Jun-2015 Dianne Hackborn <hackbod@google.com> am 1a18d087: am ea7438e4: Merge "Fix issue #21571700: Need to be smarter about how foreground..." into mnc-dev

* commit '1a18d087d7c31ee037c9583949f5ecc34ae96479':
Fix issue #21571700: Need to be smarter about how foreground...
a3acdb33df7c7be7ff3d9f376ff833e4b0c1d897 09-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21621920: VI: need mechanism to get current request

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

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

Change-Id: I4ef74b5ed07447da9303a74a1bdf42e4966df363
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ea7438e4a698945b3e3a7786cff726c337291a68 09-Jun-2015 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #21571700: Need to be smarter about how foreground..." into mnc-dev
87f0f73b0217b76fabdbb931cd9c518a1b73dac0 09-Jun-2015 Julia Reynolds <juliacr@google.com> am 6be25283: am 6ca311ca: am 058652c2: Merge "Remove the ability to set a preferred setup activity." into mnc-dev

* commit '6be25283c8c5d7b2be78839a59626bb590a1e7bc':
Remove the ability to set a preferred setup activity.
6be25283c8c5d7b2be78839a59626bb590a1e7bc 09-Jun-2015 Julia Reynolds <juliacr@google.com> am 6ca311ca: am 058652c2: Merge "Remove the ability to set a preferred setup activity." into mnc-dev

* commit '6ca311ca99bc1290d714c6918e57db6daef7a941':
Remove the ability to set a preferred setup activity.
cedd53adc3875fe1b4275afa35ec5c3ede7b6c39 09-Jun-2015 Julia Reynolds <juliacr@google.com> Remove the ability to set a preferred setup activity.

Bug: 21557327
Change-Id: I8c1809d25c5f5fcd186dfc0636d8ac47ed5fc903
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
469dd58baecb08d8f6daf559595362ada5fbe545 09-Jun-2015 Benjamin Franz <bfranz@google.com> Align the behaviour of different lock task modes

Currently lock task modes started by the activity flag
android:lockTaskMode behave differently from those started using
startLockTask(). With those changes lock tasks initiated by non-priv
apps cannot finish without calling into stopLockTask. Revoking the
whitelisting on a locked task will also kill that task, independently
of the way the lock task mode was started.

Bug: 21608206
Change-Id: I841abf1103855e2d7218a4a8ca9b43c105630dc9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
3618761bf8c3e99eff082c20b91a49a44cbc2eac 08-Jun-2015 Wale Ogunwale <ogunwale@google.com> am e14bd608: am 5265fc96: am 7fa228f4: Merge "Release voice wake lock at end of voice interaction session" into mnc-dev

* commit 'e14bd608f74cdeed2cc557504941b09bb0e94a42':
Release voice wake lock at end of voice interaction session
accba49d8ff06d46a0eafb99e11d2e0621e916fa 08-Jun-2015 Wale Ogunwale <ogunwale@google.com> am a47884b3: am 56651bc4: am aac4c5c2: Merge "Hold service lock when AMS.setProcessMemoryTrimLevel() is called" into mnc-dev

* commit 'a47884b386b8bb5c9ae8f76ba683615260a8c037':
Hold service lock when AMS.setProcessMemoryTrimLevel() is called
bff5a412355ae896a47c0a11cb75ddfa2a9f009a 08-Jun-2015 Tim Kilbourn <tkilbourn@google.com> am 6b3bb7d6: am 0a08108d: am 159f558a: Merge "Pass an args bundle to launchAssistAction." into mnc-dev

* commit '6b3bb7d66966fd4c2ff99f2fc831970678a82de6':
Pass an args bundle to launchAssistAction.
e14bd608f74cdeed2cc557504941b09bb0e94a42 08-Jun-2015 Wale Ogunwale <ogunwale@google.com> am 5265fc96: am 7fa228f4: Merge "Release voice wake lock at end of voice interaction session" into mnc-dev

* commit '5265fc9689fb8b2a6fac25069aa9e5ced233749a':
Release voice wake lock at end of voice interaction session
a47884b386b8bb5c9ae8f76ba683615260a8c037 08-Jun-2015 Wale Ogunwale <ogunwale@google.com> am 56651bc4: am aac4c5c2: Merge "Hold service lock when AMS.setProcessMemoryTrimLevel() is called" into mnc-dev

* commit '56651bc459495451cd2069dbc12f990531b1865a':
Hold service lock when AMS.setProcessMemoryTrimLevel() is called
6b3bb7d66966fd4c2ff99f2fc831970678a82de6 08-Jun-2015 Tim Kilbourn <tkilbourn@google.com> am 0a08108d: am 159f558a: Merge "Pass an args bundle to launchAssistAction." into mnc-dev

* commit '0a08108d753f2d04da046e6d7792ee33ac2af364':
Pass an args bundle to launchAssistAction.
7fa228f4eaa774df9e925e0c037f0fa78caafafc 08-Jun-2015 Wale Ogunwale <ogunwale@google.com> Merge "Release voice wake lock at end of voice interaction session" into mnc-dev
4a922d470089bde49c2ca50b258973828a665aba 08-Jun-2015 Wale Ogunwale <ogunwale@google.com> Release voice wake lock at end of voice interaction session

Bug: 21615776
Bug: 21615761
Change-Id: I75d568474d4df5f21ea5b616887c6187e54f69e7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
aac4c5c28f6699ddcbbc25638e73e5ab42b8360e 08-Jun-2015 Wale Ogunwale <ogunwale@google.com> Merge "Hold service lock when AMS.setProcessMemoryTrimLevel() is called" into mnc-dev
159f558a39d200e08e06245d64ec1df9a08e7d93 08-Jun-2015 Tim Kilbourn <tkilbourn@google.com> Merge "Pass an args bundle to launchAssistAction." into mnc-dev
e9408f3157a9af3b3a896278343341c4e18f6502 08-Jun-2015 Wale Ogunwale <ogunwale@google.com> Hold service lock when AMS.setProcessMemoryTrimLevel() is called

Bug: 21633189
Change-Id: I7203807466593ced6ec3dd328c1a03532caf3a31
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c70b4364a52a16d86a759a23bafbf326c7b2dca7 06-Jun-2015 Justin Harrison <astyrrian@google.com> am 94d5ade9: am 705a35de: am c3b9156e: am 6715ef75: am 4f2927d2: am 0eeb3bb8: am 33aa55b1: am 127d0b80: Merge "Revert "Revert "During early boot, send LOCALE_CHANGED only to registered receivers""" into lmp-mr1-dev

* commit '94d5ade9ea645914e22bb356ddcaeb814bf02596':
Revert "Revert "During early boot, send LOCALE_CHANGED only to registered receivers""
1fbd65e45e5a7aeffe5b32943085a2646c82b775 06-Jun-2015 Justin Harrison <astyrrian@google.com> am 01c37505: am 00fd82c3: am 9445df6f: am 95be178d: am c4d7c826: am f8c2ffef: am c8fd50b1: am 29b98884: Merge "Revert "During early boot, send LOCALE_CHANGED only to registered receivers"" into lmp-mr1-dev

* commit '01c3750504834929eed709d917d7220ba50673e8':
Revert "During early boot, send LOCALE_CHANGED only to registered receivers"
94d5ade9ea645914e22bb356ddcaeb814bf02596 06-Jun-2015 Justin Harrison <astyrrian@google.com> am 705a35de: am c3b9156e: am 6715ef75: am 4f2927d2: am 0eeb3bb8: am 33aa55b1: am 127d0b80: Merge "Revert "Revert "During early boot, send LOCALE_CHANGED only to registered receivers""" into lmp-mr1-dev

* commit '705a35de3adcd3406687bad66d4bd45f3a6725f8':
Revert "Revert "During early boot, send LOCALE_CHANGED only to registered receivers""
01c3750504834929eed709d917d7220ba50673e8 06-Jun-2015 Justin Harrison <astyrrian@google.com> am 00fd82c3: am 9445df6f: am 95be178d: am c4d7c826: am f8c2ffef: am c8fd50b1: am 29b98884: Merge "Revert "During early boot, send LOCALE_CHANGED only to registered receivers"" into lmp-mr1-dev

* commit '00fd82c3f773f6e18605daf8f00b62e996e41588':
Revert "During early boot, send LOCALE_CHANGED only to registered receivers"
dd335a119fe53eebc778cefad6ebcf321ca51701 06-Jun-2015 Stefan Kuhne <skuhne@google.com> am 00032442: am a3590bff: am 5c6c06bf: Merge "Adding am send-trim-memory command" into mnc-dev

* commit '000324423f16362cd14b805af801a4ea3dfd8cd0':
Adding am send-trim-memory command
c3b9156e284b689845e65880b60be2efc9fa4127 06-Jun-2015 Justin Harrison <astyrrian@google.com> am 6715ef75: am 4f2927d2: am 0eeb3bb8: am 33aa55b1: am 127d0b80: Merge "Revert "Revert "During early boot, send LOCALE_CHANGED only to registered receivers""" into lmp-mr1-dev

* commit '6715ef754a72fdc2477257051e539c38aae6afcd':
Revert "Revert "During early boot, send LOCALE_CHANGED only to registered receivers""
9445df6f0b2c6e623e9773bb8a5a1f51cc75ff76 06-Jun-2015 Justin Harrison <astyrrian@google.com> am 95be178d: am c4d7c826: am f8c2ffef: am c8fd50b1: am 29b98884: Merge "Revert "During early boot, send LOCALE_CHANGED only to registered receivers"" into lmp-mr1-dev

* commit '95be178dafd0dfefcae060f65df296cb523f82a4':
Revert "During early boot, send LOCALE_CHANGED only to registered receivers"
000324423f16362cd14b805af801a4ea3dfd8cd0 06-Jun-2015 Stefan Kuhne <skuhne@google.com> am a3590bff: am 5c6c06bf: Merge "Adding am send-trim-memory command" into mnc-dev

* commit 'a3590bffa11dabd0721b731f53e0a1ad84caeabc':
Adding am send-trim-memory command
5c6c06bf187e6e96d9db1398108d613f86f5a912 06-Jun-2015 Stefan Kuhne <skuhne@google.com> Merge "Adding am send-trim-memory command" into mnc-dev
16045c24fe10cc92329ede099923f1223f49b17d 05-Jun-2015 Stefan Kuhne <skuhne@google.com> Adding am send-trim-memory command

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

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

Bug: 21633189
Change-Id: I7a41ce02c3c9043ffd3e5aaa791f7b7306a9de49
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0e5f110fc915a9b044eb04cd07ae7ac588eacc8f 06-Jun-2015 Tim Kilbourn <tkilbourn@google.com> Pass an args bundle to launchAssistAction.

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

Bug: 21666123
Change-Id: I0f8c09e2f617606bef481bdff924cb6b9b47dd12
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a3601ad430998d1b0205b5a7789b1987626ac16a 04-Jun-2015 Dianne Hackborn <hackbod@google.com> am 4752d671: am 7771406d: am b0a5e78f: Merge "More API changes." into mnc-dev

* commit '4752d671f2789cb0a369a6bd4d9a1188fb46f042':
More API changes.
4752d671f2789cb0a369a6bd4d9a1188fb46f042 04-Jun-2015 Dianne Hackborn <hackbod@google.com> am 7771406d: am b0a5e78f: Merge "More API changes." into mnc-dev

* commit '7771406d95ae5cfb83c17d0e0ed710e33925b39e':
More API changes.
6715ef754a72fdc2477257051e539c38aae6afcd 04-Jun-2015 Justin Harrison <astyrrian@google.com> am 4f2927d2: am 0eeb3bb8: am 33aa55b1: am 127d0b80: Merge "Revert "Revert "During early boot, send LOCALE_CHANGED only to registered receivers""" into lmp-mr1-dev

* commit '4f2927d22415b9a38f34645ae7909592d574c170':
Revert "Revert "During early boot, send LOCALE_CHANGED only to registered receivers""
95be178dafd0dfefcae060f65df296cb523f82a4 04-Jun-2015 Justin Harrison <astyrrian@google.com> am c4d7c826: am f8c2ffef: am c8fd50b1: am 29b98884: Merge "Revert "During early boot, send LOCALE_CHANGED only to registered receivers"" into lmp-mr1-dev

* commit 'c4d7c826486868e31bacfe2265b96af1ff3115ea':
Revert "During early boot, send LOCALE_CHANGED only to registered receivers"
127d0b8065cb87fafddd0cf65a33e42afac69672 03-Jun-2015 Justin Harrison <astyrrian@google.com> Merge "Revert "Revert "During early boot, send LOCALE_CHANGED only to registered receivers""" into lmp-mr1-dev
aa9a679b00ea62677cb213fcca6af501870e4daf 03-Jun-2015 Justin Harrison <astyrrian@google.com> Revert "Revert "During early boot, send LOCALE_CHANGED only to registered receivers""

This reverts commit c48c31394e7e5dc104d22644d0e4e4a6a607497a.

Change-Id: Ia2b59da5d953a8a692c0e2f5eabb12e952dbdea1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
29b988846721eb870df9813a950ef31a2ecacebd 03-Jun-2015 Justin Harrison <astyrrian@google.com> Merge "Revert "During early boot, send LOCALE_CHANGED only to registered receivers"" into lmp-mr1-dev
c48c31394e7e5dc104d22644d0e4e4a6a607497a 03-Jun-2015 Justin Harrison <astyrrian@google.com> Revert "During early boot, send LOCALE_CHANGED only to registered receivers"

This reverts commit afd883f8a3ee260a5505f83d628c0b789871c837.

Change-Id: Ia4fadbbc7e531d13cd9e9019f0cdb30cc090cb7a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
69c6adc96eecfde74ceb83cf9177428dc08b6067 02-Jun-2015 Dianne Hackborn <hackbod@google.com> More API changes.

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

Clean up some more of the VoiceInteractionSession APIs.

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

Change-Id: I962d4069fcb34fe89547a95d395ae1b9fa3b4148
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a8df7a9047c1324312c361a5364f4a8dcaae1611 01-Jun-2015 Wale Ogunwale <ogunwale@google.com> am 0f486a6e: am 320b9534: am 4021117d: Merge "Allow app to stop lockTaskMode if started by manifest attribute" into mnc-dev

* commit '0f486a6e380a851c4d28039c4616eb7baf39ac0d':
Allow app to stop lockTaskMode if started by manifest attribute
0f486a6e380a851c4d28039c4616eb7baf39ac0d 01-Jun-2015 Wale Ogunwale <ogunwale@google.com> am 320b9534: am 4021117d: Merge "Allow app to stop lockTaskMode if started by manifest attribute" into mnc-dev

* commit '320b953417ef8a048ede95ba933046b60c3b7532':
Allow app to stop lockTaskMode if started by manifest attribute
2c8c30ac3cbd899cefc9b963669f3a18df08b425 01-Jun-2015 Wale Ogunwale <ogunwale@google.com> Allow app to stop lockTaskMode if started by manifest attribute

It is possible lockTaskMode was started by the system process
because android:lockTaskMode is set to a locking value in the
application's manifest instead of the app calling
startLockTaskMode. In this case TaskRecord.mLockTaskUid will
be 0, so we compare the callingUid to the
TaskRecord.effectiveUid instead so the app can exit lockTaskMode.

Bug: 21464182
Change-Id: Ibca6de8e4b17051d5fcbb05cde9c8aefed7216f2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a201082c20ac5ca2b4badbfff789482533e02f0b 29-May-2015 Wale Ogunwale <ogunwale@google.com> am a001e51f: am 0dbc5b58: am c7cbdd11: Merge "Don\'t kill process with active service/receiver when task is removed." into mnc-dev

* commit 'a001e51f3ede9848955a1ab3b0a5fd24b4321e2a':
Fix build
Don't kill process with active service/receiver when task is removed.
a001e51f3ede9848955a1ab3b0a5fd24b4321e2a 29-May-2015 Wale Ogunwale <ogunwale@google.com> am 0dbc5b58: am c7cbdd11: Merge "Don\'t kill process with active service/receiver when task is removed." into mnc-dev

* commit '0dbc5b582c40bf8830362fe0bb5b64d100d7fe5d':
Don't kill process with active service/receiver when task is removed.
e6ca5b3720f02b86c6dbedfef268e7a5050a1de4 29-May-2015 Dianne Hackborn <hackbod@google.com> am e6562d90: am da71e100: am 4573dddc: Merge "Add new API to set URI on AssistContent." into mnc-dev

* commit 'e6562d903b9e62b4d4c6c08307a39577f15f1c49':
Add new API to set URI on AssistContent.
c7cbdd11c322daa3a3c7acbf7e457c3ccf34c4d3 29-May-2015 Wale Ogunwale <ogunwale@google.com> Merge "Don't kill process with active service/receiver when task is removed." into mnc-dev
e6562d903b9e62b4d4c6c08307a39577f15f1c49 29-May-2015 Dianne Hackborn <hackbod@google.com> am da71e100: am 4573dddc: Merge "Add new API to set URI on AssistContent." into mnc-dev

* commit 'da71e1004082427e36db21c39f47b13e0afa8ed4':
Add new API to set URI on AssistContent.
4573dddcce3f232d2eeb20bfe0e204e15a9416e9 28-May-2015 Dianne Hackborn <hackbod@google.com> Merge "Add new API to set URI on AssistContent." into mnc-dev
94ea95d0d80c4ee47a0b092e5ad2274eb9a8ee97 28-May-2015 David Srbecky <dsrbecky@google.com> am 9d698acf: am efe01cc6: am 3976a569: Merge "Replace --include-cfi with --generate-debug-info."

* commit '9d698acfc487e2e161bc3e56d7ba664c329a57a3':
Replace --include-cfi with --generate-debug-info.
9d698acfc487e2e161bc3e56d7ba664c329a57a3 28-May-2015 David Srbecky <dsrbecky@google.com> am efe01cc6: am 3976a569: Merge "Replace --include-cfi with --generate-debug-info."

* commit 'efe01cc62ee49f57c34726ec9c13ddaa9c1b1d8b':
Replace --include-cfi with --generate-debug-info.
09d57fe9b357495b7bc62be39a8befa00d9d7ffb 28-May-2015 Dianne Hackborn <hackbod@google.com> Add new API to set URI on AssistContent.

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

Change-Id: Ib40cc3b152bafeb358fd3adec564a7dda3a0dd1d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f39477b592e6e17fe41ace2e18602a69b2dd1619 28-May-2015 David Srbecky <dsrbecky@google.com> Replace --include-cfi with --generate-debug-info.

This follows a change in dex2oat.

Change-Id: I46b61298ca00bee2e83080456b180d63efd95b8f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e79c697eed712a03af7b50f26561eaf6c279b294 28-May-2015 Martijn Coenen <maco@google.com> am ef243d09: am 05b5850a: am f3f53d9e: Merge "Trace process launch from ActivityManager." into mnc-dev

* commit 'ef243d091013c7f645ca4ccb5d522cf86c1b5141':
Trace process launch from ActivityManager.
f3f53d9e8d1e4ae05f6495ce1828b9a6f61f4632 28-May-2015 Martijn Coenen <maco@google.com> Merge "Trace process launch from ActivityManager." into mnc-dev
dcfbae30d19a5e2aab4ffc380b6cde7874e15cd6 27-May-2015 Julia Reynolds <juliacr@google.com> am 5d49caa3: am bd24ba18: am 77aa9afe: Merge "Fallback to priority activity if preferred activity not available." into mnc-dev

* commit '5d49caa32330368eff04bc69c4272c37c3fa880b':
Fallback to priority activity if preferred activity not available.
843f648c821eef6bd1ade3bc3b8a17f94f85129a 27-May-2015 Julia Reynolds <juliacr@google.com> Fallback to priority activity if preferred activity not available.

Bug: 21434199
Change-Id: I1f268700219dea7f9ed02bda320923f49a5a3457
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
21531bce0e8848311c7f8caceeee3b988c7396f4 27-May-2015 Wale Ogunwale <ogunwale@google.com> am 57141700: am 0f771240: am bf0439a7: am 02f3cf79: am 523a19bf: am c9a0c0b9: Lockdown AM.getRunningAppProcesses API with permission.REAL_GET_TASKS

* commit '5714170091065bb51f33c8f3ce272db07f69a21b':
Lockdown AM.getRunningAppProcesses API with permission.REAL_GET_TASKS
02f3cf79989b202a45753ad74653d48f7d73c73d 27-May-2015 Wale Ogunwale <ogunwale@google.com> am 523a19bf: am c9a0c0b9: Lockdown AM.getRunningAppProcesses API with permission.REAL_GET_TASKS

* commit '523a19bf3df202c58369279fc4e538e9e342c1e7':
Lockdown AM.getRunningAppProcesses API with permission.REAL_GET_TASKS
523a19bf3df202c58369279fc4e538e9e342c1e7 27-May-2015 Wale Ogunwale <ogunwale@google.com> am c9a0c0b9: Lockdown AM.getRunningAppProcesses API with permission.REAL_GET_TASKS

* commit 'c9a0c0b90773fded6c251646300231f67c891b78':
Lockdown AM.getRunningAppProcesses API with permission.REAL_GET_TASKS
5069e675b7da20c4983d4306d3c6c19101d82e4a 27-May-2015 Wale Ogunwale <ogunwale@google.com> Don't kill process with active service/receiver when task is removed.

Bug: 20046621
Change-Id: Ib2e555802f1d3da0c0b78803badd612cab18ce32
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
dee3823670a0930ee90b1ba64822abdd530a1f4f 27-May-2015 Svetoslav <svetoslavganov@google.com> am 62969048: am d3f88dd4: am 80ce4ad6: Merge "Clear binder id after a permissions check before killing a UID." into mnc-dev

* commit '6296904856d3ad195c0c4fa18e2c33506ce1e736':
Clear binder id after a permissions check before killing a UID.
5d4a67ff607862dc610aadce23091249342ae8b7 27-May-2015 Christopher Tate <ctate@google.com> am d3fc46c7: am b3c5aebd: am 2d091225: Merge "Gracefully handle races with package uninstall" into mnc-dev

* commit 'd3fc46c7e8c42f4f0ce00cd79bcad7ffc2519789':
Gracefully handle races with package uninstall
80ce4ad644af507b20eeac3d2ecf937ef4abd2de 27-May-2015 Svetoslav <svetoslavganov@google.com> Merge "Clear binder id after a permissions check before killing a UID." into mnc-dev
0507d6b850218066d3d4e66f18fb408789c06b5c 26-May-2015 Svetoslav <svetoslavganov@google.com> Clear binder id after a permissions check before killing a UID.

bug:21035702

Change-Id: I2798d28780421720d85c5b49fa28897aa6c76d97
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
058650a28780276caac1e022d8ef2b203a9529d0 27-May-2015 Wale Ogunwale <ogunwale@google.com> am 83101c83: am 027a8733: am b944fdc1: Merge "Converted more AMS Log calls to use ActivityManagerDebugConfig" into mnc-dev

* commit '83101c833f0cd1769caf4cb8026f31a2c55dfa71':
Converted more AMS Log calls to use ActivityManagerDebugConfig
2d09122563360b377a1e66ebbdf084af9cb881e8 27-May-2015 Christopher Tate <ctate@google.com> Merge "Gracefully handle races with package uninstall" into mnc-dev
6ce8165bf3f33db2237203c5658098d6c501c624 26-May-2015 Christopher Tate <ctate@google.com> Gracefully handle races with package uninstall

Bug 21417673

Change-Id: I46f9bf86454d356742f7bd5226a685257a40ced7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0fc365c1455ebd4064474d27774f41cfcd8e1cb5 26-May-2015 Wale Ogunwale <ogunwale@google.com> Converted more AMS Log calls to use ActivityManagerDebugConfig

Bug: 21276405
Change-Id: I90d47b1b28f716e650df7f4377ed7cdd30b46ec8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c9a0c0b90773fded6c251646300231f67c891b78 07-Apr-2015 Wale Ogunwale <ogunwale@google.com> Lockdown AM.getRunningAppProcesses API with permission.REAL_GET_TASKS

* Applications must now have ...permission.REAL_GET_TASKS to
be able to get process information for all applications.
* Only the process information for the calling application will be
returned if the app doesn't have the permission.
* Privilages apps will temporarily be able to get process information
for all applications if they don't have the new permission, but have
deprecated ...permission.GET_TASKS.

Bug: 20034603
Change-Id: I67ae9491f65d2280adb6a81593693d499714a216
(cherry picked from commit 9dbaa54f6834e013a63f18bd51ace554de811d80)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
73795315885adba0732af5cf19f4eeecd559bf30 22-May-2015 Maxim Bogatov <maximbogatov@google.com> Merge "Limit large font accessibility setting to user profile."
4f11754f72ac4c60448b36a1a933cdc2d7bc1870 08-May-2015 Wojciech Staszkiewicz <staszkiewicz@google.com> Pass charset to XmlPullParser.setInput instead of null

Passing null to XmlPullParser.setInput forces it to do additional
work, which can be easily avoided if we know the charset beforehand.

bug: b/20849543

(cherry picked from commit 9e9e2e73c6ec7bece20268196dc89ad0c8bafad4)

Change-Id: Iaff97be9df2d0f99d7af8f19f65934439c9658e2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
033c8797bd97dcc04e3fac52024998c97d28073b 20-May-2015 Martijn Coenen <maco@google.com> Trace process launch from ActivityManager.

Change-Id: I13b7695fba2e77428a74c0215f65eea8d07dda07
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8b20cdb27bc5b4c433c4fc650203be9a25842bbd 22-May-2015 Dianne Hackborn <hackbod@google.com> Merge "Add API to track usage time of apps." into mnc-dev
b5a380d409a1431a38db978864b9d85b689e3cce 21-May-2015 Dianne Hackborn <hackbod@google.com> Add API to track usage time of apps.

This adds a new ActivityOption for the caller to ask the
system to track the time the user is in the app it launches,
delivering the result when they are done.

The time interval tracked is from when the app launches the
activity until the user leaves that app's flow. They are
considered to stay in the flow as long as new activities
are being launched or returned to from the original flow,
even if they cross package or task boundaries. For example,
if the originator starts an activity to view an image, and
while there the user selects to share, which launches gmail
in a new task, and they complete the share, the time during
that entire operation will be included.

The user is considered to complete the operation once they
switch to another activity that is not part of the tracked
flow. For example, use the notification shade, launcher, or
recents to launch or switch to another app. Simply going
in to these navigation elements does not break the flow
(although the launcher and recents stops time tracking of
the session), it is the act of going somewhere else that
completes the tracking.

The data is delivered to the app through a PendingIntent,
which includes the total time the app was in the flow along
with a time break-down by app package.

Change-Id: If1cf8892d422c52ec5042eba0e15a8e7e8f83abf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
05075305b4bac26df1c97af1901171ba26f0a48b 20-May-2015 Maxim Bogatov <maximbogatov@google.com> Limit large font accessibility setting to user profile.

There were 2 problems:
1) When Settings application updated font size it called
ActivityManagerNative.updatePersistentConfiguration() that makes IPC
call to system_process. Then font size was persisted in system_process.
But, the user id we save with the font size if calculated based on the
current process, which is UserHandle.USER_OWNER for the system_process.

2) When user was changed font size was not read from database. Font size
from current configuration was always used.

b/18305168

Change-Id: Id847935a1ab1da3ef133e28ed6928c99c5fe0f16
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
db49fec8aaf78ffe091014bbfe04a9843f974986 22-May-2015 Craig Mautner <cmautner@google.com> For getHomeActivity() only return current user.

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

Also remove some cruft that accumulated.

Fixes bug 21055376.

Change-Id: Ic1d58129aedbe3624f8a9d12c05c84674687b0a4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4a3b824b23f13406fdc12d5f3ebb221c32459f31 21-May-2015 Craig Mautner <cmautner@google.com> Add debug for bug 21055376.

Change-Id: I1e93fb225f2639af031cdfa748a7898f31ad5a94
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
432f64ee969271dc236b63431e5f6e306993dfce 20-May-2015 Craig Mautner <cmautner@google.com> Avoid resuming activity before launch.

The locktask logic would always bring a locked task to the front and
then resume it when locking. When a task is to be locked at launch that
would cause it to resume immediately before onLaunch was called. Which
would cause havoc because the token was not yet in
ActivityThread.mActivities. This lead to premature finish() calls and
looping restarts.

This change causes the resume to only be called when an app calls
startLockTask. Otherwise the resume call is skipped.

Plus additional locktask debug logging.

Fixes bug 21031298.

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

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

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

Change-Id: I77359164c40d0f36fe1ef296dd9f9c3062431148
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
63b007e651f7b487b09f42f13fe03e0327edea6f 19-May-2015 Stefan Kuhne <skuhne@google.com> Fixing build breakage

There was a merge conflict due to 2 overlapping CL's.

Bug: 20763296
Change-Id: Ib5e8476587dfd1354d288150501771df4b3b7ec8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e88d1e5926d3f3e8a4ceaced7dad7bdc8bc61fa4 18-May-2015 Stefan Kuhne <skuhne@google.com> Revert "Backup/restore recents task list"

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

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

Bug: 15986349
Bug: 19014377
Bug: 20763296

Change-Id: I06fd35a43036ef0b7260cf4db9c42890df63b95d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
038959e851603500eb39b52fef33cbe75dbd73e3 15-May-2015 Adam Lesinski <adamlesinski@google.com> Merge "Remove UID from kernel cpu accounting when uninstalled" into mnc-dev
b99e6d69c30056520f7cb793e4be1851b3bd8426 15-May-2015 Adam Lesinski <adamlesinski@google.com> Merge "Parse uid_cputime proc file" into mnc-dev
4f9fd626d32989fe76c29e092d1fc591c6a8e1eb 15-May-2015 Wale Ogunwale <ogunwale@google.com> Merge "Clean-up broadcast receivers when component is disabled." into mnc-dev
ca1c12581a794db7569c7408b3547bf04f9bb3c9 15-May-2015 Wale Ogunwale <ogunwale@google.com> Clean-up broadcast receivers when component is disabled.

Bug: 15804187
Change-Id: Ib672f720bd5c8d81d3846568ef53f7723685f317
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
dbb902d4adffaad1d054e5179552e46d047f7832 13-May-2015 riddle_hsu <riddle_hsu@htc.com> Also restart provider if there is external handle.

e.g. ContentResolver.getType will call
ActivityManagerService.getProviderMimeType
that will not have connection but increase
externalProcessNoHandleCount.

Change-Id: I649c0b2390a749c77c6be5e7dfadc1acb689ec4c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e0570201f59342ef02412ece2f179ef42441a032 13-May-2015 Craig Mautner <cmautner@google.com> Lock top task if whitelisting arrives after start.

If the DevicePolicyManagerService updates the whitelist after a task
in the whitelist has started then the task won't have started locked.

When the updated whitelist arrives this change automatically locks the
topmost task if it is in the whitelist.

Also more locktask debugging.

Fixes bug 21031298.

Change-Id: I2494af6f2819ca91bc01abc5decb3d1adc088226
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9e9e2e73c6ec7bece20268196dc89ad0c8bafad4 08-May-2015 Wojciech Staszkiewicz <staszkiewicz@google.com> Pass charset to XmlPullParser.setInput instead of null

Passing null to XmlPullParser.setInput forces it to do additional
work, which can be easily avoided if we know the charset beforehand.

bug: b/20849543

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

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

Bug: 19964562
Change-Id: Ifef8abd189a3146d854b81b9b948861e4d38c155
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
691a1737a34bb3afe6f8405b5fb26f31aaa5b4b2 13-May-2015 riddle_hsu <riddle_hsu@htc.com> Also restart provider if there is external handle.

e.g. ContentResolver.getType will call
ActivityManagerService.getProviderMimeType
that will not have connection but increase
externalProcessNoHandleCount.

Change-Id: I649c0b2390a749c77c6be5e7dfadc1acb689ec4c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b83ffee5a40bf00e156152ad85bf8cf6bb96e2f1 12-May-2015 Adam Lesinski <adamlesinski@google.com> Remove UID from kernel cpu accounting when uninstalled

Bug:20182139
Change-Id: I77d41570c6aa0efd927b7beb266ef249ed9abff1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
06af1fac166a83507450b6bbb1f98a8dde68d92e 06-May-2015 Adam Lesinski <adamlesinski@google.com> Parse uid_cputime proc file

Instead of using the ProcessCpuTracker as the source of truth, we
periodically poll the new uid_cputime kernel module for stats
on all UID cpu time.

TODO: Need to tell the kernel when to stop tracking UIDs (aka on package
uninstall).

Change-Id: Id1d251aae23ab53f7acc0aba3bca5118bc2c194a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f931e3c28422a9169e01b2be62ac17c5159a70d0 12-May-2015 Dianne Hackborn <hackbod@google.com> Merge "Always use REGISTERED_ONLY when appropriate." into mnc-dev
e0d90c8221c20409cc8c906942c41d3db04f45a5 12-May-2015 Dianne Hackborn <hackbod@google.com> Always use REGISTERED_ONLY when appropriate.

Previously we would only check mProcessesReady when going
through the public calls to send broadcasts; now handle it
even if the activity manager is calling its internal
implementation.

Change-Id: I702b4cb85b35a7a051ef05c9875a39f5fa03f0f1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c7374318a69d4341235bd143b9fdae2cabcea3e9 12-May-2015 Christopher Tate <ctate@google.com> am 7a4cfa58: am 960cb481: am 613626b7: am afd883f8: During early boot, send LOCALE_CHANGED only to registered receivers

* commit '7a4cfa58b1421f95266acc4f6a1683804726a0e0':
During early boot, send LOCALE_CHANGED only to registered receivers
7a4cfa58b1421f95266acc4f6a1683804726a0e0 12-May-2015 Christopher Tate <ctate@google.com> am 960cb481: am 613626b7: am afd883f8: During early boot, send LOCALE_CHANGED only to registered receivers

* commit '960cb4816c082eee52a221052a8e4232f0c0fb14':
During early boot, send LOCALE_CHANGED only to registered receivers
bb9d9278aa6fe3ba3d4c21b03d3e3da4543a974c 12-May-2015 Amith Yamasani <yamasani@google.com> Merge "Idle timebase" into mnc-dev
afd883f8a3ee260a5505f83d628c0b789871c837 12-May-2015 Christopher Tate <ctate@google.com> During early boot, send LOCALE_CHANGED only to registered receivers

Bug 20855725
Bug 19060618

Change-Id: I368660ecc6ee97a0c2a2f627fa1b09288bc92bd1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
06bf824628c118fbd5ad6756913d7fd63a6f4ce5 09-May-2015 Amith Yamasani <yamasani@google.com> Idle timebase

Use screen on time as timebase for idling out apps
that have been inactive.

Store the time when an app was last active as an additional
package state in UsageStats. Compare it to screenOnTime to decide
if it's inactive.

Exclude device idle whitelist from apps that can go inactive.

Bug: 20066058

Change-Id: I709f9f31a9affa7ca6e1ae3e4c5729c5fb221669
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bcb6c1eb9e762455510645eb47579f7d597d6b78 11-May-2015 Fyodor Kupolov <fkupolov@google.com> Fix errors during user switching

Fix NPE in getHomeActivityForUser. Skip system processes in
killBackgroundUserProcessesWithRecordAudioPermission.

Bug: 21016983
Change-Id: I97f9ca362f4dbf0a659e3d5d7ae6cd8dbeb6404a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b501330a1b6ef14ff512a5727f7a01bc423d6fbb 18-Apr-2015 Fyodor Kupolov <fkupolov@google.com> Disable multi-user background recording

On user switch, kill existing processes of the background user with
android.permission.RECORD_AUDIO permission. Home activity should not be
killed to avoid an expensive restart of the home launcher, when the
user switches back.

Introduced DISALLOW_RECORD_AUDIO user restriction, which is enabled for the
background user, and removed for the foreground user.

Introduced a concept of system controlled user restriction, which can only
be set by the system, rather than device administrator.

Bug: 20346194
Change-Id: Ic942fd565e80d14424230dae612965a8e229c4ef
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f2f37781701407acfc64098370b6db1ee70613a2 09-May-2015 Christopher Tate <ctate@google.com> am e8334254: am 4f35e169: am 4475e7df: am ea2c4033: Mark persistent apps as such when the ProcessRecord is created

* commit 'e83342540b2b7dc7571c12768007697685a6add5':
Mark persistent apps as such when the ProcessRecord is created
b2fa5f3160cfc9b1703c6970649a926370971ea9 09-May-2015 Wale Ogunwale <ogunwale@google.com> Merge "Clean-up component states in AMS when component is disabled" into mnc-dev
e83342540b2b7dc7571c12768007697685a6add5 09-May-2015 Christopher Tate <ctate@google.com> am 4f35e169: am 4475e7df: am ea2c4033: Mark persistent apps as such when the ProcessRecord is created

* commit '4f35e1699a4b62bd71bed27fece85e2c026210d1':
Mark persistent apps as such when the ProcessRecord is created
540e123b14ef71f0bfda325e11773c1c510fb8ba 02-May-2015 Wale Ogunwale <ogunwale@google.com> Clean-up component states in AMS when component is disabled

Bug: 15804187
Change-Id: I2b5856c5a0a012f34698fb64f8596d32924bbd1f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ea2c403311f741f5a0a9688847cfd17041c81c0d 08-May-2015 Christopher Tate <ctate@google.com> Mark persistent apps as such when the ProcessRecord is created

...rather than only during the OS's "time to start the persistent apps"
boot phase. This closes a window of opportunity during which a
persistent app container may be live without having been properly
noted as such, because it wound up being launched prior to the
[rather late] boot phase at which the persistent apps are directly
enumerated and bookkeeping for them established.

Bug 20855725

Change-Id: I41822b412de4540dbdeab300b38089303678f76c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c14b9cf628471f4f3b34d7c91ef193326eff92c6 13-Mar-2015 Richard Uhler <ruhler@google.com> Add 'App Summary' section to meminfo.

The 'App Summary' section is shown by default when other memory
details are shown. This adds a new meminfo flag '-s' to show only the
App Summary section.

Change-Id: I66913673cd3afca873a8b13e45abe071d4c57b82
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e02b7868c6c8f856a21f36569a77dab7f1cc7c78 05-May-2015 Kenny Guy <kennyguy@google.com> Merge "Call profile changed in cases were focused activity is nulled." into mnc-dev
019d2304998f3ed77c0a608df6cf4bea1138f8dc 04-May-2015 Svet Ganov <svetoslavganov@google.com> Permission UI - legacy apps support

Change-Id: Id3f98c138422d33868363d587dd196898b42a0d4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b9d71a6f89b1183f6389b1774652445a420c6cbf 30-Apr-2015 Svet Ganov <svetoslavganov@google.com> Add body sensors app op - framework base

Change-Id: Idd5cd573fab3405e5b2a6e51d2d9d115650826e9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4c5067ea8e33974c81fb69f3565dd93634bea132 30-Apr-2015 Kenny Guy <kennyguy@google.com> Call profile changed in cases were focused activity is nulled.

Fix case where profile changed listener isn't called as
focused acitivity is set to null due to app crash.

Bug: 20254760
Change-Id: Ifc296682b9f7cb85c05137e8ad6ad74d31bf6eff
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fcda22b1fe33370922a53d6562aa15366818bd45 30-Apr-2015 Andreas Gampe <agampe@google.com> Merge "am b6d14a00: resolved conflicts for merge of c29791d5 to mnc-dev-plus-aosp" into mnc-dev
e31b820dad4c5f2b19ee10479a675a139ad3c61e 30-Apr-2015 Jeff Sharkey <jsharkey@android.com> New "frozen" state during app move/upgrade.

This replaces mOperationPending, which was in an odd place. It adds
a new PackageSetting.frozen flag that is a last-ditch effort to
prevent ActivityManager from starting an app while it's being moved
or upgraded.

Also provides clearer guarding around all upgrades by freezing,
killing, upgrading, then unfreezing.

Bug: 20275579
Change-Id: I28bb0359a6f4e05080fb336b18dd2a249509d989
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f7b795ca1a552909d333ed3f2d5ec881a8b23144 30-Apr-2015 Dianne Hackborn <hackbod@google.com> Merge "Update use of procstate for services." into mnc-dev
d69e4c1460017062e7c36be55801cb434ad19d97 24-Apr-2015 Dianne Hackborn <hackbod@google.com> Update use of procstate for services.

Now that we have a separate foreground service proc state
(above a sleeping top app), update various system services
to put their bindings into this state when appropriate.

There are two new bind flags for this -- one that just always
makes it a foreground service, another that only does it when
the device is awake (useful for things like the wallpaper).

And with all of that, tweak network policy manager to only
include apps that are at least foreground service state when
in power save and device idle modes. This will allow us to
further reduce the set of apps that have network access
(in particular not giving access to the current top app when
the screen is off), hopefully leading to even better battery
life.

Change-Id: I91d85a5c5ed64e856149e9a5d94a634a7925ec7f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
00758a3b370879ac1f21fc85c291f741f947eca3 29-Apr-2015 Wale Ogunwale <ogunwale@google.com> Merge "Some code clean-up." into mnc-dev
c14624da8e6155fccbe3c0e9a3623ed5385224ff 29-Apr-2015 Wale Ogunwale <ogunwale@google.com> Some code clean-up.

Change-Id: I626c4c40c32dbf43408e0649364dfe8be2bb2321
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fa5ecdc4ac6d7a8db2bb9e4a6a60a3189025df30 28-Apr-2015 Svet Ganov <svetoslavganov@google.com> Respect the record audio app op - framework

Change-Id: I5696d2ef22738ccffaf8bd7a0ee68cbc3dea3bf1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
27c39f1adeaf1a653fb41a5af64ee815b8048dd6 27-Apr-2015 Andreas Gampe <agampe@google.com> am b6d14a00: resolved conflicts for merge of c29791d5 to mnc-dev-plus-aosp

* commit 'b6d14a009e43a4d61ae2a4f98f6e3b914148d0a9':
Frameworks/base: Add debug.gencfi property

(cherry picked from commit a5b55a017a984608eacdf414bc1cbcd7615f1c13)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
13c58bacc8f1ff35bb24ba19069bab8a41aabf68 20-Apr-2015 Julia Reynolds <juliacr@google.com> Allow device initializers to set a preferred setup activity.

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

Bug: 20223050
Change-Id: I335aeb010a1ae5db07a4343d26e160c74bd299e1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a876b35d485008b690578889d11e69b40d4e7170 25-Apr-2015 Andreas Gampe <agampe@google.com> Frameworks/base: Add debug.gencfi property

Add the debug.gencfi system property that forces generation of
CFI data.

Change-Id: Ida66f8c1567634d05cfdbba1a982be3684e94369
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a298a96af77f0cb638b4e2be2ab762d0183ee813 24-Apr-2015 Olawale Ogunwale <ogunwale@google.com> am 3846d3a4: am 6d856bfb: am cf7d2d95: Merge "[ActivityManager] Avoid orphan ContentProviderRecord."

* commit '3846d3a4c5d79a9d7e86e43c64a5c21a29036de0':
[ActivityManager] Avoid orphan ContentProviderRecord.
6d856bfba5b6ae488d49c4909510cd87000cd922 24-Apr-2015 Olawale Ogunwale <ogunwale@google.com> am cf7d2d95: Merge "[ActivityManager] Avoid orphan ContentProviderRecord."

* commit 'cf7d2d95adb358a628c2622b43a999d3ab784406':
[ActivityManager] Avoid orphan ContentProviderRecord.
cf7d2d95adb358a628c2622b43a999d3ab784406 24-Apr-2015 Olawale Ogunwale <ogunwale@google.com> Merge "[ActivityManager] Avoid orphan ContentProviderRecord."
015c5e57b58d26ae53849c02d3aebfcd52d85c3d 23-Apr-2015 Craig Mautner <cmautner@google.com> Disallow data clearing of DeviceOwner.

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

Fixes bug 20107015.

Change-Id: I4ef313b394bd8059d19d20aa6533396305d1357d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
81786701b61f8295c8f7c9c1861642233910b056 22-Apr-2015 Craig Mautner <cmautner@google.com> Merge "Add API for putting up locktask pinning toast."
d080ef216e9a12339382cea94f07ea20ea217786 22-Apr-2015 Olawale Ogunwale <ogunwale@google.com> am 8ac2478b: am f7be8b67: am fa147b5c: Merge "[ActivityManager] Move UI operation to UI handler"

* commit '8ac2478b97ccb3f5e94b4df50c935c8f5cdff99c':
[ActivityManager] Move UI operation to UI handler
bfb8c0bdc2c3f2ba3132ec811b36eea1df90a6c6 22-Apr-2015 Olawale Ogunwale <ogunwale@google.com> am 9e6c83ab: am acaa886c: am 0408187e: Merge "[ActivityManager] Avoid unnecessary restart provider process"

* commit '9e6c83abaf59574ed5c1e9934560ea50abe296be':
[ActivityManager] Avoid unnecessary restart provider process
a93311f91730be33c734689c6dfbbcf7fd12d6d7 21-Apr-2015 Jeff Brown <jeffbrown@google.com> Merge "Make activity manager sleep top activity when dreaming."
c21ae9ed221912b61306e075d3f22726ac04013c 15-Apr-2015 Craig Mautner <cmautner@google.com> Add API for putting up locktask pinning toast.

Fixes bug 18993662.

Change-Id: Ic1753285044857f8ea897784485fd1a9580acf25
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f7be8b6739f174919ad01dcd32788b1b67c6820a 21-Apr-2015 Olawale Ogunwale <ogunwale@google.com> am fa147b5c: Merge "[ActivityManager] Move UI operation to UI handler"

* commit 'fa147b5caf7b44f76aee515afecda639fbc52c22':
[ActivityManager] Move UI operation to UI handler
acaa886ce765c58c1e71b440b623a16ae419f5da 21-Apr-2015 Olawale Ogunwale <ogunwale@google.com> am 0408187e: Merge "[ActivityManager] Avoid unnecessary restart provider process"

* commit '0408187e7d2e7bdb6d0cb0521f49859a3d9a7396':
[ActivityManager] Avoid unnecessary restart provider process
758f714ca8638cf44041d9e1e6442093e73fd664 15-Apr-2015 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Move UI operation to UI handler

Because ANR will dump cpu usage, stack traces in ActivityManager
thread, if system is busy or in low-end device, it may spend more
than 5s to dump. So when there is UI operation (e.g. pop dialog)
in ActivityManager thread, it may meet key dispatch timeout.

Change-Id: Ie550e31a7cff65bdcfc9af2c32989e9deb5fb2cf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
061ea99546fbba1da86094518992cf6b7a125278 18-Apr-2015 Jeff Brown <jeffbrown@google.com> Make activity manager sleep top activity when dreaming.

Added the concept of a sleep token to represent a demand to sleep.
We grab this token whenever a dream window is visible.

This change also deletes a special condition in shouldSleepLocked()
which would tend to keep activities running when the lock screen
was shown unless they had previously been sleeping. I believe this
condition is no longer necessary and the policy is much simpler
without it. Let's see if anything breaks.

NOTE: This can currently only be used within the system server process
but it might make sense to move it to IActivityManager (guarded by
DEVICE_POWER permission) so that keyguard can use it. If we added
a callback on release to inform the client that the underlying activity
has finished drawing then we could untangle a bunch of keyguard
specific logic.

Bug: 18866521
Change-Id: I84b2118f5b990a71a1647d1cee536ad3d99f3a24
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
239d17c05a2694d4c415cb48adeb39e4e3dd386d 16-Apr-2015 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Avoid unnecessary restart provider process

Caller C accesses provider P. Both processes of C and P died
before P publishes, P will still be restarted even there is
no connection because P is in mLaunchingProviders.
When device is low memory, the restarting provider process
may be killed easily before publish because no caller to raise
its oom-adj. Then device will busy keeping restart it.

Solution:
If there is no connection to the provider, do not restart it.

Change-Id: If6f2d2258d78b6c0989c6e5f3e0cad14db821464
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
15df08abd8190353e1430f88c2ed6462d72a5b25 01-Apr-2015 Craig Mautner <cmautner@google.com> Introduce android:lockTaskMode

The ability for tasks to be started in locktask mode or pinned is
dependent on the value of android:lockTaskMode for the root activity
of the task.

For bug 19995702

Change-Id: I514a144a3a0ff7dbdd4987da5361b94bdfe9a437
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
517daeccb29ce42b1ec4b366e7807088cad3f5ed 15-Apr-2015 Wale Ogunwale <ogunwale@google.com> Moved SystemServer binder thread monitor from AMS to Monitor class.

Since to it applies to more than just the ActivityManagerService.

Bug: 19297165
Change-Id: I3affd50aaf8a49589ca48b845d6d31e4a44efb8f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d7fdd0228e6abdbc079f9cf08b780e4222dfe7c5 14-Apr-2015 Wale Ogunwale <ogunwale@google.com> Added watchdog monitor for Binder threads availability.

The watchdog will trigger if all binder threads in the system_server
are stuck for a long time (1min) preventing the process from
handling additional IPC requests.

Bug: 19297165
Change-Id: I5909a9c230bf23917feaed53f2b54bd50425bf3c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
e13b15c8101471c2aae1fbdcd55da9b2d7bbf7b1 13-Apr-2015 Kenny Guy <kennyguy@google.com> Merge "Add foreground profile changed to user switch observer."
429796226a8831af63a6303a58329f6b68f7b100 13-Apr-2015 Kenny Guy <kennyguy@google.com> Add foreground profile changed to user switch observer.

Called when the focused activity changes from one profile
to another to allow sys ui to vary display based on the
current profile.
This reverts commit 735a3f90598be31bca5d551d781280a205a5f27f.
Resubmitting with fix for build break in another package.

Bug: 19531782
Change-Id: I98cd2968ade3b1d23feb90d98057f306695d569e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
48a09a0678752eca242a5379b024da78eb36144f 13-Apr-2015 Kenny Guy <kennyguy@google.com> Merge "Revert "Add foreground profile changed to user switch observer.""
735a3f90598be31bca5d551d781280a205a5f27f 13-Apr-2015 Kenny Guy <kennyguy@google.com> Revert "Add foreground profile changed to user switch observer."

This reverts commit 99b9030a3ececd9b88e5011c98be0a5b9499c776.

Change-Id: If152904f298ecd9e6fd5d038797d061a5c85eec8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d10bd4852291f1c99d2fc011606a695d631504fe 13-Apr-2015 Kenny Guy <kennyguy@google.com> Merge "Add foreground profile changed to user switch observer."
6036cd51265d31c08eefe0470a9f37e7f757aae8 11-Apr-2015 Jeff Sharkey <jsharkey@android.com> Merge "Support moving apps to expanded storage."
5033c1ef5b097a752593156de3dcf5400e6e2508 10-Apr-2015 Olawale Ogunwale <ogunwale@google.com> am 448cb9f9: am 6159f6eb: am 4406568e: Merge "Check caller status precisely when registering receiver."

* commit '448cb9f9ee8c6bd0a53662362f4a71a1fa4bbd5b':
Check caller status precisely when registering receiver.
6159f6eb231028bc6420edf4157fb335e78aca00 10-Apr-2015 Olawale Ogunwale <ogunwale@google.com> am 4406568e: Merge "Check caller status precisely when registering receiver."

* commit '4406568ebac6f6bbf627aeb6909b409d948cecf4':
Check caller status precisely when registering receiver.
4406568ebac6f6bbf627aeb6909b409d948cecf4 10-Apr-2015 Olawale Ogunwale <ogunwale@google.com> Merge "Check caller status precisely when registering receiver."
b15506f95e7b00d9a5b89a0c732689fcad2a12ff 04-Feb-2015 riddle_hsu <riddle_hsu@htc.com> Check caller status precisely when registering receiver.

Fine tune commit 9ac9609f.
Because process may reuse same process record to restart.
It is better to check below conditions to skip:
1. Simple dead and has been cleaned.
=> .thread will be null
2.The process has restarted with new pid but has not attached yet.
=> .thread will be null
3.The process has restarted and attached.
=> The IBinder will be different

Change-Id: Ic052f5025558ca93e1a6ab11bca61fe995126bb9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
99b9030a3ececd9b88e5011c98be0a5b9499c776 01-Apr-2015 Kenny Guy <kennyguy@google.com> Add foreground profile changed to user switch observer.

Called when the focused activity changes from one profile
to another to allow sys ui to vary display based on the
current profile.

Bug: 19531782
Change-Id: I1f98398f4b37ce77077394546906ef4dff06cd47
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b9f3674c11ed9c89b80a69f728cbc5f540b2ecde 09-Apr-2015 Jeff Sharkey <jsharkey@android.com> Support moving apps to expanded storage.

Start deriving the data path for apps based on the volume UUID where
the app lives. This path is used for all higher-level APIs, giving
us a clean place to switch app storage.

When parsing a package, keep track of the volume UUID where it lives
and update PackageSetting once installed. For now continue treating
moves as installs, but we'll eventually clean this up to avoid the
additional dexopt pass. Wire up move to use the new installd command
to move private data between devices.

Cache LoadedApk only for the current user, since otherwise the data
dir points at the wrong path.

Bug: 19993667
Change-Id: I53336e3b147d5fd3130e6800869af172b628da37
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
56a6d371bd4978bb7dfa7cce8bfbcc0bb13abd93 10-Apr-2015 Mathieu Chartier <mathieuc@google.com> am da164973: Merge "Add dalvik subitems for -d in dumpsys meminfo "Total PSS by category""

* commit 'da164973f35aa32e44d0b9336deef28df5b13544':
Add dalvik subitems for -d in dumpsys meminfo "Total PSS by category"
537691fc2dc880d4b469fab82a4d209f6f67de69 09-Apr-2015 Mathieu Chartier <mathieuc@google.com> Add dalvik subitems for -d in dumpsys meminfo "Total PSS by category"

Example output of "adb shell dumpsys meminfo -d":

Total PSS by category:
193605 kB: Dalvik
87561 kB: .Heap
77863 kB: .LOS
15333 kB: .Zygote
12848 kB: .NonMoving
6770 kB: .GC
2597 kB: .LinearAlloc
1180 kB: .JITCache
1180 kB: .IndirectRef
103936 kB: EGL mtrack
101827 kB: Native

Bug: 17643507

(cherry picked from commit 546edc5a31bb5a843048e11d8afb0b1f6441ddb4)

Change-Id: If34627cf93ba5305b428d2278f350a2649d63d5e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b47ba1e7d578338f193a0ca7ec089b6ce382f47e 10-Apr-2015 Mathieu Chartier <mathieuc@google.com> Merge "Add dalvik subitems for -d in dumpsys meminfo "Total PSS by category""
546edc5a31bb5a843048e11d8afb0b1f6441ddb4 09-Apr-2015 Mathieu Chartier <mathieuc@google.com> Add dalvik subitems for -d in dumpsys meminfo "Total PSS by category"

Example output of "adb shell dumpsys meminfo -d":

Total PSS by category:
193605 kB: Dalvik
87561 kB: .Heap
77863 kB: .LOS
15333 kB: .Zygote
12848 kB: .NonMoving
6770 kB: .GC
2597 kB: .LinearAlloc
1180 kB: .JITCache
1180 kB: .IndirectRef
103936 kB: EGL mtrack
101827 kB: Native

Bug: 17643507
Change-Id: Idd3e5560f376157c32094a5fbb84e8b6be4b2843
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
49208d0b9125f78883ad92fc8d4bdc929bdb9403 09-Apr-2015 Fyodor Kupolov <fkupolov@google.com> Merge "Replaced zeros with UserHandle.USER_OWNER"
8b0c61d37818656bcb52fc2d1847b1cc61ec0200 08-Apr-2015 Nick Kralevich <nnk@google.com> heapdump: use appendable file descriptor

For heapdump functionality, there's no need to give apps
readable/writable file descriptors. An append-only file descriptor
is sufficient.

Bug: 20073185
Change-Id: Ib2c42a72b2704db5f1b919c24e33609f7a45e57a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
30b89849032eb57d1da93de40a6a9bd2a5f55a2e 07-Apr-2015 Craig Mautner <cmautner@google.com> Merge "No longer unlock activity manager to test whitelist"
e56007786ace2fe0615197d95317ccd7be4d1ca6 04-Apr-2015 Craig Mautner <cmautner@google.com> No longer unlock activity manager to test whitelist

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

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

Change-Id: I3ed6eb5ceae2cd7e7ae3280abd708d5ce43a2851
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9d1878674c86ab651926e192845d459bfafb6898 07-Apr-2015 Narayan Kamath <narayan@google.com> Merge "Don't set userSetLocale from Configuration.setLocale."
33c375ff9268fda513bebc67ec3e01dcdc56837e 07-Apr-2015 Wale Ogunwale <ogunwale@google.com> Merge "Lockdown AM.getRunningAppProcesses API with permission.REAL_GET_TASKS"
9dbaa54f6834e013a63f18bd51ace554de811d80 07-Apr-2015 Wale Ogunwale <ogunwale@google.com> Lockdown AM.getRunningAppProcesses API with permission.REAL_GET_TASKS

* Applications must now have ...permission.REAL_GET_TASKS to
be able to get process information for all applications.
* Only the process information for the calling application will be
returned if the app doesn't have the permission.
* Privilages apps will temporarily be able to get process information
for all applications if they don't have the new permission, but have
deprecated ...permission.GET_TASKS.

Bug: 20034603
Change-Id: I67ae9491f65d2280adb6a81593693d499714a216
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
516460819541e483321ef9156e4093d19f123ecc 06-Apr-2015 Dianne Hackborn <hackbod@google.com> Merge "Various fixes and improvements..."
12b4a4a7ecb3f24f9bc3f3a763b4c8be4ca45b27 06-Apr-2015 Wale Ogunwale <ogunwale@google.com> resolved conflicts for merge of 60df172f to master

Change-Id: I15f90e041399d2133c041b0449e6d6a95d36595a
adedb407c5cedaba123ea5f44f3d68fd98e8ee55 06-Apr-2015 Olawale Ogunwale <ogunwale@google.com> am 655ef081: Merge "[ActivityManager] Examine bad process before clean up application record"

* commit '655ef08144ec0b71a98b6b3a38e50c6b346ae467':
[ActivityManager] Examine bad process before clean up application record
655ef08144ec0b71a98b6b3a38e50c6b346ae467 06-Apr-2015 Olawale Ogunwale <ogunwale@google.com> Merge "[ActivityManager] Examine bad process before clean up application record"
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/services/core/java/com/android/server/am/ActivityManagerService.java
b0ff32245cb6b51e43dd3ee40b86d683c62de2b9 04-Mar-2015 Amith Yamasani <yamasani@google.com> Throttle jobs for idle apps

First pass at delaying jobs from apps that are idle.

TODO: Throttle syncs
TODO: Provide a periodic point at which apps are checked for idleness.

Apps that switch to foreground process state are tracked by UsageStats
as an INTERACTION event that affects the last-used timestamp.

JobScheduler's logic for when an app is ready is trumped by the idleness
of the app, and only if the battery is not charging. When charging state
changes, we update the idle state of all the tracked jobs.

android package is whitelisted.

Bug: 20066058
Change-Id: I0a0acb517b100a5c7b11e3f435f4141375f3451f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
70392818f07f175d4914cef13b12c215ff08f1df 23-Mar-2015 Narayan Kamath <narayan@google.com> Don't set userSetLocale from Configuration.setLocale.

This seems to have been a mistake : userSetLocale controls whether
a locale is persisted and as written it's too easy to make system wide
locale changes without intending to. Third party apps do not have
sufficient permissions to set global locales anyway, so they won't care
whether it's set or not.

Also, set userSetLocale = true in the LocalePicker.updateLocale internal
API, which is what all platform apps use to set the locale.

In addition, this commit fixes a bug where we were not setting RTL
directionality for the default locale loaded by the activity manager
service.

Change-Id: I2e11ad31e012dfa314ab8d78034f986b49ecae60
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bcfe87f3e05ac65d7ecb7156cd0de580586df5e9 02-Apr-2015 Wale Ogunwale <ogunwale@google.com> resolved conflicts for merge of 65073b91 to master

Change-Id: I65a9d95caa98ec33e41480546b4447ec787c6840
9987b6e867d862c27cd1339d7fa8135b75d565f1 02-Apr-2015 Olawale Ogunwale <ogunwale@google.com> am e4d4e22f: Merge "[ActivityManager] Avoid improper resume top activity."

* commit 'e4d4e22f26bfd36a553fb24232d2fd4ddf4fc907':
[ActivityManager] Avoid improper resume top activity.
558e849a7772cda924ac0617708c439ed05c17ed 02-Apr-2015 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Avoid improper resume top activity.

When there is a process died, only resume top if
it contains visible activity.

This can fix case 1 in
https://android-review.googlesource.com/#/c/120901/

Change-Id: I45584e76f9e863980d04bbb593d7d26a8900acd0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ee006da858459e91666ae53432659e934c8a8dbd 30-Mar-2015 Wale Ogunwale <ogunwale@google.com> Converted more log points in AMS to use ActivityManagerDebugConfig.

Change-Id: I59e777de30e2e9a3c7d086dc634129cd19135fab
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
aa2609aae749401f009e0737c2902df4449226fb 01-Apr-2015 Craig Mautner <cmautner@google.com> Merge "Revert "Add lockTaskOnLaunch attribute.""
6cd6cec2adae647ca6ec3aa7ef3288cbb1f814b1 01-Apr-2015 Craig Mautner <cmautner@google.com> Revert "Add lockTaskOnLaunch attribute."

This reverts commit 0fb1cb56abf708291c09c783463408c7074ae9a7.
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
e1d6333341375217ce645bdbe039901fd6f64226 01-Apr-2015 Craig Mautner <cmautner@google.com> Merge "Add lockTaskOnLaunch attribute."
0fb1cb56abf708291c09c783463408c7074ae9a7 31-Mar-2015 Craig Mautner <cmautner@google.com> Add lockTaskOnLaunch attribute.

The new AndroidManifest activity attribute, lockTaskOnLaunch attribute
is a boolean that puts the system in lockTask mode when true and if
the activity specified is the root of a privileged task.

This bug also fixes lockTask mode for root activities that finish
themselves. Previously finish was not allowed even if there were
activities left in the task that were still valid.

A NullPointerException for lock task toasts has also been fixed.

Fixes bug 19995702.

Change-Id: Iba6976b1a0cc5a22eb526db66d2e9af66445541f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
29382d29618f9f51fe8cde77d2dfd8e0b6e1071d 31-Mar-2015 Wale Ogunwale <ogunwale@google.com> resolved conflicts for merge of 6abcec1d to master

Change-Id: I28986f8863298a767a8290b02d5418d4d1d42d17
df736de8d8165b1aff675d00581ccdf94a7547aa 31-Mar-2015 Olawale Ogunwale <ogunwale@google.com> am d052a3d3: Merge "[ActivityManager] Fix index out of bounds when updating next pss time."

* commit 'd052a3d37beffff3735716340745ec7c83efc23d':
[ActivityManager] Fix index out of bounds when updating next pss time.
5064fddf81e477a90c81d72f7328aa5887c67511 31-Mar-2015 louis_chang <louis_chang@htc.com> [ActivityManager] Examine bad process before clean up application
record

Symptom:
Unable to launch activity

Root cause:
There are some cases that would start process while pid
assigned or already running. So the previous application
record will be clean up via handleAppDiedLocked(), but it
won't be removed from ActivityManager.mProcessNames since
the process is supposed to be restart later.

However, if the process is started from a background
operation and has named as a bad process, it silently fail
the launch. Then, the process won't ever be request to
start afterward. The process status is app.pid > 0 and
app.thread is null.

The application components are unable to launch since then.

Solution:
Examine bad process before clean up application record

Change-Id: I53dc06e49254094abc06e460c8b8b33f36803601
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6793fc328ab4532202d86f64fe4fdbc3fb047bc4 31-Mar-2015 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Fix index out of bounds when updating next pss time.

Symptom:
System server crash.

Root Cause:
The value curProcState for array index is -1 if the process
has not attached yet.

Solution:
Skip computing for process which is not attached or curProcState
is nonexistent state.

Change-Id: I71aaf45bb78d73097ebe9dfebf76b72f2d243232
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4887789e44cdb16b042a35e8ec03983213e88ac6 18-Mar-2015 Jeff Sharkey <jsharkey@android.com> Progress towards dynamic storage support.

Storage devices are no longer hard-coded, and instead bubble up from
whatever Disk and VolumeBase that vold uncovered, turning into
sibling Java objects in MountService. We now treat vold events as
the source-of-truth for state, and synchronize our state by asking
vold to "reset" whenever we reconnect.

We've now moved to a model where all storage devices are mounted in
the root mount namespace (user boundaries protected with GIDs), so
we no longer need app-to-vold path translation. This also means that
zygote only needs to bind mount the user-specific /mnt/user/n/ path
onto /storage/self/ to make legacy paths like /sdcard work. This
grealy simplifies a lot of system code.

Many parts of the platform depend on a primary storage device always
being present, so we hack together a stub StorageVolume when vold
doesn't have a volume ready yet.

StorageVolume isn't really a volume anymore; it's the user-specific
view onto a volume, so MountService now filters and builds them
based on the calling user. StorageVolume is now immutable, making
it easier to reason about.

Environment now builds all of its paths dynamically based on active
volumes. Adds utility methods to turn int types and flags into
user-readable strings for debugging purposes.

Remove UMS sharing support for now, since no current devices support
it; MTP is the recommended solution going forward because it offers
better multi-user support.

Simplify unmount logic, since vold will now gladly trigger EJECTING
broadcast and kill stubborn processes.

Bug: 19993667
Change-Id: I9842280e61974c91bae15d764e386969aedcd338
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4a7e775100b1eeab5a1f5ec56946642af6044ce1 31-Mar-2015 Fyodor Kupolov <fkupolov@google.com> Replaced zeros with UserHandle.USER_OWNER

Non-functional change. Where applicable, replaced zeros with UserHandle
.USER_OWNER.

Change-Id: I2274166c88cd7109cd6d2650c40b34b35758bdcf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5670d9a2503557ca583eddcab1702800b5016cd9 31-Mar-2015 Olawale Ogunwale <ogunwale@google.com> am 4af5bd7c: Merge "Add ProcessInfoService to activity manager."

* commit '4af5bd7cdaccdba6001a384a81c258f542e74075':
Add ProcessInfoService to activity manager.
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/services/core/java/com/android/server/am/ActivityManagerService.java
4b6bd8d36b093d36d9ae80b43e95049c259d7319 19-Mar-2015 Adam Lesinski <adamlesinski@google.com> Retrieve WiFi info outside of BatteryStatsImpl

In order to not deadlock the system, we need to retrieve
WiFi energy info outside of the BatteryStats lock. We do this,
then pass that data down to BatteryStatsImpl to process.

b/19729960

Change-Id: Ib8beba1d5ac81d89144d502c4b688d0a88c5b102
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1e725a7ec9eb79bb447d5171839c453d672a895c 25-Mar-2015 Dianne Hackborn <hackbod@google.com> Battery stats: wakeup alarm tracking, general cleanup.

Instead of just tracking the total number of wakeup alarms
per package, track a count for each tag. Note this is only
wakeup alarms, not non-wakeup alarms.

Also tighten up the code a bit by exposing the actual ArrayMap
container through most of the BatteryStats API, so we can more
efficiently iterate over them (which is all we ever want to do
with those containers at that point).

Finally remove all printing of "since unplugged" stats, as
another step towards completely removing that tracking. If
nobody screams, hopefully soon we can go through and just get
rid of all the extra state we are carrying around that is
tracking that data.

Also note that currently the per-tag wakeup alarm data is
being reported in the human-readable stats, but in the checkin
data it is still being rolled up into a single number. To fix
this, I need to completely rework the pkg entry line to have
separate data for services and wakeup alarms (so have three
types -- pkg for the start of a package, wal for a wakeup
alarm, svc for a service).

Change-Id: I8033acca8742935cfe95511cdea730a405b17cab
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7ebb072ade764507a2a305570feaa4429eed233e 24-Mar-2015 Jeff Sharkey <jsharkey@android.com> Merge "Start apps with per-user GIDs."
51f8f00633221e25c47d18eca01d1a5bb180f5b2 24-Mar-2015 Jeff Sharkey <jsharkey@android.com> Start apps with per-user GIDs.

Bug: 19905213
Change-Id: I053b34f6b80540d4d696e6142d26dd7610bf84e1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0dbc50acae101e5ec75db32cc4eb220594c60d6b 24-Mar-2015 Olawale Ogunwale <ogunwale@google.com> am 04466d92: am bfd7a123: am f5f70b66: Merge "[ActivityManager] Avoid killing unrelated processes."

* commit '04466d92db4b4a511141d272db045864950b4d7d':
[ActivityManager] Avoid killing unrelated processes.
bfd7a1233411c60692797f9824695b90663061bf 24-Mar-2015 Olawale Ogunwale <ogunwale@google.com> am f5f70b66: Merge "[ActivityManager] Avoid killing unrelated processes."

* commit 'f5f70b66a3f22ca5e23a4d1e6061f2a36dfb4c92':
[ActivityManager] Avoid killing unrelated processes.
f5f70b66a3f22ca5e23a4d1e6061f2a36dfb4c92 24-Mar-2015 Olawale Ogunwale <ogunwale@google.com> Merge "[ActivityManager] Avoid killing unrelated processes."
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/services/core/java/com/android/server/am/ActivityManagerService.java
efadd572b93eee88e4b63feb6b2cc0741d900c76 20-Mar-2015 Craig Mautner <cmautner@google.com> Merge "Fix bad nesting count when remote calls fail."
79ec42e6a3c6a6f6a00ef3ad92221a5ad2149aa9 20-Mar-2015 Dianne Hackborn <hackbod@google.com> Merge "First stab at device idle mode."
8ad2af7e5b28f71e7bdfc1bb097937c6c1d22b18 18-Mar-2015 Dianne Hackborn <hackbod@google.com> First stab at device idle mode.

Introduce a new device idle controller service that
monitor's the device state and determines when to go
in to idle mode. When in idle mode, all we do right
now is turn off network access the same as we do for
power save mode. Many more things should come in the
future -- stopping the alarm manager from scheduling
(most) alarms, telling GmsCore for it to stop doing
stuff, etc.

Battery stats now has state tracking for devie idle
mode, as well as events for the reasons we can come
out of idle mode (significant motion or the device
becoming active). Also added new events noting when
packages are installed.

Renamed the "low power" event in battery stats to
"power save" because the former was just way too
confusing.

Finally, fix buffer size reading kernel wake locks.
(Stupidly, just increasing the buffer size. Ideally
we should try to be smarter and grow our buffer to
fit the data available, but I'll leave that for
another time.)

Change-Id: I0be2062466c83ee9d890c6cf5a228d9cc4090eca
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
eef3bcbbe4783a24fb65127390436ae55dd17aae 19-Mar-2015 Alan Viverette <alanv@google.com> Merge "Replace usages of deprecated Resources.getColor() and getColorStateList()"
4a357cd2e55293402d7172766f7f9419815fc1e8 19-Mar-2015 Alan Viverette <alanv@google.com> Replace usages of deprecated Resources.getColor() and getColorStateList()

Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
75f1ba5a815ce13caff1faa8e0df7d4ac483507a 19-Mar-2015 Mathieu Chartier <mathieuc@google.com> am f792e016: am 437ac8f8: Merge "Add JIT late override property"

* commit 'f792e01606b988ab84190217529cca53da8db3f5':
Add JIT late override property
f792e01606b988ab84190217529cca53da8db3f5 19-Mar-2015 Mathieu Chartier <mathieuc@google.com> am 437ac8f8: Merge "Add JIT late override property"

* commit '437ac8f8445b078041171eff56ce7ffbd1cf6766':
Add JIT late override property
7a49028aa2f25364042fae031d95f9283844e645 17-Mar-2015 Mathieu Chartier <mathieuc@google.com> Add JIT late override property

Required for JIT debug property since user builds can't restart
the shell.

Bug: 19735273

Change-Id: I1983852e80010c344b45e0bb459de47c56adfce8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5f2bb4c9bc27aee581bf888f1fd22c5c9311240d 13-Mar-2015 Craig Mautner <cmautner@google.com> Fix bad nesting count when remote calls fail.

The nesting count for services depends on callbacks decrementing
ServiceRecord.executeNesting in response to remote service calls. If a
remote call fails the callback does not get made and the nesting count
gets out of sync. This causes orphans in the executingServices set.

This fix makes the callback locally when the remote call fails.

TransactionTooLargeExceptions caused by Intents containing large
amounts of data were being caught and not propagated to the calling
methods.

This fix propagates TransactionTooLargeExceptions back to the calling
methods.

Fixes bug 19698308.

Change-Id: I9eb6ae414d14d6b3a2709abb1f2bdfbd4cbc3c03
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3ab9a27e3d612efef6a046d4df7880803df1eef9 16-Mar-2015 Wale Ogunwale <ogunwale@google.com> Convert some log points to in AMS to use ActivityManagerDebugConfig class.

Change-Id: I02154b0e1c2c64af840848fd6def054342922efa
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fd5767fa37485952b7291ea701cc84c38c2621fc 17-Mar-2015 Wale Ogunwale <ogunwale@google.com> Merge "Remove duplicate move of home stack that can cause animation jank."
2541306ad56112fad1453566561038c35ae2448a 17-Mar-2015 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Avoid killing unrelated processes.

Kernel will reuse process id, when wrap-around happens,
there may be just after a pid is freed, a new thread/process
uses the pid immediately.

For examples, there may be a process with pid 1234 killed
by lowmemorykiller or itself (app.killed=false).
Before the death recipient enters AMS, a new thread/process
is started with pid 1234, then when appDiedLocked executes,
this new pid 1234 will be killed again.

It is especially easy happens to zygote:
During zygote starting process, it will stop 5 daemons threads.
And restart the 5 threads after fork is called, so it has
larger pid range to hit the resue case.
https://code.google.com/p/android/issues/detail?id=160661

Solution:
If the dead event is from binder, it is not necessary
to call killProcessQuiet again, because it should really
be dead.
Keep no checking for killProcessGroup because zygote does
not have record under /acct/, and also the parameter uid
has restriction that will not kill another application
which reuses the pid.

Change-Id: Iec4a4884ae641c4d036f4d024ce463f7a351a17b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3d07c94c393831091958fe6a98811843db8973bd 14-Mar-2015 Dianne Hackborn <hackbod@google.com> Add new voice request for picking from a list.

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

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

Change-Id: I7cc4d566b80f59fe0a9ac51ae9bbb7188a01f433
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d80c263e2a45f0a2b65fd9762aa8deea49c8ca72 13-Mar-2015 Wale Ogunwale <ogunwale@google.com> Remove duplicate move of home stack that can cause animation jank.

Each move of the home stack in the ActivityManager ends up calling
into the WindowManager which causes layout to be performed.

Also, fixed issue where ActivityStack.moveTaskToFrontLocked()
could move a task to the front without the focus been adjusted to
the new top activity.

Bug: 19692494
Change-Id: Ib4c999c6dfa1af3fda0fced52b58da614b154d00
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
484bc6e5a79af1b7b0a2eb682802006522b274fd 13-Mar-2015 Dianne Hackborn <hackbod@google.com> Merge "More work on collecting assist data."
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/services/core/java/com/android/server/am/ActivityManagerService.java
7d701174f423754a2dade39fd16f102c085bd865 11-Mar-2015 Wale Ogunwale <ogunwale@google.com> Protect against NPE for ActivityRecords without a stack.

A previous change allowed us to remove stack that no longer contained
any task. This was causing some NPE when an ActivityRecord.Token or
some other cached ActivityRecord later gets converted back to an
ActivityRecord and we try to access its stack.

Bug: 19552874
Change-Id: Ie9454bbce56591b337f97af40f8c00b8597becdf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
04f4d6bb8892fe9b6e8f60d18a4f4dd051ab8124 11-Mar-2015 Wale Ogunwale <ogunwale@google.com> Revert "Revert "Remove activity and window stacks when last task is removed.""

This reverts commit 7a7bf5ea48b12f044c591fb03ed3e58acd28ceb7.
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
11cce7989b41be88bb81af072bc9bed7ab829694 11-Mar-2015 Guang Zhu <guangzhu@google.com> Fix build

Change-Id: I530793e9090d780a5cb2581ee185badc51e14902
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
de01b03a855eb482e2264ee31e98fb4d3a42ebab 11-Mar-2015 Wale Ogunwale <ogunwale@google.com> Merge "Converted some AMS log points to use ActivityManagerDebugConfig."
e23149f1555303940d212b742707518b7f9f84ab 07-Mar-2015 Wale Ogunwale <ogunwale@google.com> Converted some AMS log points to use ActivityManagerDebugConfig.

Change-Id: I0563bafd29ae0bbe596ed8c06fcc573b5ead50b7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7a7bf5ea48b12f044c591fb03ed3e58acd28ceb7 10-Mar-2015 Wale Ogunwale <ogunwale@google.com> Revert "Remove activity and window stacks when last task is removed."

This reverts commit 0f95e3f0753508344b198c0a76afb892df514f52.

Bug: 19644506
Bug: 19083170
Change-Id: I2eb2a0400be58fe2c5d48a4b68368725e98aaf6f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
62793e4382b4b0b53d7373d92a62dc4e3ccbde05 09-Mar-2015 Dianne Hackborn <hackbod@google.com> Battery stats issues: fix jiffy handling, print scan counts.

Issue #19431959: Framework incorrectly assumes that kernel
clock_ticks are 10ms

We now retrieve the time of a jiffy from the kernel, and all CPU
times are now handled in milliseconds.

Issue #19571810: Add per-app breakdown of number of WiFi scans
in batterystats checkin data

Added to the report (the information was already being tracked).

Change-Id: If1702d6b9bcf851704129f1811471e68ed576a5d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b9a5e4ad30c9add140fd13491419ae66e947809d 04-Mar-2015 Dianne Hackborn <hackbod@google.com> Add new debug feature to automatically create heap dumps.

Not yet working, unless you turn off SELinux enforcing.
We need to update SElinux to allow the system process
to give apps access to /data/system/heapdump/javaheap.bin.

Currently watching can only be enabled through the shell,
such as:

adb shell am set-watch-heap com.android.systemui 1024

The last number is the process pss size in bytes, so this is
asking us to warn if it goes about 1K which will be all the
time.

Change-Id: I2089e5db2927afca0bf01a363c6247ee5dcb26e8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
47d740b92b631b1f69b63702f5edfc83538345cf 05-Mar-2015 Wale Ogunwale <ogunwale@google.com> Merge "Made AM package debug log more configurable."
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/services/core/java/com/android/server/am/ActivityManagerService.java
d57969f6ec38c7633ca65bcd5bdd766cd972cfe4 16-Nov-2014 Wale Ogunwale <ogunwale@google.com> Made AM package debug log more configurable.

* Added class ActivityManagerDebugConfig.java for housing all debug
log configuration for activity manager package.
* Added ability for using default activity manager log tag or class
specified tag string which is very helpful during debugging.
* Added ability to prepend log category name to log tag that can
also be useful during debugging.
* Converted BroadcastQueue.java and ActiveService.java to use the
new log class. Other classes in the package will be gradually
converted.

Change-Id: I0e4b343da75cb2e539b5ad5f0f79f6bc7af46d7b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
83a63bac5d303c63c534c10a53d37edcea782d28 04-Mar-2015 Craig Mautner <cmautner@google.com> am 8fa394fa: Merge "Do not make ActivityContainer available to apps. DO NOT MERGE" into lmp-dev

* commit '8fa394fa8c4eb3ca832dac36baf5645a40d449f1':
Do not make ActivityContainer available to apps. DO NOT MERGE
cb82f30186ea0f664cdb880cae1114cecd20ebc6 25-Feb-2015 Wale Ogunwale <ogunwale@google.com> Revert "Revert "Have AMS.setFocusedActivityLocked() move the focus stack to the front""

This reverts commit 3426b72cff7f8eeea4c802f4f0fcae4b995e177a
and fixes bugs 19505341 19507107

Bug: 19219490
Bug: 19507107
Bug: 19505341
Change-Id: I7d6fc9fa41ed03bb7834facbb4c453e2561f13c9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3426b72cff7f8eeea4c802f4f0fcae4b995e177a 25-Feb-2015 Wale Ogunwale <ogunwale@google.com> Revert "Have AMS.setFocusedActivityLocked() move the focus stack to the front"

This reverts commit af0e44885992b0675d7881c391caeff88414695f.

Unblock the release while I figure-out how the change broke things...

Bug: 19505341
Bug: 19507107
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
af0e44885992b0675d7881c391caeff88414695f 24-Feb-2015 Wale Ogunwale <ogunwale@google.com> Have AMS.setFocusedActivityLocked() move the focus stack to the front

Bug: 19219490
Change-Id: I089c42a6cf6277f5975064103c9804c2ab05dcd6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
53a29a90f35f72462c0d6ad650921d5566c1f8f0 24-Feb-2015 Wale Ogunwale <ogunwale@google.com> Added ActivityManager API and AM command to resize a task.

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

Change-Id: Ia13f1e92a7c59ce6543c226533ac8ea623488290
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
822237858ac32e3ea2b6cf16f8d2c855a0247f44 20-Feb-2015 Wale Ogunwale <ogunwale@google.com> Merge "Remove activity and window stacks when last task is removed."
5f83382c40a0785d6fde6b6afb4f33c9ed683fba 20-Feb-2015 Dianne Hackborn <hackbod@google.com> Merge "Add some detailed data as part of battery history."
d1eccbea388fde6a575acb4e797efdd07798344a 18-Feb-2015 Dianne Hackborn <hackbod@google.com> Add some detailed data as part of battery history.

Every time the battery level changes, a new extended
detailed use data structure is written to the history.
This currently only contains delta CPU use since the
last detailed entry (total CPU and to three uids), but
it gives us the infrastructure for adding more detailed
data in the future.

A detail entry for regular history looks like:

Details: cpu=15730u+2307s (u0a57=11312u+502s, 1000=2344u+701s, 0=473u+991s)
/proc/stat=15377 usr, 1797 sys, 197 io, 0 irq, 8 sirq, 23103 idle (42.9% of 6m 44s 820ms)

u is user-space cpu time, s is system/kernel time.

The equivalent check-in output is:

9,h,0,Dcpu=15730:2307/10057:11312:502/1000:2344:701/0:473:991
9,h,0,Dpst=15377,1797,197,0,8,23103

Also add a new "unplug" command to the battery service,
to easily put it into a state where it always considers
the device to be running on battery.

Change-Id: Ic76d966f11e592b9dd671879977bf999ebc11eef
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0f95e3f0753508344b198c0a76afb892df514f52 20-Feb-2015 Wale Ogunwale <ogunwale@google.com> Remove activity and window stacks when last task is removed.

Also,
* Only restore recent task to a full screen stack instead of any
randomly sized stack.
* Fixed issue where we were restore task from recents for some
operations when we didn't need to.
* Null out TaskRecord.stack when the task is removed from the
stack.

Bug: 19083170
Change-Id: I4e006f101f9d0f2aebde130ad77afc4d258c6612
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
40f616b1f654822b3ac7c13853212c63d91312d5 17-Feb-2015 Craig Mautner <cmautner@google.com> Do not make ActivityContainer available to apps. DO NOT MERGE

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

Fixes bug 19394591.

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

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

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

Fixes bug 19394591.

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

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

Fixes bug 19394591.

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

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

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

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

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

Change-Id: I18312fe1601d7926d1fb96a817638d60f6263771
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a511eea83b0209729e4b42e219f233f818a6d9e7 13-Feb-2015 Narayan Kamath <narayan@google.com> am aee7f64c: am b4a5c04c: Merge "Remove code that sets user.* system properties."

* commit 'aee7f64c10ffd2135dc98f7a540836ad7a32438b':
Remove code that sets user.* system properties.
5bb57e8543b0da2959a7744ed8aa957d12c635ce 12-Feb-2015 Narayan Kamath <narayan@google.com> Remove code that sets user.* system properties.

This has been disallowed by the SELinux for several years now,
so can safely be removed. Given that saveLocaleLocked is
simplified quite a bit, we can now inline into its only caller.

bug: 18910417

(cherry picked from commit 70e8f6600de8a2b9cbb17cd919b14a4609fc68bd)

Change-Id: Ib2888ea22ffca6f4b402efd5780f89c924cd1570
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
70e8f6600de8a2b9cbb17cd919b14a4609fc68bd 12-Feb-2015 Narayan Kamath <narayan@google.com> Remove code that sets user.* system properties.

This has been disallowed by the SELinux for several years now,
so can safely be removed. Given that saveLocaleLocked is
simplified quite a bit, we can now inline into its only caller.

bug: 18910417

Change-Id: I18251f77e4a25a0e7ecda8e85a9b3fcdc2dc7b05
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6f609928cf456f8bb5fed2e1905dc08cbcdaa0a7 12-Feb-2015 Narayan Kamath <narayan@google.com> am c7e48719: Merge "Remove references to persist.sys.language/country." automerge: 8be3724
automerge: 00e821a

* commit '00e821a8608efdc19041bdda1e832d3d4b3c29e2':
Remove references to persist.sys.language/country.
00e821a8608efdc19041bdda1e832d3d4b3c29e2 12-Feb-2015 Narayan Kamath <narayan@google.com> am c7e48719: Merge "Remove references to persist.sys.language/country."
automerge: 8be3724

* commit '8be3724a06f7b2d28c6664ca11a03f91f97f0972':
Remove references to persist.sys.language/country.
b61db8229a8f220f23b22b7ccde72e5cf73e0e07 12-Feb-2015 Narayan Kamath <narayan@google.com> Remove references to persist.sys.language/country.

Addresses a couple of TODOs now that all usages have been
removed and fixes a doc that specifies how the emulator locale
can be set.

bug: 17691569

Change-Id: I802ea1e12448a5442840cad1fdc0956d3e2c7a8c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
83a0068d6546ba4b1f09c9fd6ccb44e784b430a2 11-Feb-2015 Wale Ogunwale <ogunwale@google.com> Merge "Am command to split a stack."
2c5763ae5d04ebd67eae2f86f840e6e68304e821 11-Feb-2015 Wale Ogunwale <ogunwale@google.com> Am command to split a stack.

Change-Id: Idf3a364fc3826f6fe92f55b5c83b16b380d62ff4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
667d55cf5a06a0e1bd12997fcd494bec52e58ad9 11-Feb-2015 Andres Morales <anmorales@google.com> Merge "check bootloader and baseband version"
a928127a74d6ffe9334774e64a4470aedbe6c28b 07-Feb-2015 Wale Ogunwale <ogunwale@google.com> Set TaskStack config orientation based on dimensions

The TaskStack override configuration is set based on the
stack dimensions so we can load the most acturate resources
for activities in the stack in a multi-window environment.

Also, disabled fixed screen orientation for resizeable
activities.

Bug: 19305402
Change-Id: I7b182554523b12f2ef77f8bbc7b16891231125bf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fd282ed2f4649cc77127ab15b9167971abb5f379 07-Feb-2015 Andres Morales <anmorales@google.com> check bootloader and baseband version

Make sure flashed bootloader/radio matches what we
expect statically.

Change-Id: I71dfcc658695ef5542bc968747345efe0936c350
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
35fa2bc2e4debee1434bd784209895472ecd174f 03-Feb-2015 Ruben Brunk <rubenbrunk@google.com> Merge "Add ProcessInfoService to activity manager."
42da895b9061efc6b0abdedc0765deae2ccc2f5e 03-Feb-2015 Craig Mautner <cmautner@google.com> Merge "[ActivityManager] Prevent application holding AMS lock" automerge: 53e8d6f automerge: 6112f63
automerge: e8bd6d7

* commit 'e8bd6d734ccef685c4e25a0ec1735c140b9fe644':
[ActivityManager] Prevent application holding AMS lock
e8bd6d734ccef685c4e25a0ec1735c140b9fe644 03-Feb-2015 Craig Mautner <cmautner@google.com> Merge "[ActivityManager] Prevent application holding AMS lock" automerge: 53e8d6f
automerge: 6112f63

* commit '6112f63369c7ba463c0384c73a4e4c0d45b63918':
[ActivityManager] Prevent application holding AMS lock
53e8d6f934be403b9c7733c190b6052d60dd0658 03-Feb-2015 Craig Mautner <cmautner@google.com> Merge "[ActivityManager] Prevent application holding AMS lock"
338026f59ac7dc8448bcbd5834882af35df03d94 03-Feb-2015 Tony Mantler <nicoya@google.com> Merge "Check NAVIGATION_NONAV in ActivityManagerService"
9d3de4cfb42519fefe9d8b03c38ba440bd6bc886 02-Feb-2015 Wale Ogunwale <ogunwale@google.com> Support for activity to opt-in/out of resizeable/multi-window support.

Bug: 19178148
Change-Id: I5819a71cdc48e0af4add11a6d4a503ec5cbe5d63
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
843ce5b2a2c25026ce8f7f066905689ba4030887 15-Dec-2014 Tony Mantler <nicoya@google.com> Check NAVIGATION_NONAV in ActivityManagerService

b/18733457

Change-Id: I12b4d1da3564129a445882025575d759fc80d6d2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
bd39d50624ae702009ff6e7e15885de479a52800 30-Jan-2015 Dianne Hackborn <hackbod@google.com> Merge "Record memory data in event log as we collect it for procstats."
0e0b7310a83942f6df67c69344020acf384c2bd4 30-Jan-2015 Winson Chung <winsonc@google.com> Merge "Adding some debug controls to test multi-window."
14dc3c900febb05cca89ffe610ebf7fb970e552b 30-Jan-2015 Todd Kennedy <toddke@google.com> Merge "Don't get extras from the Intent"
aab56dbc1ef5c91afad1e61d633305bb3aa3cb1b 30-Jan-2015 Todd Kennedy <toddke@google.com> Show stacks underneath a resized stack

When a stack is resized, make sure any non-fullscreen stack beneath it
becomes visible. This may mean additional activities are resumed in the
process.

Bug: 19083171
Change-Id: I5e7a3f82d76932ea2b9dbf0324ea183c42ee5496
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1a5da04902ab47fb499c07ef5948450f2815e09e 24-Jan-2015 Dianne Hackborn <hackbod@google.com> Record memory data in event log as we collect it for procstats.

Change-Id: I37d6d87aac0c400ea402ae20e6174fd851d3c1f9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a92cbad2a916b3893311672ae643070f8306f477 30-Jan-2015 Dianne Hackborn <hackbod@google.com> Improve messaging of pre boot apps.

Have the system take care of showing the boot message
as it runs pre boot apps, rather than relying on them
doing this on their own.

Change-Id: Ife6db0691907cf413311dafb4b023e63e8795a79
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d16c565a607de754379fe699a4def21bd0e3de2f 27-Jan-2015 Winson Chung <winsonc@google.com> Adding some debug controls to test multi-window.

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

Change-Id: I3fb51c248f53a1d4c4eb23ca9fb3a76888def1de
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
783f28691e27b7b116730fad4f9fd9c083bab283 27-Jan-2015 Wale Ogunwale <ogunwale@google.com> Merge "Support activities in the same process having different resources."
60454dbc4d815c90ff2713e224953d6547fc3ad5 24-Jan-2015 Wale Ogunwale <ogunwale@google.com> Support activities in the same process having different resources.

Activities can be of various sizes in a multi-window environment.
This change allows them to have override configurations that allows
different resources to the loaded if needed.

Bug: 19002213
Change-Id: Ib2c7be0b427f5ce05e7a362bcdd496ddbc9164f0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1de57d883e41e7ea46fa4fab6b9da7044ed5cd7c 26-Jan-2015 Craig Mautner <cmautner@google.com> resolve merge conflicts of 2322ea5 to master.

Change-Id: I1570e633bf0d552a32d7fa9a2e0ebd81953f632b
2322ea558eced3deed94193d9b9d498f69b14a78 26-Jan-2015 Craig Mautner <cmautner@google.com> am 8995e140: Merge "Add reason string for bringing stack to front" into lmp-mr1-dev
automerge: afc6d33

* commit 'afc6d332790166943302f051d32ec0874d9280aa':
Add reason string for bringing stack to front
299f960e5e5837da44cd81692388f3cbd5d2c362 26-Jan-2015 Craig Mautner <cmautner@google.com> Add reason string for bringing stack to front

Additional debug and useful information.
Also removed am_resume_activity verbosity and refactored method to
eliminate unused parameter.

For bug 17721767.

Change-Id: Ie1c0652a38a0c6ae6db27a52a9e5da29e252e300
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d31c16457a7360bc892d71c308c7ab76cdb45af1 23-Jan-2015 Craig Mautner <cmautner@google.com> Merge "Even more debug for bug 17721767." into lmp-mr1-dev automerge: dbabf37 automerge: 5cb31f2
automerge: b978450

* commit 'b978450b1c91f73eff63669ae3390627c0148dc4':
Even more debug for bug 17721767.
b978450b1c91f73eff63669ae3390627c0148dc4 23-Jan-2015 Craig Mautner <cmautner@google.com> Merge "Even more debug for bug 17721767." into lmp-mr1-dev automerge: dbabf37
automerge: 5cb31f2

* commit '5cb31f2179c70152f94bcb8309449fc2e7bed63a':
Even more debug for bug 17721767.
de313753d0fd0173d0558518d9a410fdc0127c76 22-Jan-2015 Craig Mautner <cmautner@google.com> Even more debug for bug 17721767.

This time adding events for stack movement and focus change.

Change-Id: Icdff9763ac2daf85c615992fa2c8e418e907908c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d2f1511f2896e09db35bd92e0aab02ba89888a04 22-Jan-2015 Todd Kennedy <toddke@google.com> Don't get extras from the Intent

When handling Intents in the system process, we need to be careful
to not cause the extras bundle to be unparcelled. If the extra is
unparcelled, any custom class added to the extras will throw a
ClassCastException during the unparcel. For legacy reasons, we
would get the "seq" extra from the Intent for broadcast debugging.
This violates our requirement to not unparcel extras in the system
server process.

Bug: 19068243
Change-Id: I6cac426a0ef8648a05ded69ee4ac244017d9b5d1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
56bbefccf27d3c32029121fe23f0b02c01eba338 22-Jan-2015 Narayan Kamath <narayan@google.com> Merge "Add support for persist.sys.locale." automerge: dca2332 automerge: 117f161
automerge: 1194e75

* commit '1194e754a95e1fa5d4eba6d0bca109156dd4df94':
Add support for persist.sys.locale.
1194e754a95e1fa5d4eba6d0bca109156dd4df94 22-Jan-2015 Narayan Kamath <narayan@google.com> Merge "Add support for persist.sys.locale." automerge: dca2332
automerge: 117f161

* commit '117f161fee52dfa200f89282c487d58c29b41d4f':
Add support for persist.sys.locale.
d30dbb8ae12e6e83e3035f12dd291f92e1f22c18 15-Jan-2015 Narayan Kamath <narayan@google.com> Add support for persist.sys.locale.

AndroidRuntime has been changed to read "ro.product.locale" and
"persist.sys.locale" instead of "ro.product.locale.language" etc.
This is passed down as "-Duser.locale" to the runtime.

The system_server has been changed to write out persist.sys.locale
on locale changes.

bug: 17691569

Change-Id: I93360c8795c9620a133656dc491d13d7b6ed162e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
885e727ab4e55155d1735f78c8a0550f7f180c8a 20-Jan-2015 Wale Ogunwale <ogunwale@google.com> am f5f54dd6: am 92dd1abe: Update restored task uid to match the package uid on current device. automerge: 7fd985f

* commit 'f5f54dd69122bc07ea0a25b8d98b9048cbe4582f':
Update restored task uid to match the package uid on current device.
f5f54dd69122bc07ea0a25b8d98b9048cbe4582f 20-Jan-2015 Wale Ogunwale <ogunwale@google.com> am 92dd1abe: Update restored task uid to match the package uid on current device.
automerge: 7fd985f

* commit '7fd985f2c69f600f7530311ac9b7c9af196dc0e0':
Update restored task uid to match the package uid on current device.
92dd1abef4c0a22db40c5f7bbd100e6b471a1ad3 16-Jan-2015 Wale Ogunwale <ogunwale@google.com> Update restored task uid to match the package uid on current device.

The uid on the task we are restoring from another device are
meaningless on the current device. Change updates the uid of any
task we restore to match the package uid on the current device.

Bug: 19014377
Change-Id: I285fbe9f509cae3d2e9a212a59e88f34b4db20e5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4900bf9d82c4905fadc43d8e2dd9a7f896da2d81 17-Jan-2015 Todd Kennedy <toddke@google.com> Expose new binder call createStackOnDisplay()

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

Bug: 19001243
Change-Id: I0f04e8f2703bcc706f58e75333869fb35f6b1ee9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
62ccbb306b2c5d0c1d6cc06725c6ee735c0e36ab 16-Jan-2015 Craig Mautner <cmautner@google.com> am 62e815bf: am 02c7c97a: am ac70b2d1: Merge "More debugging for bug 18201239." into lmp-mr1-dev

* commit '62e815bf7b154fe984e1a2aa8d615a2f04f71785':
More debugging for bug 18201239.
62e815bf7b154fe984e1a2aa8d615a2f04f71785 16-Jan-2015 Craig Mautner <cmautner@google.com> am 02c7c97a: am ac70b2d1: Merge "More debugging for bug 18201239." into lmp-mr1-dev

* commit '02c7c97a62ba9b79e56d1f7e206615e6eaca0689':
More debugging for bug 18201239.
66c4a824b9b11a47c7bd1bf858d92fe207409ab9 16-Jan-2015 Craig Mautner <cmautner@google.com> More debugging for bug 18201239.

Fixes bug 19045133.

Change-Id: I2ef2b8600278ed91df59db4acf4740dac970ee3a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0ec9c29fb724eef676d2472f2e15904ff8f52cc0 16-Jan-2015 Jeff Sharkey <jsharkey@android.com> am c2ae6fb9: Merge commit \'605eb79c9519307147fc1795d0eb155638a7f542\' into manualmerge

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

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

Everyone uses moveActivityTaskToBack() instead.

Fixes item #3 of bug 18088522.

Change-Id: I16028335fe1eef8a2aa47804f46536e395a16d8c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f24e490058bc59344f8bd10fb6cbbffa792fbc05 16-Jan-2015 Jeff Sharkey <jsharkey@android.com> Merge "Offer to detect non-SSL/TLS network traffic."
605eb79c9519307147fc1795d0eb155638a7f542 04-Nov-2014 Jeff Sharkey <jsharkey@android.com> Offer to detect non-SSL/TLS network traffic.

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

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

Bug: 18335678
Change-Id: I3adbc974efd8d3766b4b1a23257563bb82d53c29
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
28432f03600ee7e33cb030f2f113f1458531f608 16-Jan-2015 Todd Kennedy <toddke@google.com> Merge "Rename the binder call createActivityContainer"
ca4d842205ce256aab53825920a791c7ab9d62f1 16-Jan-2015 Todd Kennedy <toddke@google.com> Rename the binder call createActivityContainer

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

Change-Id: Id3a32df19a5bb6740cbabcd65897349e9f2f2946
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7dc8d32fd2fae16c6b1c95a49c864c2041a7a72c 13-Jan-2015 Narayan Kamath <narayan@google.com> Fix unexpected language changes on SIM card insertion.

There are two separate issues here that need to be fixed, both
boil down to the fact that adding an imperative (userSetLocale)
to the Configuration is a bad idea. Because of this:

- We'd never persist the first user set configuration if it was en_US,
because of an erroneous call to Configuration.setLocale.

- ActivityManager.getConfiguration would sometimes return a
Configuration with userSetLocale == true, which means callers with
the right permissions would inadvertently persist a locale they didn't
want to persist.

bug: 18879010

(cherry picked from commit c63a16b8e46f2f3ecce6c548663cc3185f011fd6)

Change-Id: I4d714eb1f75afc0a5bf4d53a374df4ed16e328bf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
eae13642867a5f1e760b81a3e20b04129967b09c 14-Jan-2015 Justin Harrison <astyrrian@google.com> am 4a7b0062: am 82008858: Merge "Fix unexpected language changes on SIM card insertion." into lmp-mr1-dev automerge: 561cf95

* commit '4a7b0062a13faec410a954798ddc091e90e57127':
Fix unexpected language changes on SIM card insertion.
4a7b0062a13faec410a954798ddc091e90e57127 14-Jan-2015 Justin Harrison <astyrrian@google.com> am 82008858: Merge "Fix unexpected language changes on SIM card insertion." into lmp-mr1-dev
automerge: 561cf95

* commit '561cf9595547581e0cc905ed5a05023bf67ca0b8':
Fix unexpected language changes on SIM card insertion.
be37df395eb791d9f877f4ca3c6e5d355a19896e 13-Jan-2015 Olawale Ogunwale <ogunwale@google.com> am 9d293911: am ebdfb6e8: Merge "[ActivityManager] Distinguish FG or BG receiver finished"
automerge: 0f8ecc8

* commit '0f8ecc84c8b86054bfd3275f942c3a705df01fbb':
[ActivityManager] Distinguish FG or BG receiver finished
7dfe83d39619189b4e5aa62d9ac34b68b96da5ab 13-Jan-2015 Olawale Ogunwale <ogunwale@google.com> am a9ae5050: am 8ddd5f4c: Merge "[ActivityManager] Fix process record leakage."
automerge: d07b9ea

* commit 'd07b9ea63dc37eaaf28bdf91b2edae62e2b35ee1':
[ActivityManager] Fix process record leakage.
c63a16b8e46f2f3ecce6c548663cc3185f011fd6 13-Jan-2015 Narayan Kamath <narayan@google.com> Fix unexpected language changes on SIM card insertion.

There are two separate issues here that need to be fixed, both
boil down to the fact that adding an imperative (userSetLocale)
to the Configuration is a bad idea. Because of this:

- We'd never persist the first user set configuration if it was en_US,
because of an erroneous call to Configuration.setLocale.

- ActivityManager.getConfiguration would sometimes return a
Configuration with userSetLocale == true, which means callers with
the right permissions would inadvertently persist a locale they didn't
want to persist.

bug: 18879010

Change-Id: Id330ffde9d2a6e516fd60edc33f5529df719c634
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0f8ecc84c8b86054bfd3275f942c3a705df01fbb 12-Jan-2015 Olawale Ogunwale <ogunwale@google.com> am 9d293911: am ebdfb6e8: Merge "[ActivityManager] Distinguish FG or BG receiver finished"

* commit '9d293911221cac930eb8edfef01362ea083eeaab':
[ActivityManager] Distinguish FG or BG receiver finished
d07b9ea63dc37eaaf28bdf91b2edae62e2b35ee1 12-Jan-2015 Olawale Ogunwale <ogunwale@google.com> am a9ae5050: am 8ddd5f4c: Merge "[ActivityManager] Fix process record leakage."

* commit 'a9ae505053585b6c46a6a86475959fd9fe501b09':
[ActivityManager] Fix process record leakage.
ebdfb6e8642e649f7efe877af398eae71cd9b80c 12-Jan-2015 Olawale Ogunwale <ogunwale@google.com> Merge "[ActivityManager] Distinguish FG or BG receiver finished"
1ed82edf1df1b1e86929669c4b9e2cac4a6f9283 09-Jan-2015 Dianne Hackborn <hackbod@google.com> am 2abf1f1c: Merge "Fix issue #18942959: Phone getting stuck then restarts after unplugging from Audi" into lmp-mr1-dev automerge: 54f9b1e automerge: a319aa8

* commit '2abf1f1c212574ea7073584406ee86898f5d3779':
Fix issue #18942959: Phone getting stuck then restarts after unplugging from Audi
2abf1f1c212574ea7073584406ee86898f5d3779 09-Jan-2015 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #18942959: Phone getting stuck then restarts after unplugging from Audi" into lmp-mr1-dev automerge: 54f9b1e
automerge: a319aa8

* commit 'a319aa800df36d40e1de453b64fd1e14573e6d80':
Fix issue #18942959: Phone getting stuck then restarts after unplugging from Audi
b3d4cb369e37b1b7e85832cc035226dc7cc8f380 09-Jan-2015 Dianne Hackborn <hackbod@google.com> Fix issue #18942959: Phone getting stuck then restarts after unplugging from Audi

FastPrintWriter needs to have its own lock for each instance, or
else one getting blocked can cause others to block and whacky deadlocks
result.

Also:

- Improve error reporting of SystemConfig to tell you which config
file is the problem.
- Fix CoreSettingsProvider to not spew errors if a setting is not
defined (it should just use a default value).
- Get rid of noisy init output of ConditionProviders.
- Reduce log noise of starting a process; move some of that information
to ProcessRecord to print on demand.

Change-Id: I1032d141ddd449968b74ab7b88ab36f2d228ad1a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9c088fc8e71c299507b5ea212e25a00ff49d892f 08-Jan-2015 Dianne Hackborn <hackbod@google.com> Merge "Add new debug feature to track associations between processes. Also add some debugging for spurious service ANRs." into lmp-mr1-dev automerge: a7881fd automerge: 30ae442
automerge: 8fa0935

* commit '8fa0935335ec5b9174e01acf861c58972a72aeab':
Add new debug feature to track associations between processes. Also add some debugging for spurious service ANRs.
8fa0935335ec5b9174e01acf861c58972a72aeab 08-Jan-2015 Dianne Hackborn <hackbod@google.com> Merge "Add new debug feature to track associations between processes. Also add some debugging for spurious service ANRs." into lmp-mr1-dev automerge: a7881fd
automerge: 30ae442

* commit '30ae442133c55d4aa3636127de556736b2eaa99f':
Add new debug feature to track associations between processes. Also add some debugging for spurious service ANRs.
a7881fd30b973f923c98d53bddf397d744b4229c 08-Jan-2015 Dianne Hackborn <hackbod@google.com> Merge "Add new debug feature to track associations between processes. Also add some debugging for spurious service ANRs." into lmp-mr1-dev
c82f2f5f9cb1bd4f5bcbd39a8ddf0d8da84f7104 09-Dec-2014 Wale Ogunwale <ogunwale@google.com> Add RecentTasks class to house recent tasks functionality.

Cleaned-up ActivityManagerService a little by moving recent
tasks functionality to new class RecentTasks.

Bug: 18556524
Change-Id: I4c877c9695b63d7fdb1b6b7addb737fd663e86c7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ab2df067fc9757f19061b968c53953ca90a4c384 07-Jan-2015 Dianne Hackborn <hackbod@google.com> Add new debug feature to track associations between processes. Also
add some debugging for spurious service ANRs.

Bug: 18201239
Change-Id: Icd43f35c696d71453e1d4deea855984b2d14b347
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cab68c789491615841ab2abc84356a40e4f8e72b 07-Jan-2015 Wale Ogunwale <ogunwale@google.com> am 6763058f: am f61bc8a2: Merge "Bring task with root activity to front when launching from recents." into lmp-mr1-dev
automerge: df3d130

* commit 'df3d1307d5141c394b0eb521d6beb7f262fb3e3f':
Bring task with root activity to front when launching from recents.
df3d1307d5141c394b0eb521d6beb7f262fb3e3f 07-Jan-2015 Wale Ogunwale <ogunwale@google.com> am 6763058f: am f61bc8a2: Merge "Bring task with root activity to front when launching from recents." into lmp-mr1-dev

* commit '6763058fe74c31bd44b8c94e2911c72e9db68e97':
Bring task with root activity to front when launching from recents.
7bc33c0d252b190af8258c827de8a8a5382210db 07-Jan-2015 Wale Ogunwale <ogunwale@google.com> Bring task with root activity to front when launching from recents.

Change makes sure we cover all cases where a task should be brought
to front if it already has a root activity and we are launching
from recents.

Bug: 18846206
Change-Id: I2e67a4c163c5a5ed6784ed620583f85d9c6ed731
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
22242ab29a5be21c5248d0cb366de3d5fcb554e8 12-Dec-2014 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Fix process record leakage.

Symptom:
Remain dead process record in mLruProcesses.

Root cause:
When a process dies and needs to restart immediately.
The process record will not be removed from mLruProcesses
in handleAppDiedLocked (return kept=true).
If the restarting process start timeout, the record in
mLruProcesses will not be removed.

Solution:
Call removeLruProcessLocked in processStartTimedOutLocked.

Change-Id: I1935ccc586016cb4e90dfdfac96cc88931553d5f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
62fbd4feb1bccfdfa08a96c71eb5a1b102ac4c2c 05-Jan-2015 Wale Ogunwale <ogunwale@google.com> am 170a678c: am 1d893785: Merge "Don\'t restore persistent task to a stack until needed." into lmp-mr1-dev
automerge: b8e5139

* commit 'b8e51390af6015c1eaff7679546a5a7d2dfa701d':
Don't restore persistent task to a stack until needed.
b8e51390af6015c1eaff7679546a5a7d2dfa701d 05-Jan-2015 Wale Ogunwale <ogunwale@google.com> am 170a678c: am 1d893785: Merge "Don\'t restore persistent task to a stack until needed." into lmp-mr1-dev

* commit '170a678cd2b7073edd061765dabd4a754f562e60':
Don't restore persistent task to a stack until needed.
1f5ac4d322d76ca76fdf5dee40fe9549aad7437e 03-Jan-2015 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Distinguish FG or BG receiver finished

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

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

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

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

Another general solution but with bigger scope:
I60dce4a48e20c1002a61a979e4d78b9b0a8b94a0

Change-Id: I913ca6f101ac8ec6c7a8e42754e6781f80247b7f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9ac9609f4d078dc0d7fe7c703fb88d20fd629bfe 23-Dec-2014 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Prevent application holding AMS lock

Symptom:
Watchdog timeout.

Reproduce code:
String action = "lets.deadlock";
Uri baseUri = Uri.parse("content://i.am.bad");
Uri uri = ContentUris.withAppendedId(baseUri, 1);
Intent intent = new Intent(action, uri);
sendStickyBroadcast(intent);

IntentFilter filter = new IntentFilter(action);
filter.addDataScheme(baseUri.getScheme());
filter.addDataAuthority(baseUri.getAuthority(), null);
filter.addDataPath(uri.getPath(), 0);
registerReceiver(null, filter);

In target provider's getType:
Invoke AMS function will result deadlock.
Or sleep a long time will also trigger watchdog timeout.

Root Cause:
If broadcast is sticky with content scheme intent.
Register receiver will trigger access provider when
matching intent with IntentFilter, and it executes
in ActivityManagerService's lock.

Solution:
Obtain necessary data to local to split lock block.

Change-Id: I0fb94472cdc478997e40ba2a60a988c5f53badb2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7de0535701351d76b634ab18577269e8130749ea 13-Dec-2014 Wale Ogunwale <ogunwale@google.com> Don't restore persistent task to a stack until needed.

On boot-up we restore all persistent tasks to an activity stack.
This can cause issues with the activity stack supervisor when it
tries to make restored tasks with activities visiable when they
shouldn't be. Which ends up messing up the order of the recents
list. Now we don't restore persistent tasks to an activity stack
on boot-up. Instead we add the task to the stack when it is needed.

Also, fixes issue with not been able to launch task records with
activity records that were restored from an other device.

Bug: 18692762
Change-Id: Iad0e6635f8c5d1dab4d341feb3e7b06291a94739
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
539db51a7d45d95673f21b579bf9b353e9c19c70 15-Dec-2014 Todd Kennedy <toddke@google.com> propagate reason to finishActivityLocked()

Bug: 18704347
Change-Id: I830ad08f344db5be99760e0112d96729077b29c6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
06024047258b01ad70f7d88e5773d8dc9b8d59fd 11-Dec-2014 Narayan Kamath <narayan@google.com> am bc59ca4b: am 31462128: Merge "Avoid tearing down process groups twice."

* commit 'bc59ca4bdbd993c1eb5c2a74f9b35857619da285':
Avoid tearing down process groups twice.
15cd63027bc8413659114714068a665869a4b3b2 11-Dec-2014 Narayan Kamath <narayan@google.com> Merge "Avoid tearing down process groups twice." into lmp-mr1-dev
2467188e396503988ea05401011837a18f9a93a1 11-Dec-2014 Amith Yamasani <yamasani@google.com> am a2530e4a: am ee24d848: Merge "Stop guest user on exiting, to conserve resources" into lmp-mr1-dev

* commit 'a2530e4aa4c35787516ffea8368c0ebc35da4df4':
Stop guest user on exiting, to conserve resources
ee24d848a5f270fb2d18150ab14200e62c9fd118 10-Dec-2014 Amith Yamasani <yamasani@google.com> Merge "Stop guest user on exiting, to conserve resources" into lmp-mr1-dev
6f96a44df3457350f2d290fb811319bb888cc19c 09-Dec-2014 Amith Yamasani <yamasani@google.com> Stop guest user on exiting, to conserve resources

Bug: 18672730
Change-Id: I17bc26ce2e10ceebeb18b75565daf21aa7df7774
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
034ef013ecb14203a005f88abb1c765055b7d4f4 10-Dec-2014 Narayan Kamath <narayan@google.com> Avoid tearing down process groups twice.

The second removal always triggers a warning.

Change-Id: Ieafa8374dbffdaff0d576de004a688cae6f8ac18
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f85a91e408a0da3799fe1701f450b71e20b68c80 10-Dec-2014 Dianne Hackborn <hackbod@google.com> am d6372242: Merge "Further work on issue #18640385: Add procstats test mode" into lmp-mr1-dev
automerge: d525891

* commit 'd52589185f57ce7eb633d12dec98e4bbae4e33fd':
Further work on issue #18640385: Add procstats test mode
ae6cc8af2674909924fb18cb73763a110bee63dd 10-Dec-2014 Dianne Hackborn <hackbod@google.com> Further work on issue #18640385: Add procstats test mode

Tune sampling periods:

- Lower minimum sample interval when in test mode.
- Add a check when sampling pss to make sure this is at least 1
second since the pss changed, to reduce the amount of bad
data (very small pss samples) that we see.

Change-Id: I624a7d0480f3f6b22d229744e028d13a2c7b0e89
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c46f75ef1d479f7b606ab04283b1b0f84849476a 10-Dec-2014 Narayan Kamath <narayan@google.com> Avoid tearing down process groups twice.

The second removal always triggers a warning.

Change-Id: Ieafa8374dbffdaff0d576de004a688cae6f8ac18
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f1ffc75c9ec093ff780954f86c72a8a7069ca6cf 10-Dec-2014 Amith Yamasani <yamasani@google.com> Merge "Allow user shutdown broadcasts to be delivered" into lmp-mr1-dev automerge: dad85a6
automerge: 7acd880

* commit '7acd8802d7c14323dfc2a5e68b1d2a82f9d3f5c0':
Allow user shutdown broadcasts to be delivered
0d2ebc29689cc7cb8a5447c38ac01fe433ed693b 09-Dec-2014 Amith Yamasani <yamasani@google.com> Allow user shutdown broadcasts to be delivered

Fixes a regression that prevents the user from being fully shutdown
after being stopped. Wasn't killing all user processes.

Bug: 7462778
Change-Id: Iee7231f7c8a167e8a61549b149294b2dbef071c1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
70acd9b36a9fc0d212b25d64f4edf0fc582331cf 09-Dec-2014 Sebastien Hertz <shertz@google.com> resolved conflicts for merge of beb84982 to lmp-mr1-dev-plus-aosp

Change-Id: Ib420549f3e20c149c15966dfece980b4f150177d
1a4b5a4f02e7d8ff8ff645377d97e6062d36aeaa 09-Dec-2014 Dianne Hackborn <hackbod@google.com> Work on issue #18640385: Add procstats test mode

You can now do "adb shell dumpsys procstats --start-testing" to
enable high frequency pss sampling.

Also improved the low on RAM mem reporting to separate out RAM
from memtrack, in case the data we are getting from that is bad.

And fixed meminfo --oom to work correctly again.

Change-Id: I7af17eab110a82298bd7b0ce381f8fa5c96c1f6a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0cfdd810ded6f8486a6b0a61044594f58ab5c052 08-Dec-2014 Dianne Hackborn <hackbod@google.com> am e52a2ea0: am 0029f0ac: Merge "Fix issue #17323751: Additional items in aggregated battery stats" into lmp-mr1-dev

* commit 'e52a2ea03bd7b8ed2f3680c5198e00fb7ad5c34c':
Fix issue #17323751: Additional items in aggregated battery stats
34e7003a78005e86326c86345561e986978723c6 08-Dec-2014 Dianne Hackborn <hackbod@google.com> am 3cb6496b: am 25d2c2d6: Merge "Fix issue #18593636: Turn on "kill important processes that..." into lmp-mr1-dev

* commit '3cb6496b6c8bb48d458c46e7a062228f0488307d':
Fix issue #18593636: Turn on "kill important processes that...
0029f0ac36c28b60d59d3d70d148ba3136971b95 05-Dec-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #17323751: Additional items in aggregated battery stats" into lmp-mr1-dev
1e01d16982e6b22ec4c0e2d6dc1e261eb6f92c8e 05-Dec-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17323751: Additional items in aggregated battery stats

- Now aggregate number of times each process has crashed and ANRed.
- Now aggregate total number of connectivity changes.
- Now record connectivity changes in the history.

Crash and ANR counts are new entries at the end of "pr" in checkin.

Connectivity change counts is a new entry at the end of "m" in checkin.

Connectivity changes in the history checkin are Ecn and include the
type of connection and its state.

Change-Id: I0c01186446034cf6c3fb97d45f5e3b5c69a0438a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
af3361bb264d9d037f0bd10532a752bbaeaec39c 05-Dec-2014 Wale Ogunwale <ogunwale@google.com> am 9a3f6ac6: am 6b54d38a: Merge "Add support from restoring recent\'s backup." into lmp-mr1-dev

* commit '9a3f6ac63c9c11008b6dbb99d5213b3d3f51fca0':
Add support from restoring recent's backup.
43606641f6a2b7f31b289da4548231306f4e5156 05-Dec-2014 Amith Yamasani <yamasani@google.com> Merge "Correct check of is user running" into lmp-mr1-dev
308fa0548b8be4d8cca7ba55846d6f61b36f1a7d 11-Nov-2014 Sergii Skorokhodov <sergii.skorokhodov@sonymobile.com> Correct check of is user running

Before the ActivityManagerService sends an intent or
starts an activity it checks if target user is in
mStartedUsers array.

When removing a non-owner user process the
UserStartedState instance will still be in mStartedUsers
array with mState STOPPING or SHUTDOWN.

This should be checked before sending an intent or start
an activity.

isUserRunningLocked(...) will interpret mState STOPPING
and SHUTDOWN as a non running user.

Bug: 7462778
Change-Id: I1b51bcdb62bdd0f6dbe05dab4d529d4ad40d0d44
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
25d2c2d61b546f730ccd4bab67c68b2eaa4281a0 05-Dec-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #18593636: Turn on "kill important processes that..." into lmp-mr1-dev
2faf91fbb300882afd1092b788aa16295eb3dde8 05-Dec-2014 Amith Yamasani <yamasani@google.com> am 66cbec51: am d234dc1f: Merge "Correct check of is user running"

* commit '66cbec512cf31228f8d86171f57cf4e3bcbbd63e':
Correct check of is user running
d234dc1f20d3a68e0dd9f2c3a5f14282fba79b13 05-Dec-2014 Amith Yamasani <yamasani@google.com> Merge "Correct check of is user running"
6b54d38a2c859f1c2cc176d1d9a33837cfc351db 04-Dec-2014 Wale Ogunwale <ogunwale@google.com> Merge "Add support from restoring recent's backup." into lmp-mr1-dev
57a873fcaa4dd95fc844887b0c255f650b9159e5 04-Dec-2014 Dianne Hackborn <hackbod@google.com> Fix issue #18593636: Turn on "kill important processes that...

...have ballooned" for all devices

Actually, this was supposed to be on for all devices, but it was no
longer being run due to changes in the idle maintenance code in L.
So now we run it again. And moved the idle maintenance window to 3am.

Change-Id: I8e90723e1431b82896d261cf90f8bf84f43b0bf2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
afca4dba31f2da85265b97ad50638fc34bad292c 04-Dec-2014 Craig Mautner <cmautner@google.com> Merge "bug fix possible NPE while startProcessLocked()" into lmp-mr1-dev
799cb730298591a9d7303ea051451a3b6dc8e51f 04-Dec-2014 Craig Mautner <cmautner@google.com> Merge "[ActivityManager] Fix race condition in pss collection" into lmp-mr1-dev
bc0975b3afdb8ba80a6d54d898b299483ad680ad 02-Dec-2014 younghwan1.kim <younghwan1.kim@lge.com> bug fix possible NPE while startProcessLocked()

In case, process doesn't create well while startingProcessLocked().
There is possibility to make NPE.
Setting app's crash handler needs to be assigned after null check routine.

Change-Id: I67fb6427f72d93f79fed36eb44c47d37eafdac31
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
71e737c8e8b970d780b930ebc6eacb4464d4a6aa 01-Dec-2014 louis_chang <louis_chang@htc.com> [ActivityManager] Fix race condition in pss collection

Symptom:
There has a race condition that two threads are accessing
the mPendingPssProcesses simultaneously. One of the thread
is collecting the process pss by looping the mPendingPssProcesses.
The other thread is requesting to collect pss of all processes,
which clears mPendingPssProcesses and adding processes back.

Solution:
Avoid race condition by adding synchornized protection.

Change-Id: Ifb090eda9c4a1b8e3fd980fe0171e9dd77773b46
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8920e1cabb56be6c46df40f5329aadbce3132fde 29-May-2014 Kazuki Nakayama <kazuki.x.nakayama@sonymobile.com> Reset killedByAm flag at attachApplicationLocked

Cherry picked from aosp.

Fixes bug 18593309.

ActivityManager reuses a process record object that killed
by him under some situation. That reused process record inherits
a killedByAm flag unexpectedly.
The killedByAm flag must be reset otherwise ActivityManager can't
judge the process can be killed or not.

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

Bug: 15986349
Change-Id: I899f81d317fcd5277a75db7ba50ecca14112df26
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fee5e3d32a26c3ac2136e37cad15fd9cc41066db 03-Dec-2014 Winson Chung <winsonc@google.com> am 50511096: am de9848c6: Merge "Initial changes to add callback on task stack changes. (Bug 17672056, Bug 18291345)" into lmp-mr1-dev

* commit '50511096998ffff4fa5c001e46b056201fb0b892':
Initial changes to add callback on task stack changes. (Bug 17672056, Bug 18291345)
9edcc7be49aa521ece6b7b5f04530a435211e2b5 11-Nov-2014 Sergii Skorokhodov <sergii.skorokhodov@sonymobile.com> Correct check of is user running

Before the ActivityManagerService sends an intent or
starts an activity it checks if target user is in
mStartedUsers array.

When removing a non-owner user process the
UserStartedState instance will still be in mStartedUsers
array with mState STOPPING or SHUTDOWN.

This should be checked before sending an intent or start
an activity.

isUserRunningLocked(...) will interpret mState STOPPING
and SHUTDOWN as a non running user.

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

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

Change-Id: I8bd9155d7a05e89c190a20429acff69a17808208
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
240602f43184b820ecff064d61e99017f849c0cf 02-Dec-2014 Craig Mautner <cmautner@google.com> am 877d8939: am f6be7d17: Merge "[ActivityManager] Fix race condition in pss collection"

* commit '877d89399af77a98dd940c034aa631029ed313cc':
[ActivityManager] Fix race condition in pss collection
f6be7d177a740f86a4ae3b8685cc9e2f31506352 02-Dec-2014 Craig Mautner <cmautner@google.com> Merge "[ActivityManager] Fix race condition in pss collection"
8abe01aa80a0697d21103322ac500dce31058b50 02-Dec-2014 Craig Mautner <cmautner@google.com> am a370d9d1: am f54954f9: Merge "bug fix possible NPE while startProcessLocked()"

* commit 'a370d9d19af04c2a9f9d5c5b5794a6a5cd6fd774':
bug fix possible NPE while startProcessLocked()
f54954f97599f83584ab736d931b1fe1aff8890c 02-Dec-2014 Craig Mautner <cmautner@google.com> Merge "bug fix possible NPE while startProcessLocked()"
62cfde14423922948928c40eddd212d1dc51d591 01-Dec-2014 louis_chang <louis_chang@htc.com> [ActivityManager] Fix race condition in pss collection

Symptom:
There has a race condition that two threads are accessing
the mPendingPssProcesses simultaneously. One of the thread
is collecting the process pss by looping the mPendingPssProcesses.
The other thread is requesting to collect pss of all processes,
which clears mPendingPssProcesses and adding processes back.

Solution:
Avoid race condition by adding synchornized protection.

Change-Id: Ifb090eda9c4a1b8e3fd980fe0171e9dd77773b46
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8f6fc8150035c94ba0ece031a9aaa5f6eea4b053 02-Dec-2014 younghwan1.kim <younghwan1.kim@lge.com> bug fix possible NPE while startProcessLocked()

In case, process doesn't create well while startingProcessLocked().
There is possibility to make NPE.
Setting app's crash handler needs to be assigned after null check routine.

Change-Id: I67fb6427f72d93f79fed36eb44c47d37eafdac31
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bda8e4192a26b5ab137ba3c22ea00b493a1b673e 01-Dec-2014 Craig Mautner <cmautner@google.com> am be342ef0: am c4cf78f4: Merge "[ActivityManager] Ensure provider external access count will be released."

* commit 'be342ef034f05c6864aaa85ab25c009148954552':
[ActivityManager] Ensure provider external access count will be released.
10c40fc01d56ee17068cb61d5c19e6ab68f2ca48 01-Dec-2014 Craig Mautner <cmautner@google.com> am a12ac54c: am 25596374: Merge "[ActivityManager] Prevent provider from been created twice."

* commit 'a12ac54cf69c0c8cfec6fa7c14176b714cae7107':
[ActivityManager] Prevent provider from been created twice.
5a6c1962590979d0722da0547a6ba3ae1a98dd04 01-Dec-2014 Craig Mautner <cmautner@google.com> am 11c67c92: am 7db48ed0: Merge "Reset killedByAm flag at attachApplicationLocked"

* commit '11c67c92de3522a50b9994eb83e34c152902ad18':
Reset killedByAm flag at attachApplicationLocked
c4cf78f4d3154af317e686c9ef702a26cf28f8f2 01-Dec-2014 Craig Mautner <cmautner@google.com> Merge "[ActivityManager] Ensure provider external access count will be released."
255963742982daf46eb665a2934bd61e7ed95c81 01-Dec-2014 Craig Mautner <cmautner@google.com> Merge "[ActivityManager] Prevent provider from been created twice."
105add8d1aebad3904a8863860fa596712151f65 15-Nov-2014 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Prevent provider from been created twice.

Root Cause:
If a process which contains provider is starting but not
from accessing provider, e.g. service/activity/receiver,
its providers' will be created during handleBindApplication.
And before the process complete publish provider to
ActivityManagerService, if there is an access call to
process provider before the process completes publishing
providers to ActivityManagerService, then the providers
will be created again.


Solution:
Don't schedule install provider if the provider record
already exist and will be published later.

Change-Id: Ic200ceae042c014c86e7edee0acd013b513af334
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
609cb91c9cbb94c792e1fe50f6d762f498d6bcc8 29-May-2014 Kazuki Nakayama <kazuki.x.nakayama@sonymobile.com> Reset killedByAm flag at attachApplicationLocked

ActivityManager reuses a process record object that killed
by him under some situation. That reused process record inherits
a killedByAm flag unexpectedly.
The killedByAm flag must be reset otherwise ActivityManager can't
judge the process can be killed or not.

Change-Id: If95137d91939cc44882ad2813131bcde0edd0c1b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5bbb1af74a40f60d6609c2b1c580cb91ffb12c54 24-Nov-2014 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #18486438: Reduce size of bugreport output" into lmp-mr1-dev
d052a9416ae3f7e42fc1e7de0740021df385ee48 22-Nov-2014 Dianne Hackborn <hackbod@google.com> Work on issue #18486438: Reduce size of bugreport output

Reduce how much stuff ProcessStats spews, and do collapsing of
repeated intent filter targets when dumping IntentResolvers.

Also add to pm's checkout output to include shared user ids,
and fix output formatting in a few places.

Change-Id: Ic9fc6731f0439101ba9343535e66cdbbad47e291
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1740062728bf66f416b47b0c7f7d89c8d6b77504 22-Nov-2014 Jeff Sharkey <jsharkey@android.com> Merge "Avoid NPE in forceStopPackageLocked()." into lmp-mr1-dev
27f36f426702acf7ba3103997e5009da2cd67c80 21-Nov-2014 Jeff Sharkey <jsharkey@android.com> Avoid NPE in forceStopPackageLocked().

Bug: 18477180
Change-Id: I5d91ae11ed2fd6e1e67e54d83fa945bb4dcee221
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9ef94019386183cb88ad090965418ef294bbb79a 21-Nov-2014 Jeff Brown <jeffbrown@google.com> resolved conflicts for merge of 694c1d2b to lmp-mr1-dev

Change-Id: I9a9b724e0fd12aa161ff276540431b9d8e218e2b
fbe96706bb9754f9ea3f6345f32e058a45ad10b4 20-Nov-2014 Jeff Brown <jeffbrown@google.com> Support keeping activities resumed while dozing.

If the lock screen is not shown, then let activities keep running
while dozing. This is important to support ambient mode on watches
since it allows the home app to keep running.

To make this possible, we need to inform the activity manager about
the exact wakefulness state, not just the overall boolean
interactive state.

Bug: 18284212
Change-Id: Ia35c99127ce51ffc178f3a2f51fca67d24061c71
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d9968438bcf439e7a8c6058a95b85286a632dc1c 20-Nov-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue with call backs from media process." into lmp-mr1-dev
1f4c02bb18ef8e8cc0fecd6786209089f84de147 13-Nov-2014 Wale Ogunwale <ogunwale@google.com> Stop activity onVisibleBehindCanceled()

Once an activity is no longer visible behind and has released
its background resources, it is added to the list of activities
that can be stopped, but not actually stopped until the next
major event (like another activity starting). We now schedule
the idle processing once the background resources have been
released so the activity can be stopped as soon as possible.

Bug: 18191707
Change-Id: I472eee949c1a78b4d944454463f03c90e7d2618b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ff17024e583b170312d82089fd358d278ce16c9a 19-Nov-2014 Dianne Hackborn <hackbod@google.com> Fix issue with call backs from media process.

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

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

Change-Id: I3c70e16e0899d7eef0bae458e83958b41ed2b75e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
343f478241fab49c909b229d6876ff8405e7b0d5 10-Nov-2014 Narayan Kamath <narayan@google.com> Tell installd when boot completes.

installd can then clear the ".booting" marker from the dalvik-cache
(owned by root). This marker is used to detect boot loops.

bug: 18280671

(cherry picked from commit 76a748e62f354c799342044f724e1f4b80121837)

Change-Id: I2364c05837ac04d428b5a34ab1802964a11d2df4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d6447bbc88b8c1c238dd8e5bfb4b0daf6d2266cb 19-Nov-2014 Jeff Sharkey <jsharkey@android.com> Merge "Speed up GrantUri.hashCode()." into lmp-mr1-dev
3597b55d12f77d2fb3019b2bbc3496673c78be7d 18-Nov-2014 Jeff Sharkey <jsharkey@android.com> Speed up GrantUri.hashCode().

It's used as a key for all outstanding permission grants, so let's
keep it fast.

Bug: 18381401
Change-Id: I4db8dba13302b98f33aacfa3e9acd9a394541cd0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
465e996776d916d8d1b62c539142827bd96a42bc 17-Nov-2014 Wale Ogunwale <ogunwale@google.com> Merge "Consolidated processing of package boardcasts in AM service." into lmp-mr1-dev
9c76a7b3e85ce7056071ac8627c8d675cc5c1599 17-Nov-2014 Jeff Sharkey <jsharkey@android.com> Merge changes Id7f9fb53,I897d7ee8 into lmp-mr1-dev

* changes:
Prevent user ID reuse until after reboot.
Warn user when build fingerprints differ.
98f1f3400d7c5c3b2c3b22f57f590e1b9e5d484d 15-Nov-2014 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Ensure provider external access count will be released.

Sympton: Oom-adj of provider process will be always 0.

Root Cause: Exception happend in openContentUri
may not call removeContentProviderExternalUnchecked.

Flow:
application [MediaPlayer.setDataSource(Context context, Uri uri)]
uri is invalid, IOException will be caught and below log will appear:
"Couldn't open file on client side, trying server side"
Continue to call setDataSource(String path, Map<String, String> headers)
->mediaserver [MediaPlayerService::Client::setDataSource]
setDataSource(httpService, url, headers) calls openContentProviderFile
->system_server (ActivityManagerService) [openContentUri]
Increase externalProcessNoHandleCount for media provider.
Call [openFile] to media provider.
->android.process.media [check permission for openFile]
enforceReadPermissionInner
->system_server [checkComponentPermission]
Use mediaserver's uid to check READ_EXTERNAL_STORAGE
-> not granted due to it is pure native process, not a known package.
Throw security exception then the flow of openContentUri is broke.
And externalProcessNoHandleCount is unable to decrease.

Application sample code:
String invalidId = "54321";
Uri externalUri = MediaStore.Files.getContentUri("external");
Uri uri = Uri.withAppendedPath(externalUri, invalidId);
mediaPlayer.setDataSource(mContext, uri);

Solution: Move removeContentProviderExternalUnchecked to finally block.

Change-Id: I75eec1f9631e9c6bb18449946d707d51ac21e8a7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5ed21bd9aca01f01e2b27e2bfa031d31c775eec7 15-Nov-2014 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Avoid orphan ContentProviderRecord.

<Symptom>
Binder threads wait forever results ANR/system hang.

<Root cause>
When X is accessing Y's provider.
Before Y publishing its provider to notify X,
someone invokes killBackgroundProcesses to kill Y.
In removeProcessLocked, it will pass restarting=true
and allowRestart=true to handleAppDiedLocked.

When the clean flow going to removeDyingProviderLocked.
The variable will be inLaunching=true always=false.
Then it will not notify the ContentProviderRecord.
And also due to the ContentProviderConnection waiting=true,
it will do nothing and just return true to
cleanUpApplicationRecordLocked to set restart as true.

But due to restarting=true, the restart flow will not execute,
then the waiting ContentProviderRecord for X will be orphan
and keep waiting.

<Reproduce step>
Service X query provider Y when X's oom adj is SERVICE_ADJ,
before Y's publish provider, invoke killBackgroundProcesses
to Y's package.
Then use command "adb shell dumpsys activity prov"
Y will always in "Launching content providers".

<Solution>
For not restarting case, pass restarting=false to
handleAppDiedLocked to let the provider process can be restarted.

A more simple way maybe just change to keep below 2 lines:
app.kill(reason, true);
handleAppDiedLocked(app, callerWillRestart, allowRestart);

Change-Id: I8992cb851fce4dbe6255da71d60390e1a33cb9c7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2cffc7dafd390f6fe24a9fbb3ef3bc8226f5b385 14-Nov-2014 Jeff Sharkey <jsharkey@android.com> Warn user when build fingerprints differ.

We're now shipping devices with several partitions which may end up
mismatched, causing subtle runtime issues. To help manufacturers and
users catch this case, show wanring when we detected mismatched
fingerprints.

Bug: 18357469
Change-Id: I897d7ee8cbf3b8042d3d7d282afab277d242ed3f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0a41a578023fc3614f8888552b32fe9ea0d74eae 14-Nov-2014 Wale Ogunwale <ogunwale@google.com> Consolidated processing of package boardcasts in AM service.

Bug: 18230409
Change-Id: Idc048eb6cfece792b1cdc651146fba965f874430
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
86677c9a511f4478bf94418208e600b1f40db733 14-Nov-2014 Winson Chung <winsonc@google.com> Fixing regression in screen pinning button visibility. (Bug 18390050)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
222722ee73c38dea5544118df6bd349e630d1c26 12-Nov-2014 Narayan Kamath <narayan@google.com> Merge "Tell installd when boot completes." into lmp-mr1-dev
e042bf2b22b391f13d8e43ddcd657183992c7197 11-Nov-2014 Craig Mautner <cmautner@google.com> If task isn't found in recents, look in the stacks.

It may take an attach to move a task into the recents list. If the
timing is right a task may not be in recents by the time we are
removing it from the stacks due to a finish. In that case we should
look in the stacks for the task as well as looking in recents.

Fixes bug 18017409.

Change-Id: Idcfe2e263c9d0fe9a063fdf22515ac4e7fe89ecb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
76a748e62f354c799342044f724e1f4b80121837 10-Nov-2014 Narayan Kamath <narayan@google.com> Tell installd when boot completes.

installd can then clear the ".booting" marker from the dalvik-cache
(owned by root). This marker is used to detect boot loops.

bug: 18280671

Change-Id: I878f1463c7f523892605c17b980a51ac3b6645e2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
395b519f4bfec6e1c171aaca2c62a75a5c07de07 08-Nov-2014 Amith Yamasani <yamasani@google.com> Merge "Inform PendingIntent sender if broadcast was not queued." into lmp-mr1-dev
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/services/core/java/com/android/server/am/ActivityManagerService.java
2f04d16f16ea935895872efe4dfcff3366070e9c 07-Nov-2014 Jason Monk <jmonk@google.com> Merge "Plumbing for screen pinning request from sysui" into lmp-mr1-dev
3ed9f2f903a8e6c38ca9f2ce3819ac063281a020 07-Nov-2014 Winson Chung <winsonc@google.com> Merge "Adding bounce animation for affiliated tasks. (Bug 16656169)" into lmp-mr1-dev
044d52934e57a337665f707aa4be1d423ee3fb29 06-Nov-2014 Winson Chung <winsonc@google.com> Adding bounce animation for affiliated tasks. (Bug 16656169)

Change-Id: I39e4a57c4e6b707d15513dacde2d40c23bb05058
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a11bb7427171418681428754051d5ee4dce851ee 06-Nov-2014 Craig Mautner <cmautner@google.com> Add logging for failure to finish.

Will help with bug 17648830.

Change-Id: Ib73c14cee332649a3e57a4779814a394f7d13173
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5565cb42f2ac07fcdbe3aab2503de07fbeb39504 12-Sep-2014 Jason Monk <jmonk@google.com> Plumbing for screen pinning request from sysui

Removes lock-to-app request dialog from the AM.

Added a showScreenPinningRequest to IStatusBar to handle the
flow from app requesting lock task to showing the dialog.

This CL also allows startLockTaskOnCurrent (system|signature) to
start lock task directly. (Note: this is the less locked version
that always allows exit through back + recents)

Bug: 16957435
Change-Id: I284918dd5989de6cb2767c2a717529eb5e9c6db4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
42d04db459e5a510c8c815c38e17e419c3e3b404 06-Nov-2014 Craig Mautner <cmautner@google.com> More fixes for keyguard animations.

Add a state machine for calling comeOutOfSleepIfNeededLocked() so
that it is only called after the lockscreen has started dismissing
but not before resumeTopActivityLocked(). Also keep
resumeTopActivityLocked() from being called from
comeOutOfSleepIfNeededLocked() recursively.

Have starting windows count towards notifying the keyguard that a
window has been drawn.

Do not update wallpaper animations based on their not being included
in the windows being animated if there are no windows being animated.

And always improve logging.

Fixes bug 15991916.

Change-Id: I0d21c5337f0e89d9eacc8dab2cdaa52fec43ac0b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
6edb5c665dcb024ae7cfb95b9a92e30dcc5777c1 31-Oct-2014 Dianne Hackborn <hackbod@google.com> Improve low on RAM reporting.

- Don't print every little native process.
- Print in different sections, so if one is too long we don't get the
rest truncated in the log.
- Include other info from meminfo -- ksm and free/used/lost summary.

Change-Id: Iea4ec3860212667e195d2b60b3ded23bfec78436
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
42dc85a848285b021d03179131efe416e804cc6b 12-Sep-2014 Jason Monk <jmonk@google.com> Make lock task check if focused better

Previously using mFocusedActivity, which doesn't seem to update
until after touch (or something). This now uses
StackSupervisor.getFocusedStack(), which seems to be working ok.

Bug: 17469165
Change-Id: Id06a27addeac1576a71fbc0d8ade1bd87e97b0cb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b3af4ec6bae4fe93d40f021e54cbbce10cc7b4c6 18-Oct-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17948288: Improve accuracy of memory use reporting

We now use Mapped to not double-count cached pages that are
mapped in to app processes. Also read in some more values that
count towards kernel RAM use, and count buffers as free rather
than used RAM.

It also looks like the zram accounting is broken -- it was never
collecting the total zram reserved space. I need to figure out
how I was finding that before.

Change-Id: I883f6fc93966774b5c7d2801d1801666dd11ed41
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9797880808320e3a7bae1f59bc7e0c5a13189e5f 14-Oct-2014 Jeff Sharkey <jsharkey@android.com> Start cross profile intents as caller.

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

Bug: 17983737
Change-Id: Ic40816a797cfdb13c0adb48b86ed4ed7d6aae8eb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ce09f5a53c8408d995c116a4430c000574d9875a 11-Oct-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17829949: Don't kill Bluetooth service...

...even in extreme low memory condition

Bind to Bluetooth with BIND_IMPORTANT, so that it is allowed to
go to a higher oom adj level.

Fix some problems when this is done from a system or persistent
process, where this would go to a level that is *too* high. Instead,
introduce a new oom adj level for it that is right below persistent.

Change-Id: I002bcc4accc36c8579c4cda161be7d2fba21ba17
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
fdf5b35ab46639759d6389a4e2a4d5799cb6814b 09-Oct-2014 Dianne Hackborn <hackbod@google.com> Implement issue #17906468: Allow search request to fall back to global search

Change-Id: I04834b2a9f1ec4a68c6a3fed14da2f8dd93b3be7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
8d05172112436a81bed6e4a0810f8914509d8a4d 01-Oct-2014 Dianne Hackborn <hackbod@google.com> More work on issue #17656716: Unhandled exception in Window Manager

Fix Slog.wtf to not acquire the activity manager lock in its code
path, so that it can never deadlock. This was the original intention
of it, but part was missed.

Now we can put back in the code to detect when strict mode data is
getting large (a little more targeted now to the actual problem),
and use Slog.wtf to report it. And as a bonus, when this happens
we will now clear all of the collected violations, to avoid getting
in to the bad case where IPCs start failing. So this should be
good enough for L to fix the problem, with wtf reports for us to
see if the underlying issue is still happening.

Finally, switch a butch of stuff in the system process from Log.wtf
to Slog.wtf, since many of those are deadlocks waiting to happen.

Oh and fix a crash in the settings provider I noticed in APR.

Change-Id: I307d51b7a4db238fd1e5fe2f3f9bf1b9c6f1c041
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
144508d5da4dec37183617ec259ab83d2db4f012 02-Oct-2014 Dianne Hackborn <hackbod@google.com> Merge "Revert white space changes." into lmp-dev
01945f240a0cad450b5a417cf9380066f5736a01 02-Oct-2014 Dianne Hackborn <hackbod@google.com> Revert white space changes.

Change-Id: I3bc9995adf5cefd91f5a9fd4d2a701056dba3ca9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
dcf21d15456e5aca28d063aea73139e30842e6d1 01-Oct-2014 Winson Chung <winsonc@google.com> Fixing invalid check to get component enabled state. (Bug 17679693)

Change-Id: I225d59bf766122d667d990d7e5b1971c6e8af2aa
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
62321ab11460fd852449b3f6a2113694e3e04e7a 01-Oct-2014 Dianne Hackborn <hackbod@google.com> Merge "Maybe fix issue #17700474: manta: high occurrence of device booted..." into lmp-dev
7622a0f8e4198adf0aae5d4e167ee132b34f4cdb 30-Sep-2014 Dianne Hackborn <hackbod@google.com> Maybe fix issue #17700474: manta: high occurrence of device booted...

...but dev.bootcomplete flag is not set

Rework things to address a few issues I found:

- When the activity goes idle, the way we were handling finishing the
boot there was calling finishBooting() with the lock held, but it
shouldn't. We now dispatch that and turning on the screen together
in a separate message.

- Make sure we don't try to start the home activity until we have
reached the point of the system being ready and mBooting being set.
This ensures we don't do any work prematurely.

Change-Id: If30c1f287af73bc2164e7aadbe98022ae42cc5e7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c0322ecda54d9c2db12e861f4d36ef50595b9740 30-Sep-2014 Jeff Sharkey <jsharkey@android.com> Clear ident when obtaining provider across users.

When calling getContentProvider() across user boundaries, and
creating the provider for the first time, we need to clear caller
identity. (We could have torn down the provider while the system
was under memory pressure.)

Bug: 17409650
Change-Id: I67713a03e5f7106f5e8fcf33fe3fdae81ce644ec
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
208678718f9f8db3bc279c7d5bd1445af2831ae3 10-Sep-2014 jgu21 <jinghui.gu@intel.com> Frameworks/base: Early init native bridge

Add the app directory to the arguments for starting a process.
Add a check for NeedsNativeBridge and a call to PreInitializeBridge
in the native fork code.

(cherry picked from commit 2eacd06bfb82b33dfcbccafbcfc0bf1218484bb5)

Bug: 17671501
Change-Id: I970db5b284b0c12e2d8a45df3950c1fff2927a4e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f839b4fcb6b179529585765517895a8c90fe315b 26-Sep-2014 Elliott Hughes <enh@google.com> Set the system locale correctly even on an encrypted device.

Bug: 17659622
Change-Id: Ibbbd5b959bfab5345f20b556c4720d0910b50084
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
192554b59bd53087b4079de3e371103ec574dba6 26-Sep-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #17671802: "content" command always prints..." into lmp-dev
2f1993ec460166413e7887f151630f6708077c0f 26-Sep-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17671802: "content" command always prints...

..."uid 2000 does not have android.permission.UPDATE_DEVICE_STATS"

Make sure to clear calling identity before getting into the guts
of the activity manager. Also fix the places the activity manager
calls in to battery stats to not require a permission check, anyway.

Change-Id: Ifd90937875b9fe0c36aa3f5cf1ec173746914e6b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
95cce9f382693ad13039d1a1fb15529017a20929 23-Sep-2014 Paul Lawrence <paullawrence@google.com> Don't set dev.bootcomplete until interacting with user

Specifically we want to not set it when encrypting and showing
progress.

Bug: 17606949
Change-Id: I668cf47781011e7fcea7aa3b43c7783b3dea77a1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2ca21efdde386c660832c86faf74d61fd3f9330d 26-Sep-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17661444: Persistent service not automatically restarted

The code to recover when running processes are removed from the
LRU list turned up an existing problem where we would remove a
persistent process from the LRU list, making it more obvious.

Now it is fixed.

Change-Id: I94ccb924b3e5649b2819d3392b6f6c9c725dc903
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fae2aabc30b0c3143fe3096140f8f4a9b00d87a7 24-Sep-2014 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #17624121: Settings crash while launching on wiped device" into lmp-dev
b294eac086e7dba9c13cfb6cb4e24e39a1b88631 24-Sep-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #17614141: Add protection for accessing images" into lmp-dev
337abb3b4e705b06f9385df063be4cc06604be04 24-Sep-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17614141: Add protection for accessing images

Add basic filename protection, also only file names that are for
app icons so this can't be abused to access thumbnails.

Change-Id: I2831c0f3f08a39aa734f93f76b6fd4aaf97e87c6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ff072725e39b8c6928d6ca2d7e263d7d081a2288 24-Sep-2014 Dianne Hackborn <hackbod@google.com> Work on issue #17624121: Settings crash while launching on wiped device

Cleaner paths and better error reporting when a problem goes wrong
while binding an application. This gets rid of the (recently added)
error about removing a process that hasn't been killed, and cleanly
kills the process along with more detailed errors about where things
failed.

Change-Id: I710a209c14da1515929e6254396b793177eee115
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
c7437dd7c0fd90757698934d199fe864b40254e1 23-Sep-2014 Dianne Hackborn <hackbod@google.com> Merge "I am such an idiot." into lmp-dev
4a1ef0b171e1b87b815df0ac718eb9fe2c2af4fe 23-Sep-2014 Dianne Hackborn <hackbod@google.com> I am such an idiot.

Seriously, don't look at this. It is so dumb.

Brought up by issue #17307700: retarget a relinquished
task is not working

Change-Id: I947438d3502f75510e2974211bb78d31008eaa90
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2e51cc684271071759231fca1e17f94ed2e6bdfb 23-Sep-2014 Adam Lesinski <adamlesinski@google.com> Merge "Revert behavior of Lockscreen Activity Launch to KK" into lmp-dev
246a8bcadde961f6bc8172811a052af3568a6f4d 23-Sep-2014 Adam Lesinski <adamlesinski@google.com> Revert behavior of Lockscreen Activity Launch to KK

There exists a lifecycle regression where launching an
app from the lockscreen (camera, etc.) causes a series
of onResume, onPause, onRestart, onStart, onResume.

This CL reverts the behavior to what it was in KK, which
is to say that the Launcher is first resumed/paused, then
the Activity being launched has a simple onRestart,onStart, onResume
lifecycle.

Bug:17459745
Change-Id: I04091d2f86a929ee972c8d6debc1beb033c135a8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
19c3b5d0d9852dedef485479473e0c4c1d9f78ea 22-Sep-2014 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #17581375: Nexus 5 getting low on RAM" into lmp-dev
d412563922f46feb4d3c3ba1500f34bddd21d73c 22-Sep-2014 Dianne Hackborn <hackbod@google.com> Work on issue #17581375: Nexus 5 getting low on RAM

Try to catch any cases where we remove a ProcessRecord from the LRU
list when it may still have a process associated with it, report
that this happened, and try to make sure the process is killed.

Change-Id: Icd74439caba5e1c283c01a49a46dae926a00ba71
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6e53b7476e9a1b1ecc30488252e183cff114ad0b 20-Sep-2014 Jeff Brown <jeffbrown@google.com> Merge "Decouple turning screen on from waking up in policy." into lmp-dev
79572afb33955ce4570b855521c67caf3e1e3a9f 19-Sep-2014 Dianne Hackborn <hackbod@google.com> Merge "Add new activity dumpsys command to persist all data." into lmp-dev
36c4db8bd3bd7dad4b6cb8abd9cdc1a627fe3bbc 19-Sep-2014 Jeff Brown <jeffbrown@google.com> Decouple turning screen on from waking up in policy.

This allows us to ensure windows are fully drawn before unblocking
screen on while dozing.

Bug: 17516245
Change-Id: Ibe63c212b8db855ce26a34a8169f33764b266ee6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ce0fd7665f297c5693ee23b3d6daf26baeed4e9d 19-Sep-2014 Dianne Hackborn <hackbod@google.com> Add new activity dumpsys command to persist all data.

Very useful for testing persisting/restoring, to make sure
that all pending changes have been written.

Change-Id: I0e3b7cd3af8afb0b6e751e086081566ab00b76c9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
29b2516012cf69022ebe33409223095fb3c99405 19-Sep-2014 Jeff Sharkey <jsharkey@android.com> Only revoke ownerless grants when unprivileged.

Recently we relaxed revokeUriPermission() to allow apps to revoke
Uri permissions that had been granted to them, but this uncovered
bugs in apps that had been relying on the previous no-op behavior.

To mitigate this, only revoke ownerless Uri permissions when in the
unprivileged state; an active owner indicates that another component
of the calling app still needs the permission.

Bug: 17554268
Change-Id: Icc412933b29041ffb699d20136a623440ecc71ec
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
95465200b0f652c48d40ca1028238763dd647900 16-Sep-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17507017: took ~3 seconds to move an app to the foreground

This is because of the 5 second timeout from when the user can bring
home to the foreground until regular third party apps can launch an
activity on top of it. Activities launched from notifications look
like they are being launched by the app, so get impacted by the timeout.

Fix this be also looking at the actual caller to see if they are
allowed to pop in front regardless of the timeout.

Change-Id: I63fbc2bcabf585e6d2810a2309f0613fdf91fdf5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f075330db4d0831588b45a1206467da03c0d906f 15-Sep-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #16907799: Processes containing bound services..." into lmp-dev
465fa3963534e41ead0dce1273b71fd50c58c973 14-Sep-2014 Dianne Hackborn <hackbod@google.com> Fix issue #16907799: Processes containing bound services...

...are killed over eagerly.

When the current foreground activity is moving to the background,
it was briefly going through the CACHED_ACTIVITY state before the
correct LAST_ACTIVITY state, allowing its bound service processes
to be killed (because they went in to the cached list). To solve
this, as long as a process has stopping activities, it won't go
lower than LAST_ACTIVITY.

Also fixed a problem where we could put a process in CACHED_EMPTY
instead of CACHED_ACTIVITY_CLIENT. There were a number of cases
in the binding flow and also the client process state transitions
where we would not correctly updateing the bound client activity
state.

And add some sanity code so that if a process hosting a
service is killed, and a client process of that service is in the
cached state, we kill the client process. This avoids situations
where we can start thrashing around in the cached list because we
are restarting process for no reason -- since they will just
continue to be cached.

Finally, tune the process LRU list to allow twice as many cached
activity processes (from 8 to 16), so we can make better use of
the RAM we have available these days.

Change-Id: Ib0cdf78c321cbb035259fc9dd6ee27b5ba1f90c5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a0e0c0dfadf54ea7ba0eb1cfc5225c9887d3150a 07-Aug-2014 Jing Ji <a5705c@motorola.com> Fix creation issue of stack trace dump directory

Use the dirname instead of the filename to create the directory

Change-Id: I16e49303b2ff5e2592ed60eab766db32d02262fe
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
13f3c9344ff8358af4cfc9419e2178afb8bec762 14-Sep-2014 Adam Lesinski <adamlesinski@google.com> Merge "Fix issue with lifecycle of Activities launched from Lockscreen" into lmp-dev
54eab3b35d798ce9ab061c53ac8219526132ac2d 13-Sep-2014 Adam Lesinski <adamlesinski@google.com> Fix issue with lifecycle of Activities launched from Lockscreen

ActivityManager still thinks the device is going to sleep, so
any Activity started while the lockscreen is showing is immediately
stopped. When Keyguard calls ActivityManager.keyguardWaitingForActivityDraw(),
then we must make sure that the ActivityManager thinks we are not sleeping.

Bug:17459745
Change-Id: I5c45c88e3a72e1f08e1b32101d0d0b4675f7a5ff
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6225dd239f6dcffb49bd1e1f33fdbb00623f378a 13-Sep-2014 Craig Mautner <cmautner@google.com> Merge "Rework the task affiliate chain validation" into lmp-dev
2ade126e626d5d6d2d2e82fce4060458a0ca21c5 12-Sep-2014 Craig Mautner <cmautner@google.com> Rework the task affiliate chain validation

The old chain was problematic. It started verification at the end of
the chain and then went no further. Then it went back down the
chain to the beginning with no checks. It also removed entries and
tried to add them back past the end of the ArrayList during boot
which caused the system process to shut down.

This method uses the ordering imposed by taskIds which is the same
order that the tasks were created. It fixes up and notes dropped
links and then reconstructs the list correctly.

Fixes bug 17467284.

Change-Id: I746ec2cdcc7ac6403278cfefc7a6db9b5549d226
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
12a1d81de7c2e76a3eda9b997a8f8842b7ed2ff5 11-Sep-2014 Amith Yamasani <yamasani@google.com> Check for singleUser attribute even for persistent apps

This enables Nfc to start a service on a different user.

Bug: 17462401

Change-Id: I92b2bcc2867a380ee18f77a40032bc43e4672c23
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f58e532e015ef31d879ee51aeeb251349784717c 11-Sep-2014 Amith Yamasani <yamasani@google.com> Merge "Apply cross-user restrictions to Shell" into lmp-dev
0ecb0c4397445984a5c5db4c31f1210fb9b594a1 11-Sep-2014 Nicolas Prevot <nprevot@google.com> Merge "Fix: always allow getProviderMimeType within the same user." into lmp-dev
023b6812abbca465773acd6141ff672d525a83ee 11-Sep-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #17414533: update batterystats occasionally takes a couple..." into lmp-dev
547f6e1803f3193b117bb396bfbce8851b85a68b 11-Sep-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #17428001: Fix revokeUriPermissions" into lmp-dev
8cd28b57ed732656d002d97879e15c5695b54fff 09-Jun-2014 Amith Yamasani <yamasani@google.com> Apply cross-user restrictions to Shell

Even though Shell user is allowed to perform cross-user actions,
lock that path down if the target user has restrictions imposed by
the profile owner device admin that prevents access via adb.

If the profile owner has imposed DISALLOW_DEBUGGING_FEATURES, don't
allow the shell user to make the following types of calls:
start activities, make service calls, access content providers,
send broadcasts, block/unblock packages, clear user data, etc.

Bug: 15086577
Change-Id: I9669fc165953076f786ed51cbc17d20d6fa995c3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
652973fca83c48d8b4622493f10e656b8d86dd17 11-Sep-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17414533: update batterystats occasionally takes a couple...

...hundred milliseconds.

Rework the locking so that no critical paths block on the cpu collection.

Change-Id: Ie615a033f7f8b523b67abee62c581d1a8fce324c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
192679a7d37d268854f4b17876c702625f9475eb 10-Sep-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17428001: Fix revokeUriPermissions

You can now revoke permissions that were granted to you.

Change-Id: I9a1872059edc715b10bbd2d653e45420d43331c3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6e2f395a86d557d2de4b52dda419a5f3eee00c84 09-Sep-2014 Craig Mautner <cmautner@google.com> Wait for animation complete before completing boot

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

Fixes bug 16309312.

Change-Id: Ic5e0d627ca4ded3e211c5d2afece89da40d34642
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c7c04890beaf459808aeecb7418913939abbd169 10-Sep-2014 Nicolas Prevot <nprevot@google.com> Fix: always allow getProviderMimeType within the same user.

Even if the ContentProvider is locked down.

BUG: 17428869
Change-Id: Id54edcd2589677973b7db538356943d23b250660
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6b0ed64fb868e64684031558cbdeedcd94d40713 05-Sep-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Add native bridge post-fork initialization

(cherry picked from commit d7746a8b65ee4690427ed798816f970218578fa3)

Change-Id: I5a20de1cb68dd1802937b369b14c50c9c1031c67
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
a6863ad62296a5280504165a1fbc70523940a9c8 05-Sep-2014 Michael Wright <michaelwr@google.com> Merge "Allow for event dispatching when in non-interactive states." into lmp-dev
70af00abf73160235d4efe114fcf4753007a8ff3 04-Sep-2014 Michael Wright <michaelwr@google.com> Allow for event dispatching when in non-interactive states.

We need to allow for event dispatching in non-interactive states so
that we can enable a richer set of interactions when a device is
dozing (i.e. is in a low power state with an Always-on-Display).

Bug: 17167296
Change-Id: I8ae0f544a8106cb91ff38c2309b8b57cbe2f2c72
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
430f5680b67c585611c24fc342559019198ba361 04-Sep-2014 Adam Lesinski <adamlesinski@google.com> Merge "Add Configuration changes to UsageStats" into lmp-dev
7f61e96db7c90c1f4418359672aa4656aebee500 03-Sep-2014 Adam Lesinski <adamlesinski@google.com> Add Configuration changes to UsageStats

Bug:17354208
Change-Id: I9b2f595e51b656607e30e798926cfb7e25134944
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0f6c32af063a44e22af72825f19f51808a2c0cf3 04-Sep-2014 George Mount <mount@google.com> Merge ""Back" with translucent window now sets ActivityOptions." into lmp-dev
9e18397112df0ebe49b9e4325d7040498b2afcfa 03-Sep-2014 George Mount <mount@google.com> "Back" with translucent window now sets ActivityOptions.

Also made convertToTranslucent set the canvas opacity.

Bug 16215650

Change-Id: Id4325eaed34cda1269d874f239aeb5f6f82c959f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a7a61594df2f0b6ee9e3577f3d928e5f01ab4a75 03-Sep-2014 Jason Monk <jmonk@google.com> Add lock task checking to moving tasks to back

Chrome seems to use this method of moving itself to the back on
back presses, causing it to escape lock task mode.

Bug: 17365048
Change-Id: I2e8bc614f771951ed96cfc36f9789d12b1742e70
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cc1f2c08e3f7d0223ff8a2fb042863e6b03d98db 03-Sep-2014 Jason Monk <jmonk@google.com> Merge "Enforce permissions on start/stopLockTaskModeOnCurrent" into lmp-dev
a42c0de977fcd06e6c7a5be5b072fd661101ac58 03-Sep-2014 Dianne Hackborn <hackbod@google.com> Add more slow execution logs.

This time *without* mixing in an bunch of unintentional reverts!

Change-Id: Iab4cb9eb6d475d9fe5ebe16e9ea4be24c6f312e8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1257e82b94f2de290f78955ea9ed507ed098b9a5 03-Sep-2014 Dianne Hackborn <hackbod@google.com> Revert "And yet more logging for slow execution."

This reverts commit 113390ac113083884b6f498424b3f6afa2df4ebc.

Change-Id: I16fdb08f83ad31c10d943862bae639f622542339
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
36927a3600520686495cba4f3fc19e1445f8a64c 02-Sep-2014 Dianne Hackborn <hackbod@google.com> And yet more logging for slow execution.

Change-Id: Idd485d3b4339e22a38fd688cbd435818ca38d233
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f71edcaa1446c54956ea5d29a44343361a668755 02-Sep-2014 Jason Monk <jmonk@google.com> Enforce permissions on start/stopLockTaskModeOnCurrent

Bug: 17308601
Change-Id: If3c941e206236023108a55360a627d24ca8ba608
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2cdcc7d360c9ca592a656cdd3aef3da0614ab1aa 02-Sep-2014 Amith Yamasani <yamasani@google.com> Merge "Make it possible to remove current user" into lmp-dev
b4558e7e5f33ee4964c5395b2dc017509ebf3f1a 02-Sep-2014 George Mount <mount@google.com> Merge "Update window always on convertTo/FromTranslucent" into lmp-dev
1df1473008c24487701c5bc15f39ed9f9697f421 30-Aug-2014 Amith Yamasani <yamasani@google.com> Make it possible to remove current user

Due to the async nature of switching users, it's not possible to
switch and remove immediately. So mark the switch target user as
soon as the user switch is requested, so that a remove will proceed
without failing at stopUserLocked().

Also, fix a similar problem with deleting the current guest and
switching to a new guest. It was attempting to remove the current
user which will result in a failed stopping of the user.
Added a way to mark the current guest
for deletion so that a new one can be created, switched to and the
old one deleted. If runtime fails, old guest is already marked for
deletion and will be cleaned up on restart.

Bug: 17321533
Change-Id: I4be0fb956227e0bb95588b5b1f2867fb1e655c0d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
828bd38a074ae62e9363267ad62214796d94e0de 30-Aug-2014 Dianne Hackborn <hackbod@google.com> More debug for issue #17310019: pause when launching settings

Dang, I missed a lot of opportunities to log!

Change-Id: I566597269fe73b0f798df4f00ad26d062021081d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ecf1cda068c95c58d296d508d34706d659e4a1ae 29-Aug-2014 Dianne Hackborn <hackbod@google.com> Debug issue #17310019: pause when launching settings

Let's log!

Change-Id: Icaf42d46aff6e74ee5fc98611dd77083a5d5052e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8bd5d6900827c465f0770290776ec52753dc9622 28-Aug-2014 Winson Chung <winsonc@google.com> Merge "Change API to return thumbnail size instead of individual dimensions. (Bug 17295512)" into lmp-dev
7e7f9a3f7c8ed6d17e1295cd1c61b4fc1ac98ec1 28-Aug-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #16953886: History and batterystats checkin summary..." into lmp-dev
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/services/core/java/com/android/server/am/ActivityManagerService.java
7d9eefd871f1cdc5ebc36fa92dae48a737ae2928 28-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #16953886: History and batterystats checkin summary...

...start timestamps are in 1970s

Look for the wall clock time being very small, and try to update
it to a better value if we see one.

Also handle time change events to update the current time we a re
tracking.

Change-Id: Ifbae2b8c43ab5baa75ee4f672a752a542e23b52d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
53dc7eac05324261a51443059b5fb5d468f33594 27-Aug-2014 Craig Mautner <cmautner@google.com> Add null check to cleanupRecentTasksLocked.

If during boot, the package manager broadcast occurs before
TaskPersister has restored the recents list then mRecentTasks will be
null and an NPE will occur. This checks for null mRecentsTasks and
returns before the NPE happens.

Fixes bug 17300409.

Change-Id: I1588ad3a3c0d04bc6f273630ef5dadf6821e5710
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
85b764e22babfe5508286fbad5d7fee12345704f 27-Aug-2014 Craig Mautner <cmautner@google.com> Update window always on convertTo/FromTranslucent

Previously we would only update the window if the activity's
translucency was changed. That meant that if the window was
opaque for a translucent activity, transitioning to translucent
would not change the window to translucent. This change forces
the window to follow the convertToTranslucent and
convertFromTranslucent calls.

Also fix for setting background on enter and exit transitions.

Partial fix for 16215650.

Change-Id: I86ea68e4bbf604d0cc60cc6e34bf8090199525d6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5232271a41323594ae406be7476b6ca2f08af3d8 27-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17146552: system anr

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

Change-Id: I8fef8251a0cb85081442cae55d85063944248d15
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.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
1771d39ebf9d0696f7c3deb7eb477056e49834ff 26-Aug-2014 Amith Yamasani <yamasani@google.com> Merge "Fix SetupWizard crash when creating Guest or Restricted profile" 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/services/core/java/com/android/server/am/ActivityManagerService.java
f3054ea8e0bca0c04650cef92f7a1ed0f1d31640 26-Aug-2014 Amith Yamasani <yamasani@google.com> Fix SetupWizard crash when creating Guest or Restricted profile

Delay the launch of Home until after the USER_INITIALIZE broadcasts
are delivered, to make sure that any disabled HOME activities are
enabled.

Bug: 15709297
Change-Id: I796a40131f82989782cf5699bcc2e1da2cafbc6b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
83bb610fad994b9046acc3feeba9d9a5264fd918 12-Aug-2014 Nicolas Prevot <nprevot@google.com> Preventing apps from granting uris to any other user.

And adding some javadoc.

BUG: 16996334

Change-Id: I02b03e513050e2704c28da8e17c2c977d858627b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
4cce1de9fe95ffc3b968de87579a543a461f96bb 26-Aug-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #16366571: UIDs for work and normal Chrome processes are the same" into lmp-dev
885fbe5c070cf1579c96ab8e150449af00e16501 24-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #16366571: UIDs for work and normal Chrome processes are the same

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

Change-Id: Ibbe3f0f64197671d279c3fc519edfc720d442938
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6dd08fdd9104faa75a2cea83e81eae31993c7392 22-Aug-2014 Amith Yamasani <yamasani@google.com> Merge "Show a user switching dialog before starting the user switch" into lmp-dev
250bf41b8ee61c7b5707fefad1456634c7e73bbb 22-Aug-2014 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #17011123: Hit Back/Recents button when in Recents..." into lmp-dev
7805a10c86a2de9fb5ddf41d63075eef342a59ea 22-Aug-2014 Amith Yamasani <yamasani@google.com> Show a user switching dialog before starting the user switch

switchUser() now first shows a dialog and the dialog calls
startUserInForeground to do the actual switch.

Bug: 16661752
Change-Id: Ie4e2e9eec8bf7c2116694072ea8555b8254a0e13
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6f4d61ff2e3143bea37bbc1a7a2a0ab415b2c88a 22-Aug-2014 Dianne Hackborn <hackbod@google.com> Work on issue #17011123: Hit Back/Recents button when in Recents...

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

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

Change-Id: Ief874e46e9a9897379dda1010bcce4c5b03d82f1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1889c5c36df8cd027f1f3f69aa227a6bdad17849 21-Aug-2014 Jason Monk <jmonk@google.com> Merge "Show lock to app request on all users" into lmp-dev
fffe00dfda10fa2c121f955bcfd84a4886c2dd32 21-Aug-2014 Nicolas Prevot <nprevot@google.com> Merge "In startActivityAsCaller, changing the way we get the userId." into lmp-dev
63f29d9d7cab8c714f54db520eebd3047977d19c 21-Aug-2014 Jason Monk <jmonk@google.com> Show lock to app request on all users

This way secondary users can see it. To avoid it being displayed
on the wrong user, clear it on user switch.

Bug: 17151184
Change-Id: I1699f85d2d90cbc0e17f39f9971f20d90637b38f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
da115ebe700f334ca9f7c8fc4e9debd77c625a82 21-Aug-2014 Nicolas Prevot <nprevot@google.com> In startActivityAsCaller, changing the way we get the userId.

BUG: 17170098

Change-Id: Ie7fbd547b664a9982895b77da1fbb28df139ce52
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
d26bfec44bc7537ba1697af44562a51912d1c8f7 20-Aug-2014 Nicolas Prevot <nprevot@google.com> Merge "Allow the system in other users to call startActivityAsCaller." into lmp-dev
5ef7e19a0e1656a7dc6af8cf785d75ddc319cd8c 20-Aug-2014 Nicolas Prevot <nprevot@google.com> Allow the system in other users to call startActivityAsCaller.

BUG: 17148852

Change-Id: I4c9811b7da90b5705e72001dd36bf67d559cb189
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
255dd04271088590fedc46c8e22b2fd4ab142d39 19-Aug-2014 Selim Cinek <cinek@google.com> Added notification color to all system notifications

Bug: 17128331
Change-Id: I81a94510ef51b99916f314c0dd65852426a1fbeb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
028ceeb472801bcfa5844fc89ed0da8463098824 18-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #14617210: Apps can gain access to any ContentProvider...

...with grantUriPermissions (no user interaction required)

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

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

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

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

Change-Id: I50410c4783faf9302c69290589a068a846e0973a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
29564cd24589867f653cd22cabbaac6493cfc530 07-Aug-2014 Narayan Kamath <narayan@google.com> Remove system_server classes from the boot image.

We set the system_server classpath in the environment
(like we do with BOOTCLASSPATH). After the zygote forks
the system_server, we dexopt the classpath (if needed)
and then launch the system server with the correct
PathClassLoader. This needed several small / medium
refactorings :

- The logic for connecting to installd is now in a separate
class and belongs in the system_server.
- SystemService / SystemServiceManager have now moved to
classes.jar. They are only used from there, and since they
use Class.forName, we want them to be loaded by the
system_server classloader, and not the bootclassloader.
- BootReceiver now moves to frameworks.jar, because it is
used by ActivityThread and friends.

bug: 16555230

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

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

Bug: 16959028
Change-Id: I526eac22f44273b3254dd6201f89194d13e597e2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4a8dddbf18fedb33bb2c725db489669a141e1d73 13-Aug-2014 Craig Mautner <cmautner@google.com> Clean up app following death when creating service

If an app has died, run through the cleanup before relaunching its
service.

Also a little simplifying refactor.

Fixes bug 16979752.

Change-Id: I376cbef2ea00fc626588386317f092cc6dea0bdc
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8de4311c51229efbe2f2d0afbf298982c5cadd96 11-Aug-2014 Jorim Jaggi <jjaggi@google.com> Lockscreen launch animations

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

Bug: 15991916

Change-Id: I133c177b84e926c87c1a404ba93d633593fec3ab
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
93baa0ed9b6b582e28454a4c636b2bfc91d90fcf 12-Aug-2014 Winson Chung <winsonc@google.com> Clearing tasks along with application data. (Bug 16952119)

Change-Id: Ie986712a7d7d0911b6de7a4b34b7d03bf7874d6f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6d2a9492e2b19421165f0cd918d9f28595bfb770 08-Aug-2014 Jeff Brown <jeffbrown@google.com> Eliminate power manager latency for boot completed.

The power manager disables the power button until boot completed
occurs. If there are many pending broadcasts in the queue, it
may be possible for BOOT_COMPLETED to be delayed for several
seconds after boot.

To avoid the delay, introduced a new boot phase which is
sent to system services immediately when boot completed happens.

Bug: 13398280
Change-Id: I1833d2ffb20305009dd76363b43e534034f1d0a2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a351ab96987381ffe7ea29a7cdec1e7fbd1497d5 09-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issues 16739817 and 16709247 in voice interaction service.

Issue #16739817 VIS doesn't start for non-primary user(s)
Issue #16709247 GSA is not the default voice interaction agent

These are both fixed by getting rid of the existing code for applying
the default voice recognizer, moving it in to the voice interaction
manager service, and extending it to also set up the default voice
interaction service.

Change-Id: If8d5936c28aebfa7eff77c8d99241c3a2ffdb0a4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
81f6d857c1baef5e159bb34dad540baf77572782 09-Aug-2014 Adam Lesinski <adamlesinski@google.com> Merge "Second iteration of the UsageStats API" into lmp-dev
3516800b611a79339a3c188332d13a26e9086b09 22-Jul-2014 Adam Lesinski <adamlesinski@google.com> Second iteration of the UsageStats API

Based on feedback from API council, updated the API.
Also added support for querying the event log.

Change-Id: Ibaa008b9e5bd145acdfe8e20c25c2ed2d96be123
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c2f20b66fd28c10e2ec8654bd74cb501eb7f837b 08-Aug-2014 Amith Yamasani <yamasani@google.com> No need to send PRE_BOOT_COMPLETED for new users

Since the primary purpose is to upgrade databases, no need
to send this broadcast. If system apps care to be informed early
on new user creation, USER_INITIALIZE is an early broadcast.

Also remove some logs that spew when switching users.

Bug: 16846465
Change-Id: Ibd7f8630ce1f41f8cadbda616de05844b127d1a8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c3093eb86bdc02ecf30c32693abafdaa01568a41 08-Aug-2014 Nicolas Prevot <nprevot@google.com> Merge "Making getProviderMimeType work across users." into lmp-dev
1dddc7fc790f14208516b4551ff12b2db8528864 07-Jul-2014 Nicolas Prevot <nprevot@google.com> Making getProviderMimeType work across users.

For apps with cross-user uri grants, but without INTERACT_ACROSS_USERS.

BUG: 16128346

Change-Id: I0136cd274eaf457804d196c09f746f66c1fe599f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
faa4b3cb06f3b10ece1f1d246a3530fc2f30a6da 06-Aug-2014 Robin Lee <rgl@google.com> Disallow switching managed profile to foreground

Another check in the ActivityManager to stop us from getting into an
invalid state by a fat-fingered 'am switch' etc.

@bug 16814252

Change-Id: Id65ab647d5a535cc2f965139a1b717cf65aa7e69
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0068d3dcf1f1a804554a1a09e3b173ac12651786 07-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue @16555033: Battery history overflowing too much

- No longer track process starts/stops normally.
- Increase buffer size to 256KB.
- Buffer size increase requires reworking how battery stats
are retrieved, since it is going to be hitting IPC limits.
- Also, store the last full stats after a reset, to be reported
at the next checkin.
- Also, discharge and charge times are tagged with the screen
and battery save state during that time.

Change-Id: Ie108ac9b626846108a9bb858101ac2b93276ac16
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
cead2839a5ed586e18299b84c4c93f095b8498b7 05-Aug-2014 Robin Lee <rgl@google.com> Permit crash report button for user profiles

Loosens the restriction for reporting an issue with an app from "same
profile" to "same user".

Fixes bug 16792315.

Change-Id: I25100a3f7030b2a74e9fe40894103677e8db6cdd
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f17e498fea935a389d88193dde2d236ea674d10b 06-Aug-2014 Amith Yamasani <yamasani@google.com> Merge "Allow phone UID to export singleton providers" into lmp-dev
41c1ded7f042a4cf303479550b38fa66d7a18906 05-Aug-2014 Amith Yamasani <yamasani@google.com> Allow phone UID to export singleton providers

Also add a user variant of replacePreferredActivity for use
by SmsApplication.

Map user restrictions for SMS/MMS to AppOps perms.

Bug: 16681533
Change-Id: I3dfed5fc754e33bb51c6f571851653a7c2770e46
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
504d78ea10b04baee2a1a65707dc7003c94d1ee4 26-Jun-2014 Nicolas Prevot <nprevot@google.com> Security fixes related to cross-user content.

Enforcing that only uri grants work across users (not permissions).
Fixing a security hole where malicious Apps could access a uri if they had uri grants to the same uri on another user.
Enforcing that userIds in uris, if they exist, are the one of the ContentProvider.

BUG: 16779492

Change-Id: Iaa5264bd6c3aa0e15be3a4a64f9dc88238e0cb2e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cc9537ce558de42577feebeb91a8cc72e102ae2e 04-Aug-2014 Craig Mautner <cmautner@google.com> Call method while holding lock.

The method removeRecentTasksForUser() was being called without the
ActivityManagerService lock held. This change calles it while the
lock is held and renames it to indicate that it should be called
while holding the lock.

Fixes bug 16775111.

Change-Id: I002f9f96d407de458934da8bc728acd54f0c398c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ad3aa32fee096f6887ba41bf0bf2b767cbdefeab 25-Jul-2014 Eunae Kim <eunae.kim@lge.com> Fix a bug that the RecentTask list of other’s may show up to non-primary users.

Cherry-pick from aosp to lmp-dev.

When switching to a newly created user, the user may face this bug
when he opens the RecentTask screen.

A possible bug scenario is described as follows:
A user id of a removed user may be recycled when created a new user.
However, mRecentTasks is not correctly controlled so that old
information may still remain and be possibly mapped to wrong user.
This patch prevents this bug by explicitly removing old information
in mRecentTasks when removing existing user.

Change-Id: I1874dbd604598a5d740ae1e034981e21214c15c6
Signed-off-by: Eunae Kim <eunae.kim@lge.com>

Conflicts:
services/java/com/android/server/am/ActivityManagerService.java
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
214be42ea690ee99e1b404844afbe2c138447b59 30-Jul-2014 riddle_hsu <riddle_hsu@htc.com> [ActivityManager] Prevent coredump file may not complete for testing.

Cherry-pick from aosp to lmp-dev

Sympton:
During testing, skip kill native crash process manually because it
will continue to die by default.

Root Cause:
Large process may take some time to do coredump.In auto test, crash
process will be killed immediately that results incomplete coredump
file.

Solution:
If the tester (IActivityController) will handle app crash event,
Do not kill native crashed process if the rom is debuggable.

Change-Id: Ia360af147d694125d440e5ba2f958c4759a50494

Conflicts:
services/java/com/android/server/am/ActivityManagerService.java
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
994e219da8ebee85d8c6b9564995e8ed9eae81e4 30-Jul-2014 Primiano Tucci <primiano@google.com> Cherry pick Move startIsolatedProcess implementation in ActivityManagerService DO NOT MERGE

This CL addresses the comments in CL 512432, moving the implementation
of startIsolatedProcess in the outer ActivityManagerService class and
making the entry point in the ActivityManagerInternal sublcass just
a proxy method.
This change also addresses a potential NPE, due to startProcessLocked
returning null in some failure cases.

Original BUG:16403706
Original Change-Id: I21eff88c23221653f552cfc171647a839e42a802

Bug: 16723226
Change-Id: I4af9fd7eea10b11e06a5c37d8160c220376b3ed1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
161536b5970ba5ab43233e7695ef69ba2bb804f4 28-Jul-2014 Primiano Tucci <primiano@google.com> Cherry pick Refactor ActivityManagerService and make WebViewFactory more pedantic. DO NOT MERGE

This CL adds more robustness to the logic in WebViewFactory, checking
whether the isolated process did start at all and catching exceptions
in its java side.
Also, this addresses the refactor comments received in CL 509840.

Original BUG:16403706
Original Change-Id: Iaaea6d36142ece6d974c2438259edf421fce9f2e

Bug: 16723226
Change-Id: Id308f2ffde9b67a3eb4719c7b81b4f46421f0c2e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
810c052d9b117217152c2a609ccec056a2a61d1e 25-Jul-2014 Primiano Tucci <primiano@google.com> Cherry pick Introduce startIsolatedProcess private API in ActivityManager DO NOT MERGE

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

Original BUG:16403706
Original Change-Id: I327b59735c12698595e0dbcc4da5d759c9103b0a

Bug: 16723226
Change-Id: Iecb49888e11eec9d302d9712953fd498db5821af
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a0995ab8212a26945fe377346e110fa9a6e663dd 31-Jul-2014 Robin Lee <rgl@google.com> Always show error dialog for other profiles

Apps running on another profile of the same user were previously
considered to be running in the background, so their error dialogs
would not show unless ANR_SHOW_BACKGROUND was set.

@bug 15665024

Change-Id: I7e559c6b7f8befc1553bc0ec06e89e5d7906d198
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f4f8bb793fe101af770dc974b29c26722bce285f 29-Jul-2014 Craig Mautner <cmautner@google.com> Eliminate memory leak in TaskPersister

Bitmaps added to TaskPersister were piling up in the queue.

- The mRecentsChanged flag was being modified without holding the
lock. There is no mRecentsChanged flag now. Everything to be
written goes into a queue.
- TaskPersister now runs until the queue is empty.
- Bitmaps being written to the same file were being added to the
end of the queue without replacing the earlier bitmap. Now we
search the queue for matching tasks and replace the bitmaps
if needed.
- Method notify() was renamed to wakeup() so IDE could find usages
quicker.
- Bitmaps that were being requested but were still in the queue
are now being fetched from the queue.

Fixes bug 16512870.

Change-Id: Idca1c712e5d2df8196e93faaf563a54405ee96bf
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6ba042b51496b9763d721b6dca8a591c323d648c 28-Jul-2014 George Mount <mount@google.com> Make returning ActivityOptions part of ActivityRecord.

Bug 16626030

Getting the timing correct for when to clear returning activity options
was difficult when Activities can be destroyed and recreated. Moving
the returning ActivityOptions to the ActivityRecord forces the
ActivityOptions to only apply to the correct Activity.

Change-Id: Ib5400b157eb741ae484aae0cc83172a3db637a3e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4b4971b8a31f29e9dd3d27d54a49914a7c3ec1fb 26-Jul-2014 Jeff Brown <jeffbrown@google.com> Fix a deadlock due to AMS calling into WMS with its lock held.

The full deadlock cycle involved ActivityManagerService,
WindowManagerService, and DevicePolicyManagerService.

Fixed by posting the work of enabling the screen to the handler
instead of doing it immediately while holding the activity manager
lock.

Bug: 16578860
Change-Id: I10514cd2df993c7193747ae823e1990a2c34e196
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3c153519ca5f2b66b88901374383f943c9d77df7 24-Jul-2014 Adam Lesinski <adamlesinski@google.com> Add Per-User logging of UsageStats

Change-Id: I4518c5d3c56b3821292accb886f9fb21f3a8b25f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d1c99b1fe85ed03261a77a14ae52e7fa3a6e523a 04-Jul-2014 Nicolas Prevot <nprevot@google.com> Migrate extras to ClipData for image/video capture intents.

The intents ACTION_IMAGE_CAPTURE, ACTION_IMAGE_CAPTURE_SECURE and ACTION_VIDEO_CAPTURE are now handled in a way
similar to ACTION_SEND and ACTION_SEND_MULTIPLE.
Migrate the uri in the EXTRA_OUTPUT extra to clipData, and add the flag GRANT_WRITE_URI_PERMISSION.

The userIds are now added to extra uris in the process receiving the intent, (not in the system process), because the
system process may not be able to parcel/unparcel the extras.

BUG: 15534203

Change-Id: I8f79666b726bc6d7745bf777ad3c7518945c5cc3
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
8746a478abcfb3b0d73b156232051af1e8d21ce2 25-Jul-2014 Craig Mautner <cmautner@google.com> Create end of animation callback for Activity

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

Fixes bug 13658460.

Change-Id: Ic48540cd4c7e37538f10cb2dc0852aa3f55d11e1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
422570ea3fe5bf6c4dbc4d96cf47734252ffe703 23-Jul-2014 Amith Yamasani <yamasani@google.com> Call PRE_BOOT_COMPLETED on starting any user

Refactor PRE_BOOT_COMPLETED delivery code.
Continue to call it on all existing users on system update.
Call it on any user being started, as part of
initialization.

Change-Id: Ie188a823fb19afde3781d6c45ada55d6e92edfac
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f1939901d2ed0480069f0b23be64f122fce93995 25-Jun-2014 Nicolas Prevot <nprevot@google.com> Making the clipboard work across users.

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

BUG: 15186236

Change-Id: I522564a7c07ff21df137adcda980bb52e5739964
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0b633fc12188ac9a78c0cea9cacc8e90d08260dc 23-Jul-2014 Craig Mautner <cmautner@google.com> Disable back button goes to recents behavior

Using a static final boolean to do this so if policy is changed it
can be enabled easily.

Also fix fetching task from wrong list. Was causing
ActivityNotFoundExceptions.

Fixes bug 16512561.

Change-Id: I9b47a86fd740d45104aa14712e71df830218c5a7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
66adae84d7e1475c4422d80860eed17e234ab8a9 21-Jul-2014 Nicolas Prevot <nprevot@google.com> Fixing cross-user content.

Change-Id: I1f1beb514950f808ed9113357c3172bddcb06d9e
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
dc00cbe2c15eef5141656311a6d05c753d7c6db6 21-Jul-2014 Craig Mautner <cmautner@google.com> Create API for launching from recents

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

Fixes bug 16358208.

Change-Id: I340800bfee79926b197929360d69f1d570bbf1eb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
13420f2311757554c314f620c83cb55153b67612 19-Jul-2014 Dianne Hackborn <hackbod@google.com> Fix issue #16400873: Apps that show ads as new tasks stay in recents...

...even when I hit back or close the activity in UI

Change the semantics of NEW_DOCUMENT to have the recents entry be
removed by default when its activity is finished, with various ways
to explicitly turn off this behavior.

Change-Id: Idc717706d27de80f28b53ad76f9e375d85118d71
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
aa9b0f15753541ff8e4d62e6497c11800c737077 17-Jul-2014 Craig Mautner <cmautner@google.com> resolved conflicts for merge of 0a931069 to lmp-dev

Conflicts:
services/core/java/com/android/server/am/ActivityManagerService.java
services/core/java/com/android/server/am/ActivityStackSupervisor.java

Change-Id: I68e8290566b51fadb5671abdd9d05faf28502e22
0a93106964eec2462ec86e372def1b0d1526cd7d 17-Jul-2014 Justin Koh <justinkoh@google.com> am 65d7c332: Merge "Additional cleanup after stack deletion." into klp-modular-dev

* commit '65d7c332d7b613f23a26066051cc7496e0efa994':
Additional cleanup after stack deletion.
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/services/core/java/com/android/server/am/ActivityManagerService.java
ee36c77acd3b92c64e53e19c570e2482382db870 16-Jul-2014 Craig Mautner <cmautner@google.com> Additional cleanup after stack deletion.

- Remove activity from PendingActivityLaunch list when it is removed
from stack. This prevents the delayed launch causing
IllegalArgumentException in b/16045752.
- Move PendingActivityLaunch from ActivityManagerService to
ActivityStackSupervisor.
- Immediately call onTaskListEmptyLocked() in cases where no
activities are found in stack.

Fixes bug 16045752.

Change-Id: Ia69a449e7f5e08ab6e36157d0fd793c4d2fdaca4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9034620dd5a13e4b76cf6c31fb1fd7e5b79678e3 17-Jul-2014 Amith Yamasani <yamasani@google.com> Merge "Allow content provider access across users" into lmp-dev
ebf1fd99d67875c36c7dcd09b2246b6c3e22e9ae 17-Jul-2014 Amith Yamasani <yamasani@google.com> Allow content provider access across users

If the package has INTERACT_ACROSS_USERS. This had recently
regressed. Bringing back the functionality needed for multiuser
call log syncing.

Bug: 16298776
Change-Id: I4fdc3d676bb8a2bf78f5c27c41a74c0491e343cd
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2053168eb4506e2f8795afdbe9731c6451e1589c 14-Jul-2014 Narayan Kamath <narayan@google.com> Dexopt for Context.createPackageContext when code is included.

The package manager now keeps track of per ISA dex-opt state.

There are two important things to keep in mind here :

- dexopt can potentially be very slow. In cases where the target
package hasn't been dexopted yet, this can take multiple seconds
and may cause an ANR in the caller if the context is being
created from the main thread.
- We will need to remove the constraint that dexopt can only be
requested by the system (or root). Apps will implicitly be
requesting dexopt by asking for package contexts with code included.
It's important to note that unlike dalvik, the dexopt stage in ART
isn't optional. ART cannot load classes directly from dex files.

bug: 15313272
Change-Id: I0bd6c323a9c1f62f1c08f6292b7f0f7f08942726
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
fdb1956ff71ff57fcdaafaaeb7f42c19de3d7c2f 12-Jul-2014 Dianne Hackborn <hackbod@google.com> Fix issue #15681802: Missing RESET:TIME in complete battery histories

But wait, there's more!

- Keep track of sync durations in the aggregated stats.
- Add events for users that are running and in the foreground.
- Rework the activity manager's tracking of stuff using
battery in the background to be based on proc stats, which
allows it to be better about determing when it should reset
its tracking of background work.
- Also add tracking of scheduled job execution, like we are
doing for syncs.
- And once I started hooking battery stats in to
JobSchedulerService, I found a few things I couldn't stop myself
from changing: (1) make it very explicit that it doesn't start
scheduling jobs until we have reached the point in system boot
where third party apps are allowed to run, and (2) adjust
the various for loops to not use iterators.

Change-Id: I69d812e27bcfee9e58a614f0f6b1c7545d7530b1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bb742462781a73bb25516067c8fe6311c1c8a93e 08-Jul-2014 Craig Mautner <cmautner@google.com> Launch activity behind launching task.

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

Fixes bug 16157517.

Change-Id: I0a94af70b4748592e94673b958ee824cfb3d7ec0
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a2ff611fd6312510f03a2556c2932f87ba3144af 15-Jul-2014 Alan Viverette <alanv@google.com> resolved conflicts for merge of dca272b8 to lmp-dev

Change-Id: Ifbd10ace66f7488f225bfae6e26bab60ab56e651
dca272b8c21f2910424496b97cd9b7a558008876 11-Jul-2014 Michael Kolb <kolby@google.com> am 0cb38d2e: Merge "Add configuration for activity thumbnails" into klp-modular-dev

* commit '0cb38d2e5ab32fd34c8129f3c2d1c158bad9abc3':
Add configuration for activity thumbnails
5f6238e4a7b2b54c4852852bd9bf045f387a5e42 10-Jul-2014 Michael Kolb <kolby@google.com> Add configuration for activity thumbnails

Bug: 15750584

Change-Id: I0b2bfb46022b46d7649f6d9ba9ba74cdfc70a6ea
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
3c58775a126c9c9b2f86bc22bd82cedbdcb06024 11-Jul-2014 Dianne Hackborn <hackbod@google.com> Merge "Allow INTERACT_ACROSS_USERS for service access."
409297da182267465adbc21cfb75a23e8d678117 11-Jul-2014 Dianne Hackborn <hackbod@google.com> Allow INTERACT_ACROSS_USERS for service access.

But only if the two users are in the same profile. Also
apply the same rule for the recently allowed interaction
across content providers.

The activity manager now keeps track of which users are in
the same profile group, and the handleIncomingUser function has
an option to allow a non-full caller to do the interaction
if the two users are in the same profile group.

Spread this joy all over the place.

Also turn off multi-user on Svelte devices.

Change-Id: I231484ea2a6bfccbb3cd51357d7a387bd75039ea
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
41cd577c12a3525663101ff9217ded509bb869d6 11-Jul-2014 Amith Yamasani <yamasani@google.com> Send USER_FOREGROUND and USER_BACKGROUND to all related profiles

Also do a check for null applicationInfo object during user creation.

Bug: 16211029
Change-Id: Ib49c241cf3698735e273edf5704bef277f1142a5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0161bbc6e54744d5e0348af3d123858818f966e9 03-Jun-2014 Colin Cross <ccross@android.com> ActivityManager: use Process.killProcessGroup to kill forked processes

Place newly-created processes in a process group, and use
killProcessGroup to kill any forked processes.

Bug: 15313911
Change-Id: I0f3e2eeebd9a910dae3f6b2801826c92aea03030
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ff110bd61a69f7ed8602ae14b27f7befec76b2e7 04-Jul-2014 Narayan Kamath <narayan@google.com> Multi-arch application installs.

Each application now has two ABIs, the primary
and the secondary. The app is always launched with
the primary, but the secondary might be used by other apps
that load the given applications code. This implies we
must:

- dex2oat the app both ways.
- extract shared libraries for both abis.

The former is relatively straightforward but the latter
requires us to change the layout for shared libs that we
unpack from applications. The bulk of this change deals
with the latter.

This change continues to fill in nativeLibraryPath during
scans for backwards compatibility. This will be removed in
a future patch.

Change-Id: Ia943dd11ef815c5cbfc60f17929eaa2a652a385a
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
61659e5daaea80104d4d0fd567e78b5f757b5df4 10-Jul-2014 Dianne Hackborn <hackbod@google.com> Add tracking of uid process states in battery stats.

We now keep track of how long each uid had processes in
various states: foreground, active, running. This is based
on a collapse of the various activity manager process states
into these three bins.

You'll see these in a checkin like this:

8,10013,l,st,61504,61504,83109

Also fix issue #16021555: App showing up as on "top" even
when the screen is off. This is "fixed" by just saying we
always report the current app at the top of the activity stack,
regardless of the state of the screen.

Change-Id: I1204904225101243eb00b43425d9806bffdd2ab9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d908edd810dd22d8ec512a19c32637df464e9d0a 13-Jun-2014 Colin Cross <ccross@android.com> ActivityManager: pass the main uid of the app to lmkd

The uid and pid will be used to together to find any forked processes
and kill them.

Bug: 15313911
Change-Id: I2edb51527e5d1a977c0fad0e6c959c8438bb4be9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
0a9927025041a6dde3f3878bdd868a69ab1b3266 07-Jul-2014 Craig Mautner <cmautner@google.com> am 09c1af5d: am c66da9d6: Merge "[ActivityManager] Prevent kill a restarted process again."

* commit '09c1af5d5c43f716fb4093eae6cf5442e7bb88d1':
[ActivityManager] Prevent kill a restarted process again.
53cc7d7998a9a656fe89ec8eba40ad479bded274 07-Jul-2014 Craig Mautner <cmautner@google.com> am 7611a5d3: am 5acdd0f6: Merge "[ActivityManager] Ensure alive process is not killedByAm."

* commit '7611a5d32889f54b1763cf076a442a0575c69b51':
[ActivityManager] Ensure alive process is not killedByAm.
f621a5b1b3268cafaf5b398f7cde0727a46891be 08-Jul-2014 Makoto Onuki <omakoto@google.com> Merge "Cross-user provider access no longer requires ..._FULL"
4451419fc675e02acd6df2664e6c4eafcca9c261 08-Jul-2014 Makoto Onuki <omakoto@google.com> Cross-user provider access no longer requires ..._FULL

Now only INTERACT_ACROSS_USERS is required.

Change-Id: If5bdbfb055d9d57a3180885f2aea652b889e7705
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
88085ad05bd62be8f3c53917e3449a8fc5c37f10 08-Jul-2014 Winson Chung <winsonc@google.com> Merge "Refactoring to support groups."
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/services/core/java/com/android/server/am/ActivityManagerService.java
6ea0d0a2592395b8980c24304733daec628e947e 03-Jul-2014 Dianne Hackborn <hackbod@google.com> Fix cleanup of voice sessions.

They would leave active voice activities lingering around.

Change-Id: I5b6716ab303636ebdf2f13c3172552a73dae3bb1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a8f569c10a423ced5be7e019c3df2bca11b052f5 07-Jul-2014 Jason Monk <jmonk@google.com> Add toast when user tries to leave lock-to-app

The toast will describe how to exit when entered normally, but when
entered by a DPM whitelisted app it will just notify them they are in
the mode.

Bug: 15780115
Change-Id: I75ac8540c31a75ac68e34b3b5c8260e191894b39
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b633657be45091cbb123843a36d8b44dece5676f 07-Jul-2014 Craig Mautner <cmautner@google.com> am 0a992702: am 09c1af5d: am c66da9d6: Merge "[ActivityManager] Prevent kill a restarted process again."

* commit '0a9927025041a6dde3f3878bdd868a69ab1b3266':
[ActivityManager] Prevent kill a restarted process again.
ee2e45acbff28986c2ced636b7550d0afbb0eeb7 27-Jun-2014 Craig Mautner <cmautner@google.com> Add Media Playing API

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

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

Fixes bug 14469711.

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

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

Fixes bug 15771895.

Change-Id: I6d350350dcf27509296d55d7b75be90a01694ac9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
468f7da79715cd7445a854ee118312cff4f2f1fd 08-Jul-2014 George Mount <mount@google.com> Merge "Introduce onNewActivityOptions for return activity"
eb8abf7207aa118065999514f9248affbdd94de1 03-Jul-2014 Craig Mautner <cmautner@google.com> Introduce onNewActivityOptions for return activity

When an activity that is already translucent returns to the
previous activity using a scene transition the receiving activity
did not receive its ActivityOptions for its side of the animation.
The new method onNewActivityOptions() delivers those options.

Fixes bug 14869070.

Change-Id: I09b136b3213aae5d3521894e17a7500ac793f3d2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
17fcc01c33fae16c9fca77ea8c0a696986563a3f 07-Jul-2014 Craig Mautner <cmautner@google.com> am 53cc7d79: am 7611a5d3: am 5acdd0f6: Merge "[ActivityManager] Ensure alive process is not killedByAm."

* commit '53cc7d7998a9a656fe89ec8eba40ad479bded274':
[ActivityManager] Ensure alive process is not killedByAm.
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/services/core/java/com/android/server/am/ActivityManagerService.java
497175beffe26336c092ee11a67b90f79dcdaca7 01-Jul-2014 Dianne Hackborn <hackbod@google.com> Rework network stats to use proc state for fg/bg.

Switch to using the process state to determine whether a
process should be foreground or background, instead of the
boolean foreground given by the activity manager.

This is for battery save mode, where we can now allow more apps
to havenetwork access: everything whose process state is at
least IMPORTANT_FOREGROUND, which allows music playback
and other use-visible things to continue to have network
access.

Note this also impact the traditional background data disabled
state, where now we allow anything top or better to have
network access. This automatically includes all persistent
processes, the current top activity, and any other processes
hosting the top activity or being used by the top activity.
So it broadens the set of apps that get network access, but I
think this increases it to a reasonable set of things that may
actually be needed for the foreground app to work correctly.

Change-Id: Icb609a2cea280dc3fa3e83417f478ed77f3685aa
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
be7c50e0a14e91330ce13161bc14a33d34ff6aca 30-Jun-2014 Dianne Hackborn <hackbod@google.com> Add network access blocking when in battery save mode.

The network policy manager now monitors battery save mode and,
when in battery save, uses its facility to block access to metered
networks to block access to all networks. That is, it tells the
network management service that all networks have an (infinite)
quota, and puts various app uids to be restricted under quota
interfaces as appropriate.

This new network blocking needs a new facility to be able to white
list apps, such as GmsCore. To do this, I refactored the package
manager's permission configuration stuff into a separate SystemConfig
class that can be used by others, and it now has a new tag to
specify package names that should be white-listed for power save
mode. These are retrieved by the network policy manager and used
to build a whitelist of uids.

The new general config files can now go in system/etc/config,
though currently everything still remains in the permissions dir.

Still left to be done is changing the semantics of what uids are
allowed in this mode, to include all perceptable uids. (So that we
can still do things like background music playback.) This will be
done in a follow-on CL.

Change-Id: I9bb7029f61dae62e6236da5ca60765439f8d76d2
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
312bc5430ac7da898f4c8a10da34f8939fb317d3 30-Jun-2014 Winson Chung <winsonc@google.com> Using base intent to check the calling app instead of uid. (Bug 15940115)

Change-Id: I571f1d3f90707046cca0eaaae3e8e958444cc971
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
80f74b544975900fa69fa078d424fa5cde9ad5c7 20-Jun-2014 Nicolas Prevot <nprevot@google.com> Splitting the different authorities of a content provider

So that sharing from contacts works across user.
When getting a contentProvider, checking that read/write permissions are not null,

Change-Id: Ib4f0419aebd9ec4e742ef08c9ed9348fde62cc11
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
bc5ddd69dd1a0771f02409e96476ea8ebe89debb 27-Jun-2014 Christopher Tate <ctate@google.com> Change permission guard on bindBackupAgent()

Bug 15829193

Change-Id: Ief86fdfb0ef73e2a5a5d34af950726c4d5c0a167
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a4e946bb6f4481d44463c620332d0666e3b8ad20 23-Jun-2014 Jason Monk <jmonk@google.com> Fix crash in starting lock task

Sometimes when coming from a dialog the current activity has changed,
which causes AM to crash and take down the framework. Instead don't
check the current activity as the user has confirmed the operation
so it is not coming from the background.

Change-Id: I0daeabcfcf814c52bcc7907a624fe6e9453c427f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
c286444f14798b783662f62c4ad3d7e8c71e9fda 26-Jun-2014 Winson Chung <winsonc@google.com> Merge "Use Task last active time to ensure we don't reload items for the cache."
d96e4948daf687f3f631ba8d93c89026fd3ce272 26-Jun-2014 Andres Morales <anmorales@google.com> Merge "interface for nfc handover supplicant commands"
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/services/core/java/com/android/server/am/ActivityManagerService.java
76e2a765b495f15a718dc4dfd9d81e9539a7074b 24-Jun-2014 Craig Mautner <cmautner@google.com> Don't set return to recents on every resume

Checking for previous task to be the Recents activity every time
through resumeTopActivityLocked() leads to missetting the
mTaskToReturnTo to Recents for Recents. Instead check for
Recents launching a task in moveTaskToFront and startActivity.

Fixes bug 15832448.

Change-Id: Ib64fe26f3fd3fdcd878edafb041928ec02757e63
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
04d480e1c338a921a8659e165d74f8437785acc1 25-Jun-2014 Dianne Hackborn <hackbod@google.com> Merge "Fix some problems with proc stats collection."
306af678a5f1938629e1182b46cc43f2da6e7774 25-Jun-2014 Dianne Hackborn <hackbod@google.com> Fix some problems with proc stats collection.

Also start debugging why we aren't being able to open
/proc files.

Change-Id: I4655904691ac22108c29858cbd01153a251ccbf5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
84984faf530e525b066e28710d0f9beb32142ec5 19-Jun-2014 Craig Mautner <cmautner@google.com> Return to recents when coming from recents

If a task is launched from recents then backing all the way
out of the task will return you to recents. Entering the task
in any other way (home, another activity, nav bar) will reset
this behavior.

Fixes bug 15703876.

Change-Id: I98dc36e4dbcb238d59e2175832076de7225bfdd9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
858aef2942e3e2b5759a8bc27fc4f1954573da7b 21-Jun-2014 Jason Monk <jmonk@google.com> Merge "Add lock-to-app mode"
62515beee67307d8859beec521b7baedfa54b2b5 21-May-2014 Jason Monk <jmonk@google.com> Add lock-to-app mode

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

Can exit the mode by long-pressing recents again.

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

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

Change-Id: Ib54d858e570cccf6bfd986958868e15f49bcef75
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1e2f374e712ef23d696616f70b284557c8bcbdcf 20-Jun-2014 Nicolas Prevot <nprevot@google.com> Merge "Making more ContentProviders work across users."
5b21454e6f81724ea48c2f85265ff107a8174005 17-Jun-2014 Nicolas Prevot <nprevot@google.com> Making more ContentProviders work across users.

If a ContentProvider makes a uri available to every app:
For an app on a different user, we grant a uri permission,
even if the ContentProvider would not normally allow granting uri permissions.

BUG:15721503
Change-Id: I0b865ae80f588137256387eba14a2e29b1129b00
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f329d050b8e72ba6daf67edc1b1b64b0035a6050 20-Jun-2014 Dianne Hackborn <hackbod@google.com> Merge "Add kernel and native memory data to procstats."
f7097a5b697fedb6976774e55a51471405a23c0e 13-May-2014 Dianne Hackborn <hackbod@google.com> Add kernel and native memory data to procstats.

We now collect memory use data in the kernel and native
application for aggregation in procstats. This should
allows us to do aggregated summaries of how memory use
is distributed across the system -- how much is free vs.
how much is in use.

Fix a bug in how we were tracking per-app version codes:
apps that used a shared user id to have multiple packages
run in the same process could get their version codes
cross-wired. Now we keep track of version codes in the
list of packages associated with a process.

Bumped the checkin version code to 5, so that we can
distinguish checkins that have this corrected data.

Also fix a bug in battery stats monitoring radio state.

Change-Id: I1c849f2df442df679a34ad7b0ca0c5870bfac8df
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2c43c339de5aaf4fef58aa9b5ac3af48609263a8 13-Jun-2014 Jeff Brown <jeffbrown@google.com> Resolve boot time dependencies related to the power manager.

This change fixes a bug where native daemons may try to communicate
with the power manager before it was fully initialized due to a race
between publishing the binder service and completing init().

The solution was to simplify the dependencies related to the power
manager. It turns out that most services that were passed in
init are not actually needed until systemReady. What remained
was a dependency on the activity manager to check permissions for
incoming calls. So now we start activity manager first.
However, the activity manager also depends on power manager for
wakelocks. To break the cycle, we now defer initializing the activity
manager's wakelocks until after the power manager has been started.

Cleaned up a bunch of boot-time service dependencies so that we
can have better confidence that they are correctly maintained.

Bug: 13884219
Change-Id: If08e2d7ccd44e7026a72441bb6bd5afd7bb9fffe
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ebf55ad6dec7e59dca668cf97ac81619793defe0 18-Jun-2014 Jason Monk <jmonk@google.com> Merge "Change lock-task DPM authorization to packages"
d7b8621bde44857ebb07130693a00f5f777887d4 16-Jun-2014 Jason Monk <jmonk@google.com> Change lock-task DPM authorization to packages

Switch the DPM lock-task authorization to be controlled by a package
rather than a component.

Change-Id: Ife9bed068f31ff2449b4451ab69d3586a3f09d89
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9740e468bc895cbc08c71aecc35fc56c3faafa06 08-Feb-2014 Andres Morales <anmorales@google.com> interface for nfc handover supplicant commands

expose:
NFC_GET_HANDOVER_SEL
NFC_GET_HANDOVER_REQ
NFC_REPORT_HANDOVER

These are used in for setting up WFD with NFC and
are only accessible given the CONNECTIVITY_INTERNAL
permission.

Change-Id: Ia43afc137d474822cad896d335530654081a808c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
82b3201a95063a1fe51842417c444c0dfd8cf780 07-Jun-2014 Nick Kralevich <nnk@google.com> resolved conflicts for merge of 13ed83ee to master

Change-Id: Ia3739cfa7af60e6a47bf94d403df190f3f2cd082
ffcfcaadfefec2fb56f67a0a614a54bf4599d62b 05-Jun-2014 Craig Mautner <cmautner@google.com> Implement maxRecents and fix TaskPersister bug

Activities can now set the maximum number of times that they will
appear in the recent task lists when using DocCentric mode. The
default number is 15, the min 1, and the max 100.

Also a bug in TaskPersister that deleted files because it did not
properly parse their task ids is fixed.

Fixes bug 13736052.

Change-Id: I7ccb4e6f89d6202ff31c8577bb7b9d8d1b7e5e8d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7f2d5162fd19345945d54cc864b3cc82bea35a2e 04-Jun-2014 Robin Lee <rgl@google.com> am c774caff: am 4891a9f9: am e46e6004: Merge "Assign AID_EVERYONE gid to newly-created processes"

* commit 'c774caff86d2e5dc5ca3a0008007cb0fd384568b':
Assign AID_EVERYONE gid to newly-created processes
c774caff86d2e5dc5ca3a0008007cb0fd384568b 04-Jun-2014 Robin Lee <rgl@google.com> am 4891a9f9: am e46e6004: Merge "Assign AID_EVERYONE gid to newly-created processes"

* commit '4891a9f9cfee569c0d362f1781f44493f5e320c0':
Assign AID_EVERYONE gid to newly-created processes
522a0278065b929e0d75d1d118e26a39ed57f010 03-Jun-2014 Narayan Kamath <narayan@google.com> am 41aa48be: am 032c5c05: Merge "Log process abis during start."

* commit '41aa48beacc93a1511a290e91293402eeb787165':
Log process abis during start.
41aa48beacc93a1511a290e91293402eeb787165 03-Jun-2014 Narayan Kamath <narayan@google.com> am 032c5c05: Merge "Log process abis during start."

* commit '032c5c054c331b63f2d45ee9c497ac852faec633':
Log process abis during start.
dfed4bc99f9f3d48ee7bf9e8ea051a8d5bc4f299 30-May-2014 Narayan Kamath <narayan@google.com> am f7871c31: am b9b31f4b: am bd4d3203: Merge "Support an ABI flag for instrumentation."

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

* commit 'b9b31f4b8eda123e7b544d1a0fa886576064adca':
Support an ABI flag for instrumentation.
1015efb143b51a5d31f2f932528f295cfa1add1f 29-May-2014 Nicolas Prevot <nprevot@google.com> Merge "Making the content resolver work with result intents."
c6cf95c0f5f7250c65e40c441fe58d8cbfd114c9 29-May-2014 Nicolas Prevot <nprevot@google.com> Making the content resolver work with result intents.

prepareToLeaveUser is called if necessary on result intents.
Adding the targetUserId to grantUriPermissionFromIntentLocked
This allows the GET_CONTENT intent to work across profiles.

Change-Id: Id81280c23247aeda7ad56e34af9b12a6f3a00a3c
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d5ba868b0df68685193300dba62895d823feaddd 28-May-2014 Amith Yamasani <yamasani@google.com> Merge "Fix singleUser attribute"
4b9d79c30eccb61645d98a4f0d49b7769e8c7ccc 22-May-2014 Amith Yamasani <yamasani@google.com> Fix singleUser attribute

Make it work correctly for singleton content providers.
Relax which apps can export singleton content providers.

Change-Id: I43d315c25ed76a876bfa6d5e0d1351bc19c9bdba
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
a64a5fe68ced5ffca58248d76eadd90759ab4164 27-May-2014 Winson Chung <winsonc@google.com> am bff02603: Merge "Updating task description whenever we create a RecentTaskInfo. (Bug. 15195617)" into lmp-preview-dev

* commit 'bff026033d40ee48e9bf8dca17e1fbbee8b41293':
Updating task description whenever we create a RecentTaskInfo. (Bug. 15195617)
8804ce96b1ef3aa260076091e77abcce0b1ea1d9 27-May-2014 Winson Chung <winsonc@google.com> Merge "Updating task description whenever we create a RecentTaskInfo. (Bug. 15195617)" into lmp-preview-dev
9693d9534342c9785877a9f98ec5aff6fd9ac496 27-May-2014 Winson Chung <winsonc@google.com> Updating task description whenever we create a RecentTaskInfo. (Bug. 15195617)

Change-Id: I371ee43296a983782eaed2e661b1febc71c86433
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5122fb6a92d2fa99f2f2cafc138527931c0dc183 27-May-2014 Craig Mautner <cmautner@google.com> am 463f9006: Merge "Only start TaskPersister once." into lmp-preview-dev

* commit '463f9006c56d66b5213edecc150863b450a7e573':
Only start TaskPersister once.
87f851d0bad0183eccbb59b1fb378db9155e4a66 27-May-2014 Craig Mautner <cmautner@google.com> Only start TaskPersister once.

Because ActivityManagerService.systemReady() is reentrant we could
restore tasks and start the TaskPersister more than one time. This
fix limits operations on TaskPersister to one time only.

Fixes bug 15256579.

Change-Id: I6bf2c26b37acdfd9b15a6f277966966b743d03b6
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
21d24a21ea4aaadd78e73de54168e8a8a8973e4d 23-Apr-2014 Craig Mautner <cmautner@google.com> Add code for persisting tasks and activities to disk DO NOT MERGE

Recent tasks that have the persistable flag set are
saved to /data/system/recent_tasks/ on shutdown and in the
background. Their thumbnails are saved to
/data/system/recent_images/.

Change-Id: Ifb820a01c412fe1f8c0f6e41aa655fafd89eaa8d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
deec695253aa5856135be3ffdcd35eaafed9e526 24-May-2014 Craig Mautner <cmautner@google.com> Merge "Add code for persisting tasks and activities to disk"
9b7135645e70e3613f7820ae0a68350a1ff47362 23-May-2014 Dmitriy Ivanov <dimitry@google.com> am 190ed5db: am 2137d6a8: am d5ee4144: Merge "Increase start timeout for wrapped process"

* commit '190ed5db4ac90612c1f6420f87ea462076fbe1a0':
Increase start timeout for wrapped process
ef73ee1dd98acfc4a19561367cfc3e4d8bbe06ea 23-Apr-2014 Craig Mautner <cmautner@google.com> Add code for persisting tasks and activities to disk

Recent tasks that have the persistable flag set are
saved to /data/system/recent_tasks/ on shutdown and in the
background. Their thumbnails are saved to
/data/system/recent_images/.

Change-Id: Ifb820a01c412fe1f8c0f6e41aa655fafd89eaa8d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
190ed5db4ac90612c1f6420f87ea462076fbe1a0 23-May-2014 Dmitriy Ivanov <dimitry@google.com> am 2137d6a8: am d5ee4144: Merge "Increase start timeout for wrapped process"

* commit '2137d6a843b82996e08f0e03376e48860919d8bc':
Increase start timeout for wrapped process
f0ee5a795a9deada60aaad41ecbbeed69a7b161b 22-May-2014 Nicolas Prevot <nprevot@google.com> Merge "Correcting a bug related to Uri permissions."
dcb27fadcde2c45e14ee1658db4d16cc699ec250 22-May-2014 Nicolas Prevot <nprevot@google.com> Correcting a bug related to Uri permissions.

Change-Id: I70765eb659151ce0c5af06075a844143c09429e8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7bd35c7e6f5e8b4085bc8ee708e67872cab9743f 12-May-2014 justinzhang <justinzhang@google.com> Use DeviecPolicyManager to authenticate lock task

Uncomment lines in ActivityManagerService. Before start lock task,
ActivityMangerService calls DevicePolicyManager to see if the
app can go into lock task.

Change-Id: I9ad784d7cc637d45884dcb2623b4c59ff802f93d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
87be9ba1eaa396c95c5f335c8ba51123d304a7bb 20-May-2014 Jason Monk <jmonk@google.com> Merge "Fix reference to ProxyInfo extra"
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/services/core/java/com/android/server/am/ActivityManagerService.java
7dab61455c32c0a93711ae977d197202dacb6bb6 15-May-2014 Jason Monk <jmonk@google.com> Fix reference to ProxyInfo extra

Also remove unneeded null check.

Change-Id: Ic25d1087f93632a24755b284ede41d870492e25d
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5d5f19a339bc4a8f10f75b51625d8d50ee0729e0 15-May-2014 Narayan Kamath <narayan@google.com> am 6e2e6868: am 706b1d7e: Merge "Remove "required" prefix from ABI fields."

* commit '6e2e686889037711170ee145f9dfdb442cee85db':
Remove "required" prefix from ABI fields.
1e74c37f8e1acb595f407e0f65744bb6b00c9314 15-May-2014 Narayan Kamath <narayan@google.com> Merge "Remove "required" prefix from ABI fields."
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/services/core/java/com/android/server/am/ActivityManagerService.java
7fd239cf0a1ddc0500b51d97e0e6c3539b42639f 14-May-2014 Craig Mautner <cmautner@google.com> Merge "Pass ActivityOptions back from finishing activity."
202259785972be771075dce8d3e43c29b8d8f1f1 13-May-2014 Nicolas Prevot <nprevot@google.com> Merge "Resolving resources across users."
233ceeebab7efe6ad4783371003c4cf29b896436 10-May-2014 Craig Mautner <cmautner@google.com> Pass ActivityOptions back from finishing activity.

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

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

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

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

Change-Id: I43dc76895aba692bf148d276253aeaf9c75fce34
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
34f6084bc21b07ae9112be6e7a8f50c49828ac9c 30-Apr-2014 Narayan Kamath <narayan@google.com> Remove "required" prefix from ABI fields.

As per a comment on an earlier code review.

Change-Id: I3ae30f8a7bc90730068644f93b926e0e05a2cdfb
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
83520b95124e0fcaaf3154a7a267f6be0205bc74 09-May-2014 Jason Monk <jmonk@google.com> Switch PacUrl storage from String to Uri

Since the interface for creating/accessing PAC URLs through a
ProxyInfo is Uri based, so should the internal storage and
references.

Change-Id: Ibf15c350f4cc526f81aba3ec463070f26af8f535
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
d9ddf2e9d04f8a53d7445a96aa3e192fa86f08d6 09-May-2014 Craig Mautner <cmautner@google.com> Merge "Introduce persistent forms of Activity lifecycle calls."
c241db85c937102714e4cb125c97c79f80bebbec 09-May-2014 Jason Monk <jmonk@google.com> Merge "Fix badness from proxy refactoring."
a002604af0c9b1204556610537b85685d7055996 23-Apr-2014 Craig Mautner <cmautner@google.com> Introduce persistent forms of Activity lifecycle calls.

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

Fixes bug 13736007.

Change-Id: I7e92917b300b76964257cfcc26c24e76aa19bd16
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5df281a570555ee132a12a4aac9aec96e8618270 09-May-2014 Jason Monk <jmonk@google.com> Fix badness from proxy refactoring.

When no PAC file getPacFileUrl() can return null now, which you
cannot call toString() on.

Change-Id: Ife00f641c2c17fbc1bde17017d9af59d23cb9182
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
8f17b5758279e287e2622a226f74e17c205f88dc 08-May-2014 Winson Chung <winsonc@google.com> Merge "Listening for system changes to active recent tasks. (Bug 14260718)"
63812fd9f20d2a0f96ef0fac69497d3334ae6d97 08-May-2014 Amith Yamasani <yamasani@google.com> Merge "Send boot_completed for users started in the background"
9f49df933f01a32d04bdf92d53c943065aa8ddf7 08-May-2014 Winson Chung <winsonc@google.com> Listening for system changes to active recent tasks. (Bug 14260718)
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6422abef786632e53337c6c298ffa64f7ddf4d90 07-May-2014 Brian Carlstrom <bdc@google.com> resolved conflicts for merge of 3bbef521 to master

Change-Id: I0bbb7c80f6c4f003779da784475d7acbfb898c94
1a7eaaa50e7f1a021129ebbe2f6ae1ac469b8812 07-May-2014 Amith Yamasani <yamasani@google.com> Send boot_completed for users started in the background

Bug: 14587584

Change-Id: I7abfad0a7102376e1665b528f3fd110a4b6ed164
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3bbef521d4b07f86010ba0729a36ff8b73bcb0ac 07-May-2014 Brian Carlstrom <bdc@google.com> resolved conflicts for merge of f2db00fd to klp-modular-dev-plus-aosp

Change-Id: I745164033962f6222832f8f19fa316a2e2634fd0
f2e074604b1ee7e47bcbf82bb9d612b64bbcee93 07-May-2014 Jason Monk <jmonk@google.com> Fix Build

Change-Id: I0035256b41199041bc1bc7d625f2c8f5a6a23e43
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9d75ccb6a1b3b300c33ce3ceab5eaece0ad55d42 07-May-2014 Jason Monk <jmonk@google.com> Merge "Make proxy API public"
207900c23b26d0df9ab28c709db4a1007d7d7904 25-Apr-2014 Jason Monk <jmonk@google.com> Make proxy API public

Also exposed proxy-related functions that were on the
ConnectivityManager.

Change-Id: I9fb5f1bcc257a6198679ea1d56e18da2ec5a3b33
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3aeaebb6fc2093069a138d0c8562020dfc76ad43 07-May-2014 Winson Chung <winsonc@google.com> Fixing regression in calculating which activities to apply recents values to.
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
03a9baedc9b933bb6a550c0cb84649b1b45b872c 02-May-2014 Winson Chung <winsonc@google.com> Refactoring activity method to update recents values.

Change-Id: Ic525be207714d34abe0c2d26091c3e46abcd9bad
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5d84bce12204072bc7ab296ce0cdea7efb5cf17c 02-May-2014 Dianne Hackborn <hackbod@google.com> Fix issue #14492403: Oom scores appear to be incorrect...

...and causing runtime restarts

Got a little too aggressive with the delete key. *blush*

Change-Id: Icd4637827424211abc2347f7f9407c2d4c95cfad
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
648c83b4ee5fe825aa4032e0bb32c1d6269b02ad 29-Apr-2014 Winson Chung <winsonc@google.com> Fixing NPE. (Bug 14385152)

Change-Id: Ie6d1e7c3e5dcf721e945c4933c077fa6abb10067
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4553b2d7c881aebb9dfe10407f33bd8d1e9e27d4 25-Apr-2014 Winson Chung <winsonc@google.com> Merge "Updating recent tasks list in response to package events. (Bug 14260718)"
8faa342c8a544229b9fc05378a6b33d18d0f8d6b 24-Apr-2014 Winson Chung <winsonc@google.com> Updating recent tasks list in response to package events. (Bug 14260718)

Change-Id: I7e887256b2d504aebfaedcfebb5ee8a40b05fe24
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
385124d8cee38dee00d4fac31e8fbe46fb30565b 03-Apr-2014 Alexandra Gherghina <alexgherghina@google.com> Modify getUserProfiles to return only enabled profiles:

Add a new enabled state for a managed profile.
Expose that as a new API on DevicePolicyManager.
Set the new state when enabling the profile.
Return only enabled profiles from the user manager.

Bug: 13755441
Bug: 13755091
Change-Id: I2907b182e19b3562592da688b3f68ef5f4088557
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1b244f44a796484866f13e0639420477c3191695 23-Apr-2014 Winson Chung <winsonc@google.com> Merge "Piping through ability for an Activity to remove its own task. (Bug 13735914)"
3b3f464445d1d369c8e87f526deba606ca62f76c 22-Apr-2014 Winson Chung <winsonc@google.com> Piping through ability for an Activity to remove its own task. (Bug 13735914)

Change-Id: Iefcd4fbe68748195de8ee37ee2b6edef55276603
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
21de56a94668e0fda1b8bb4ee4f99a09b40d28fd 06-Apr-2014 Jeff Sharkey <jsharkey@android.com> Add directory selection to DocumentsProvider.

Introduce new ACTION_PICK_DIRECTORY that allows users to grant access
to an entire document subtree. Instead of requiring grants for each
individual document, this leverages new prefix URI permission grants
by defining new "via"-style URIs:

content://com.example/via/12/document/24/

This references document 24 by using a prefix grant given for
document 12. Internally, we use isChildDocument() to enforce that
24 is actually a descendant (child, grandchild, etc) of 12. Since
this is an optional API, providers indicate support with
Root.FLAG_SUPPORTS_DIR_SELECTION.

Extend DocumentsUI to support picking directories. Expose
createDocument() API to work with returned directories.

Offer to canonicalize via-style URIs into direct URIs, generating
exact permission grants along the way. Override openAssetFile()
to pass through CancellationSignal. Move testing code into ApiDemos.

Bug: 10607375
Change-Id: Ifffc1cff878870f8152eb6ca0199c5d014b9cb07
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
846318a3250fa95f47a9decfbffb05a31dbd0006 04-Apr-2014 Jeff Sharkey <jsharkey@android.com> Allow prefix-based Uri permission grants.

Define new FLAG_GRANT_PREFIX_URI_PERMISSION which indicates that a
Uri permission grant should also apply to any other Uris that have
matching scheme, authority, and path segments. For example, a prefix
grant for /foo/ would allow /foo/bar/ but not /foo2/.

Allow persistable and prefix grants to be issued directly through
grantUriPermission(). Relaxing persistable is fine, since it still
requires the receiver to actively take the permission.

Since exact- and prefix-match grants for the same Uri can coexist,
we track them separately using a new UriGrant key. (Consider the
case where an app separately extends READ|PREFIX and WRITE for
the same Uri: we can't let that become READ|WRITE|PREFIX.)

Fix revoke to always take away persisted permissions. Move prefix
matching logic to Uri and add tests. Add new flags to "am" tool, and
various internal uses around Intent and Context. Switch some lagging
users to ArraySet.

Bug: 10607375
Change-Id: Ia8ce2b88421ff9f2fe5a979a27a026fc445d46f1
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7ad27288f1b66733a4fcb2bdcb17dd5db6c6423d 22-Apr-2014 Craig Mautner <cmautner@google.com> am c00c89b1: am f4c909bc: Fix ActivityView lifecycle

* commit 'c00c89b1add5bcbf6a76287c9a3384877449c746':
Fix ActivityView lifecycle
c00c89b1add5bcbf6a76287c9a3384877449c746 22-Apr-2014 Craig Mautner <cmautner@google.com> am f4c909bc: Fix ActivityView lifecycle

* commit 'f4c909bcb87d6f103c9f9e8255fa61bd86f4de67':
Fix ActivityView lifecycle
f4c909bcb87d6f103c9f9e8255fa61bd86f4de67 18-Apr-2014 Craig Mautner <cmautner@google.com> Fix ActivityView lifecycle

Major changes to maintain the VirtualDisplay across repeated
attach/detach cycles of an ActivityView. This keeps the activities
and VirtualDisplays in the ActivityView from getting into bad states.

Fixes bug 14107002.

Change-Id: Idc2aaf85ac496eab0eeb436736cb10a2020040e8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
f148f36d140e995ec8f755e60bbb0b37f33c3da7 10-Apr-2014 Narayan Kamath <narayan@google.com> am 9e289d70: am 1d26a3f1: am 09e13cc5: Merge "System services detect and register app CPU ABIs"

* commit '9e289d70a8baaed0030413b5991653792e2a816d':
System services detect and register app CPU ABIs
9e289d70a8baaed0030413b5991653792e2a816d 10-Apr-2014 Narayan Kamath <narayan@google.com> am 1d26a3f1: am 09e13cc5: Merge "System services detect and register app CPU ABIs"

* commit '1d26a3f1efd0d965e8751e8515608c31789bdbe2':
System services detect and register app CPU ABIs
6fdb5e6df178b3b1062ac67b505b288aa609a66b 10-Apr-2014 Jeff Brown <jeffbrown@google.com> resolved conflicts for merge of 7289f3ab to klp-modular-dev-plus-aosp

Change-Id: I5bdc8862828b56557410a95e7f9b14def81a0ded
a981e3b01ae6af2b67e582f0d1cbb95560d05626 09-Apr-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 7289f3ab to klp-modular-dev-plus-aosp

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

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

Deleted the startRunning method since it is no longer useful.

Bug: 13133142
Change-Id: I7f845c61ecc7ee890154ed0cbd90795de609b7ea
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
35fc6a02aeded9578375af5828e14043164028d5 03-Apr-2014 Craig Mautner <cmautner@google.com> Merge "Implement setActivityLabelAndIcon()."
f4824a06884e096beef921646cba4be29d7f36fc 02-Apr-2014 Kenny Guy <kennyguy@google.com> Fix issue with not allowing activities for current user.

Change-Id: Ic2e30c3f4990a03aac9801ee9bf5f270a5e90ef8
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1ccace916c8fdc61f1a8db6677aed518d31647e6 02-Apr-2014 Kenny Guy <kennyguy@google.com> Merge "Rename related users to profiles."
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/services/core/java/com/android/server/am/ActivityManagerService.java
b69bb445585a083b8e4ff8a13a1a1a63e9c22a6a 02-Apr-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 71ab4f4f to master

Change-Id: I888c231f7579523e12fbd68f820f0775019e51e0
71ab4f4f48a9b8b485d80adf18d568ef6265b1e8 02-Apr-2014 Narayan Kamath <narayan@google.com> am ea9e5eca: am 17b1b8fe: Merge "Move zygote startup logic to the frameworks."

* commit 'ea9e5ecac1e5240370f0e3f998b9c8b159ee9320':
Move zygote startup logic to the frameworks.
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/services/core/java/com/android/server/am/ActivityManagerService.java
439cf5b433123970a94388cf9309d9ea4d31b3cb 31-Mar-2014 Narayan Kamath <narayan@google.com> am 56a8f8b4: resolved conflicts for merge of 439145f0 to klp-modular-dev-plus-aosp

* commit '56a8f8b48ff1d0855209307b9076d6e9b348b59b':
Don't make isSafeMode a field on the Zygote class.
56a8f8b48ff1d0855209307b9076d6e9b348b59b 31-Mar-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 439145f0 to klp-modular-dev-plus-aosp

This isn't a straightforward conflict resolution. This code
has changed significantly. mSafeMode is now a flag on the activity
manager service, and is set when SystemServer calls enterSafeMode.

Change-Id: I1e8ff524566c5e44bb6bf3b138cdebb70004aca3
43111e897be9f79ababb0ecf99f155695416d956 24-Mar-2014 Dianne Hackborn <hackbod@google.com> Merge "Battery stats: wake locks, radio active, cleanup."
4590e52f3d0558e01322fe4dd55bb612afdfb079 24-Mar-2014 Dianne Hackborn <hackbod@google.com> Battery stats: wake locks, radio active, cleanup.

- Improve wake lock work source updates to also update the current
history tag, in case the new work source gets recorded in the
history.

- Fix bug in recording radio active time that was not distributing
any time to apps.

- No longer hold a wake lock while dispatching data conn active call,
since it comes with its own timestamp.

- Fix issue where the top app was not being cleared while the screen
was off.

- Remove obsolete STATS_LAST stats type.

- Fix bug that was not clearing the total run time when resetting
the stats.

Change-Id: Iabe17a9edf34f762374ae09fcffb8a819cf72e30
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
8fc2eba0f7590122c15290b7ce3389be15394fd4 18-Mar-2014 Dianne Hackborn <hackbod@android.com> am a2a13718: am 7987d84e: am d1d91eca: am 7cb1dfe6: Merge "Insufficient ProcessRecord cleanup when persistent process is killed"

* commit 'a2a13718d00172d224960146e4956de58da5b484':
Insufficient ProcessRecord cleanup when persistent process is killed
7987d84e35fb8d7a20ef33786906968e8b7f2dc2 18-Mar-2014 Dianne Hackborn <hackbod@android.com> am d1d91eca: am 7cb1dfe6: Merge "Insufficient ProcessRecord cleanup when persistent process is killed"

* commit 'd1d91eca3e78f2074b110a0e3530aeff6deef6fe':
Insufficient ProcessRecord cleanup when persistent process is killed
e9ebd60fc4dd32a57784e8d9c7dcb8b599d25f75 18-Mar-2014 Dianne Hackborn <hackbod@google.com> Merge "Treat IME processes as hosting activities"
f0f94d129b6eb3c48624e915898d86d4f2de59ff 18-Mar-2014 Dianne Hackborn <hackbod@google.com> Treat IME processes as hosting activities

When we stop using an IME process, we still treat that
process as if it is hosting activities (in the activity part
of the LRU list), to try to keep it around. This is intended
to help the experience of switching between IMEs, reducing
the chance of your previous IME process being killed and thus
requiring much more time to switch.

Change-Id: Ie5793fd9b40d980fa18f80246326511ed6ae0597
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.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/services/core/java/com/android/server/am/ActivityManagerService.java
d00f47402cb886a43a3448128bdcd9dd2f348a2a 12-Mar-2014 Craig Mautner <cmautner@google.com> Launch new tasks with Doc Centric flag.

Introduction of new Intent flag FLAG_ACTIVITY_NEW_DOCUMENT. When
this flag is set the target activity will be launched in its own
task. This is the start of the new Doc Centric mode of working.

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

Change-Id: Ide2c202b4a5b25410f0f32bd0a81ccf817ede38f
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
724cc1f04f117ee27583d015b414a5ba4540d3b1 10-Mar-2014 Amith Yamasani <yamasani@google.com> Merge "Allow related users to show activities on primary user"
734983fff35d9ed2b7a9848bdfbca401887d0dd8 05-Mar-2014 Amith Yamasani <yamasani@google.com> Allow related users to show activities on primary user

Make ActivityManager and WindowManager understand related users.

Task stack will now contain interleaved tasks for related users,
but still group regular users separately from groups of related users.

InputMethodManagerService permits related users to invoke IME and receive
key events.

Change-Id: I3bd87b32aec69c3f8d470c8b29b144f4e849c808
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
ca35c18a374c143831cc282987c762507c0ffc34 07-Mar-2014 Narayan Kamath <narayan@google.com> am cd4874cf: am d265bcc4: Merge "Inform libcore of time format pref. changes."

* commit 'cd4874cfdc00d17454529b5dca85a487c7c2de77':
Inform libcore of time format pref. changes.
f084e2779b03c261e0fcbfd7d7c6d9960a6358a1 07-Mar-2014 Narayan Kamath <narayan@google.com> Merge "Inform libcore of time format pref. changes."
ccb2a086fe0de77a4e3277454cb4a66f8e7dc57d 19-Dec-2013 Narayan Kamath <narayan@google.com> Inform libcore of time format pref. changes.

- Introduce a boolean extra for intent TIME_CHANGED that
specifies if the user wants a 24 hour format or not.
- Have the ActivityManagerService inform running processes
of changes to this preference.
- Add plumbing in ActivityThread to inform j.t.DateFormat

(cherry-picked from dd491cc756233c088fd26eba4918671fcc9cfc30)

Change-Id: Ib90636bda4bc8332cfa22def831877b524b5c486
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
72f456fc51ecd584c3b82f8f54020edd7b9a0f46 07-Mar-2014 Dianne Hackborn <hackbod@google.com> am a6590837: am 8b776e86: am c71c901a: am 278fa87c: am 430652c1: Merge "Fix issue #13199860: PRE_BOOT_COMPLETED intent is..." into klp-dev

* commit 'a6590837a9d0211b4c44f25e1cbe2cd196aa1a3d':
Fix issue #13199860: PRE_BOOT_COMPLETED intent is...
c71c901ad4d33a373efdad4cf97d12f8ca77e089 07-Mar-2014 Dianne Hackborn <hackbod@google.com> am 278fa87c: am 430652c1: Merge "Fix issue #13199860: PRE_BOOT_COMPLETED intent is..." into klp-dev

* commit '278fa87cc9a5e08d410c5b1e6c75afcffc22a988':
Fix issue #13199860: PRE_BOOT_COMPLETED intent is...
6143a02f96a5c6c7a0a84f5dbe70732998256a72 05-Mar-2014 Kenny Guy <kennyguy@google.com> Start related users on boot and user switch.

Collect related initialized users and start
them on boot and user switch.
Update list users command to show whether a
user is running or not.

Change-Id: Ib3d5debcb01ec55a07d93450b988b0180fc63263
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
264707caa392abd8c92764e0b04b37290c16fb5a 05-Mar-2014 Kenny Guy <kennyguy@google.com> Fix bug with starting users in background.

It shouldn't tell the window manager to lock or freeze the
screen when starting a user in the background.

Change-Id: I24c6c19a20c360ecbed7d28e1d7249c025a463b9
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
08488bf3fe6f4b1fadf59821feaf07b4c2ae52ae 21-Feb-2014 Kenny Guy <kennyguy@google.com> Allow user to be started in background.

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

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

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

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

More maintenance fixes.

Fix bug 13157352.

Change-Id: Ic86d39a84452a1cf1dc1762cec517b419ad0a852
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
cab8617b8ccea3a99b1ee15e15915c512a10c738 11-Feb-2014 Jeff Brown <jeffbrown@google.com> am 25df673b: am 1b51c9cb: Merge "Make SystemService constructor take a Context." into klp-modular-dev

* commit '25df673b849de374cf1de40250dfd8a48b7ac28b':
Make SystemService constructor take a Context.
b880d880c6cd989eacc28c365fc9a41d31900da1 11-Feb-2014 Jeff Brown <jeffbrown@google.com> Make SystemService constructor take a Context.

This change simplifies the process of initializing a SystemService
by folding the onCreate() step back into the constructor. It removes
some ambuiguity about what work should happen in the constructor and
should make it possible for services to retain most of their final
fields after refactoring into the new pattern.

Change-Id: I25f41af0321bc01898658ab44b369f9c5d16800b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9358dcca6f3d33d1e3f976a4c3a5f61e103930dc 10-Feb-2014 Dianne Hackborn <hackbod@google.com> Maybe fix issue #12957738: SecurityException in...

...Multiple Processes: uid 10069 does not have
android.permission.UPDATE_DEVICE_STATS.

Change-Id: Ibabb5b09d52412df8bebdc85a584f89e175b1ec5
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
eaf2ac464b1cd741d7d0fe700771b1b7c00ddb29 07-Feb-2014 Dianne Hackborn <hackbod@google.com> Battery stats: more events, fixes.

Add new history events for top application package and
foreground application packages.

Doing this involved a fair amount of improvement to history
events. The event code is now separated out to have "start"
and "finish" identifies, and we use that to now keep track
of which events are active. With that, when resetting the
stats, we can spit out all of the currently active events at
the front of the new history.

Also fixed some problems when I re-arranged the history delta
int bits that were conflicting with the packing of the battery
status bits. These packing structures are changed to work
together correctly.

Change-Id: Ic8b815060dd8a50ff4a0a209efc2e1044215cd88
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
898c13df7b9b12ff10062f3542593e12fbe0c119 29-Jan-2014 Adam Lesinski <adamlesinski@google.com> Check feature bits before loading optional services

At startup, we check with PackageManager whether a system service is
available before attempting to load it. A system service is available
if its associated feature (similar to hardware features) is present.
This does not remove unavailable services from the compiled jar.

Change-Id: I13571805083aa4e65519a74acb52efd17b9fb3d7
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
9e4adfb358ca3680288c07201efc8811472a579d 05-Feb-2014 Craig Mautner <cmautner@google.com> resolved conflicts for merge of 32360147 to master

Change-Id: I97cc95f66df50006469f8debd286966cc21edb60
df88d73092c62a1a3cd2b2056ca63ae2e70cc238 27-Jan-2014 Craig Mautner <cmautner@google.com> Add IIntentSender to ActivityContainer.startActivity

PendingIntents and IntentSenders can now be launched. Still does not
work once the host activity has been paused and resumed.

Window manager TaskStacks now exist independently of Displays and app
windows persist after Displays are removed below them. Attaching the
stack to a new Display does not yet restore the windows to it.

Fixes bug 12747909.

Change-Id: I509007ee23fda400b353f483cf6ecce08177763b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
39e79006cf22f10eb62ac721238778aa6b7d3473 22-Jan-2014 Dianne Hackborn <hackbod@google.com> Merge "Battery stats improvements."
099bc627c463d9941e23e480f25a78a154429c55 22-Jan-2014 Dianne Hackborn <hackbod@google.com> Battery stats improvements.

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

Change-Id: Ifbdd0740132ed178033851c58f165adc0d50f716
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
509cc13b705f8c488774e7097ab17471c3dacd2e 18-Jan-2014 Jeff Brown <jeffbrown@google.com> am e2c9cd58: Merge "Refactor display manager service to new pattern." into klp-modular-dev

* commit 'e2c9cd583f4f706b48270b8cbe84df627c69af24':
Refactor display manager service to new pattern.
4ccb823a9f62e57f9d221f83a97e82967e79a9e5 17-Jan-2014 Jeff Brown <jeffbrown@google.com> Refactor display manager service to new pattern.

Transform DisplayManagerService into a SystemService and start cleaning
up other local services that it uses from window manager and input manager.

Clean up service thread initialization.

Remove unnecessary static variables from ActivityManagerService.

It's starting to become clear that we really need a better way to manage
service dependencies. Boot phases don't quite cut it.

Change-Id: If319dbd7cbfbd4812fe55ece969e818d4b20755b
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
09d30981f8e882ffaa336aa4665bfe348557895a 16-Jan-2014 Jeff Brown <jeffbrown@google.com> resolved conflicts for merge of 6f357d32 to master

Change-Id: I1979e6ed1acddbe656f5010114fd900f10865e75
6f357d3284a833cc50a990e14b39f389b8972254 16-Jan-2014 Jeff Brown <jeffbrown@google.com> Start untangling system server early bootstrapping.

Refactored SystemServer to get rid of a bunch of legacy cruft related
to how the ServerThread used to be started up.

Create system context first when system server starts. This removes
the tangled initialization order dependency that forced us to start
the activity manager service before most anything else.

Moved factory test related constants into the FactoryTest class.

Partially migrated Installer, ActivityManagerService, and
PowerManagerService to the new SystemService pattern. There's more
work to be done here, particularly around the lifecycle of the
power manager.

Bug: 12172368
Change-Id: Ia527dd56e3b3fd90f9eeb41289dbe044921230d4
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
b859449b717b24ac6e678c303d7706d55fd184f7 08-Jan-2014 Craig Mautner <cmautner@google.com> resolved conflicts for merge of 88bfc6dd to master

Change-Id: Ib656ac0591b21ad14f2df51021729552e9373515
88bfc6ddc846d714bc15518ef6741e39145a1687 08-Jan-2014 Craig Mautner <cmautner@google.com> Merge "Extend stack management to other displays." into klp-modular-dev
a807dbaeed2a125cea6868f6d51402f8416fddec 06-Jan-2014 Todd Poynor <toddpoynor@google.com> am 91ecb36d: ActivityManagerService use lmkd low memory killer daemon -- DO NOT MERGE

* commit '91ecb36df50be3446809e9da2a8f571d157f7549':
ActivityManagerService use lmkd low memory killer daemon -- DO NOT MERGE
e0a3884cb627efc650e19fbe76b1b3343468cf57 17-Dec-2013 Craig Mautner <cmautner@google.com> Extend stack management to other displays.

- Abandon ActivityContainer.startActivity() in favor of
IActivityManager.startActivityAsUserInContainer().
- Modify Am to test starting an activity on a container.
- Create a DisplayContext as the base context if the activity token
is on a different display.
- Test for home display in more cases when manipulating home stack.
- Rename mDisplayInfos => mActivityDisplays.
- Create new method for moving task to front of stack regardless of
which display it is on.

Change-Id: I4fcb83ae844c5839ee3e2722229623d1a80ed921
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
49782e46c0eb85a25ae2abcf80880c48dbab5aea 20-Dec-2013 Amith Yamasani <yamasani@google.com> am 9158825f: Move some system services to separate directories

* commit '9158825f9c41869689d6b1786d7c7aa8bdd524ce':
Move some system services to separate directories
9158825f9c41869689d6b1786d7c7aa8bdd524ce 22-Nov-2013 Amith Yamasani <yamasani@google.com> Move some system services to separate directories

Refactored the directory structure so that services can be optionally
excluded. This is step 1. Will be followed by another change that makes
it possible to remove services from the build.

Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java