• Home
  • History
  • Annotate
  • only in /frameworks/base/services/tests/servicestests/src/com/android/server/
History log of /frameworks/base/services/tests/servicestests/src/com/android/server/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0823c9ff5cbbe954bd747d4713b18f5856bdd371 15-Jun-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Remove snapshot when screen gets rotated in mean time" into oc-dev
38d44ec857a75ebc98818743d08addf81ddc923e 15-Jun-2017 Jorim Jaggi <jjaggi@google.com> Remove snapshot when screen gets rotated in mean time

We also need to wait for windows that are not gone for layout, as
otherwise we'd unfreeze before the surface is actually created.

Test: go/wm-smoke
Test: Open Camera in landscape but home screen locked to portrait
Change-Id: I0fc7a016445e18af1eead292665702b768b4e95b
Fixes: 38261533
m/TaskSnapshotSurfaceTest.java
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
m/AppWindowContainerControllerTests.java
4a526c124554e75dc4bc11a682645a73bd47d501 16-May-2017 Winson Chung <winsonc@google.com> Ensure that we use SF Vsync Choreographer for the PiP transition.

- Move the bounds animation onto the animation thread
- Remove existing code referencing the old sf-vsync choreographer
- Add ability for ValueAnimator subclasses to reference a different
AnimationHandler, which uses a different FrameCallbackProvider with the
sf-vsync choreographer in the animations that require it
- Ensure that PiP touch events are batched and sent aligned with the
sf-vsync
- Move GC onto its own thread to not block other BackgroundThread calls

Bug: 36371375
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: bit FrameworksServicesTests:com.android.server.wm.BoundsAnimationControllerTests
Test: go/wm-smoke

Change-Id: I6a41b35a4e4d4d6dbea82c2673452825fe3ffa58
m/BoundsAnimationControllerTests.java
d62dc39dc5a31c2c150fc5083e5a520fcb394c63 01-Jun-2017 sunjian <sunjian@google.com> Update AccountManagerService side logic for .getAccountsByTypeForPackage
with null type.

Bug: 37987384
Test: manual, APCT
Change-Id: I4d5f735736f1b1d7bbf778aee2ec813071c34f19
ccounts/AccountManagerServiceTest.java
f1946baae71d52fa743187323de332c682f7b6b8 06-Jun-2017 Jian Sun <sunjian@google.com> Merge "Fix visibility issue in AccountManager.getAuthTokenByFeatures." into oc-dev
f29d549c2d16f377fe11261b98d77d2c9db1070c 12-May-2017 sunjian <sunjian@google.com> Fix visibility issue in AccountManager.getAuthTokenByFeatures.

Bug: 34679769
Test: manual, APCT
Change-Id: I7270a5a5dd681ad088fa28e48d849ba3541e45cd
ccounts/AccountManagerServiceTest.java
ccounts/AccountManagerServiceTestFixtures.java
ccounts/TestAccountType1Authenticator.java
73f2a2a4d7c144d166cec17d54c00214d67c45f8 01-Jun-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix camera launch delay from Keyguard" into oc-dev
45ca0544ea03e04d1ecb11640484818fe2838c28 31-May-2017 Jorim Jaggi <jjaggi@google.com> Fix camera launch delay from Keyguard

When we launch the camera from the lockscreen, we launch a
trampoline activity that launches a real activity. Now, under
certain race conditions the trampoline activity was resumed but
then set to invisible immediately again such that the window
was never relayouted. Thus, the activity was stuck in
WAITING_RELAYOUT state in UnknownAppVisibilityController, leading
to a app transition timeout.

To fix this, we immediately remove the app from the unknown
visibility controller as soon as it gets set to invisible again.

Test: Set animation scale multiplier to 0, open camera, finish
activity by pressing back, turn off screen, launch camera via
double tap, observe no delay.
Test: go/wm-smoke

Fixes: 37677242
Change-Id: I103a89af5fb515d6635f86abe2c67a02d90abd79
m/UnknownAppVisibilityControllerTest.java
9c1b222fc1861f2e34fdac1cf1c2d624cebc4fd8 31-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix issue with aspect ratio not applying correctly when PIP is expanded" into oc-dev
a71febe2aaa2796cde538aa21c3e2ff006e7d3f3 22-May-2017 Winson Chung <winsonc@google.com> Fix issue with aspect ratio not applying correctly when PIP is expanded

- The current code always used the default min edge size to calculate the
PIP bounds when the aspect ratio changes, so if a PIP app sets the aspect
ratio in response to the an action, the bounds would be resized down
incorrectly.
- This CL fixes the issue with current aspect ratio not being initialized
correctly, and also ensures that SystemUI always updates the min edge
size when expanding the PIP.

Bug: 38324839
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: go/wm-smoke

Change-Id: Ida0f68b2f8f93f9bf1915dda8762a156704d4709
m/ActivityTestsBase.java
ae73ba4c591630bd5f90b8e8e3ceaed3be20fa56 05-May-2017 Bryce Lee <brycelee@google.com> Do not always skip preparing window to display when already visible.

The window flag FLAG_TURN_SCREEN_ON relies on this method to properly
flag the screen to turn on. An optimization was put in place to skip
this method when the window was already visible. As a result, we would
skip turning the screen on if the activity was recreated.

This changelist addresses this issue by causing this method to execute
always if the flag is set.

Change-Id: I82c05c66136f7cc252b8d574d305809d455732ce
Fixes: 37432034
Test: bit FrameworksServicesTests:com.android.server.wm.WindowStateTests#testPrepareWindowToDisplayDuringRelayout
Test: go/wm-smoke
m/WindowStateTests.java
9eb635c428367f0b67ed8acd5bc11f3275c400af 25-May-2017 Bryce Lee <brycelee@google.com> Merge "Use cached keyguard flags during relaunch." into oc-dev
ef4e38f96fa696e92629e87edaabad151e5248f8 25-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Ensure that windows are drawn before starting transition into PiP." into oc-dev
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
m/BoundsAnimationControllerTests.java
b80cffad4bd64daf643302a99a9172c8536c27ff 25-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix flaky tests" into oc-dev
081554b2e65b794189cd1412684d7fa9d07602fb 25-May-2017 Bryce Lee <brycelee@google.com> Use cached keyguard flags during relaunch.

It is possible for the display to be unfrozen before an
AppWindowToken is finished relaunching. This allows for other window
containers (such as the StatusBar) to influence the rotation when
unfreezing.

This changelist prevents the cached keyguard flag values for the
AppWindowToken when relaunching. This prevents incorrect values from
being reported during transient relaunch window states.

Fixes: 38262879
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests#testKeyguardFlagsDuringRelaunch

Change-Id: I2aa23ac282cf7626bb187c6cd1a4a3524f788877
m/AppWindowTokenTests.java
153badbf417c3b32fb2702c723185882ca1b3ba2 24-May-2017 Jorim Jaggi <jjaggi@google.com> Fix flaky tests

Need to wait until handlers are idle because the display gets
frozen when adding a new one, which will screw up starting window
creating.

Test: AppWindowContainerControllerTests x1000
Change-Id: Ic949efc4e53abe2a580eb5c410f5905f0361a75a
Fixes: 62037783
m/WindowTestsBase.java
cfeff74317f19d5b90335c3e458ef055bdbd17cd 23-May-2017 Jorim Jaggi <jjaggi@google.com> Fix starting window leak when adding/removing quickly

The following race condition may happen when transferring starting
windows:
- Add thread (android.anim) calls Snapshot.create
- Remove thread (android.display!) checks that yes there is a
starting window, but no surface yet. Thus, it nulls out everything.
- Add thread returns from Snapshot.create: container.startingData
is null but startingWindow is also null. Thus, we never set
abort=true and we never set the starting window properly or remove
it properly.

Test: Some basic starting window sanity testing. Otherwise, pray
to the race condition gods.
Test: AppWindowContainerControllerTests#testAddRemoveRace
Fixes: 37888853

Change-Id: Ia287bfa52f708b36ff93ef7cd45a0d080bd4dd9c
m/AppWindowContainerControllerTests.java
9765bcf76113ce2bd3d75c067021741bf7c3e521 23-May-2017 Sudheer Shanka <sudheersai@google.com> Merge "Skip ConnOnActivityStartTest and CoreSettingsObserverTest." into oc-dev
f3bb49b02ae80a612dd7179dd15ba2c3986db912 19-May-2017 Sudheer Shanka <sudheersai@google.com> Merge "Update PackageSettingBase.usesStaticLibraries correctly." into oc-dev
ff4cc4ebb516a39c6f3252a240a57646c3354484 19-May-2017 Keun-young Park <keunyoung@google.com> Merge "Wait for keyguard draw before stopping boot animation" into oc-dev
4136d2d54b986a09b237aee30974d3c00d308338 08-May-2017 Keun-young Park <keunyoung@google.com> Wait for keyguard draw before stopping boot animation

- Add check for keyguard drawn before stopping boot animation.
Otherwise blank screen can happen.
- Bind to keyguard service when sysui is launched to reduce waiting
time later.
- Increase keyguard timeout to 5 secs if it is not boot completed.
Otherwise (= normal screen on), keep the current 1 sec.
This timeout can still lead into blank screen so use bigger timeout
during boot-up to prevent such case.

bug: 37867510
Test: many reboots

Change-Id: Ibfdc42d295bb1d3f5b4ea316fe5aca9ab875e4be
m/TestWindowManagerPolicy.java
64900ad13ccaa78b163d73783d484ccc4a7c607d 19-May-2017 Jorim Jaggi <jjaggi@google.com> Merge "Take snapshot when screen is turning off" into oc-dev
009d0460f055b5e7fc7922891058d1189a7fbe59 19-May-2017 Jorim Jaggi <jjaggi@google.com> Merge "Purge StoreWriteQueue items to avoid system health issues" into oc-dev
cb2b2ef73cd245b61292d2f8b524dc2da40df99e 19-May-2017 Sudheer Shanka <sudheersai@google.com> Skip ConnOnActivityStartTest and CoreSettingsObserverTest.

- ConnOnActivityStartTest is consistently failing because the device
doesn't have network connectivity. This test probably needs to be moved to a
different test suite but for now just skipping the tests.
- CoreSettingsObserverTest is failing because the test depends on a mock
settings provider but since the Settings class caches the provider
object, the test will end up using real settings provider and fails.

Bug: 38432755
Bug: 38433611
Test: N/A
Change-Id: I0504d9f0df14a0f952e32c8572eefe9ccfebfd2c
m/CoreSettingsObserverTest.java
et/ConnOnActivityStartTest.java
51304d7380b6122ac55645fd9085ba071b04afa9 17-May-2017 Jorim Jaggi <jjaggi@google.com> Take snapshot when screen is turning off

Since we can't take a snapshot when screen is turned off, we need
to snapshot before we are turning the screen off. For this, we
- Add a callback from DisplayPowerController to give policy a
chance to do something before display will be turned off.
- Implement this callback by taking snapshots of all visible
tasks.

Test: Inspect logs/traces about screen off blocking to make sure
callback is working correctly.
Test: Insert artificial 500ms delay in onScreenTurningOff and make
sure we are unblocking screen off when turning on screen in the
meantime.
Test: Open Maps, go to recents, open maps again, scroll to another
location, toggle power button, make sure the old location isn't
shown during unlock.

Change-Id: I489f31358f838d418f894f996495946084f136a4
Fixes: 37107783
m/TestWindowManagerPolicy.java
ef3651cff41b929b2fc0c3bd6effe93257f4d831 18-May-2017 Jorim Jaggi <jjaggi@google.com> Purge StoreWriteQueue items to avoid system health issues

If queue gets too deep we may run out of memory or cause other
system health issues.

Test: TaskSnapshotPersisterLoaderTest
Bug: 38416992
Bug: 37631016
Change-Id: I725c9a458f78af2e625f2451bb0030176035f596
m/TaskSnapshotPersisterLoaderTest.java
5a270bcd6665c705b9b761f8e956356fb492218e 18-May-2017 Andrii Kulian <akulian@google.com> Merge "Don't report displays that are going to be removed" into oc-dev
95cf170ce94f51e9455304207ab20d4bd7109697 17-May-2017 Phil Weaver <pweaver@google.com> Merge "Match attributes to actions for pip a11y" into oc-dev
c7a31d197028bb537cdd01e195cf1fbacd259f2d 17-May-2017 Jorim Jaggi <jjaggi@google.com> Merge "Use ArrayList as children" into oc-dev
b6f06813b1eccbd96a6a71de599a36a3a3e08955 16-May-2017 Sudheer Shanka <sudheersai@google.com> Update PackageSettingBase.usesStaticLibraries correctly.

Change-Id: Ie18f3a621a2a24ee385593454f45d4713ca8bd1f
Fixes: 36844859
Test: manual &&
android.os.cts.StaticSharedLibsHostTests - Same pass/failures before and after this change &&
runtest -c com.android.server.pm.PackageManagerSettingsTests#testInsertPackageSetting \
frameworks-services
m/PackageManagerSettingsTests.java
0214ed9b119cdbc87cfc12908635deaf16603fe5 16-May-2017 Andrii Kulian <akulian@google.com> Don't report displays that are going to be removed

When display is removed from system, it is immediately removed from
AM, but removal can be deferred in WM if there is an active animation
on that display. If AM then requests display ids in focus order from
WM, it might get a display that was already deleted in AM.
This CL skips displays marked for deferred removal.

Bug: 38166277
Test: DisplayContentTests#testDontReportDeferredRemoval
Change-Id: I49544963f476fc58a609094781ed46541af8a238
m/DisplayContentTests.java
cda99f106bcc87a6abae1ac2977a2a30d6f8ad4d 16-May-2017 Christine Franks <christyfranks@google.com> Merge "Fix broken retaildemo tests" into oc-dev
612bb885bcef87034070e8e3bfc0b0e953c0f606 16-May-2017 Jorim Jaggi <jjaggi@google.com> Use ArrayList as children

Such that traversal is O(n) instead of O(n²)

Test: WindowContainerTests
Bug: 32668632
Change-Id: Ie52026a76a0f65c71ff6bd35d13b3d0c5d44bb3f
m/WindowTestUtils.java
e25dbaa619bab4291e1013582a0b59e7b82d4db8 09-May-2017 Christine Franks <christyfranks@google.com> Fix broken retaildemo tests

Bug: 38162695
Test: runtest frameworks-services -c
com.android.server.retaildemo.RetailDemoModeServiceTest &&
runtest frameworks-services -c
com.android.server.retaildemo.PreloadAppsInstallerTest

Change-Id: Iac60202414753b3e04e89cb29271cbd150a3acdd
etaildemo/PreloadAppsInstallerTest.java
etaildemo/RetailDemoModeServiceTest.java
28f0fd7a2d5b26a728d72984a8cf69ac0fcc4400 16-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Invoke BLKSECDISCARD to securely delete sensitive data" into oc-dev
70aa4d18be4865ef28795aa9e78f6b36ac437d8a 15-May-2017 Jorim Jaggi <jjaggi@google.com> Also add starting window when activity is not alive

The fact whether the process is running or not is not necessarily
a reason to not show a starting window. Sometimes the process with
an activity gets killed, but later gets restarted because of some
broadcast or service without recreating the activity. In this
case, we still need a splash screen to hide the recreation delay,
which is usually as expensive as if the process is not running.

Test: Open Calendar, kill `pid calendar`, reopen it, make sure
starting window is shown.
Test: As above but with a couple of other apps - with and widhout
trampoline activities.
Test: Boot freshly and open a couple of apps from recents

Change-Id: I8c4f928fca77b5446cab55c89bc69adbaaaa8da3
Fixes: 37951698
m/AppWindowContainerControllerTests.java
ee67b61bb08ab09be413f181f948f6359f4c256d 27-Apr-2017 Rubin Xu <rubinxu@google.com> Invoke BLKSECDISCARD to securely delete sensitive data

Bug: 34600579
Test: manual - change device lock under synthetic password, verify
old data on disk is erased.

Change-Id: I247bd1f095dd27335e671981f9e2d77e149af84f
Merged-In: I247bd1f095dd27335e671981f9e2d77e149af84f
aseLockSettingsServiceTests.java
ockSettingsStorageTests.java
ockLockSettingsContext.java
ockStorageManager.java
daf0506f4513b59a3e023ed528aaec52095e5456 13-May-2017 Jaekyun Seok <jaekyun@google.com> Merge "Fix broken PackageParserTest" into oc-dev
d7bd16b258d3a35b07a4dbf6c4ae78587f5fdcc8 13-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Updating AppWidgetServiceImplTest as per Mockito changes" into oc-dev
027f4753bcdbef5a830ed877f974701727e98d19 12-May-2017 Wale Ogunwale <ogunwale@google.com> Fixed exceptions during test tearDown

- Acquire WM lock when tearing down test. Prevent the handler thread
from modifying state at the same time.
- Don't set surface boundaries on window states without a surface
control.
- Avoid exception if process can read screen-edge-insets for Pip.

Change-Id: If4a2438032866eaec84ed79c30c1d716e0f89758
Fixes: 38113905
Test: this is it!
m/WindowTestsBase.java
79255161042bf60bd890923104b3444a730295b5 12-May-2017 Sunny Goyal <sunnygoyal@google.com> Updating AppWidgetServiceImplTest as per Mockito changes

Bug: 38251013
Test: adb shell am instrument -e class com.android.server.appwidget.AppWidgetServiceImplTest \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: I847335e1c5f9b720b2eecbac1b89b95d9b695e47
ppwidget/AppWidgetServiceImplTest.java
fe77bbc98a9b5a6aca385911d6c51b44b4e709c4 12-May-2017 Jaekyun Seok <jaekyun@google.com> Fix broken PackageParserTest

The PackageParserTest has been broken since ag/2084396 was merged.

Test: runtest --path services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java
Bug: 38250904
Change-Id: Ief35d9e1227f9e2f43343d52e47fe02ee126f0c4
m/PackageParserTest.java
424e328bba28632f43e69ab10377c56603a898c1 11-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add uniqueId to Virtual Display and pass through to inputflinger (1/2)" into oc-dev
a9154ab39112f30b9f90e62b79c6ed8f43dfc5bb 11-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added isUserNameSet" into oc-dev
b0608636a29bcec8ecb4391cd50f29f68b3e7e81 05-Apr-2017 Santos Cordon <santoscordon@google.com> Add uniqueId to Virtual Display and pass through to inputflinger (1/2)

This CL adds:
1) Adds uniqueId (protected via system/sig permission) to virtual
displays.
2) Add support for N virtual display viewports into inputflinger.
3) Set the virtual display's viewports in inputflinger if it has the
uniqueId value set to non-null. (a) Moving the new viewport from java to
native inputflinger and (b) adding "uniqueId" value to viewports makes
up the great majority of this change.
4) From the inputflinger side, we also read in a new value from the
input device configuration files called 'touch.displayId'.
5) When touch.displayId and the virtual display's uniqueId match,
inputflinger links the two.

Test: Start VR and ensure that the virtual viewport shows up when running
'adb shell dump input". Run a VR app, and ensure that the virtual input
device is associated with the new virtual viewport.
Test: com.android.server.display.DisplayManagerServiceTest

Bug: 36051620
Change-Id: Ic2117eb8e19f7f3c59687160591f8bc6692c1f12
Merged-In: Ic2117eb8e19f7f3c59687160591f8bc6692c1f12
isplay/DisplayManagerServiceTest.java
ef5700667fc19a5a903d14e3d90b2d4aed2f2e5c 11-May-2017 Makoto Onuki <omakoto@google.com> Merge "Reconnect to DAService after binding is dead" into oc-dev
605b12a6d0110c81d63e78e93f299a6b5753da46 11-May-2017 Fyodor Kupolov <fkupolov@google.com> Added isUserNameSet

It can be used to check that the value returned by getUserName() was set
by the user and is not a default value returned by the system.

Test: UserManagerServiceUserInfoTest pass
Bug: 38138381
Change-Id: I0ca37970fda548508190bffd1fa7be95d4a15076
m/UserManagerServiceUserInfoTest.java
31ef1394663ff7f36be36e63898544afc6a10c66 11-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Offload saving bitmaps from binder threads" into oc-dev
09c529a9bc85bfd0d50b65f447472ad064eac16c 01-May-2017 Makoto Onuki <omakoto@google.com> Reconnect to DAService after binding is dead

- When the DO/PO process crashes twice with a short interval, AM gives up
and the binding will be "died". Once binding is in this state it'll never
be re-connected.

(Still, DO/PO can disable and re-enable their DAS to force DPMS to bind again
though.)

- Detect this and re-connect after one hour.

- Back-off time will be exponentially increased and never reset until DPMS
explicitly re-connects, which happens when:
-- the device rebooted,
-- the user stopped and re-started, or
-- the DAS is disabled and re-enabled.

Test: adb shell am instrument -e class com.android.server.am.PersistentConnectionTest -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyConstantsTest -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w com.android.frameworks.servicestests
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 VERBOSE -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceAdminServiceDeviceOwnerTest
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 VERBOSE -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceAdminServiceProfileOwnerTest

Bug 37711907

Change-Id: Ie0b227a94e6ce85d72a969a4dea1020baf734e2f
m/PersistentConnectionTest.java
evicepolicy/DevicePolicyConstantsTest.java
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DpmMockContext.java
475c36539da9687d75447adb9054c98ce03c754a 08-May-2017 Makoto Onuki <omakoto@google.com> Offload saving bitmaps from binder threads

Bug 34691191
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
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 CtsShortcutManagerTestCases
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 CtsShortcutHostTestCases
Test: Manual test with the phone app

Change-Id: Ibccf8ca162eae9179ee4cbdf0307ff34a6953aa1
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest2.java
39791594560b2326625b663ed6796882900c220f 26-Apr-2017 Bryce Lee <brycelee@google.com> Prevent non-fullscreen activities from influencing orientation

This changelist enforces that activities targeting O and beyond
can only specify an orientation if they are fullscreen. The
change ignores the orientation on the server side and throws an
exception when the client has an orientation set in onCreate or
invokes Activity#setRequestedOrientation.

Fixes: 33483680
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testNonFullscreenActivityProhibited
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testLegacyNonFullscreenActivityPermitted
Change-Id: I4f7f79744918fad6465a537633dfadec8d05c6df
m/AppWindowTokenTests.java
64d6e3e11d477bc94815235e514187e0d9642c7f 09-May-2017 Phil Weaver <pweaver@google.com> Merge "Fix crash in a11y cache" into oc-dev
d193972a7fa6fe692f2a1c58c50dbc6ed22603c7 09-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixed issue with associating WindowToken with null binder." into oc-dev
2f569ed618f0eb834efb7a27c57d8ca43bcf4f1b 08-May-2017 Wale Ogunwale <ogunwale@google.com> Fixed issue with associating WindowToken with null binder.

App don't have to specify a LayoutParams.token when adding a window to
the system, however when they don't WM maps all the windows to a single
WindowToken mapped to a null IBinder. This isn't correct since the
windows can be coming from different apps and also null binder shouldn't
be used to map tokens.
We now:
1. Associate the WindowToken with the IWindow client for bookkeeping in
WM if the app didn't specify LayoutParams.token for the window it is
adding.
2. Throw an illegal argumenet exception we we try to associate a null
binder with a window token or null window token with a binder on a
display.

Fixes: 38021710
Test: Start an alert window, lock and unlock the phone, long press to
bring up power dialog, and tap outside it to make sure it goes away.

Change-Id: I6816b7fb9b9a0a8f5387062bada862eb75004e4f
m/WindowTestUtils.java
3da4c44d73fa038c3f24ac1a25395469d4a91394 06-May-2017 Justin Klaassen <justinklaassen@google.com> Night display status restored until valid state

Fixes: 38013048
Test: runtest -c com.android.server.NightDisplayServiceTest \
frameworks-services

Change-Id: I8dc4177f89727a29ee6ab8e3db5a23c8127b800c
ightDisplayServiceTest.java
9ccb15a351c3732b4dd8f55eb100756b0f88a9e8 05-May-2017 Makoto Onuki <omakoto@google.com> Merge "Show warning log when ShortcutInfo is re-published" into oc-dev
4e9002e69a7fd24acd3aba5ee70a9d5ef17c1960 05-May-2017 Daniel Nishi <dhnishi@google.com> Merge "Use the StorageStatsManager in FileCollector." into oc-dev
943ebe705cece8f643d9d7ace005322ddf114d86 04-May-2017 Bryce Lee <brycelee@google.com> Prevent NPE in ActivityStack#shouldbeVisible.

If there is a visibleBehind activity, we check to see if the top
activity in the top stack is not fullscreen. However, it is possible
for the top stack to be empty. This can happen if the previously top
activity is being re-installed.

This changelist addresses the issue by checking if the top activity is
null before referencing it.

Change-Id: I6de904bed1c7035ed1e112c9cacc1b6c2bac4e8f
Fixes: 32180256
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackTests#testShouldBeVisibleWithVisibleBehindActivity
m/ActivityStackTests.java
m/ActivityTestsBase.java
914d4bf10f8ad7f04769b9a18d19cd3de8d886f2 05-May-2017 Vladislav Kuzkokov <vkuzkokov@google.com> Merge "Store "block uninstall" flag separately from the rest of package state." into oc-dev
bd886e52b8e1f0f9592fd9390155e9f01bfc16f8 05-May-2017 Aurimas Liutikas <aurimas@google.com> Merge "Avoid reflection when mocking UserManagerService" into oc-dev
22e0d48bbe15293da067eefe3a73ef59fa66b062 05-May-2017 Phil Weaver <pweaver@google.com> Match attributes to actions for pip a11y

When we strip and replace actions for UIs inside a picture-
in-picture window, make sure attributes match. For example,
if an node was clickable and exposes ACTION_CLICK, when
removing actions we must clear both the click action and
the clickable attribute.

Bug: 37923645
Test: Updating unit tests
Change-Id: I84de5cae136bccb20b2234aef59bf5e0a7c15949
ccessibility/ActionReplacingCallbackTest.java
2fbfb105eebfc3e45282c6b73451e6fafe32f717 04-May-2017 Fyodor Kupolov <fkupolov@google.com> Avoid reflection when mocking UserManagerService

Fixed a crash due to a change in the private constructor signature

Test: PackageManagerSettingsTests are passing
Bug: 37989886
Change-Id: I5d46f6018b4bdb369b2e39ad3020235e7f2c5a2e
m/PackageManagerSettingsTests.java
bf563b63e5d3672ec102ee191a301e49e472139b 04-May-2017 Makoto Onuki <omakoto@google.com> Show warning log when ShortcutInfo is re-published

Bug 37986391
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: Id9ca30068440915d2e86850fe2ed3684c0ce2af8
m/ShortcutManagerTest1.java
253984ed8c8f39fa0aa9c5f4addf2f44f334c749 24-Oct-2016 Vladislav Kuzkokov <vkuzkokov@google.com> Store "block uninstall" flag separately from the rest of package state.

This allows to set "block uninstall" prior to installation and avoid the
inevitable race that happens when Device Policy app tries to force install and
then immediately block uninstall.

BUG=31043188
Test: Block com.chrome.beta in TestDPC. install, fail to uninstall through adb, unblock, uninstall

Change-Id: I5ffa2abcb003982eccfb77585c43b59532dd501d
(cherry picked from commit 1fff9dcb9d0a4d7224ff8aa0f39e82df0b30152c)
m/PackageManagerSettingsTests.java
m/PackageUserStateTest.java
2ecf42f96c9d9ee0d1c849cc8961d703dc037e10 04-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added TaskSnapshotCacheTest back to presubmit" into oc-dev
61a1fabab68436de7315f0c4b5270b9c84e48667 03-May-2017 Phil Weaver <pweaver@google.com> Fix crash in a11y cache

Caused by bad data from an app where a node was its own ancestor.
When the node changed, the copy in the cache was recycled while
flushing the descendants. Now recovering more gracefully.

Bug: 37674439
Test: Adding a unit test for this case, ran a11y cts and unit tests,
verified that the app reporting bad data no longer crashes TalkBack.
Change-Id: I10bc9df2b4821529334a19aa27719c1510187690
ccessibility/AccessibilityCacheTest.java
5d230dc202cb03185652e12b3024ceea1132dd4d 10-Apr-2017 Daniel Nishi <dhnishi@google.com> Use the StorageStatsManager in FileCollector.

This should vastly improve the speed of the FileCollector and
resolves the null context issue from the previous variant.

Change-Id: I16a70cd0376511b095b1d7fe1c25e8df95263bc1
Fixes: 35807386
Test: Existing tests continue to pass.
torage/DiskStatsLoggingServiceTest.java
d05dda1d40e2867825e6e4b35986f9c4ca1e98cf 04-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'allow_none_scorer' into oc-dev

* changes:
Revert permission check on setActiveScorer.
Allow the active scorer to be set to NULL.
bf08eb6da7d37b9ef035975068187905afe2d975 03-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix snapshots for secure windows" into oc-dev
68e882ce7f64d12a61de4f0a27403ecb3b70efae 03-May-2017 Wale Ogunwale <ogunwale@google.com> Added TaskSnapshotCacheTest back to presubmit

The problem the test was having was fixed by ag/2179887

Also, fixed NPE during test tear down.

Change-Id: I974fcb9a12928dd4494525f9bae5c7c448657e30
Fixes: 35196891
Bug: 37682538
Test: TaskSnapshotCacheTest
m/TaskSnapshotCacheTest.java
m/TaskSnapshotPersisterTestBase.java
d635a4ae20014b6ff52d8b05e7f4f622808d4efd 03-May-2017 Jorim Jaggi <jjaggi@google.com> Fix snapshots for secure windows

First, also draw system bar backgrounds when drawing a fake
snapshot. For that, refactor the drawing into a separate class so
it can be reused. Also enable fake snapshots for secure windows.

Test: com.android.server.wm.TaskSnapshotControllerTest
Test: com.android.server.wm.TaskSnapshotSurfaceTest
Test: Secure activity with resuming delay, make sure system bars
are covered when reopening app.

Bug: 35710126
Change-Id: I2f0ebc7e7acb80015780a4e882f0a472599efa30
m/TaskSnapshotControllerTest.java
m/TaskSnapshotSurfaceTest.java
e5bb03e2ea8cf0d7ab98fb6e6f8db1007d8d48d2 11-Feb-2017 Christine Franks <christyfranks@google.com> Night display status restores on reboot/user change

Fixes: 30086742
Test: runtest -c com.android.server.NightDisplayServiceTest \
frameworks-services
Change-Id: I264be077e607baf8e19496f0c57549a907668005
ightDisplayServiceTest.java
42bab7897f16c884d5c40ccc8a09f3e9f3338a65 02-May-2017 Wale Ogunwale <ogunwale@google.com> Disable flaky DisplayContentTests#testFocusedWindowMultipleDisplays

Reduce pre-submit noise. We can re-enable once we figure-out why it
is flaky.

Bug: 37908381
Test: disabled!
Change-Id: Ia82ba73fafafc433487027f2ee2d582dceb65ed2
m/DisplayContentTests.java
a9f933e53a6f4cf6152b0525cfafc602e5c3798f 28-Apr-2017 Jeremy Joslin <jjoslin@google.com> Revert permission check on setActiveScorer.

Reverted to the pre-O behavior of allowing the call if the caller
has the SCORE_NETWORKS permission.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 37722313
Change-Id: I54a99dde364d6a5c88d35072922020542c6ae003
etworkScoreServiceTest.java
7aa0b0d94e577cb0e9620f0ea53ed37795be7e52 27-Apr-2017 Jeremy Joslin <jjoslin@google.com> Allow the active scorer to be set to NULL.

Setting the scorer to NULL will disable scoring/recommendations.

Test: runtest frameworks-services -c com.android.server.NetworkScorerAppManagerTest
Bug: 37722313
Change-Id: I8bdc43aa80cc2d6668ffa24389a8e4e9aaf95bd6
etworkScorerAppManagerTest.java
f323e3a5435ac21c6a5684e0aeba5f26ea699f9d 01-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Move the last user save from onCleanupUser to onStopUser" into oc-dev
01ce92b8ac98da3887515e4aa85353ac6cbcbd01 28-Apr-2017 Makoto Onuki <omakoto@google.com> Move the last user save from onCleanupUser to onStopUser

Bug: 37780857

Test: manual test with work profile

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Change-Id: I8b053c6a55df374a89ab85d76b9d36abf639f649
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
4d09adcef11a4a26126d73ff9f452667303b1db7 01-May-2017 Salvador Martinez <dehboxturtle@google.com> Merge "Added dialog to notify user of thermal shutdown" into oc-dev
0152fd36861cc7f4a2f191719de6f40e2d068b44 30-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixing test due to null PiP default bounds." into oc-dev
5bb8294f926dcaf4a7288ba4457d84d57bb4ab53 29-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add managed profile whitelist to control NotificationListenerServices" into oc-dev
060f0f0341307104f3e54a8391ba334db89b9ae8 29-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "A11y changes for API council" into oc-dev
ef1648c2cd4a2ffc198d85be316fcacb9613a642 29-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Don't try to create user for task snapshot tests" into oc-dev
9c844410572cd432f589d3e1c5a8ea5b67647775 28-Apr-2017 Winson Chung <winsonc@google.com> Fixing test due to null PiP default bounds.

- Also moving the default bounds call into the pinned stack window
controller

Bug: 37682538
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests\#testReplacingTaskInPinnedStack

Change-Id: Id6608d484617ec1a596e608aab649a082b4b1e95
m/ActivityTestsBase.java
83d139bd1b3e3b93a8c9a1f0572438c024bbe679 29-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Use List instead of array in network logging API." into oc-dev
e163126d2e27ce1fbd5c74279dfb5d05c97b8392 29-Apr-2017 Wale Ogunwale <ogunwale@google.com> Don't try to create user for task snapshot tests

Seems user creation can fail in test harness some times.
Also, I am not sure there is a need to create a user in this
case when we can just use the user id of the current process.

Also removed SettingBackupTest from @Presubmit since it is still
failing.

Bug: 37684646
Bug: 37682538
Test: SettingsBackupTest
Test: TaskSnapshotPersisterLoaderTest
Change-Id: I523bb576217f7782027741916f9ea14fc6d7fb50
m/TaskSnapshotPersisterLoaderTest.java
m/TaskSnapshotPersisterTestBase.java
be2922ff34424cfb996d895cde0cb31c724d09dc 28-Apr-2017 Phil Weaver <pweaver@google.com> A11y changes for API council

Bug: 37749679
Bug: 37747749
Bug: 37737948
Bug: 37718183
Bug: 37720667
Bug: 37724600
Bug: 37708057

Test: Updating unit and cts tests, which still pass.
Change-Id: If28bdf985c4314e8e84dcd6510f406dd4e80dd38
ccessibility/AccessibilityGestureDetectorTest.java
ccessibility/FingerprintGestureControllerTest.java
ccessibility/GestureDescriptionTest.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
m/PackageParserTest.java
f09a16628dd42fb3b45ec41c508543d42c8d98d6 28-Apr-2017 Pavel Grafov <pgrafov@google.com> Use List instead of array in network logging API.

Bug: 37625453
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
Test: ts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceOwnerTest#testNetworkLoggingWithSingleUser
Change-Id: Icba7e3178202e0e650689d98c4010a9b40c6a53c
evicepolicy/NetworkEventTest.java
90357d62e9908730bb3c781a402db455bf473596 28-Apr-2017 Pavel Grafov <pgrafov@google.com> Merge "Introduce DISALLOW_BLUETOOTH_SHARING." into oc-dev
cfbe105e4bade5f1143d0f3411b638690bae19ba 28-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Rename FingerprintGestureCallback.onGesture" into oc-dev
d08c064976dccdde8a5a9a6066bdcff40ae16fbe 27-Apr-2017 Bryce Lee <brycelee@google.com> Merge "Don't call adjustFocusedActivityStackLocked on finished activity." into oc-dev
a6ea92097cf85b78958f25fb53e312be0399df35 27-Apr-2017 Pavel Grafov <pgrafov@google.com> Use InetAddress instead of String in network events.

This is a conservative change that converts strings to
InetAddress on the fly just before givint it to the client.

Also renamed getIpAddressesCount to getTotalResolvedAddressCount
to make it 1) harder to misuse it as getInetAddresses().length
2) more descriptive.

Bug: 37625453
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceOwnerTest#testNetworkLoggingWithSingleUser
Change-Id: I2a31dddd6874f1a629895e4dff105cf41984a775
evicepolicy/NetworkEventTest.java
4f4f6f83c20162814e95e9ca0654eee89a818bde 28-Mar-2017 Pavel Grafov <pgrafov@google.com> Introduce DISALLOW_BLUETOOTH_SHARING.

When this restriction is enforced Bluetooth sharing option should not be
present when the user tries to share something. Previously this was handled
by explicitly disabling bluetooth sharing activity during managed
provisioning, now this code is to be removed (see topic CLs) and the same
behavior should be achieved by setting this restriction for profile owners
by default.

In Bluetooth:
1) Don't check restrictions on boot, it is invoked anyway through the
listener during boot.
2) Ignore when the restriction is "changed" from true to true - i think
it was the initial intent in that condition.
3) Disable the component for a particular user and not always the
system user. This is something that has to be fixed in O I think since
currently in secondary user the bluetooth itself gets disabled but the
sharing thing still shows up.

In DPMS:
1) Now ActiveAdmin for PO also contains a set of restrictions applied by
default.
2) Now all ActiveAdmins for POs are loaded quite early. That shouldn't
have huge impact though.

Bug: 36249732
Test: run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.ManagedProfileTest#testBluetoothSharingRestriction
Test: run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceOwnerTest#testBluetoothRestriction
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
Change-Id: I78c4ffbd503c4a10138e8c0862a9f206f24c5631
Merged-in: I78c4ffbd503c4a10138e8c0862a9f206f24c5631
(cherry picked from commit 7f4ad75218bdd3f1bdf9022a146147eae032cc0c)
evicepolicy/DevicePolicyManagerServiceMigrationTest.java
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DpmMockContext.java
a6f7b25c3d160be02cb7384f154a1f77a8faaffa 10-Apr-2017 Salvador Martinez <dehboxturtle@google.com> Added dialog to notify user of thermal shutdown

tldr; Have the phone check when it reboots if it last shut
down due to heat. If so, we should show the user an
notification and dialog giving them more details.

- Added hidden api to allow apps to query system_server
for the reason the phone last rebooted
- Added notification that is shown when the phone is
booted if the last shutdown was due to excessive
heat.
- Added dialog to provide more details about the
shutdown if the notification is tapped.
- Added tests to verify that file is read and
as expected.
- Updated code for high temperature warning that
is shown while the phone is running to avoid
mixups in the future.

Test: FrameworksServiceTests
Bug: 30994946
Change-Id: Ic25f42539911c89ba7f1834e206f7931d65c2865
ower/PowerManagerServiceTest.java
9c6458dd58106538e790bbc702dbc10798e1bd18 30-Mar-2017 Esteban Talavera <etalavera@google.com> Add managed profile whitelist to control NotificationListenerServices

Only let notification listeners installed in the primary profile
see work profile notification if allowed by policy

Bug: 36657192
Test: runtest systemui-notification
Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services
Change-Id: If719151644380e9162180a24d12f798e42867c0a
(cherry picked from commit 7e4cbadc6a561be62bf3b5e4c949bbb863018cc7)
evicepolicy/DevicePolicyManagerTest.java
424dd39e256b880b0a18d8570daf399885a7567b 27-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "setAffiliationIds and getAffiliationIds uses set instead of list" into oc-dev
3165743c5040fb47a32ef30ccb7ffe11275a547e 25-Apr-2017 Tony Mak <tonymak@google.com> setAffiliationIds and getAffiliationIds uses set instead of list

Didn't use @remove because java doesn't support two methods differs from
the return type only.

Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerTest#testLockTask_unaffiliatedUser
Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerPlusProfileOwnerTest

Change-Id: Ic7c7221ef5e680a6765f028c2ab73d4c2f908c58
Fix: 37622682
evicepolicy/DevicePolicyManagerTest.java
d7e1fb89d961636bcb98777efbb39c987fad2b7d 27-Apr-2017 Phil Weaver <pweaver@google.com> Rename FingerprintGestureCallback.onGesture

Renaming to onGestureDetected.

Deprecating onGesture. It needs to be removed for release.
Leaving it in to avoid breaking TalkBack, which is using it.

Bug: 37708057
Test: Accessibility unit and CTS tests still pass.
Change-Id: Icd66889216fc978ad6d27aa83a8c8d13869daad3
ccessibility/FingerprintGestureControllerTest.java
3345c4ea9687bb35a8c419ec21ec90b49616b2c9 25-Apr-2017 Bryce Lee <brycelee@google.com> Don't call adjustFocusedActivityStackLocked on finished activity.

When an activity is finished, adjustFocusedActivityStackLocked is
already called on the associated record and the task association is
lost. Calling it again is redundant and leads to a crash as we
assume the task is still associated with the activity.

Change-Id: Ie7cc9ad8b1542d7415b7409e539c88d3b4ec8dcd
Fixes: 37329424
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackTests#testStopActivityWhenActivityDestroyed
m/ActivityStackTests.java
m/ActivityTestsBase.java
0f8764485b055d5f4904a3db201ca338b398347a 26-Apr-2017 Wale Ogunwale <ogunwale@google.com> Merge "Reduce use of static variables in window manager unit tests" into oc-dev
11cc516a925ac7fc814dbb0a79a7f0abfbfe1ce1 26-Apr-2017 Wale Ogunwale <ogunwale@google.com> Reduce use of static variables in window manager unit tests

This was causing test cross-contamination since different test might
expect different states from the variables.

Bug: 37682538
Test: tons of it!
Change-Id: Ie8a1ea400695b6346d7dfa3369b5c44bb467a33d
m/AppBoundsTests.java
m/AppWindowContainerControllerTests.java
m/AppWindowTokenTests.java
m/DisplayContentTests.java
m/StackWindowControllerTests.java
m/TaskPositionerTests.java
m/TaskSnapshotCacheTest.java
m/TaskSnapshotControllerTest.java
m/TaskStackContainersTests.java
m/TaskStackTests.java
m/TaskWindowContainerControllerTests.java
m/TestWindowManagerPolicy.java
m/UnknownAppVisibilityControllerTest.java
m/WindowContainerControllerTests.java
m/WindowFrameTests.java
m/WindowLayersControllerTests.java
m/WindowTestUtils.java
m/WindowTestsBase.java
m/WindowTokenTests.java
bad4573bd459c7a0219f56ddc208e84ff45cb7c6 25-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'experio-scoring' into oc-dev

* changes:
Remove Settings.CURATE_SAVED_OPEN_NETWORKS
Remove request recommendation from AIDL files.
Remove the recommendation request impl and test code.
Deprecate the recommendation request code.
b6a7dc033ceb11df2d4e95dc1bb272362332e557 18-Apr-2017 Dmitry Dementyev <dementyev@google.com> Update PACKAGE_REMOVED broadcast.

1) Include KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE.
2) Only send the broadcast to packages which were able to see the
account.

Test: manual, APCT.
Bug:37280078

(cherry picked from commit cbbc99f76224cedb6d680c3cd7f0afc9cc912202)

Change-Id: I3c323e545628199903313096f93654687fa8f22b
ccounts/AccountManagerServiceTest.java
9ebd87de8e87ad1f69970eeaff1d676ac4d7a8ec 22-Apr-2017 Sudheer Shanka <sudheersai@google.com> Merge "Fix flaky tests in ConnOnActivityStartTest." into oc-dev
faf37babb0bc0962c01750b222fc03bd197b0b62 22-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Let unlocked profile verifyCredential under unified lock" into oc-dev
4b32f7c676e014c3d59aac280be6a159cef3d4b8 21-Apr-2017 Jeff Sharkey <jsharkey@google.com> Merge "Fix code accounting bugs, track external app data." into oc-dev
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
etworkPolicyManagerServiceTest.java
c93cdef2fa5403ac46767f1853f4e803824d4d20 21-Apr-2017 Charles He <qiurui@google.com> Let unlocked profile verifyCredential under unified lock

When unified work challenge is enabled and the primary user is unlocked,
LockSettingsService should unlock the managed profile subsequently by
calling verifyCredential() in most cases. Previously,
verifyCredential() is not called on managed profiles when any one of the
two conditions are met:
1. when the profile is not yet running
2. when the profile is already unlocked
These were introduced to make sure the managed profile stays locked when
it is in QUIET_MODE (i.e. work mode off).

However, condition 2 is problematic. Specifically, it also prevents auth
tokens, etc., from being refreshed (side effects of verifyCredential()),
even when the profile is not in QUIET_MODE.

We remove condition 2 in this change to make sure verifyCredential() is
still called on the managed profile when it is RUNNING_UNLOCKED.
Condition 1 alone should be able to handle the QUIET_MODE case. Unit
test is also updated in case regression occurs.

Bug: 36851574
Test: runtest frameworks-services -c com.android.server.LockSettingsServiceTests
Test: runtest frameworks-services -c com.android.server.SyntheticPasswordTests
Test: CTS verifier > BYOD managed provisioning > Authentication-bound keys
Test: (all of above are run on both sailfish and angler)
Change-Id: Ice89c1eedacaf07e076252a2a571a1eb100ef791
aseLockSettingsServiceTests.java
ockSettingsServiceTests.java
9240fffcbb2a41c9270a1b480e1759417ccab85d 20-Apr-2017 Bryce Lee <brycelee@google.com> Merge "Do not pause resumed activity in resumeTopActivityUncheckedLocked." into oc-dev
b1a0139590448d706c778d22891efe80b05f11f2 14-Apr-2017 Jeremy Joslin <jjoslin@google.com> Remove the recommendation request impl and test code.

Removing most of the platform side request recommendation code and
its tests.

Test: adb shell am instrument -e class android.net.NetworkRecommendationProviderTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 37357264
Change-Id: I36e592c5c82c38aa2174a51cf02c6e9825ef4f11
etworkScoreServiceTest.java
b156c3a0064b652c37ea4185dfe413edc67b53ca 20-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Do not check user escrow state if synthetic password is not enabled yet" into oc-dev
5daa3121a92f5e3124b8db469aeddea269a4c1df 19-Apr-2017 Bryce Lee <brycelee@google.com> Do not pause resumed activity in resumeTopActivityUncheckedLocked.

A number of operations occur between setting the resumed activity and
notifying the activity to resume. One of these steps is updating the
configuration, which can cause the device to pause the resumed
activity. Since the activity has not been told to resume, this leads
to a pause before resume.

This changelist addresses the issue by checking whether we are in the
middle of resuming the top activity before attempting to stop the
currently set resumed activity.

Change-Id: I3b5b61de6b1b5a35b7773912b4e63d6c69096c04
Fixes: 35637717
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackTests#testNoPauseDuringResumeTopActivity
m/ActivityStackTests.java
96d27d826fadbc5e1f942db16dfd0b062ef0f3a4 20-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add shell command for turning on/off WebView multiprocess." into oc-dev
308f30b8e633bc808a1df675e76fca0c4ee58484 12-Apr-2017 Rubin Xu <rubinxu@google.com> Do not check user escrow state if synthetic password is not enabled yet

1. when adding escrow tokens, do not throw SecurityException if the user hasn't
migrated to synthetic password yet.
2. during migration, activate any pending escrow tokens.
3. Disable escrow before attempting to activate escrow tokens, this currently
includes whenever the user authenticates, and when synthetic password
migration happens.

Also, add some comments in SyntheticPasswordManager and remove an invalid call
to destroy escrow data.

Test: runtest frameworks-services -c com.android.server.SyntheticPasswordTests
Bug: 36776133
Change-Id: If4b9d385fb43e09d90b6dde6d25b4fcc0c6b7ddc
Merged-In: If4b9d385fb43e09d90b6dde6d25b4fcc0c6b7ddc
yntheticPasswordTests.java
aca246565a7426654685ff0653519f40af8a3b01 20-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Delay PiP transition to fullscreen until activities draw." into oc-dev
1c17139f19201ecf0f53f4cfd2304219650f5f16 20-Apr-2017 Sudheer Shanka <sudheersai@google.com> Fix flaky tests in ConnOnActivityStartTest.

Bug: 27803922
Test: runtest -c com.android.server.net.ConnOnActivityStartTest frameworks-services
Change-Id: I8fd47b3935819eaf86e3e4f312a75b1257153489
et/ConnOnActivityStartTest.java
ecc06b32305ac234db24e3f76bcae0199b80c395 18-Apr-2017 Robert Carr <racarr@google.com> Delay PiP transition to fullscreen until activities draw.

To avoid awful stretching.

Bug: 37473110
Test: Transition app fullscreen verify no awful video stretching.
Change-Id: I810a72207e45b8f83a63c9f0b3cc9a433569852c
m/BoundsAnimationControllerTests.java
b265016b0c02fde89e392b4637a70317b0a63545 07-Apr-2017 Gustav Sennton <gsennton@google.com> Add shell command for turning on/off WebView multiprocess.

Now that we are removing the WebView Multiprocess Developer Setting we
instead add a couple of shell commands for debugging purposes:
adb shell cmd webviewupdate enable-multiprocess
adb shell cmd webviewupdate disable-multiprocess

We also ensure that multiprocess for WebView is enabled after this
change - even if the user disabled it earlier.

Bug: 36513859
Test: Run WebViewUpdateServiceTest tests.
Test: Ensure disabling/enabling multiprocess through the new adb
commands causes WebViewZygote to be used accordingly, and kills apps
using WebView.
Test: Disable multiprocess on a previous OC-build, then flash a build
with this change in it, and ensure multiprocess is turned on
(multiprocess is currently on by default for all devices).
Change-Id: I923198781777e33848b671ec44f50bbc65b43e24
ebkit/WebViewUpdateServiceTest.java
f04390ed49f8152453c859519976767f4e1a8caa 19-Apr-2017 Keun-young Park <keunyoung@google.com> Merge "fs_stat: ignore quota fix caused by tree optimization" into oc-dev
6bea235195c7b2aa96e468c6107cfa9a616bebf3 18-Apr-2017 Keun-young Park <keunyoung@google.com> fs_stat: ignore quota fix caused by tree optimization

- tree optimization leads into quota fix which is not a real fix.
- Distinguish such case from real file system fix to get fs statistics
correctly.
- This is only for correct fs stat metric collection. There is no
functionality change in device side.
- Full parsing is only run when fs fix is detected from fs_stat.
Examplt of fsck fix that will be ignored as optimization:
e2fsck 1.43.3 (04-Sep-2016)
Pass 1: Checking inodes, blocks, and sizes
Inode 877141 extent tree (at level 1) could be shorter. Fix? yes

Pass 1E: Optimizing extent trees
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
[QUOTA WARNING] Usage inconsistent for ID 10038:actual (71667712, 1000) != expected (71671808, 1000)
Update quota info for quota type 0? yes

[QUOTA WARNING] Usage inconsistent for ID 10038:actual (59555840, 953) != expected (59559936, 953)
Update quota info for quota type 1? yes

/dev/block/platform/soc/624000.ufshc/by-name/userdata: ***** FILE SYSTEM WAS MODIFIED *****
- also added unit test for the fsck log parsing

bug: 36391645
Test: many reboots with fs_stat check, runtest frameworks-services -c com.android.server.BootReceiverFixFsckFsStatTest
Change-Id: I86a97a3b50ee573db51d19d2cd243b8f7795a165
ootReceiverFixFsckFsStatTest.java
0034788844fd053f87beee60092c1dd44c7046e2 18-Apr-2017 Jeff Sharkey <jsharkey@android.com> Fix code accounting bugs, track external app data.

When counting code size, don't include APKs baked into the system.

Settings already accounts external storage used by apps, so they
need a way to exclude that from the total space used by external
storage; give them new getAppSize() API.

Refine docs to explain that emulated storage might be included in
measured statistics.

Resolve symlinks as part of matching getUuidForPath().

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Bug: 35812899, 35844919, 37193650
Change-Id: Iec3ce8b336b71dc98a7d25fdd30fa78e9ee826dc
m/InstallerTest.java
bab3075e2ee85de8b0ac6c3961eae5156a95c699 13-Apr-2017 Sunny Goyal <sunnygoyal@google.com> Creating a common class for loading drawables and handling various badging

Test: Manually tested on device
Bug: 36591157
Change-Id: Ic847537d416650015cecaeb68f47f7f032e0dbaa
m/UserManagerServiceCreateProfileTest.java
467deff7e949d99451cd74c98bfbcc11e7a7e8f0 18-Apr-2017 Bryce Lee <brycelee@google.com> Merge "Allow at most one pinned stack task." into oc-dev
04ab3466fabb7244660adf54740a4f60874b02a1 11-Apr-2017 Bryce Lee <brycelee@google.com> Allow at most one pinned stack task.

This changelist enforces only one task may be present in the pinned
stack at a time. If a task is already persent, the existing task is
moved to the fullscreen stack.

Fixes: 36844394
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerPinnedStackTests#testPipMovedToFullscreenStack
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests#testDisallowMultipleTasksInPinnedStack

Change-Id: Iaf0fbda6df835d93738fdf6f7f3a8c5956c2b262
m/ActivityRecordTests.java
m/ActivityStackSupervisorTests.java
m/ActivityStackTests.java
m/ActivityTestsBase.java
m/TestWindowManagerPolicy.java
m/WindowTestUtils.java
3244faae2935ccaad333a22723ae382fa9517c32 18-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Cleanup that wasn't uploaded with ag/2094132" into oc-dev
d7852f43636c0a6be7023b6ac6fc17ad0f72b899 18-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AppErrors: Add test for AppErrorDialog.onCreate" into oc-dev
0da67d661e20a3361f0ee4f10a19d1b8edf5e73d 17-Apr-2017 Adrian Roos <roosa@google.com> AppErrors: Add test for AppErrorDialog.onCreate

Also refactor to make sure we always remove the TIMEOUT
message and clear the mProc.mCrashDialog field, even when
dismissing without the Handler.

Bug: 37351370
Test: runtest -c com.android.server.am.AppErrorDialogTest frameworks-services
Change-Id: If9fb348e8ed83c6c1c0f48fa7fd27ffd33b530f2
m/AppErrorDialogTest.java
0a20cf7ca46e1d0dd75b084d2f4165369bd817fa 14-Apr-2017 Mike Tsao <miket@google.com> Cleanup that wasn't uploaded with ag/2094132

I saw that Tree Hugger had verified, and hit submit without
remembering to repo upload the last patch set containing toddke's
most recent set of suggestions.

Bug: 37192695
Test: runtest -c com.android.server.pm.PackageManagerServiceTest frameworks-services
Change-Id: I4d6376165aaa615007891ba045c9b5c34e4b0394
(cherry picked from commit 338d332873c431c46057eae3c93ed79351ddd2e4)
m/PackageManagerServiceTest.java
7c31e7924cc1d7870aef4eeb9187cd2ad6549ea3 17-Apr-2017 Mike Tsao <miket@google.com> Merge "Add tests for ag/2086796" into oc-dev
11139e913c3b4897c6ff37606e614d3db1f23418 17-Apr-2017 Winson Chung <winsonc@google.com> Merge "Schedule PIP mode changes at the beginning/end of the transitions." into oc-dev
e400c441c2669b7b3643d70ecc5a637ecf8d2b54 11-Apr-2017 Mike Tsao <miket@google.com> Add tests for ag/2086796

Fixes: 37192695
Change-Id: Id0b3cbf986490d64cdc5592541dee1b004853503
Test: added
(cherry picked from commit cfe4ffecceee005ff6bc79dcc1637f44f82bd43a)
m/PackageManagerServiceTest.java
22d4ef008dd1956424f1026f151930ccd47d7db6 17-Apr-2017 Bryce Lee <brycelee@google.com> Merge "Don't allow stacks above pinned stack." into oc-dev
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
m/BoundsAnimationControllerTests.java
c4555784bee072cee02575523c3a30a0f8b516ec 14-Apr-2017 Wale Ogunwale <ogunwale@google.com> Merge "Move stack to front in-sync with task reparenting" into oc-dev
864d53d6fc18dfc894666a7de7dabef63c8a340e 14-Apr-2017 Daniel Nishi <dhnishi@google.com> Merge "Revert "Use the StorageStatsManager in FileCollector."" into oc-dev
2719cc134e68e4c8f0def68fdc1d68dc3de9c1d8 14-Apr-2017 Wale Ogunwale <ogunwale@google.com> Move stack to front in-sync with task reparenting

When reparenting a task to another stack have window manager move the
destination stack to the front at the same time it is reparenting the
task if REPARENT_MOVE_STACK_TO_FRONT is set to avoid jank.

Test: manual
Bug: 37299899
Change-Id: I45678e742188a4871f93a11178f7ab2b60c7bcc3
m/TaskWindowContainerControllerTests.java
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)
19953caad316a6afc6446bb268bdc062a3f5ab90 11-Apr-2017 Winson Chung <winsonc@google.com> Tightening up rotation behavior for PIP (2/3)

- Change BoundsAnimationController to be more consistent:
1) Ensure that on animation end is always called even when cancelled to
ensure animation start/end parity in the callbacks
2) Ensure that setPinnedStackSize() is only called between start/end
3) Prevent calling setPinnedStackSize() to the final bounds if the
animation is cancelled
- With that, we add a flag to cancel the current bounds animation when a
rotation happens while the bounds are animating. In addition, we also
add a check from AM to WM before applying the resize during the animation
in the case where WM sends the bounds to AM, but AM lock is held while
updating the exact stack bounds (once that finishes the old stale bounds
would have been applied)
- In addition, we can then move the handling of the of the rotation to the
config change update in WM, if we handle it before the other checks.

Bug: 36879891
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: I62c6df8b349971cc82a7898ae8b26834723faec5
m/BoundsAnimationControllerTests.java
a461e30053da64966d632a9655d0dca0daac983c 12-Apr-2017 Dmitry Dementyev <dementyev@google.com> Add ACTION_ACCOUNT_REMOVED to Account Manager.

AccountManagerService sends an intent with the action when account of any type is removed or renamed.

Test: manual, APCT.
Bug: 37280078

Change-Id: I53b1bb9d6cde1edba5c37ecf3e4e13d748b19005
ccounts/AccountManagerServiceTest.java
61bce9ab13ac3783720ab6e5a1fda939bea23977 13-Apr-2017 Bryce Lee <brycelee@google.com> Merge "Remove window container from empty task when destroying." into oc-dev
3cf3b199e3e120f23f54eb7f9905c8d285cb8a28 13-Apr-2017 Daniel Nishi <dhnishi@google.com> Revert "Use the StorageStatsManager in FileCollector."

This reverts commit bd441caaf6fb268b2756bc51304efa038bf58376 due to
causing NPE crashes.

Bug: 37314851
Change-Id: I933eaa3888f84945873de8f7fca0d235306f6aaa
torage/DiskStatsLoggingServiceTest.java
f726b4aa9aca75faead138f1d13e5369bd3b865e 13-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Always call unbind." into oc-dev
840c566d13b8c84ad5edb37006176d6731bad250 13-Apr-2017 Bryce Lee <brycelee@google.com> Remove window container from empty task when destroying.

Previously, the window container was being removed whenever we were
removing the task in a destroy mode. However, this caused issues
where an activity may still be present in the task record, leading to
a subequent change to limit this to tasks with overlays. This led to
the situation where the window container would not be destroyed when
it was supposed to, such as moving an activity to recents, but
otherwise destroying.

This changelist addresses the issue by always removing the window
container from tasks when removed from their parent stack in a
destroy mode and empty. In the recents flow, this will fire and
cleanup when the activity is destroyed.

Change-Id: I87548d6ff8e4d77b6294504d7cc78370cd5d31fa
Fixes: 37301159
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackTests
m/ActivityStackTests.java
m/ActivityTestsBase.java
76c13a5fce91acadfa2b28f1def68c87e7b65db5 13-Apr-2017 Hyunyoung Song <hyunyoungs@google.com> Merge "Update API, add more documentation on AdaptiveIconDrawable" into oc-dev
1e2595d7928e5259563e59d65e5f7d05e236f054 05-Apr-2017 Jeremy Joslin <jjoslin@google.com> Always call unbind.

Per a recent discussion unbind should always be called, even if
bind() returns false.

Restructured the NetworkScoreService code to allow for easier and
more robust testing of the inner ServiceConnection class.

Bug: 36999204
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Change-Id: I08870b7109cb7f51cdab8b632b7d1d0898c3c015
etworkScoreServiceTest.java
92e3da2354484d1dce64413c97d4605addb7f64a 07-Apr-2017 Hyunyoung Song <hyunyoungs@google.com> Update API, add more documentation on AdaptiveIconDrawable

and fix multiple miscellaneous bugs.

Bug: 37079814
Bug: 37100106
Bug: 34829216

Test: $ runtest --path=frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java
Test: $ runtest --path=frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
Test: $ runtest --path=frameworks/base/core/tests/coretests/src/android/grpahics/drawable/AdaptiveIconDrawableTest.java

Change-Id: I0f5b2232853031bf3860ebea2736e894d17e4d2e
m/ShortcutManagerTest1.java
fe99773a70e6bdfb141cafa06c91760a9264354e 12-Apr-2017 Jorim Jaggi <jjaggi@google.com> Merge "Disallow task snapshot starting window for intent != ACTION_MAIN" into oc-dev
feada91060fe356a86a9a4e16e3c8c8f60c69389 12-Apr-2017 Daniel Nishi <dhnishi@google.com> Merge "Use the StorageStatsManager in FileCollector." into oc-dev
bae01b1a70dd721e7343265bedfceee39bdc39f1 12-Apr-2017 Jorim Jaggi <jjaggi@google.com> Disallow task snapshot starting window for intent != ACTION_MAIN

We don't want to show a task snapshot if the intent wasn't the
launcher intent. Likely the app will show something different, so
we shouldn't show a snapshot in this case.

Test: AppWindowContainerControllerTests
Test: Open app, make sure we get snapshot window
Test: Open Chrome, go home, Open chrome incognito from shortcut,
make sure no flash

Change-Id: Ib608ba8070ce09f418f1036248d81eebfa354128
Fixes: 35099602
m/AppWindowContainerControllerTests.java
bd441caaf6fb268b2756bc51304efa038bf58376 10-Apr-2017 Daniel Nishi <dhnishi@google.com> Use the StorageStatsManager in FileCollector.

This should vastly improve the speed of the FileCollector.

Change-Id: I7a878a0622bbd6c758fb1d36125414d8b025e709
Fixes: 35807386
Test: Existing tests continue to pass.
torage/DiskStatsLoggingServiceTest.java
cdef591e52e691a6f57e367caa5670fdc4ee1a8a 03-Apr-2017 Jorim Jaggi <jjaggi@google.com> Improve caching behavior of thumbnails

Remove the retrieval cache on system_server. It's not needed at
this point.

Instead, we cache the low-res thumbnails on SystemUI side that
will be visible when recents launches. For that, we introduce
a strong thumbnail cache, which gets filled up whenever the task
stack changes.

Also fix a couple of issues like that the visibility report was
pretty wrong as well as some tasks got unloaded because tasks were
bound before layout happend.

Also fix a merge issue where we didn't load the reduced resolution
thumbnail :/

Test: TaskSnapshotCacheTest
Test: Open a couple of apps, open recents, make sure all
thumbnails are already loaded.

Fixes: 36374895
Change-Id: Idbf1acd4ceab6a7c4656e9791e245a8b102017f2
m/TaskSnapshotCacheTest.java
971fe468a493e8f1164ec4ae147e404505b551a0 11-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert "Revert "Handle case when snapshot dimensions don't match""" into oc-dev
48f4b57591d08e0c0b1de0fbc7d79ebd915d0cf9 10-Apr-2017 Bryce Lee <brycelee@google.com> Don't allow stacks above pinned stack.

Previously, stacks would be allowed above the pinned stack if the
pinned stack was not visible. We however do not correct the stack
position when the pinned stack later becomes visible. This can lead
to a scenario where the pinned stack has become visible yet is below
other stacks. When a stack is positioned in this state, an
IllegalStateException is thrown to indicate the invalid pinned stack
position.

Since the pinned stack should only be present and populated when
there is a pip activity, we can instead use its presence as an
indicator other stacks should be underneath it. This avoids placing a
stack above the pinned stack during transitional states where the
stack children might not be visible, therefore preventing the above
exception from occurring.

Fixes: 36669386
Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests#testPinnedStackLocation
Change-Id: I67a58806e83b11f0b135c12441bb0a9bec58eee7
m/DisplayContentTests.java
30d64f3a93f5fc5aaf75eeb38d658ef04a884b41 07-Apr-2017 Jorim Jaggi <jjaggi@google.com> Revert "Revert "Handle case when snapshot dimensions don't match""

This reverts commit ba53d8ae410976709e1413b74173a791e8dead15.

Also fixes that we always had a size mismatch.

Test: TaskSnapshotSurfaceTest
Test: Open app in different orientation than snapshot, make sure
looks ok.

Bug: 36991071
Change-Id: If572b68fd72cec7679984fdff0be5905caba69f4
Fixes: 36703868
m/TaskSnapshotSurfaceTest.java
c2ec7bf965b00d7cbac699c25aa372a9b5f9fcc3 10-Apr-2017 Andrii Kulian <akulian@google.com> Merge "Fix activity move between displays" into oc-dev
c9a6e756820ab766230163fb69b539fa6cba0eff 10-Apr-2017 Eric Sandness <sandness@google.com> Merge "Fix mock of setApplicationRestrictions()" into oc-dev
51c1b670224fa1598644426b472d51346dd22f30 08-Apr-2017 Andrii Kulian <akulian@google.com> Fix activity move between displays

1. ActivityConfigCallback might not have been registered
because DecorView was not yet attached to window and ViewRootImpl
was not available. In this CL the callback is set as soon as a
DecorView is attached to window.
2. When private display was removed from system, its stacks were
moved to bottom in AM but moved to top in WM.
3. When reparenting stack visibility of activities should be updated
before reparenting in WM, because otherwise WM will be resizing
windows that should no longer visible and reporting it to clients.

Bug: 34164473
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testOnMovedToDisplayCallback
Test: #testContentDestroyOnDisplayRemoved
Change-Id: I6ccc27d873d0d60d7650659fb25cbfcaaeb0fd07
m/DisplayContentTests.java
m/StackWindowControllerTests.java
bc4bd823d9b7acaf6fd715e24496bab2731de0be 08-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I5d41419a,I763be06c into oc-dev

* changes:
Introduce android.anim thread in system_server
Fix thread booster
ed7993b5d147a6741d26fe0b16cc9fa5e34ceaee 28-Mar-2017 Jorim Jaggi <jjaggi@google.com> Introduce android.anim thread in system_server

We create a new thread on which everything is running that
directly impacts window animations, i.e. layout, anim tick and
starting window creation. This is such that any work on
android.display can not lead to jank in the window animation,
specifically lock contention on activity manager lock that blocks
callbacks from android.display into AM can not lead to window
animation jank.

Test: Run animation, take systrace, make sure animation is on
android.anim
Test: AppWindowContainerControllerTestTest: AppWindowContainerControllerTestss
Fixes: 36792959

Change-Id: I5d41419a709b7984724e7053a3afdcc1ffe1aaa2
m/AppWindowContainerControllerTests.java
m/WindowTestsBase.java
a9b8253b38c3fcc6388f79bbc5c34ad540f6a6eb 07-Apr-2017 Eric Sandness <sandness@google.com> Fix mock of setApplicationRestrictions()

If any(Bundle.class) is used in the mock's when() clause instead of
nullable(Bundle.class), the mock is not called when the bundle argument
is null.

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest
frameworks-services

Bug: 36808416
Change-Id: Iab96fe88837e8f27a1da5775494b4611a547f13a
evicepolicy/DevicePolicyManagerTest.java
963dbbbdb616646240dde9a4b2b7b7592ddfefaa 06-Apr-2017 Gustav Sennton <gsennton@google.com> Remove WebView-fallback code for handling the non-functional stub.

We have already removed the non-functional WebView stub, so we can now
remove the logic ensuring that a primary device user could use any
valid WebView package even when a secondary user did not have any
WebView package to choose from (since all device users should always
have a valid package to use as WebView implementation).

Bug: 34730873
Test: run WebViewUpdateServiceTest tests.
Test: Create new user, disable Chrome for that user, ensure WebView
loads for that user and for the primary user.
Change-Id: Ia77cc2efd9e40a157fb5b68a988425ef15508033
ebkit/WebViewUpdateServiceTest.java
e78467f671ef855c34487d84b63a34e9c75e5dc6 07-Apr-2017 Sudheer Shanka <sudheersai@google.com> Merge "Add tests for verifying network availability on activity start." into oc-dev
d17ebaba9acfdd2e730a504f9a2bd27c099d2b70 07-Apr-2017 Sudheer Shanka <sudheersai@google.com> Merge "Fix testWaitForNetworkStateUpdate." into oc-dev
e7ac324c71fb52d4104c8d92c9cea55d334bb4f1 06-Apr-2017 Jason Monk <jmonk@google.com> Merge "Revert "Handle case when snapshot dimensions don't match"" into oc-dev
ba53d8ae410976709e1413b74173a791e8dead15 06-Apr-2017 Jason Monk <jmonk@google.com> Revert "Handle case when snapshot dimensions don't match"

This reverts commit aea6b74e17a0f7b105999adad50dd20eac17df35.
Bug: 36991071
Bug: 36703868
Change-Id: Ie71992144e78a6580bfce17dfdf20396af80eacd
m/TaskSnapshotSurfaceTest.java
cfeb32287a5882a1c0fcbb26e58953e8b234c899 06-Apr-2017 Sudheer Shanka <sudheersai@google.com> Merge "Don't populate a setting instead of defaulting to 0 when not set." into oc-dev
539128f6d652d0a38cede9cb4dbb9888f89ffbcf 06-Apr-2017 Calin Juravle <calin@google.com> Merge "Keep track of protected data dirs in DexManager" into oc-dev
343715b1c195dc08bce4157bdfb58403679aa9e5 06-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Do not stop lock task if it is starting background user" into oc-dev
31579276522f9b658a467b9012f09e42e6802663 05-Apr-2017 Bryce Lee <brycelee@google.com> Merge "Remove accidental debugger wait." into oc-dev
18498714fe22c62de461179aba3f08195db17e5f 05-Apr-2017 Bryce Lee <brycelee@google.com> Remove accidental debugger wait.

Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests
Change-Id: I129b139a14d925221f2c9b614f45aedac1f153b5
m/ActivityStackSupervisorTests.java
47347373294db1674a6935a66e74766bf31b1c4c 05-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Restore @VisibleForTesting on NetworkScorerAppManager." into oc-dev
101b1515487c0156ff78da2a9eae8db471d4f5f7 05-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Consolidate a11y unit tests and get them working" into oc-dev
5c2cf03f5f8e26f715931370004d21ee217edcde 03-Apr-2017 Tony Mak <tonymak@google.com> Do not stop lock task if it is starting background user

We do not switch user when starting background user, so no need to
stop lock task.

Refactor a bit to make unit test possible.

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java
Test: Lock an app using TestDPC, creating work profile, lock task is not dismissed

Bug: 35591838

Change-Id: I52c1f6ba07860df9266462750bf953a002f69026
m/UserControllerTest.java
adbadd5577d2b1291d10146b6ffb5577cf236528 29-Mar-2017 Calin Juravle <calin@google.com> Keep track of protected data dirs in DexManager

Apps may store data in any of their protected dirs
(deviceProtectedDataDir or credentialProtectedDataDir).

DexManager used to keep track of only the default data directory, which
could be any of them. The CL adds support for all protected dirs.

Test: runtest -x services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java
check that all of gmscore modules get recorded and compiled with
adb shell cmd package compile --secondary com.android.google.gms

Bug: 32871170
Change-Id: Id98904ce9e9fc8bb060b01c6fbb9ccce8f7f5328
m/dex/DexManagerTests.java
5c80debe867cff368546b0d8ba0b81d27e88c3d6 04-Apr-2017 Dmitry Dementyev <dementyev@google.com> Clear calling identity before getUserAccounts in
AccountManagerService

Fix accountsDb tests.

Bug: 36860606
Test: manual
Change-Id: Iad86d1bf7edd0f847262562ace9c2d5c9fdff978
(cherry picked from commit 9fc6f574b43c938913fad7a2ed04b5a7c717bd68)
ccounts/AccountsDbTest.java
081d2ccd520bc84e5fe3f9724519489242716321 05-Apr-2017 Bryce Lee <brycelee@google.com> Merge "Do not try to restore a task id if it does not exist." into oc-dev
8592407581fa553ae8d22fdea23c71682227fe4b 05-Apr-2017 Bryce Lee <brycelee@google.com> Merge "Fix ActivityRecordTests." into oc-dev
8fdf0513461367185ea70386f16bf420dd662212 05-Apr-2017 Tony Wickham <twickham@google.com> Merge "Add AppWidgetManager#getInstalledProvidersForPackage()" into oc-dev
7a6cc9b5a70217029a08bdaae701f072bf5410de 29-Mar-2017 Phil Weaver <pweaver@google.com> Consolidate a11y unit tests and get them working

Moving tests for accessibility manager into the a11y
directory and getting them to use some of the newer
test infrastructure. Minor tweaks to
AccessibilityManager to make it testable.

Deleting the AccessibilityManagerService tests entirely.
This class is difficult to unit test with the current
infrastructure, but is covered in CTS tests to a large
degree. I wasn't able to get these working quickly, and
they rely on timeouts that make them run much slower than
the other tests. They also throw exceptions when their
mock accessibility services receive accessibility events,
which causes the system to blacklist those services, causing
the tests to fail differently until the system is reset.
I think it's better to focus on writing new, more robust
tests than on rewriting these tests to pass.

Bug: 36614219
Test: A11y unit tests now work.
Change-Id: I8effe44f22110d55ebb700dc46f59b7e7a1aa946
(cherry picked from commit 9213d23178183981c653714f8df5806aab458bb0)
ccessibilityManagerServiceTest.java
ccessibilityManagerTest.java
ockAccessibilityService.java
ccessibility/AccessibilityManagerTest.java
ccessibility/MagnificationControllerTest.java
ccessibility/MessageCapturingHandler.java
3115bdf15af01ea43c28e1251657c7154e9acc91 05-Apr-2017 Bryce Lee <brycelee@google.com> Fix ActivityRecordTests.

Tests are not guaranteed to run on the same thread as setup methods.
Therefore, we must ensure any loopers used are already created by the
time the test runs. We do this now by creating a HandlerThread and
referencing its Looper later. Loopers are initialized per
HandlerThread, which will allow us to both isolate its usage and
guarantee the Looper initialization by test time.

Change-Id: If15494783959e5c399375033253cef69b921ff84
Fixes: 36916522
Test: bit FrameworksServicesTests:com.android.server.am.ActivityRecordTests
m/ActivityRecordTests.java
m/ActivityTestsBase.java
ef3874ba9148c801cfe53c153386baf93e34bd6d 05-Apr-2017 Wale Ogunwale <ogunwale@google.com> Merge "Disable presubmit for ActivityRecordTests" into oc-dev
4cb9b96d596ca10e298a6398893b773dab1a16c4 05-Apr-2017 Wale Ogunwale <ogunwale@google.com> Disable presubmit for ActivityRecordTests

Failing in CI

Test: ActivityRecordTests
Bug: 36916522
Change-Id: Id5571b722cc5c14f2897fcc65d52d35bf4a78105
m/ActivityRecordTests.java
f1acc1e8114d629278ae98657e32abecfb7b9991 05-Apr-2017 Jeremy Joslin <jjoslin@google.com> Restore @VisibleForTesting on NetworkScorerAppManager.

The NetworkScoreService tests fail (Mockito doesn't work) without
those methods being public :/

Also removed a failing test from NetworkScoreServiceTest since a
recent CL changed the behavior of dump (no longer throws).

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Change-Id: Id3fb9451027db3685b16b659a00a6a52b7a1e523
etworkScoreServiceTest.java
9d3f668d09dea3e8f14094c2efae9fdd7ce25908 05-Apr-2017 Sudheer Shanka <sudheersai@google.com> Fix testWaitForNetworkStateUpdate.

Bug: 36899583
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
Change-Id: I9fd94bc74403b173770dd7ec2483780bf6698640
m/ActivityManagerServiceTest.java
bce47223cb6e178fe3a2547974c93f32548c12ed 03-Apr-2017 Sudheer Shanka <sudheersai@google.com> Don't populate a setting instead of defaulting to 0 when not set.

Currently in CoreSettingsObserver while populating settings, when a
setting is not found, it's value is defaulted to 0. Instead don't
populate the setting when it is not found.

Bug: 34735550
Test: runtest -c com.android.server.am.CoreSettingsObserverTest frameworks-services
Change-Id: I9d231330c6db2636e4aa2f0caae455ddfc3e63a2
m/CoreSettingsObserverTest.java
92b7b659393c79d5eb2ee962abaffdcc64b20790 03-Apr-2017 Bryce Lee <brycelee@google.com> Do not try to restore a task id if it does not exist.

Previously, we were trying to restore the recent task regardless of
if it was found in recents or a stack. This would lead to
referencing a null object later.

Change-Id: I014a751d3254ad267c32ac0b54783b31b8d17e93
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests
Fixes: 36688598
m/ActivityStackSupervisorTests.java
a41da04b2d3eb6d746bb357925ec5d4d2a72998c 30-Mar-2017 Tony Wickham <twickham@google.com> Add AppWidgetManager#getInstalledProvidersForPackage()

This allows more fine-grained control than getting all installed
providers for a user, when you might only want to check for a particular
package. For instance, Launcher can use this API to surface widgets per
app without having to ask for all the widgets.

Test: Unit test on AppWidgetServiceImplTest
$ runtest --path=services/tests/servicestests/src/com/android/server/appwidget/AppWidgetServiceImplTest.java

Bug: 34940468
Change-Id: I182bf1c012d31182024422fc4a63f57f151c3ee5
ppwidget/AppWidgetServiceImplTest.java
0bbde28dd41a3488ba211caa31588641543de33b 04-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Migrate the NETWORK_SCORER_APP Setting." into oc-dev
b0fe21782f2d4f9101aed3455b0c8f8632698e88 31-Mar-2017 Jeremy Joslin <jjoslin@google.com> Migrate the NETWORK_SCORER_APP Setting.

Migrate the value of NETWORK_SCORER_APP to the USE_OPEN_WIFI_PACKAGE
Setting if the following conditions are true:
* NETWORK_SCORER_APP has a value
* An active scorer/recommender is present.
* The active scorer specifies a valid UseOpenWifiActivity.
* The NETWORK_SCORER_APP value matches the package name of the
UseOpenWifiActivity or the active scorer.

Test: runtest frameworks-services -c com.android.server.NetworkScorerAppManagerTest
Bug: 36718516
Change-Id: I7d7a56c62b4a7f4a0e43824fbb2075e80d7a753b
etworkScorerAppManagerTest.java
1edadac465f70629c66b0c9b053b8ac154133ec9 04-Apr-2017 Jorim Jaggi <jjaggi@google.com> Merge "Handle case when snapshot dimensions don't match" 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
m/ActivityRecordTests.java
m/ActivityTestsBase.java
m/AppWindowContainerControllerTests.java
m/AppWindowTokenTests.java
m/DisplayContentTests.java
m/StackWindowControllerTests.java
m/TaskStackContainersTests.java
m/TaskStackTests.java
m/TaskWindowContainerControllerTests.java
m/UnknownAppVisibilityControllerTest.java
m/WindowFrameTests.java
m/WindowTestUtils.java
m/WindowTestsBase.java
m/WindowTokenTests.java
6a7a967b712145a84771de2920082d3647de2d24 04-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Remove/fix broken test due to change to DUMP permission check." into oc-dev
c4361e34ad6fbc1bab34271ece668ebf79232a64 03-Apr-2017 Makoto Onuki <omakoto@google.com> Remove/fix broken test due to change to DUMP permission check.

Bug 36854321
Test: adb shell am instrument -e class 'com.android.server.pm.ShortcutManagerTest2' -w com.android.frameworks.servicestests

Change-Id: I80f2a326b70f8d0598246732510e3725a0c58871
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest2.java
ef7dff2563ccbe74564ab3b417d810a04df556e7 03-Apr-2017 Makoto Onuki <omakoto@google.com> Merge "Revert "Push chooser targets to the shortcut manager."" into oc-dev
2c93764bee6c00526fda24a26f8a472c26d908c3 03-Apr-2017 Andrii Kulian <akulian@google.com> Merge "Fix some WM unit tests" into oc-dev
7efe56b779d4c44399513c4c92142df2bb8cc51f 03-Apr-2017 Bryce Lee <brycelee@google.com> Merge "Add app bounds to configuration." into oc-dev
aea6b74e17a0f7b105999adad50dd20eac17df35 21-Mar-2017 Jorim Jaggi <jjaggi@google.com> Handle case when snapshot dimensions don't match

If the snapshot starting window has different dimensions than the
snapshots we have taken, we do the following:

- Create a child Surface that has exactly the dimensions of the
snapshot.
- We fill the parent surface with the app background color, as well
as all screen background decorations (status bar background,
navigation bar background).
- We also clip of the status bar/navigation bar background in some
cases, as it looks ugly if it's not behind the system bars.
- Furthermore, we inherit all layout flags on the window and all
layout relevant SystemUI flags on the window such that it's very
likely that the size will match, and the system bars are drawn
correctly.
- In order to make the transition from the snapshot to the real
window a bit more predictable/less messy, we enforce a minimum
duration the snapshot is visible, which is slightly more than our
app transitions.

Test: TaskSnapshotSurfaceTest
Test: Open app, go home, go landscape, open app again
Test: Go to multi-window, open app from recents with a snapshot
taken in fullscreen.

Fixes: 36703868
Change-Id: Ia2d4add6971a18ab7aa2942d2b644d6e87a402af
m/TaskSnapshotSurfaceTest.java
7566d76c618a48b8dcc981dac3cab1e42f864063 30-Mar-2017 Bryce Lee <brycelee@google.com> Add app bounds to configuration.

The system previously overrode the display size for a specific scope
(task/activity/etc.) by setting the associated Configuration's
screenWidthDp/screenHeightDp. This leads to two issues. First, the
conversion of screen size from pixels to display independent pixels
and then upconverting later on leads to rounding errors. Secondly,
the screenWidthDp and screenHeightDp values account for insets, such
as the status bar. These however are not reflected in the display
size when returned from Display#getMetrics/getSize.

This changelist addresses the issue by adding a Rect value to
Configuration which stores the app display bounds. This is always set
at the display level and overridden as appropriate. As the proper
app insets are accounted for at the root configuration, all overrides
(outside of specific exceptions) are the result of the intersection
between the requested bound and the parent bound.

Change-Id: I2c4fcd0bee92af12aabbca258de05b4ec061d0e1
Fixes: 34338931
Bug: 36812336
Bug: 36676979
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsAppTestCases android.app.cts.AspectRatioTests
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerDisplayTests
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests
m/AppBoundsTests.java
2f8f5ffc4bba842333d9597b4153cb27094ab529 01-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Handle disabled packages as removed." into oc-dev
a95bfff74604bbf05a66ff37947b1b2fb2fdcaa2 31-Mar-2017 Andrii Kulian <akulian@google.com> Fix some WM unit tests

WindowFrameTests#testLayoutNonfullscreenTask and
sizes because test assumed that frame for window was always
bigger than screen size. Now we calculate all frames relative
to real display size.

TestWindowManagerPolicy used in WM unit tests reported incorrect
value from rotationHasCompatibleMetricsLw(), which lead to
DisplayContent#mAltOrientation set to "true" after any rotation
and resulted in shrinked display metrics.

DisplayContentTests#testDefaultDisplayOverrideConfigUpdate was
not restoring the config applied to default display because
it was trying update values in config from non-empty to empty,
which is considered a no-diff.

Test: com.android.server.wm.WindowFrameTests
Test: #testCalculatePolicyCrop
Test: #testLayoutNonfullscreenTask
Test: com.android.server.wm.AppWindowTokenTests
Test: #testLandscapeSeascapeRotationByApp
Test: com.android.server.wm.DisplayContentTests
Test: #testDefaultDisplayOverrideConfigUpdate
Change-Id: Ia0ed46307f67f6b47859209ebcf13253b59b8002
m/DisplayContentTests.java
m/TestWindowManagerPolicy.java
m/WindowFrameTests.java
82fb2eb057032bb7f38f547fb3667c7bf2547517 01-Apr-2017 Makoto Onuki <omakoto@google.com> Handle disabled packages as removed.

Bug 36600272
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: I272334cef00337d5ba01ce4b878c799d9476432f
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
2af994ec034040a69e41cc89df7ed6b994aaad89 01-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Ensure we show the PiP menu in response to KEYCODE_WINDOW." into oc-dev
99302b55c6a960c9078ad2c84ae9be3296bd32f3 29-Mar-2017 Makoto Onuki <omakoto@google.com> Revert "Push chooser targets to the shortcut manager."

This reverts commit 58fc95dc578244b7beb687a48184045dcce788b8.

Bug 36186790
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 CtsShortcutHostTestCases
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 CtsShortcutManagerTestCases

Also all unit tests, except for the known failrues.
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: I733ee7e12a419ee7ea17ca67c56afe7b039d189a
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
ac52f2892d5c72c26387d510093ddfc741a8a632 30-Mar-2017 Winson Chung <winsonc@google.com> Ensure we show the PiP menu in response to KEYCODE_WINDOW.

Bug: 36687605
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testWindowButtonEntersPip
Change-Id: I0bb35fd666eb6a438e4676267f6726b44bffb3db
m/TestWindowManagerPolicy.java
554c5946ce9fb273d4b95839fa1f04a680ff9034 31-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix broken unit tests due to mockito upgrade." into oc-dev
20959b2d406d6b76fb6f16075230da7542e1e3e8 31-Mar-2017 Sudheer Shanka <sudheersai@google.com> Merge "Don't increment procStateSeq if uid doesn't have internet permission." into oc-dev
d0010c5ef12ccf0b5c20e7c12cf86def990b4feb 30-Mar-2017 Makoto Onuki <omakoto@google.com> Fix broken unit tests due to mockito upgrade.

Bug 36781317

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: Ie9abcd8bdf5353c96ebade0e8489f667ef9904ee
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest8.java
ed25ce6d598d7ed14f9b9859cdd2219bcc907f4c 30-Mar-2017 Sudheer Shanka <sudheersai@google.com> Fix flaky tests in NetworkPolicyManagerServiceTest.

Test: runtest -c com.android.server.NetworkPolicyManagerServiceTest frameworks-services
Change-Id: I0a6f0d11e3922bfeb2bd3784f23e10ae45e5e40c
etworkPolicyManagerServiceTest.java
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
m/ActivityManagerInternalTest.java
m/ActivityManagerServiceTest.java
686bb2d337517b0b3f4ff4a6062c84a3ee730307 20-Mar-2017 Sudheer Shanka <sudheersai@google.com> Add tests for verifying network availability on activity start.

Bug: 27803922
Test: runtest -c com.android.server.net.ConnOnActivityStartTest frameworks-services
Change-Id: I771e1fd9edbe14f1ff7a7a84c3896af6dd6f20a0
et/ConnOnActivityStartTest.java
6ce48e25e510aed187c8b2a84377e0676449767a 29-Mar-2017 Ammar Aijazi <aaijazi@google.com> NetworkPolicy gets updated due to CarrierConfigManager updates.

Bug: b/34385985
Test: Added unit tests to NetworkPolicyManagerServiceTest
Change-Id: I1d8249081c478e6484c8011d3eab73a53f105fac
etworkPolicyManagerServiceTest.java
27cec32496090efd153327f4fc5a5cecc6f59d9b 21-Mar-2017 Bryce Lee <brycelee@google.com> Add configuration for maximum UI width.

This changelist adds config_maxUiWidth, a new system resource
configuration which specifies the maximum width the user interface
can operate in. If the physical or specified width is greater than
this value, dimensions and density are scaled down accordingly. The
native mode resolution can be still discovered through
Display.Mode#getPhysicalWidth/getPhysicalHeight.

Test: Defined override for development device and verified values.
Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests#testMaxUiWidth
Change-Id: I12e7ad52f2aa8014e143bc7e80b020c9b24ed9c8
Fixes: 25820708
m/DisplayContentTests.java
77a1f7522e1046d0f145013e71288235a569119b 28-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Parse NotificationChannel ID meta-data."
117e0c9b5a65370b7895f73014adbc211f598c68 28-Mar-2017 Dmitry Dementyev <dementyev@google.com> Merge "Add cache for Account Visibility values."
995d1c97ea6cf9cea751facfa0b4183f2aa91be9 27-Mar-2017 Sudheer Shanka <sudheersai@google.com> Merge "Uncomment a test."
71fa5261d335a877453383eea911e9f51ad15589 23-Mar-2017 Dmitry Dementyev <dementyev@google.com> Add cache for Account Visibility values.

Test: cts
Bug: 36485175
Change-Id: I075b81f8b287199d51ea09dc1108748310ab846c
ccounts/AccountManagerServiceTest.java
ccounts/AccountsDbTest.java
e259c2c42be68fa2ead28eeed1df5042452d0eae 27-Mar-2017 David Stevens <stevensd@google.com> Merge "Compute the focused window in display focus order"
469395638813abdb7423d0b91d6c42c2b1dcb78a 24-Mar-2017 David Stevens <stevensd@google.com> Compute the focused window in display focus order

A WindowContainer's children are sorted so the focused child is at the
end of the list, so RootWindowContainer needs to iterate from end to
start when looking for the focused window.

Bug: 36590788
Test: DisplayContentTests#testFocusedWindowMultipleDisplays
Change-Id: I56e6b7d2054bc1e74b54a4f99706a08d278fa2e1
m/DisplayContentTests.java
m/WindowTestsBase.java
5e5a68dc063a3692ec8dcd9c07c9861680a18a52 25-Mar-2017 Wale Ogunwale <ogunwale@google.com> Fixed issue with SCREEN_ORIENTATION_BEHIND not working correctly

If an app specifies SCREEN_ORIENTATION_BEHIND, then use the orientation
of the app behind it regardless of the visibility state of the app
behind.

Fixes: 35281868
Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackTests
Change-Id: Ieba4e4bb1a7f47cd6f082491d37fcabcf5bd5199
m/AppWindowTokenTests.java
m/TaskStackTests.java
m/WindowContainerTests.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
m/ActivityManagerServiceTest.java
d292c1555875e3e2c134f8d477b2a77d27df55d4 25-Mar-2017 Sudheer Shanka <sudheersai@google.com> Merge "Update AMS to use NetworkManagementInternal.isNetworkRestrictedForUid."
c9d150dcbd027e5a3316218eac892a767e399352 25-Mar-2017 Sudheer Shanka <sudheersai@google.com> Merge "Add NetworkManagementInternal.isNetworkRestrictedForUid."
d601360904df9b811205f44f15c89f12703d6d72 24-Mar-2017 Amin Shaikh <ashaikh@google.com> Parse NotificationChannel ID meta-data.

- Add this new meta-data field on NetworkRecommendationProvider to NetworkScorerAppData

Bug: 36571359
Test: runtest frameworks-services
Change-Id: Ic8c594bea406fc5183a4919b808bce5159912650
etworkScoreServiceTest.java
etworkScorerAppManagerTest.java
84acb2e042ce65863b37dcfca4903e3404c6e593 24-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added support for maxAspectRatio manifest attribute."
582fae1cf46dfe3ea63e1ba1123575467c70a221 24-Mar-2017 Phil Weaver <pweaver@google.com> Merge "Restructure a11y shortcut settings"
55ddf8f9e5d8241130aeac6be7b4978860f41bf8 20-Mar-2017 Wale Ogunwale <ogunwale@google.com> Added support for maxAspectRatio manifest attribute.

- Allows an app to specify the maximum aspect ratio it supports.
- Support for overriding configuration and bounds at the activity
record and app window token level.

Test: cts/.../run-test CtsAppTestCases android.app.cts.AspectRatioTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Bug: 36505427
Bug: 33205955
Bug: 35810513
Change-Id: Ib2d46ed0c546dd903d09d6bb7162a98bd390ba81
m/WindowContainerTests.java
m/WindowFrameTests.java
m/WindowTestsBase.java
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
m/ActivityManagerServiceTest.java
62f5c178378be82d15fcb6d0b3a95be154f062bd 18-Mar-2017 Sudheer Shanka <sudheersai@google.com> Add NetworkManagementInternal.isNetworkRestrictedForUid.

This will be used by the ActivityManagerService to decide if
an app needs to block for network or not.

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

Change-Id: I9e62406e2638f70497b43b5b41607df41aefd66c
etworkManagementInternalTest.java
0795bf8d62676bc11a4dd4bb83100283ba29e407 24-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Hook up data saver to battery saver."
ce687c5e4a0ce27e9190fb5c823ec4649fbc3712 15-Mar-2017 Phil Weaver <pweaver@google.com> Restructure a11y shortcut settings

Separating the shortcut on/off from the shortcut service.
Enabling the shortcut to work from the lock screen if the
user wants it to.

Bug: 35872328
Bug: 35219988
Bug: 35443593
Test: Adjusted tests for shortcut controller, manually
activated shortcut in a variety of conditions.
Change-Id: Id39d33ec62eb5f11b76b2972089167dc7d4c625b
olicy/AccessibilityShortcutControllerTest.java
29c82ab242d50000d22e593c27153751c8c6b44a 10-Mar-2017 jackqdyulei <jackqdyulei@google.com> Hook up data saver to battery saver.

1. Add globalBatterySaverEnabled in PowerSaveState, which stores
the real battery saver mode, not the one for specific service.
2. Add "mRestrictBackgroundChangedInBsm" and
"mRestrictBackgroundBeforeBsm" to restore the mRestrictBackground
if necessary.
3. If user toggles the data saver when battery saver is on, don't
restore the data saver when battery saver is off.

Bug: 34693888
Test: FrameworksServicesTests
Change-Id: Ic50c1cae3fb110a228e59e5d1fd04c164e4b7274
etworkPolicyManagerServiceTest.java
ower/BatterySaverPolicyTest.java
707af7c57b1616109e8eda2f78647b82a5511c16 22-Mar-2017 Fyodor Kupolov <fkupolov@google.com> Merge "Added concurrency test"
2290efde5501766f14d840e41930490e853a5e57 22-Mar-2017 Fyodor Kupolov <fkupolov@google.com> Added concurrency test

Test 2 threads repeatedly calling getAccounts while 1 thread calls
setAuthToken.

Example output:
I AccountManagerServiceTest: readTotalTime=1468 avg=36.7
I AccountManagerServiceTest: writeTotalTime=813 avg=40

Bug: 36485175
Test: AccountManagerServiceTest
Change-Id: Iee66339ceeb8f149eb9fc0906c537db60465d475
ccounts/AccountManagerServiceTest.java
c344373ed49c768f3b1cc8486c6ab376e5ef5256 22-Mar-2017 Bryce Lee <brycelee@google.com> Merge "Do not allow Tasks to influence orientation under some conditions."
541feb1ccf753a9db24109d38135ef1144080774 22-Mar-2017 Jorim Jaggi <jjaggi@google.com> Merge "When snapshots are disabled, fill it with single color."
a359c9846d2fa8bfe2784222be350d2e6046de16 22-Mar-2017 Jorim Jaggi <jjaggi@google.com> Merge "Add API to disable snapshotting of activities"
61fbcbcc94d1ca949afae47ec0ec7a8da80aadef 10-Mar-2017 Bryce Lee <brycelee@google.com> Do not allow Tasks to influence orientation under some conditions.

When all AppWindowTokens belonging to a Task are closing, it should
not be considered for orientation. Likewise, if a task is moving to
the bottom, it should also not be considered.

Change-Id: Ie387457c413d5360afbb0ac8edb112f81feab81b
Fixes: 35699615
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackTests#testClosingAppDifferentStackOrientation
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackTests#testMoveTaskToBackDifferentStackOrientation
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testTaskCloseRestoreOrientation
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testTaskMoveToBackOrientation
m/TaskStackTests.java
b251fad07f5a2188a7a53450131e635114ba30fa 22-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Don't unlock the work profile if it is turned off."
8f4fe6eccbc3849686f08389cb5868f2d59f5fbb 14-Mar-2017 Jorim Jaggi <jjaggi@google.com> When snapshots are disabled, fill it with single color.

Test: Launch DisableScreenshotsActivity, go to recents, make sure
content is blue. Reopen activity from home, make sure starting
window is blue.

Bug: 31339431
Change-Id: I29689774c3cdcb784d8f5bfa4f947a6f35b91e01
m/TaskSnapshotControllerTest.java
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
m/TaskSnapshotControllerTest.java
m/WindowTestsBase.java
8e87af55337a19cf7242a1bf2f516bc26ae65f9e 03-Mar-2017 Andrew Scull <ascull@google.com> Don't unlock the work profile if it is turned off.

Test: Turn off work, lock and unlock device with PIN/password/pattern,
turn on work and now you get a screen lock prompt.
Test: runtest frameworks-services -c com.android.server.LockSettingsServiceTests

Change-Id: I0c6946af4ffb1546ffbd4d80c11fa4b8ab5555bc
aseLockSettingsServiceTests.java
ockSettingsServiceTests.java
a300ab2746d06b2fd614c2ae76a5d3acfdd69bbd 22-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix logic errors when checking the caller."
ac9e6f74537e76ea5a5bb0aedf818608dc7cd972 22-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Implement runtime account update notifications."
c1bacbd2f6b273e99a723be8cb786174dffbfb3e 22-Mar-2017 Fyodor Kupolov <fkupolov@google.com> Merge "Support expiration of preloaded file cache"
d225f0bfd5bc8e7767dc000ea5174bddd95bdea8 21-Mar-2017 Fyodor Kupolov <fkupolov@google.com> Support expiration of preloaded file cache

When device is provisioned, we delete all files from /data/preloads
except file_cache. We should do best effort to keep file_cache during
the first config_keepPreloadsMinDays. After that,
persist.sys.preloads.file_cache_expired is set to 1, which indicates
that cache can be deleted when additional storage space is requested.

Bug: 34690396
Test: Manual + RetailDemoModeServiceTest
Change-Id: Ie584a9dd6689bcc5e6b3cb448e95dfe5f73d2eeb
etaildemo/RetailDemoModeServiceTest.java
3bddadd3e15992598b817ff21783a968875687d8 22-Mar-2017 Jeremy Joslin <jjoslin@google.com> Fix logic errors when checking the caller.

A few methods were incorrectly ORing instead of ANDing the frontline
security check. Fixed and added tests.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Change-Id: I20531ad5a8df6fe9b9e2225198be25a2a070b603
etworkScoreServiceTest.java
8882d881f95f5719a4a9c3eb3f6555b4882e8c4d 15-Mar-2017 Dmitry Dementyev <dementyev@google.com> Implement runtime account update notifications.

Test: manual, cts.
Change-Id: Iaf9fe4814c3d3c2ca2dca0a5bfa0f997e060bfeb
ccounts/AccountManagerServiceTest.java
ccounts/AccountManagerServiceTestFixtures.java
74cb00696e27924de4fc7052a90aa2348b536b2d 21-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Exfiltrate cert code from DevicePolicyManager"
2dde2b122f620ba853d950cc1b88ae0596d958f6 21-Mar-2017 Jorim Jaggi <jjaggi@google.com> Merge changes I7f7a9842,I4c74b269

* changes:
Implement new thumbnail loading strategy
Also store reduced resolution screenshots
5c9fb3c5271b3e602d0d018a5bcfd3d6dbb98d9c 21-Mar-2017 Bryce Lee <brycelee@google.com> Merge "Do not remove the default display during tests."
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
m/TaskSnapshotCacheTest.java
m/TaskSnapshotPersisterLoaderTest.java
m/TaskSnapshotPersisterTestBase.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
m/ActivityManagerInternalTest.java
m/ActivityManagerServiceTest.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
m/ActivityManagerInternalTest.java
m/ActivityManagerServiceTest.java
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
etworkPolicyManagerServiceTest.java
m/ActivityManagerInternalTest.java
6272c7f83fd1e78ec610d84621abfd0b87680465 18-Mar-2017 Bryce Lee <brycelee@google.com> Do not remove the default display during tests.

The default display is used by some tests that exercise features only
functional only on the default display (like policy rotation). This CL
makes this display not get removed with the created test displays and
ensures no collision in id space from a previous test run (done in the
test setup).

Change-Id: Ia14b9c023c779d263283fe8c7b512dca17ff312f
Fix: 36385757
Test: bit FrameworksServicesTests:com.android.server.wm.StackWindowControllerTests#testRemoveContainer_deferRemoval
m/AppWindowTokenTests.java
m/WindowTestsBase.java
2903d131579ca6ed77f63fa08029e06c41289d10 18-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Better call emulation for DevicePolicyManagerTest"
088d7aa9c1e9b73ea9dce1616b4958f0c41ca05e 17-Mar-2017 Robin Lee <rgl@google.com> Exfiltrate cert code from DevicePolicyManager

The intent is for this not to cause any behaviour changes, just to
make it easier to see what is going on with the code.

Permissions are checked in DevicePolicyManagerService. All calls to
CertificateMonitor are privileged.

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases
Change-Id: I98224087315a62234732f08b53fe91884be86386
evicepolicy/DevicePolicyManagerServiceTestable.java
2c68dadb200a4a7113b2d5162fc9137eed944ddf 17-Mar-2017 Robin Lee <rgl@google.com> Better call emulation for DevicePolicyManagerTest

Let's have several separate contexts instead of doing strange things
with package names in one monolithic context representing every single
user on the device at once, sometimes multiple times in the same call.

Syntax looks like:

runAsCaller(callerContext, dpms, (dpm) -> {
assertSomething(dpm.doSomething(caller, param));
});

When a caller calls into DevicePolicyManager here's what happens:

PRE

- a new DevicePolicyManager is created with the caller context
- service context callingIdentity is saved
- the callingUid, callingPid, and callingPermissions are added to the service context

TEST

- client-side test code interacts with DevicePolicyManager using the caller context
- server-side coder under test runs as DevicePolicyManagerService using the service context

POST

- service context callingIdentity is restored to what it was before the test.

This should be easier to reason about.

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases
Change-Id: I148e3f298b0a958639ce261e9cf91f6eb49fae4d
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
evicepolicy/DpmTestBase.java
c1b59ed73eeea40c70cc81e2ab486cd54d94ed5d 17-Mar-2017 Andrii Kulian <akulian@google.com> Merge "Separate global and override config sent to client"
446079600ece83b22cb91865bcbeb694292b0108 16-Mar-2017 Andrii Kulian <akulian@google.com> Separate global and override config sent to client

There is some flakiness in View#onConfigurationChanged callback -
if ViewRootImpl receives config update earlier than ActivityThread,
it may not detect the configuration change and skip inner updates.
Also now ViewRootImpl assumes that it receives the global config as
a param, but instead it gets merged config from WM. This means that
ViewRootImpl#sConfigCallbacks was sending incorrect values to the
recipients.

This CL switches to sending global and override configuration to the
client separately. Also in case if there is a corresponding activity,
it first updates it and waits for update callback to ViewRootImpl.
This way global config and override config for activity will always
be set first and resources will be updated before inner state of
ViewRootImpl is updated.

Bug: 35870157
Bug: 34164473
Test: android.server.cts.ActivityManagerDisplayTests
Test: testOnMovedToDisplayCallback
Change-Id: Ic9e7541cf25ecfac6ec90e48f7efb0ece91f657e
m/TestIWindow.java
6b9b130c9823f4473ccc374e853e19a5ed35a992 16-Mar-2017 Bryce Lee <brycelee@google.com> Merge "Fix AppWindowTokenTests#testLandscapeSeascapeRotationByPolicy"
8b30ec3f49d4c8037bc6aa03ed6dd91aff3968ad 05-Mar-2017 Rubin Xu <rubinxu@google.com> Fix SynthethicPassowrdManager unit tests

Mock DevicePolicyManager in the unit tests.

Bug: 34600579
Test: runtest frameworks-services -c com.android.server.SyntheticPasswordTests
Change-Id: Ieca30a74d7d9d867994e912d188231510f54e76c
aseLockSettingsServiceTests.java
ockSettingsStorageTests.java
ockLockSettingsContext.java
310de9e5ee7b57b928e7a6613d61bcfb1c0bf166 15-Mar-2017 Bryce Lee <brycelee@google.com> Fix AppWindowTokenTests#testLandscapeSeascapeRotationByPolicy

Previously this test was marked as blocked by b/35034729. This bug
has been fixed, however the test still fails due to other issues
addressed here.

Addressed issues are as follows:
1. Updating rotation by display manager requires a display with the
default display id present. This display is removed during setup. The
first id to be used by a display after this point is the
default id + 1. We already have logic in place to avoid collisions so
it is safe and correct to start out at the default id.
2. Without allowing the animator to complete its steps after a
rotation, future rotations will be deferred. We must simulate the
steps taken by the and resulting from the animtor. These include
marking the orientation change as complete and performing a surface
placement afterwards.

Bug: 35034729
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
Change-Id: Ib01c047ac49982a4a3c1debaa3cee1b7b9b53632
m/AppWindowTokenTests.java
m/WindowTestsBase.java
dc61d1b2c05c73f3c78de8146caa17432fa5a32c 14-Mar-2017 Calin Juravle <calin@google.com> Merge "Add missing return in DexManager"
58277fab89c22ab7a9ac1f77da37a4368c91582f 14-Mar-2017 Phil Weaver <pweaver@google.com> Merge "Add haptic feedback for a11y shortcut"
2dfc1b3e125860221bc67835c2d5c99198a12f8a 11-Mar-2017 Calin Juravle <calin@google.com> Add missing return in DexManager

Harmless issue but which can spam the logs.

Test: mostly manual since the check is buried deep inside and cannot be
verified accurately. I added another test to DexManager to stress that
code path and then checked the logs.

Bug: 36117123
Change-Id: I1a878a200f3f726dfaa85f1bed1398acc8dce979
m/dex/DexManagerTests.java
ef4351cc72abeeba0f659950c199a4f9b7cd1842 18-Jan-2017 Eugene Susla <eugenesusla@google.com> Dont dispatch a11y events that have no subscribers

This allows to avoid A11yManager -> A11yManagerService IPC, when there's no
subscribers to a given event

Test: steps:
- Enable A11yManager.DEBUG
- Navigate through a few random activities
- In logcat, ensure log messages are present, notifying that certain events
won't be dispatched
Change-Id: Ia019fb66053f10095b3651407d09de8e89cdd227
ccessibilityManagerServiceTest.java
ccessibilityManagerTest.java
32ea37255dbb9c5d7d40b73e435d12df934a803a 13-Mar-2017 Phil Weaver <pweaver@google.com> Add haptic feedback for a11y shortcut

Bug: 35036259
Test: Activated shortcut, felt the vibration. Also added unit test.
Change-Id: I3070620d9152ce9b9bb084ee4f01d26020f125d0
olicy/AccessibilityShortcutControllerTest.java
8ee7285128c3843401d4c4d0412cd66e86ba49e3 10-Mar-2017 Andrii Kulian <akulian@google.com> Move rotation tracking to DisplayContent

This CL moves rotation tracking from WindowManagerService to
DisplayContent. This way displays can be rotated independently and
rotation of the main display won't affect rotation of secondary
ones.

Bug: 34242678
Test: android.server.cts.ActivityManagerDisplayTests
Test: testRotationNotAffectingSecondaryScreen
Change-Id: Ic46aaa523482b31ff5ec77f0c2908ceda1156fc0
m/AppWindowTokenTests.java
bd7ae7df281e3fdc5d0cbe1acceb8c0d82ecceb9 11-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Basic accessibility support for picture-in-picture"
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
etworkPolicyManagerServiceTest.java
m/ActivityManagerServiceTest.java
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest2.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.
f00cd14f17c0acd6bffe78947d32ea0a2900d139 03-Mar-2017 Phil Weaver <pweaver@google.com> Basic accessibility support for picture-in-picture

Exposing actions from the PIP InputConsumer to accessibility,
stripping all actions from a covered PIP app, and adding the
InputConsumer's actions on the PIP app's root view.

We were also using an "undefined" accessibility ID to mean
three different things: a root view, a host view of a virtual
view hierarchy, and a truly undefined view. I've introduced
new values for cases where the id could be defined.

Also gathering all window IDs into one place to reduce the
chance of collisions.

Bug: 34773134
Test: In progress. Current cts passes.
Change-Id: I97269741a292cf406272bf02359c76c396f84640
ccessibility/ActionReplacingCallbackTest.java
ccessibility/MotionEventInjectorTest.java
bed66827557413df428080ec7cf4a46a2047bc51 10-Mar-2017 Paul Duffin <paulduffin@google.com> Merge "Refactor code incompatible with Mockito 2.7.13"
7219795ffb1b2eafa10ac85f603dbef1620bf810 10-Mar-2017 Daniel Nishi <dhnishi@google.com> Merge "Don't look up storage for uninstalled apps."
192bb0bc54f6bb418f5778fe26eb2e68514290fb 09-Mar-2017 Paul Duffin <paulduffin@google.com> Refactor code incompatible with Mockito 2.7.13

(cherry picked from 76e319f015c2b43498ce3ce610a253d63e76cbf3)

Some additional internal only refactorings were done as well.

Bug: 32912773
Test: make checkbuild
Change-Id: I96e3da967fad731fc8f39bde9db95f50ab7353fb
etworkScoreServiceTest.java
etworkScorerAppManagerTest.java
ccessibility/KeyEventDispatcherTest.java
ccessibility/MagnificationControllerTest.java
ccessibility/MotionEventInjectorTest.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/MockUtils.java
olicy/AccessibilityShortcutControllerTest.java
etaildemo/RetailDemoModeServiceTest.java
ebkit/WebViewUpdateServiceTest.java
m/TestWindowManagerPolicy.java
8e44f6c46822028a853c41610d2289e299987af0 10-Mar-2017 Wale Ogunwale <ogunwale@google.com> Revert "Have WM use token info. from IMMS to determine IME target window"

This reverts commit daab865344fcfa45fe2789e43462f730a44fba64.

IMMS is currently sending wrong target candidates, so we need to revert
this until we figure-out what is going on there :(

Bug: 31559891
Bug: 35903813
Test: DisplayContentTests
Change-Id: I5c5beff4bac1b0781fa6663b13ff0dfe83a7806b
m/DisplayContentTests.java
m/WindowTestsBase.java
579e5581d5339dbdc79b9176fcc2fad660d155db 09-Mar-2017 Daniel Nishi <dhnishi@google.com> Don't look up storage for uninstalled apps.

This also catches any potential state exceptions which may
occur when errors occur during storage queries on a package.
This should stop the crashes.

Change-Id: Idab92434f74eaf44ba7b3fdbbc6c2c1ac9b10ee2
Fixes: 36075582
Test: FrameworkServicesTest & manually verified file is populated
torage/AppCollectorTest.java
18f805e73d944fade201f94b7c324fb71bb2bd16 09-Mar-2017 Lei Yu <jackqdyulei@google.com> Merge "Hook up screen brightness knob to DisplayPowerController."
92681e8cfbbae58b00a80bb1e60f5444cf53fbdd 28-Feb-2017 jackqdyulei <jackqdyulei@google.com> Hook up screen brightness knob to DisplayPowerController.

This knob is designed to effectively tune the battery saver.

Bug: 34693888
Test: FrameworksServicesTests
Change-Id: I9fd7896f59fabd9baf649cdb12f01b1baaf4c34b
ower/PowerManagerServiceTest.java
30d69eaf868d2c8a9440f49b9a611c40a9f1ac1d 08-Mar-2017 Lei Yu <jackqdyulei@google.com> Merge "Add BatterySaverPolicy for power save mode"
455e90add22835d0744fc0f5c2feb5fcaf03b28f 10-Feb-2017 jackqdyulei <jackqdyulei@google.com> Add BatterySaverPolicy for power save mode

The BatterySaverPolicy is designed to consolidate all battery saver
knobs into a central location. Usually it is consistent to
mLowPowerModeEnabled unless it gets different data for specific
service. By adding these knobs, we can effectively tune the battery
saver.

This cl sets up the framework for BatterySaverPolicy and updates
following service to get battery saver data from BatterySaverPolicy

1. GnssLocationProvider
2. VibratorService
3. WindowManagerService
4. BackupManagerService
5. SoundTriggerService
6. NetworkPolicyManagerService

Screen brightness will come in a following cl.

Bug: 34693888
Test: FrameworksServicesTests

Change-Id: I6b040e93391614b44d136a485faa4a332c396e51
ower/BatterySaverPolicyTest.java
m/TestWindowManagerPolicy.java
1966cccd321b9f7342226cb09f210cbdb083a1de 08-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Keep Settings.Global.NETWORK_RECOMMENDATIONS_ENABLED updated."
8603ad42df11630e833c10a5d211b01d2cc60c25 07-Mar-2017 Daniel Nishi <dhnishi@google.com> Merge "Use the fast track for the AppCollector."
9925c6a7e703a1267aef47d4b17c494d1fedb162 06-Mar-2017 Jeremy Joslin <jjoslin@google.com> Keep Settings.Global.NETWORK_RECOMMENDATIONS_ENABLED updated.

Make sure Settings.Global.NETWORK_RECOMMENDATIONS_ENABLED reflects
the current active scorer state. When valid the setting will have a
value of 1, when invalid it will be 0 (or more
accurately not 1, see below).

Introduced a new valid setting value, -1, which indicates the feature
has been forced off.

Test: runtest frameworks-services -c com.android.server.NetworkScorerAppManagerTest
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 35896421
Change-Id: I271725f798e5d0acc7c08c79678dba5115f8faad
etworkScorerAppManagerTest.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
m/ActivityManagerServiceTest.java
172f7801c7376a33d7cfe07c8cb4525d14db0c8f 06-Mar-2017 Bartosz Fabianowski <bartfab@google.com> Rename DPM.isDefaultInputMethodSetByOwner()

Settings.Secure.DEFAULT_INPUT_METHOD is a misnomer. It does not really
record a permanent default of any sort - it just indicates the currently
chosen IME. Thus, isDefaultInputMethodSetByOwner() should more
appropriately be called isCurrentInputMethodSetByOwner().

Furthermore, it turns out that setting a different IME for a user and
the user's work profile is unsupported. Thus, it is sufficient for the
intended use case to just retrieve the calling user's default IME.
There is no need for a |user| parameter.

Bug: 32692748
Test: unit tests (see DevicePolicyManagerTest.java for invocation)
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases

Change-Id: Ia0846d38a1361042429dae7430a8b055575ef2e0
evicepolicy/DevicePolicyManagerTest.java
e096df0063f9b22af1bf9159e4b6056c1c5c70f0 03-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adding support for passing arbitrary extras when requesting to pin a widget. Also defining an extra constant for widget preview which can be used by developers to provide a snapshot of the widget with the pin request"
8b5ca97a6ccdcd5ee7beb924c5eafd63a310a3cb 03-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add API for checking which CA certs were installed by the DO/PO"
b52ba99d000cc4dae52829e384cb48a645cb23db 03-Mar-2017 Daniel Nishi <dhnishi@google.com> Merge "Save/load calculated cache quotas to a file."
05dc9f764c9d399add8b7495e680f66d098c55eb 22-Feb-2017 Bartosz Fabianowski <bartfab@google.com> Add API for checking which CA certs were installed by the DO/PO

With this API, the system can determine whether a CA cert was
installed by the user or the user's DO/PO.

Bug: 32692748
Test: unit tests (see DevicePolicyManagerTest.java for invocation)
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases

Change-Id: I3bcae5ac18ec2b110154184fc515df804fd73da6
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
b85a22ca090615c1ee33a31c444a3d15a6a56341 03-Mar-2017 Bryce Lee <brycelee@google.com> Merge "Remove mTask from AppWindowToken."
e40da3c1b7d4eb810b6f067075dbbb011d02a379 14-Feb-2017 Daniel Nishi <dhnishi@google.com> Save/load calculated cache quotas to a file.

This will prevent us from unnecessarily redoing calculation work
by loading the last caches on boot and shoving them down to
installd.

Bug: 33965858
Test: Framework services tests
Change-Id: Ie94e269aa72bceb1ebe87911eaa42e2d826c1123
torage/CacheQuotaStrategyTest.java
3c954e9e01b4a79535f3de27a20398e6af620df0 02-Mar-2017 Calin Juravle <calin@google.com> Merge "Update package use info when the app data is updated"
99dd37b3c5262910150ef955d16a33d32da264dd 23-Feb-2017 Calin Juravle <calin@google.com> Update package use info when the app data is updated

- clear usesByOtherApps flag when the package is updated
- delete secondary dex usage data when the app data is destroyed

Test: runtest -x .../PackageDexUsageTests.java
runtest -x .../DexManagerTests.java
Bug: 32871170
Bug: 35381405

Change-Id: I3a249b9e8680e745fa678c7ce61b4ae764078fb9
m/dex/DexManagerTests.java
m/dex/PackageDexUsageTests.java
594ea5f8b031c09de090eab446209b84aa78fd37 02-Mar-2017 Dianne Hackborn <hackbod@google.com> Merge "Implement issue #34842682: Add ability to limit permissions based on features"
7fbeb8a5d754c7e5c330458cf241c5e2a718099c 02-Mar-2017 Bryce Lee <brycelee@google.com> Remove mTask from AppWindowToken.

mTask was a duplicate reference to the WindowContainer's parent. The
main benefit of this refenrece was type, as its callers require an
instance of type Task.

With the introduction of the method getTask, we can shift away from
this variable and instead directly cast the parent here. If the
window hierarchy changes in the future (such as AppWindowToken parent
types not being Task), we can re-evaluate and adjust how task is
returned.

Test: manual
Change-Id: Idd6bba1121056ed79745911efe838edfa685bbf2
m/WindowTestsBase.java
c20082bd46e614c054a0f883e316fb37f26b110d 02-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Change MaskableBitmap to AdaptiveBitmap Test: $ make dist -j30 b/35399620"
4ad6b57700bef4c484021f49e018117046562e6b 28-Feb-2017 Sunny Goyal <sunnygoyal@google.com> Adding support for passing arbitrary extras when requesting to pin a widget.
Also defining an extra constant for widget preview which can be used by
developers to provide a snapshot of the widget with the pin request

Bug: 35811129
Test: All exisiting tests passing
for f in 1 2 3 4 5 6 7 8 9 10; do \
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest$f \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner; \
done;

adb shell am instrument -e class com.android.server.appwidget.AppWidgetServiceImplTest \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Id854bd28468a5bf0416ff1a1b19c44d850016f32
ppwidget/AppWidgetServiceImplTest.java
m/ShortcutManagerTest9.java
6d41026f1b3dc910c9d34ab89993a280dc9679cf 01-Mar-2017 Bryce Lee <brycelee@google.com> Clean up closing apps list when clearing anAppWindowToken's task.

Previously it was possible for an AppWindowToken to be removed while
on the closing apps list, used in transition animations. During these
transitions, the visibility of the token is modified. Since
visibility relies on the WindowContainer parent, a
NullPointerException would occur.

This changelist addresses the issue by making sure to remove any
AppWindowToken from this list when its task is set to null.

Change-Id: Id9234822b228f4658f04d42ac0fe7b49ded6f5a1
Fixes: 35352214
Test: manual (primarily code inspection)
m/AppWindowContainerControllerTests.java
m/DisplayContentTests.java
m/TaskSnapshotControllerTest.java
m/WindowTestsBase.java
e4179e2c4e674b32390a9133bb9fbb3ef5df651b 01-Mar-2017 Hyunyoung Song <hyunyoungs@google.com> Change MaskableBitmap to AdaptiveBitmap
Test: $ make dist -j30
b/35399620

Change-Id: I96d6eaceaf7ce9dec7de21634a5fa2bd40b0deba
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
c4584c1da8b426ea9f9698508079d3b751ce815b 01-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add a network scorer label metadata field to NetworkScoreAppData"
cd154e95353e7af11314d2339500d6c7f85e181a 01-Mar-2017 Dianne Hackborn <hackbod@google.com> Implement issue #34842682: Add ability to limit permissions based on features

Two new attributes for <uses-permission>: android:requiredFeature and
android:requiredNotFeature.

Also update aapt to include this information in badging:

uses-permission: name='android.content.cts.REQUIRED_NOT_FEATURE_UNDEFINED' requiredNotFeature='android.software.cts.undefined'
uses-permission: name='android.content.cts.REQUIRED_MULTI_DENY' requiredFeature='android.software.cts.undefined' requiredNotFeature='android.software.cts'

Test: new PermissionFeatureTest suite.

Change-Id: Icc1f815a4675ae9dd2cb7f61730ab28b5c11228a
m/ParallelPackageParserTest.java
18d62becbd98a906f74f1249251cd88a56019ab3 01-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add a process state seq counter to UidRecord."
8b1339af53c3e3287cfb98eb25c69f31739923e6 01-Mar-2017 Stephen Chen <stewchen@google.com> Add a network scorer label metadata field to NetworkScoreAppData

This field allows Network Score Services to pass an alternate label for
the scorer.

Bug: 35848510
Test: runtest --path
frameworks/base/services/tests/servicestests/src/com/android/server/NetworkScorerAppManagerTest.java
runtest --path
frameworks/base/services/tests/servicestests/src/com/android/server/NetworkScoreServiceTest.java

Change-Id: Ic28671c1663bd08b2406045d20c150a209d56054
etworkScoreServiceTest.java
etworkScorerAppManagerTest.java
fc1f26f61f87d5537efb30d3aa0f538ae5c042d0 01-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Only adjust window layers from WindowLayerController"
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
m/ActivityManagerServiceTest.java
dee1b3f80c363fa6d3c9e87acd729161bce56c23 27-Feb-2017 Robert Carr <racarr@google.com> Only adjust window layers from WindowLayerController

Various animation adjustment logic will directly set mAnimLayer
outside of WindowLayerController. If we end up setting this layer
very high, we can end up moving it above the special windows
collected in WindowLayersController.

Bug: 33702491
Bug: 35396882
Test: bit FrameworksServicesTests:com.android.server.wm.WindowTokenTests
Change-Id: I9850529ecd6f0067bc24421515b39b645885a3ec
m/WindowTestsBase.java
m/WindowTokenTests.java
d7b0329ab7c3355c84f8227939e88f305dd78b51 28-Feb-2017 Daniel Nishi <dhnishi@google.com> Use the fast track for the AppCollector.

This replaces some of the threading shenanigans done to get this
working with the regular PackageManager call. By swapping this
out, we can get results faster, using less power, and with a
simpler implementation and testing strategy.

Bug: 35807386
Test: FrameworkServicesTest
Change-Id: Ib94fd7eba838b5e728f8f2615bcb4d9c82f21885
torage/AppCollectorTest.java
a7aaae881cb3168641e3117a0de6db15b63b5a44 28-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Delete ParcelableString, add StringParceledListSlice"
abaa0695c5361b36a7a2cdbe87c77bf60be20af7 20-Feb-2017 Robin Lee <rgl@google.com> Delete ParcelableString, add StringParceledListSlice

Both inherit from package private BaseParceledListSlice.

This is still bad, but it's not as bad. The existing code that uses
this can just do Foo.bar().getList() now instead of having to marshal
to and from an oddball type at either end as well.

In the longer term ParceledListSlice<> should be eliminated, but it's
not clear how far into the future that is going to happen.

Test: runtest -x services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: runtest -x core/tests/coretests/src/android/content/pm/ParceledListSliceTest.java
Change-Id: Ie69b96b5215d6e04990f6d31345772cdfee21d78
evicepolicy/DevicePolicyManagerTest.java
b1dc328990316ff355d8281e2586f98d13cf7152 28-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Have WM use token info. from IMMS to determine IME target window"
daab865344fcfa45fe2789e43462f730a44fba64 24-Feb-2017 Wale Ogunwale <ogunwale@google.com> Have WM use token info. from IMMS to determine IME target window

Window Manager currently places the IME above the highest window
that can possibly be using the IME. While this method works for
most cases, it does cause some animation jank if the window making
the IME visible is below an other window that could possibly make
the IME visible, but isn't. When this happens the IME is displayed
on-top of which we don't want since the top app isn't making the
IME visible.
We now rely on a strong signal from the input method manager service
WMS.updateInputMethodWindowStatus() to depend which window is actually
using the IME so the window manager can z-order things correctly.

Fixes: 31559891
Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Change-Id: I524aa9dbeb764aac15034a13adf9381304c38fa6
m/DisplayContentTests.java
m/WindowTestsBase.java
59774e209cf1f6a13365cc527d588c5d91fa5e00 27-Feb-2017 Dianne Hackborn <hackbod@google.com> Merge "Add new job scheduler constraints for "battery not low"."
a06ec6a9435f9555142e700f54cf20278bc1982f 13-Feb-2017 Dianne Hackborn <hackbod@google.com> Add new job scheduler constraints for "battery not low".

Clean up the implementation of boolean constraints so that
they are in a single flags value that gets propagated all of
the way from JobInfo.Builder in to the JobStatus. Much simpler
and easier to add new constraints!

Also introduce some shell commands to make it easier to write
tests against the job scheduler (and other things tied to power).
One of the big things here is that there is a new sequence number
that propagates with battery updates, which we can look for in
the job scheduler to determine when a change the test has made
to battery state has actually gotten applied, to allow it to
safely and minimally wait until executing the condition being
tested.

Test: New BatteryConstraintTest suite added.

Change-Id: I11076d90b80ec25ee604c29b6a6dc2337fd867ce
ob/JobStoreTest.java
58fc95dc578244b7beb687a48184045dcce788b8 14-Dec-2016 Hakan Seyalioglu <hseya@google.com> Push chooser targets to the shortcut manager.

More info at go/direct-share-push

Test: Some basic testing currently in, more to be added.

Change-Id: I069f9779988c3eca2c4d8b83ec62501983854355
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
4190575960f524696da89574e6825f91e0925ead 27-Feb-2017 Jeff Sharkey <jsharkey@google.com> Merge "Delete @removed APIs that never shipped."
99ccebf548bf90f828f838b1bdf5cd61d3472f08 25-Feb-2017 Amith Yamasani <yamasani@google.com> Merge "Reduce screen on delay during UsageStats rollover"
61d5fd7fee3250bdf4b6ddfbccbd6bceae9436c6 24-Feb-2017 Amith Yamasani <yamasani@google.com> Reduce screen on delay during UsageStats rollover

Decoupled the app idle book-keeping from usage stats lock, by
introducing an mAppIdleLock. This is used for all state related
to app idle. In some cases, the locks will be nested, with
mLock being acquired first and then mAppIdleLock.

This should fix the situation where a rollover, which writes to
disk and could take several seconds when the system is swamped,
like when the device just came out of idle and the screen was
turned on (like this run-on sentence), causes calls from other
services for app-idle status to be blocked. This was resulting
in a long time to turn on the screen.

Also fixed a dump indentation issue.

Bug: 34627115
Bug: 34961340
Test: Manual, force into idle, increased rollover frequency,
and tested screen on time.

Change-Id: Ie8b44e6f07f82d8a31f1b733a403dd9b6dc310f6
sage/AppIdleHistoryTests.java
dd9bda81f698043a0110d4e2178d20cb160ba829 24-Feb-2017 Jeff Sharkey <jsharkey@android.com> Delete @removed APIs that never shipped.

These were never part of any public API level, so apps should never
have been using them.

Test: builds, boots
Bug: 31241513
Change-Id: I4fc8f5c325da56694a5db98acc995a22d4947805
m/PackageParserTest.java
ee3fb5cac97ad63b3ba1727cb3b38c1888a29cb9 13-Feb-2017 Jeremy Joslin <jjoslin@google.com> Bind to the recommendation service specified in the Setting.

High level changes to NetworkScorerAppManager:
* Implemented getAllValidScorers() and removed the old
config-based discovery code.
* Implemented setActiveScorer() to persist its given package
name to Settings if it represents a valid network
recommendation app.
* Added a new method that reverts the setting back to the
configured default if the current setting represents an
invalid app.

High level changes to NetworkScoreService:
* Updated the PackageMonitor to only watch a single package.
* Moved most of the startup logic to onUserUnlocked() so we
don't have to worry about whether or not the device is encrypted
when querying the PackageManager.
* The PackageMonitor is only registered/unregistered when the
package it's watching changes.

Test: runtest frameworks-services -c com.android.server.NetworkScorerAppManagerTest
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 35095406
Change-Id: Ib32aca72dac4b831a64ceb3cd5c31e8fa2f61396
etworkScoreServiceTest.java
etworkScorerAppManagerTest.java
f621bc973380bb87013c503f7daaf25fd0b94721 16-Feb-2017 Jeremy Joslin <jjoslin@google.com> Move NetworkScorerAppManager into com.android.server.

NetworkScorerAppManager is only used internally by the
NetworkScoreService and no longer needs to be part of core.
Extracted its inner class, NetworkScorerAppData, into a top-level
class and left it in android.net as it's used as part of the
NetworkScoreManager API.

Test: runtest frameworks-services -c com.android.server.NetworkScorerAppManagerTest
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 35095406
Change-Id: I201f081e05d0a909b4ae3142b63afc3e21548f77
etworkScoreServiceTest.java
etworkScorerAppManagerTest.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'
m/PackageParserTest.java
df0824ad4cd31a3e96653fe82ce969b08cd00be2 23-Feb-2017 Guang Zhu <guangzhu@google.com> Merge "Revert "OMS: integrate OverlayManagerService into framework""
95459806920dec34abb3214ab6e1a9b9213a2a61 23-Feb-2017 Guang Zhu <guangzhu@google.com> Revert "OMS: integrate OverlayManagerService into framework"

Bug: 31052947
Bug: 35697944

This reverts commit 21a3d1ad686dee97b9cf0ed80389ee2ab0d48013.

Change-Id: I2d86931020301524c26cf8c8e80d557c97fdd6c3
m/PackageParserTest.java
0f09817859b19054aee3feded1dbf9757a5ec131 23-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "OMS: integrate OverlayManagerService into framework"
0e9acb53bdd0386358218c798501b71e0d28d972 23-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add "Use open Wi-Fi automatically" setting."
5840f4238fa51442dcc87a651e4f7ac39171f29f 23-Feb-2017 Daniel Nishi <dhnishi@google.com> Merge "Add a flag to enable/disable the cache quota calc."
bc9a8e6f5ba404261c6a7a7e49a529661e05e910 03-Feb-2017 Amin Shaikh <ashaikh@google.com> Add "Use open Wi-Fi automatically" setting.

- Add constant in NetworkScoreManager for the meta-data key required
for NetworkRecommendationProviders to specify which package provides
this feature.
- Add Setting to specify which package is enabled for providing this
feature.

Bug: 34773276
Test: make
Change-Id: I3f8209c21b8b219c242650f97ba407b5985a5250
etworkScoreServiceTest.java
0f703e64e3e111048acb7abf5792d589ce1e3eb7 22-Feb-2017 Daniel Nishi <dhnishi@google.com> Add a flag to enable/disable the cache quota calc.

Bug: 34770259
Test: ServicesTests
Change-Id: I74155203c4802b1a3b89117859002bf40b1ca435
sage/StorageStatsServiceTest.java
b902a835a3e9a8765b76b034030b61b702db6968 22-Feb-2017 Daniel Nishi <dhnishi@google.com> Don't crash when primary volume is null in AppCollector. am: d54f3a487b
am: e13bfbde1a

Change-Id: I8b35924b59938f84502b0afaa8165ebf1fc2e4d4
e13bfbde1a1baae986ec33586f0fb1221eec5d64 22-Feb-2017 Daniel Nishi <dhnishi@google.com> Don't crash when primary volume is null in AppCollector.
am: d54f3a487b

Change-Id: I77e27f4a7e901e98995039bcfd68453bec83a6cd
d54f3a487bba1dc5008e2e1482ef451a59500752 22-Feb-2017 Daniel Nishi <dhnishi@google.com> Don't crash when primary volume is null in AppCollector.

getPrimaryStorageCurrentVolume() may return a null value. I did
not plan for this case in the AppCollector. This case occurs when
the primary storage is not mounted when the function is called.

By adding in a null check after getPrimaryStorageCurrentVolume()
and adding in preconditions to verify the non-nullness of the
volume as it propagates through the AppCollector, we ensure that
there should be no more NPE crashes for this reason.

Bug: 35636901
Test: FrameworkServicesTests
Change-Id: I4009e55502f71b8f14dd917ddd00caef3551aafd
torage/AppCollectorTest.java
21a3d1ad686dee97b9cf0ed80389ee2ab0d48013 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.

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'
Change-Id: Idc96dae6fc075d5373aa055bbf50e919136d7353
m/PackageParserTest.java
b327a4a34e9128d9a758232edbf9d06de53364fa 21-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixed issues with child windows been IME targets"
342479581e113a6cf05f6e1d6470a86ad6032bcb 19-Feb-2017 Wale Ogunwale <ogunwale@google.com> Fixed issues with child windows been IME targets

- Fixed issue with WindowState.getWindow() returning the parent window before
its children with positive sub-layers. Positive sub-layer children should be
returned first, then the parent window, and then negative sub-layer children.
This was causing the the parent window to be selected as the IME target
instead of the child on-top of it since they both can be IME targets and the
parent window was returned first.
- Fixed issue with WindowState.forAllWindow() not returning the IME window if
the current IME target is a child window.
- Add test WindowStateTest.testGetWindow(),
DisplayContentTests.testForAllWindows_WithChildWindowImeTarget(), and
DisplayContentTests.testComputeImeTarget() to cover the failing cases.

Change-Id: I0c93e0344601fc870011e8a8d84528f62b0a2a06
Fixes: 34786357
Fixes: 34306127
Fixes: 34711958
Fixes: 35362942
Test: bit FrameworksServicesTests:com.android.server.wm.WindowStateTests
Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
m/DisplayContentTests.java
m/WindowStateTests.java
m/WindowTestsBase.java
07ac1442b5b62c4cdeb4a5e93b4c38c6d9241894 10-Feb-2017 Narayan Kamath <narayan@google.com> PackageParser: String interning fixes.

Stop interning string metadata values as well as class names as it's
unlikely there will be much duplication among these.

Also make sure we intern the same set of strings when parsing packages
from their cache entries as we do when parsing them from the package
itself.

This change also improves error reporting for the unit-test and fixes
a failure that was introduced by a previous change (the addition of
static libraries).

Test: PackageParserTest
Bug: 34726698

Change-Id: Ia0d0342b91b3294bd5569756255918d1dc886e05
m/PackageParserTest.java
d89cf81f80f17c58abf564728d0e10c4754ab600 18-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Change MaskableIconDrawable to AdaptiveIconDrawable"
8c9a6b0089ff712df4e06454ade1443b77a4a9f4 17-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert "Revert "Per user setting for instant app"""
be8835e86bc39570994af32ead381875e3ee54d5 17-Feb-2017 Hyunyoung Song <hyunyoungs@google.com> Change MaskableIconDrawable to AdaptiveIconDrawable

Test: $ make -j31 dist

Bug: 35399620
Change-Id: I5e54f75b3df21ffe546e0e54dbd7ea29499d1789
m/ShortcutManagerTest1.java
000fd43eece0f5e8a3111ca62da05b05576fe4b8 17-Feb-2017 Andrii Kulian <akulian@google.com> Merge "Report move to display for activities that handle config changes"
4f7e1fc9af698e08576c9beadef872f5c4ea04a8 17-Feb-2017 Bartosz Fabianowski <bartfab@google.com> Merge "Add API for checking whether the default IME was set by the DO/PO"
b047b8bd7e363081e91ba6cbc8d09cd355624584 09-Feb-2017 Andrii Kulian <akulian@google.com> Report move to display for activities that handle config changes

When activity that is moved between displays handles all configuration
changes, it won't be restarted. This CL adds a callback to the client
to notify it about display change. Usually it will be followed by
onConfigurationChanged, except when configuration didn't actually change.
When activity is recreated, it won't receive onMovedToDisplay.

Bug: 34862802
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testOnMovedToDisplayCallback
Change-Id: I9a9501cab788623ada15a31efb53e4b2378639fe
m/TestIWindow.java
977e656e491410aee79a66d5a45b3e052f7a644a 16-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Make a11y shortcut toast appear for all users."
939ccc3854d841e4aa1fc33017d49a2446315ca6 16-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Clear DISALLOW_ADD_USER in clearDeviceOwner for all cases"
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
m/BaseShortcutManagerTest.java
m/PackageManagerSettingsTests.java
m/PackageParserTest.java
etaildemo/PreloadAppsInstallerTest.java
348f696d33ffc188459e6318c65c8f9058f8d974 30-Jan-2017 Victor Chang <vichang@google.com> Clear DISALLOW_ADD_USER in clearDeviceOwner for all cases

We are not moving the restriction from system to the DO in the end.
clearDeviceOwnerUserRestrictionLocked becomes the permanent solution
for DeviceOwner CTS. Looks like no one setting DISALLOW_ADD_USER
directly in UserManager except DO/PO, and so remove it when DO is
clear

Change-Id: I235bebebd02b5e0d9883eea6dd3a4e49b40fe043
Fix: 33476323
Test: runtest frameworks-services -c com.android.server.devicepolicy.DevicePolicyManagerTest
evicepolicy/DevicePolicyManagerTest.java
aff5e9c21c28f21f7a3688d84e747727cf17f382 25-Jan-2017 Bartosz Fabianowski <bartfab@google.com> Add API for checking whether the default IME was set by the DO/PO

With this API, the system can determine whether a user's default
IME was set by the user or the user's DO/PO.

Bug: 32692748
Test: DPMS unit tests and CTS CtsDevicePolicyManagerTestCases

Change-Id: Ibd703ff5c9e4c072599ad8d6023c94a97d728109
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
824b073fbeee57154316c1e60d211e8e9ab54ac6 16-Feb-2017 Rubin Xu <rubinxu@google.com> Merge "Add escrow token API in DevicePolicyManager."
4c64c0d99ee4340983d17f971f3dfca0c1cbf234 16-Feb-2017 Hyunyoung Song <hyunyoungs@google.com> Merge "ShortcutManager should support MaskableBitmap Icon type"
f281e7afae14f61e1d031f55cc80c59d0b39b528 13-Feb-2017 Hyunyoung Song <hyunyoungs@google.com> ShortcutManager should support MaskableBitmap Icon type

Note: https://ag/1872683/ is where initial code review happened.

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases -t 'android.content.pm.cts.shortcuthost.ShortcutManagerMultiuserTest'
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.LauncherAppsProfileTest'


b/34196580

Change-Id: I3b983c29387e474c7a8c687a524105ceaceac81e
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
0b6b10d1eeb30631aaa44e84db8f14444832a2bd 16-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fail safely on invalid ScanResults when creating NetworkKey"
aab7a4146ccd14f94ac87f4c52895f1bb5d37645 30-Dec-2016 Rubin Xu <rubinxu@google.com> Add escrow token API in DevicePolicyManager.

Take advantage of the new authentication flow in LockSettingsService
and allow PO or DO to provision escrow tokens on the device. The
escrow token grants them the ability to change device lockscreen
(if used by DO) or work profile challenge (if used by PO). The
new password reset mechanism is even usable before user unlocks,
and it preserves authentication-bound keys in keystore.

Test: runtest frameworks-services -c com.android.server.SyntheticPasswordTests
Test: runtest frameworks-services -c com.android.server.devicepolicy.DevicePolicyManagerTest
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedDeviceOwnerTest#testResetPasswordWithToken
Bug: 33126620
Change-Id: Iaa684c51946f726cbd909e9ac70ad3e9ca3de1ac
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmTestBase.java
f095f8366bac52ac1eeb2b3eb1a403294ceeb541 31-Jan-2017 Rubin Xu <rubinxu@google.com> Add escrow token support to synthetic password flow

Escrow token provides an alternative way to derive synthetic password for a
given user. In the new flow, a pre-provisioned escrow token
should be able to do anything the user password can do, since they both
derives the synthetici password which is the master key in the new auth flow.

Test: runtest frameworks-services -c com.android.server.SyntheticPasswordTests
Bug: 33126414
Change-Id: Ib5ee38fd61f66de3245427ce992ebc12f1873a26
yntheticPasswordTests.java
3bf722a8d54ca7192dfe07ee7b73eac7d25ccac5 15-Dec-2016 Rubin Xu <rubinxu@google.com> Add synthetic password to authentication flow

The user password is used to unlock a per-user synthetic password which
serves the purpose of what the user password previsouly achieves (protect
keystore, vold disk encryption, auth token generation).

Test: runtest frameworks-services -c com.android.server.SyntheticPasswordTests
Test: manual
1. Start with fresh device, enable synthetic password with "adb shell cmd lock_settings sp 1"
1.1 add device lock, reboot and verify (positive & negative); change device lock, reboot and verify.
1.2 Inflate a work profile, reboot and verify device lock. check SID with "adb shell dumpsys lock_settings"
1.3 Un-unify and add work challenge, reboot and verify work challenge and SID.
1.4 Re-unify work challenge, reboot and verify.
1.5 Clear device lock, reboot and verify lock and SID.

2. Start with a fresh device, add a device lock and inflate a work profile.
2.1 Enable synthetic password, note current SID
2.2 Reboot and unlock device. Verify synthetic password is generated and SID remains.
2.3 Clear device lock, reboot and verify (SID should be cleared)

3. Start with a fresh device, inflate a work profile, add separate work challenge
3.1 Enable synthetic password, not current SID
3.2 Reboot and unlock device and profile. Verify synthetic password is generated.
3.3 Clear device lock only, reboot and verify (work profile SID should remain)

All steps tested on marlin (FBE) and bullhead (FDE)

Bug: 33126414
Change-Id: Idb9ebfc7bba2fe40670c5fee2189e873d9704540
aseLockSettingsServiceTests.java
ockSettingsServiceTestable.java
ockSettingsServiceTests.java
ockSettingsStorageTestable.java
ockSettingsStorageTests.java
ockGateKeeperService.java
ockSyntheticPasswordManager.java
yntheticPasswordTests.java
fde900dbbd8c2d2863274804db287deb0af9ccc4 15-Feb-2017 Stephen Chen <stewchen@google.com> Fail safely on invalid ScanResults when creating NetworkKey

Added tests for NetworkKey#createFromScanResult

Bug: 34671341
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkKeyTest.java
runtest --path
frameworks/base/services/tests/servicestests/src/com/android/server/NetworkScoreServiceTest.java

Change-Id: Ideac1615917649cd3934421228a82aeed37e7ad1
etworkScoreServiceTest.java
7192297bc9669f3705d2a18893889e9a113a342a 14-Feb-2017 Phil Weaver <pweaver@google.com> Make a11y shortcut toast appear for all users.

Setting flag to make the toast appear for all users.

Bug: 35209951
Test: Verified manually on guest users, added automated check
that the flag is set.

Change-Id: I91d1f32acebe1197356289b23142d33c5a8bbd23
olicy/AccessibilityShortcutControllerTest.java
a10b057bb869ca7c99938053ca5fe60029555b3b 14-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "MonitoringCertTask no longer relies on software.device_admin"
7f5c91c6bce6a8ff2414549219a321a98a98ab31 08-Feb-2017 Robin Lee <rgl@google.com> MonitoringCertTask no longer relies on software.device_admin

Added a test to validate that it still works the way it should before
and after the change.

Bug: 33258404
Bug: 35196414
Fix: 35129745
Test: runtest -x services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: also manual, instructions:
Test: (1) Disable software.device_admin from tablet_core_hardware, rebuild.
Test: (2) Install CA cert. Notification should appear.
Test: (3) Reboot. Notification should still be there.
Change-Id: Id992725c1844a2fffbde4d8acaba531e99f853ad
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
0a2b187309aea30c7f4f69dc91feb58604b0995c 13-Feb-2017 Makoto Onuki <omakoto@google.com> Merge "Do not allow work profile to see main other profiles"
12cb6628dbfc2f50a04502f37386d453956a02e3 13-Feb-2017 Winson Chung <winsonc@google.com> Merge "Create a new stack for the assistant activity."
de3c16c8057b61bb3cc2e0c3d5603730f5841c51 26-Jan-2017 Makoto Onuki <omakoto@google.com> Do not allow work profile to see main other profiles

It won't throw SecurityException, but it'll pretend there's
no apps on the other profile.

- Also log an error about it, in the client side process.

- Also still send WTF() about the reverse access.

Bug: 34650921
Bug: 34340531

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases -t 'android.content.pm.cts.shortcuthost.ShortcutManagerMultiuserTest'
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.LauncherAppsProfileTest'
Change-Id: I6164014685009db3f34a176a3f12c517766b2b49
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
4a73a224234a66dcbf597f83121ca9cd4692311e 13-Feb-2017 Wale Ogunwale <ogunwale@google.com> Removed TaskSnapshotCacheTest from presumbit

Until b/35196891 is fixed.

Bug: 35196891
Test: TaskSnapshotCacheTest
Change-Id: I636b1da5149e45f24ef740d0d7619743856d6df4
m/TaskSnapshotCacheTest.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
m/WindowLayersControllerTests.java
m/WindowTestsBase.java
500ce9ea58a6c3465703257eab03f9bad76b1e0a 12-Feb-2017 Jeff Sharkey <jsharkey@android.com> Explicit API for allocating disk space.

Now that we're giving apps better guidance around how much cached
disk space they can use, we also need to provide a way to help clear
some of those cached files. The final logic is coming in a future
CL, but it will be designed to prevent abuse.

Test: newly added CTS tests
Bug: 34690590
Change-Id: I1e46ade0cdabbc33162fc7bfa76abec711992f92
ockStorageManager.java
f2ecbbc35ee4119839e830f0c55657465fb1e11d 10-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix WindowFrameTest error."
186d9dee1bea76d3af1cfff0213925245d28c54b 09-Feb-2017 Robert Carr <racarr@google.com> Fix WindowFrameTest error.

It appears somehow we are using real display sizes and it varies from
device to device. This itself is somewhat concerning, but easy enough
to handle. If you look at the line before the modified lines
it seems like this is what I meant to do initially but somehow it didn't happen.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Fixes: 35197592
Change-Id: I05880ba95a8ee3b790fb14daf00c878b4f85095c
m/WindowFrameTests.java
d927a0e24e0810be637c70c9ff44755a0b10323e 08-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "New internal interface method to get the active scorer metadata."
1a81a63b8103003fbc8722b3613f062a46282253 08-Feb-2017 Wale Ogunwale <ogunwale@google.com> Merge "Fixed failing WM pre-submit tests"
b94a914c9e2446f791cf165a38dd6683c4251f0a 08-Feb-2017 Rubin Xu <rubinxu@google.com> Merge "Small tweaks in LockSettingsService"
17f175ca1a75d5a4864b88126f5d2a59935d52fd 08-Feb-2017 Wale Ogunwale <ogunwale@google.com> Fixed failing WM pre-submit tests

- Pre-submit wasn't really enabled so several changes were merged in
that caused test failures
- Specify that AppWindowTokenTests token fill their parent since that
is important for the orientation tests it runs
- Disable testLandscapeSeascapeRotationByPolicy() until we have time
to figure-out the problem with the test.
- Initialize ActivityManagerInternal local service mock when we
initialize the test object for window manager.
- Changed UnknownAppVisibilityControllerTest to use test
infrastructure in WindowTestsBase.
- Fixed testGetOrientation_childSpecified to check the correct expected
state.
- Allow testAssignWindowLayers_ForImeNonAppImeTarget to create an alert
window at internal system window z-order.
- Remove all non-common windows for the system after each test run.

Bug: 35034729
Test: adb shell am instrument -w -e package com.android.server.wm
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: I4726811e382b18fbef6b9d9b12a5ee56776628e4
m/AppWindowTokenTests.java
m/TaskPositionerTests.java
m/TestWindowManagerPolicy.java
m/UnknownAppVisibilityControllerTest.java
m/WindowContainerTests.java
m/WindowLayersControllerTests.java
m/WindowTestsBase.java
a5172f69ca02f5338b4c36ad5e9b57b9fb4fd8d2 02-Feb-2017 Jeremy Joslin <jjoslin@google.com> New internal interface method to get the active scorer metadata.

Returns the cached NetworkScorerAppData from the connected service.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34773276
Change-Id: Ia8986e770c4ede0c0f7e2ad4f5bc0a0117a9ae2b
etworkScoreServiceTest.java
f546dbf39df3763596395d6bbae3fd9216f0b744 07-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix NetworkPolicyManagerServiceTest."
a1c92b7e8d534758d49c1808181aaa62f15357e3 06-Feb-2017 Stephen Chen <stewchen@google.com> Fix NetworkPolicyManagerServiceTest.

Bug: 33349775
Fixes: 33349775
Test: runtest --path
frameworks/base/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java

Change-Id: Ia4516b65730375a48aa7c7ef1ab89157ffa4f355
etworkPolicyManagerServiceTest.java
50979d14f913b97852c9e39b3b85c555988760f5 28-Jan-2017 Fyodor Kupolov <fkupolov@google.com> Tests for UserDataPreparer

Moved reconcileUsers, enforceSerialNumber to UserDataPreparer and added
unit tests

Test: manual + UserDataPreparerTest
Bug: 34736064
Change-Id: Icde93974ac68849e38357d8cfea0cc1b7a2aab49
m/UserDataPreparerTest.java
4d600d150f60249995c2212cff5acc9d11cbfc80 06-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Clear affiliation ids and lock task packages when clearing DO/PO"
f6f095a9c1da78d6c6267d14ea49ddb444396907 04-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Removed android.R.attr#onTopLauncher"
de9c63b8aea3c9cb4a482de4f950cb6859fb72f7 04-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Update Account Discovery API."
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
m/PackageParserTest.java
069bbd382898d3330d284912b3a472495045c363 03-Feb-2017 Wale Ogunwale <ogunwale@google.com> Removed android.R.attr#onTopLauncher

The product that the feature was intended for never launched, so
removing the complexity from the code base.

Test: builds
Change-Id: I75e60ee2da46f6012f03a6077f77bc6b9acecad5
m/WindowFrameTests.java
m/WindowTestsBase.java
37e877beccb9f3edd2a1dd33e01a76a7cd71c711 02-Feb-2017 Jeremy Joslin <jjoslin@google.com> Cache NetworkScorerAppData in the ScoringServiceConnection.

Store the entire NetworkScorerAppData instance in the
ScoringServiceConnection instead of just most of its fields.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34773276
Change-Id: Id2ed7c431dee9895e85e1966903ac919f1704eba
etworkScoreServiceTest.java
a7bd04e89271fe0bce7bb5136bc8df0466827c6c 02-Feb-2017 Esteban Talavera <etalavera@google.com> Clear affiliation ids and lock task packages when clearing DO/PO

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services
Change-Id: I38eea34cff82766c7e3b8cd79dd9757a212bb451
evicepolicy/DevicePolicyManagerTest.java
e366f82cef233a3378964da93f7313aa9fdeb56a 31-Jan-2017 Dmitry Dementyev <dementyev@google.com> Update Account Discovery API.

Use package name instead of uid.
Check calling package name in getAccounts methods.

Bug: 34841115, 34841115
Test: cts tests, manual tests.
Change-Id: I8a9e6aea5e2b6677be4bc414836b842239c5b6ac
ccounts/AccountManagerServiceTest.java
ccounts/AccountsDbTest.java
a55b168b5d5a0584b2411793f870a7849c5014f1 31-Jan-2017 Rubin Xu <rubinxu@google.com> Small tweaks in LockSettingsService

Paves way for synthetic password flow: Two notable changes:
1. when unify/un-unify work challenges, provide the old work profile password.
2. when clearing lock, supply old credentials.

Test: Unit test to be added in a follow up CL.
Bug: 33126414
Change-Id: I2a9553c5e7cc701338436e99e5a1289cebd1eda9
ockSettingsShellCommandTest.java
5cd907d3d6ceebf8731ef1f69347cce6f76109e9 26-Jan-2017 Wale Ogunwale <ogunwale@google.com> Alert Windows behavioral changes

- Introduced TYPE_APPLICATION_OVERLAY window type. Can be used by apps
to display windows on top of other app windows, but below critical
system windows.
- Deprecate alert window types TYPE_PHONE, TYPE_SYSTEM_ALERT,
TYPE_SYSTEM_OVERLAY, TYPE_PRIORITY_PHONE, and TYPE_SYSTEM_ERROR.
Apps should now use TYPE_APP_OVERLAY for this.
- Apps targetting O or greater are not allowed to add the old alert
window types.
Apps targetting less than O can still add the old types.
Apps with permission INTERNAL_SYSTEM_WINDOW (system signature apps) can
still add the old types.
- Z-order old alert windows types below TYPE_APPLICATION_OVERLAY if
they are added by an app without the INTERNAL_SYSTEM_WINDOW permission.

Test: android.server.cts.AlertWindowsTests
Bug: 33256752
Change-Id: I12170955a7a333151d3387c169b51c53c32164fc
m/TestWindowManagerPolicy.java
m/WindowFrameTests.java
m/WindowTestsBase.java
f9295bcc249f5dc8da8fb85a4b108a0b8f729e2f 02-Feb-2017 Gustav Sennton <gsennton@google.com> Merge "Make sure we cannot use packages targeting pre-O as WebView packages."
335595078510e06a0c50b273e3b4e8b0ec015320 02-Feb-2017 Esteban Talavera <etalavera@google.com> Merge "Affiliated profile owners can set lock task packages"
0c430fa464e8713ceec062c673bed8bdc8687e1e 01-Feb-2017 Bryce Lee <brycelee@google.com> Merge "Allow opening activity to specify orientation."
a163b76570d15e0bbfd318b2962c4966a8a538e5 24-Jan-2017 Bryce Lee <brycelee@google.com> Allow opening activity to specify orientation.

An activity's window is initially not visible. This means it is not
accounted for until it becomes visible, which means requested
orientations will not be honored until after onCreate.

This changelist removes the visibility check previously used determining
the orientation.

This changelist also addresses an issue where an ActivityRecord member
variable tracking the last configuration sent was not being initially
updated.

Fixes: 33844887
Fixes: 33814250
Fixes: 34165818
Fixes: 34177026
Fixes: 33809086
Fixes: 34111451
Fixes: 33844423

Test: Verified reported issues fixed in apps mentioned in bugs
Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts.ActivityManagerAppConfigurationTests
Change-Id: If9243792b9f2d137dc5addbf6fb735a0048fa192
m/WindowContainerTests.java
a99952c18db3e40ea50eb36bf8978ac29cf1fbb3 01-Feb-2017 Bryce Lee <brycelee@google.com> Merge "Revert "Allow opening activity to specify orientation.""
2fb7de3d51bea5daf8790c0bc5070bd2ecba2a2a 01-Feb-2017 Bryce Lee <brycelee@google.com> Revert "Allow opening activity to specify orientation."

This reverts commit f0a6fdbf53882949db0a141693dd33302b42d51b.

Reason for revert: Submitted before complete.

Change-Id: I545ff45b5e870c79d66884b7a2a80981293b1b24
m/WindowContainerTests.java
26dbff358ce258af5c3ef31ef4f98c976961fa94 01-Feb-2017 Bryce Lee <brycelee@google.com> Merge "Allow opening activity to specify orientation."
bdcada976298716b9fb566fd6264e31098df4391 01-Feb-2017 Esteban Talavera <etalavera@google.com> Affiliated profile owners can set lock task packages

Mentioned that in the documentation, cleaned up the code
a bit and added unit tests

Bug: 34614754

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services
Change-Id: I91232bbe494398015094ab977c6a2adce339811f
evicepolicy/DevicePolicyManagerTest.java
564c2fd5db707dbe3e10df3e69780c0ab6ce7a51 30-Jan-2017 Gustav Sennton <gsennton@google.com> Make sure we cannot use packages targeting pre-O as WebView packages.

Using a WebView package targeting a release before O as WebView provider
on O will cause crashes (because of incompatibility issues), this CL
makes us interpret a package targeting a pre-O release as being invalid
on O.

Also remove the code that lets us fall back to loading the old
WebViewChromiumFactoryProvider (pre-O) class.

Bug: 34773740
Bug: 34180497
Test: Ensure WebView provider with targetSdkVersion="O" shows up in the
WebView Implementation Dev Setting, ensure targetSdkVersion=25 doesn't
show up.
Test: Add WVUS unit test to ensure a packages with targetSdkVersion < 26
are considered invalid, and > 26 are valid. Run WVUS unit tests.

Change-Id: I4d80d46019e2522bc3fc6068712d28eedb31fcce
ebkit/WebViewUpdateServiceTest.java
f0a6fdbf53882949db0a141693dd33302b42d51b 24-Jan-2017 Bryce Lee <brycelee@google.com> Allow opening activity to specify orientation.

An activity's window is initially not visible. This means it is not
accounted for until it becomes visible, which means requested
orientations will not be honored until after onCreate.

This changelist removes the visibility check previously used determining
the orientation.

This changelist also addresses an issue where an ActivityRecord member
variable tracking the last configuration sent was not being initially
updated.

Fixes: 33844887
Fixes: 33814250
Fixes: 34165818
Fixes: 34177026
Fixes: 33809086
Fixes: 34111451

Test: Verified reported issues fixed in apps mentioned in bugs
Test: Added additional unit tests to exercise override getOrientation.

Change-Id: I26b7e808b6f3d857543e3a187b6c318e88afa063
Signed-off-by: Bryce Lee <brycelee@google.com>
m/WindowContainerTests.java
27fcd9c97a2ceb50bab026237390207e5ee9e290 21-Jan-2017 Phil Weaver <pweaver@google.com> Accessibility can capture fingerprint gestures

Bug: 27148522
Test: Unit tests for two new classes in this CL, CTS in
linked CL.
Change-Id: Icb5113e00b1f8724814263b3cc7f72fe4a6f0b41
ccessibility/FingerprintGestureControllerTest.java
ccessibility/FingerprintGestureDispatcherTest.java
f180a9f56c5b01deb82fbeca0219ee42d84fb04c 30-Jan-2017 Chad Brower <cbrower@google.com> Merge "Update the accessibility gesture recognition logic, using prior assumptions about allowed gesture set to increase accuracy."
2b4f8731ca5d20bb686aacdd09bb2351eeebd337 30-Jan-2017 Calin Juravle <calin@google.com> Merge "[PM] Clean up logic for secondary dex oat files"
a0f2f77cdc24fb51f2c6906b6fc481c2c6d673c5 30-Jan-2017 Calin Juravle <calin@google.com> Merge "Compile secondary dex files in DexManager"
1aa5f88e35734383e66ecd65e82e83d788e18ccb 25-Jan-2017 Calin Juravle <calin@google.com> [PM] Clean up logic for secondary dex oat files

Add logic in DexManager to reconcile secondary dex records with the
actual files on disk. If secondary dex files are moved or removed then
DexManager will remove the generated oat files during the call to
reconcileSecondaryOdex() and update its internal state.

Add 'adb shell cmd package reconcile-secondary-dex packageName' which
will force DexManager to sync its data with the actual secondary dex
files.

Test: devices bots
runtest -x .../PackageDexUsageTests.java
runtest -x .../DexManagerTests.java
adb shell cmd package reconcile-secondary-dex
com.android.google.gms (after artificially/temporarily renaming some
dex files)

Bug: 32871170

Change-Id: Id2d72dc89995f89cf1ddf79ae4e992afd3f3c127
m/dex/DexManagerTests.java
m/dex/PackageDexUsageTests.java
c22c30ed1c05c5c24185dc4d380d1c5026923d46 17-Jan-2017 Calin Juravle <calin@google.com> Compile secondary dex files in DexManager

Add logic for secondary dex compilation in DexManager. Also, extend the
`cmd package compile` command with '--secondary-dex' option which will
compile all used secondary dex files for the given package.

Test: flash & boot,
cmd package compile --secondary-dex -f -m speed
com.google.android.gms
Bug: 32871170

Change-Id: Ia2b95cb70d26c4ead5cb650047641b0881ca84ae
m/dex/DexManagerTests.java
ffc7b784348282b7641cf973012b0f67190cecf9 27-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Reparent the activity in the task with associated window containers."
6029cae5558d314e26394b6c3b14464ac633d6fa 19-Jan-2017 Chad Brower <cbrower@google.com> Update the accessibility gesture recognition logic, using prior
assumptions about allowed gesture set to increase accuracy.

Test: Using gesture data from real users at
https://drive.google.com/corp/drive/folders/0BzgTMSNz7WvCNTExbGwtSTRWTzQ
measured accuracy via standalone app at
https://cs.corp.google.com/piper///depot/google3/java/com/google/android/apps/internal/accessibility/A11yGestures/
Also added unit test to check that synthetic gesture motions are recognized.

Change-Id: I06e61ec814ee52db7441c4998012c2df9910589e
ccessibility/AccessibilityGestureDetectorTest.java
3048004087968674c3af97e1c0b110a223f04703 26-Jan-2017 Winson Chung <winsonc@google.com> Reparent the activity in the task with associated window containers.

- Currently moveActivityToStack() adds the activity to the top of the
new task in the new stack, but the code path to update the window
container controllers assumes that they are in the same task and
attempts to position it by index. Instead, we should properly
reparent the activity in the new task (just like we reparent tasks
into new stacks), and also reparent the associated app window tokens
into their new tasks on the WM side.
- Also should fix an issue when trying to reparent an activity from one
task to another task by affinity.

Bug: 34394702
Test: AppWidgetContainerControllerTests#testReparent
Test: android.server.cts.ActivityManagerPinnedStackTests#testEnterPipFromTaskWithMultipleActivities
Change-Id: Ib767f85eb4f469cfd1c108c55242996325bdb866
m/AppWindowContainerControllerTests.java
m/WindowTestsBase.java
695417c25275a555d2775d46d2dcb8f9210e7cbe 27-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix DPM.getPermissionGrantState()"
2dbf9ae67a972e83f248eab06c583ff988da7422 27-Jan-2017 Bartosz Fabianowski <bartfab@google.com> Fix DPM.getPermissionGrantState()

The recent addition of DPM API access delegation introduced a bug in
this method. When a system app (UID 1000) called the method, it would
crash.

Bug: 34760123
Test: DPM unit tests
Change-Id: I69390ca30270d64a4d28a74c13a7679f14a62959
evicepolicy/DevicePolicyManagerTest.java
33d9bc529e4969444aca821190f16b565a7726a9 26-Jan-2017 Sunny Goyal <sunnygoyal@google.com> Merge "Adding AppWidgetManager.isRequestPinAppWidgetSupported"
c24bb2c4a6cd9a618453f2c72145656c1287cf1b 26-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix shared dim layer not cleared when all users removed"
367ff7fd5251790ad8dc086bd386be8cba1dda5c 26-Jan-2017 Andrii Kulian <akulian@google.com> Fix shared dim layer not cleared when all users removed

For secondary display, shared fullscreen dim layer user is
the only stack that is present on the display. When this stack
is removed the shared dim layer was not cleared. Because of
that it was crashing when trying to obtain DisplayContent from it.

Now when we're removing a dim layer user we check if we've removed
the last one and clear shared fullscreen dim layer if needed.

Bug: 34367817
Test: bit FrameworksServicesTests:com.android.server.wm.DimLayerControllerTests
Change-Id: I415196a345c491eddd26a55370bb819ce6485151
m/DimLayerControllerTests.java
m/DisplayContentTests.java
m/StackWindowControllerTests.java
m/TaskWindowContainerControllerTests.java
m/WindowTestsBase.java
75a6d9c8759fd92d441ab4a791c637f38db3804b 26-Jan-2017 Calin Juravle <calin@google.com> Merge "Notify DexManager about new package installs"
7b5bbb5509748c06ed5225b1c8458d74e81a7f31 26-Jan-2017 Dmitry Dementyev <dementyev@google.com> Merge "Implement Account Discovery API."
eb30016ad478f0ee0f4afbeca78aacbb38ab9c5b 26-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Implement pointer capture API"
6cc3e76ad9f695f5c3ceb6d3ee6c41a61fe1146a 26-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Do not remove file_cache when exiting demo mode"
d1b6dcbea63c688650d13d77156526581db27630 26-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Don't return self if not a profile"
f4948726d97e85f6448a67f01fb35334be3118ba 26-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Updates to the cache filtering impl."
01985ff6d249e434b900cd33718d830a948e3a86 20-Jan-2017 Dmitry Dementyev <dementyev@google.com> Implement Account Discovery API.

Inludes temporary flow for notifications filtered by accountType
Bug: 33046496
Test: cts tests, manual tests.
Change-Id: I2d767030e851579a0666efd7e243a1239af740c7
ccounts/AccountManagerServiceTest.java
ccounts/AccountsDbTest.java
e71fe2b80320ec8a06630ae509fbc4e3e1f3ca40 25-Jan-2017 Jeremy Joslin <jjoslin@google.com> Updates to the cache filtering impl.

Addressing comments from ag/1828816.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34127291
Change-Id: I4c927caaedc722400c8cb52334ab261afa1ffaa5
etworkScoreServiceTest.java
73145f4e60b874a408d26842d1cfc9c9506bfd9a 17-Jan-2017 phweiss <phweiss@google.com> Create public API for policy transparency outside of Settings

The new DPM.createAdminSupportIntent() returns an intent that shows the
"This action was disabled by your admin"-dialog from settings.
This enables apps to inform the user about the cause of restricted
functionality.

A new extra for the intent allows to specialize the dialog for different
restricted features, instead of a generic message for all features.

Bug: 31215663
Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services

Change-Id: I3de7aeec0f88b8f013a63957aec803cd123fbedc
evicepolicy/DevicePolicyManagerTest.java
3787de16d24001eeb452e1c711d4290a396e67c9 21-Dec-2016 Vladislav Kaznacheev <kaznacheev@google.com> Implement pointer capture API

When in pointer capture mode, mouse pointer disappears and
further mouse events are dispatched to the focused view
in the window which has requested capture.

The captured events have the source SOURCE_MOUSE_RELATIVE
belonging to SOURCE_CLASS_TRACKBALL. They are
dispatched through dispatchCapturedPointerEvent /
onCapturedPointerEvent. There is also a new listener.

Pointer capture mode may only be granted to a currently
focused window, and will be canceled upon a window focus change.

Test: cts-tradefed ... --test android.view.cts.PointerCaptureTest
Bug: 30897034
Change-Id: I6e5934aa415ac2b6dda1cee173d0f23e5021af84
m/TestIWindow.java
6e68706f67c84a714bc9d765cf3f30d1e43ae9ce 10-Sep-2016 Fyodor Kupolov <fkupolov@google.com> Do not remove file_cache when exiting demo mode

When clearing /data/preloads directory, keep files in file_cache directory.
The content there will only be removed if systems runs low on storage.

Test: manual + RetailDemoModeServiceTest
Bug: 31008665
Change-Id: Id335d84940ee829617986f5345f169271a333de1
etaildemo/RetailDemoModeServiceTest.java
801e342faaa45708e15f488af4c8fc2f9de91712 25-Jan-2017 Amith Yamasani <yamasani@google.com> Don't return self if not a profile

This fixes the inconsistency between no profile and a
removed profile.

Change-Id: I85d37ce42113bde8567be382372c5f4997601e85
Fixes: 34699518
Test: runtest -x
frameworks/base/services/tests/servicetests/src/com/android/server/pm/UserManagerTest.java
m/UserManagerTest.java
06c39bc07ffe6002969af441538bb447031da6c9 25-Jan-2017 Rubin Xu <rubinxu@google.com> Fix build breakage

Implement new methods in MockStorageManager

Test: it builds
Change-Id: Icdd49a1b6709ab63a8b00328b9da8120482bbc8a
ockStorageManager.java
037e758db567a6691ad8db8cb3282ab548d4db67 25-Jan-2017 Robert Sesek <rsesek@google.com> Merge changes I100dac6b,Ibbecac7e

* changes:
Enable multiprocess WebView by default.
Prepare to enable multiprocess by default.
e7beedff6e02cf11bce748d1aa73c848c53bbccd 25-Jan-2017 Rubin Xu <rubinxu@google.com> Merge "Add unit tests for LockSettingsService"
ea694adb68aca147ec61c8c10fecb39347295106 25-Jan-2017 Hongming Jin <hongmingjin@google.com> Merge "Test: AccountManagerService APCT test."
8f3b34338aca7276a45033e362776678c2adf984 25-Jan-2017 Esteban Talavera <etalavera@google.com> Merge "Wipe device or profile if max failed attempt reached"
b88f42b6b1414ae8107be13c0d2f3957549ecaaf 24-Jan-2017 Esteban Talavera <etalavera@google.com> Wipe device or profile if max failed attempt reached

If the device or profile owner have set a max password failed
attempts policy, the device or profile should be wiped even if
DISALLOW_FACTORY_RESET / DISALLOW_REMOVE_USER /
DISALLOW_REMOVE_MANAGED_PROFILE was set by that admin. However
it should still fail if another device admin set the policy - this
is in line with what wipeData() does at the moment.

Bug: 34450538

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerPlusManagedProfileTest#testWipeData
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.ManagedProfileTest#testWipeData
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerTest#testDisallowFactoryReset
Change-Id: Ifac240692ce74432f7b57f3dfbbbac2a7282297b
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
f994677626a6babc5121647646f17a7de85065a7 28-Nov-2016 Edman Anjos <edmanp@google.com> Refactor DPMS Cert Installer and App Restrictions delegation.

The DevicePolicyManagerService currently supports delegation of
certificate installation and application restriction management, both
of which are individually handled by DPMS.

Upcoming framework features will add four more delegation types,
namely: block uninstall; app permission management; app access
management; and system app enabler. At this moment it makes sense to
refactor the underlying delegation system in DPMS so that current and
future delegates can be handled in a more generic way.

Bug: 33099995
Test: DPMS unit tests
Change-Id: I9e350143572c6690febdd59d1ed5149af8ee4388
evicepolicy/DevicePolicyManagerTest.java
38c239507884be18edc5c0ea80f8f90e8d296ec7 25-Jan-2017 Nicolas Prévot <nprevot@google.com> Merge "Allow DO to provision even if it has set disallow remove mp."
dc375072c4fc95d612ccd3c60ff0519eb75b804c 11-Jan-2017 Torne (Richard Coles) <torne@google.com> Prepare to enable multiprocess by default.

Implement logic to track the version on which the user last manually
enabled/disabled multiprocess (by storing the version code in the
setting, negated for disabled). This enables us to have the following
logic:

1) If multiprocess is enabled by default, re-enable it for users who
turned it off on a previous version, but leave it off for users who
turned it off on the current version. This lets us collect fresh
bug reports after fixing previous issues.

2) If multiprocess is disabled by default, leave it on for users who
have enabled it manually, but turn it back off for users who were
just relying on the default.

This CL leaves it set to "disabled by default" so there is no immediate
behavioural change, but this enables us to switch the "enabled by
default" flag back and forth freely later.

Bug: 21643067
Test: run WebViewUpdateServiceTest
Test: manually upgrade/downgrade webview, verify behaviour of setting
Change-Id: Ibbecac7e5ee75e9c4a1b6efb84253ace98d1eb1a
ebkit/TestSystemImpl.java
ebkit/WebViewUpdateServiceTest.java
7242ca513750486adb500d4e2ad4e51438bbe43b 25-Jan-2017 Nicolas Prévot <nprevot@google.com> Merge "Update DPM unit tests checking isProvisioningAllowed for comp."
8c505dbacb65ac8bd11b1061657c1a3b5abe1be2 25-Jan-2017 Hongming Jin <hongmingjin@google.com> Test: AccountManagerService APCT test.

APCT tests for AccountManagerService for getAccountsByFeatures

Bug: 31346530
Change-Id: I996d667fb72478f635a8afa5b53fb8b4d350b22a
ccounts/AccountManagerServiceTest.java
ccounts/TestAccountType1Authenticator.java
482ebe9bad56deaee3a2ccc36f05a261cfa5bec4 25-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Implemented network score cache filtering."
ba242734015ec89d434289c0905d0cc977c0a414 25-Jan-2017 Jeremy Joslin <jjoslin@google.com> Implemented network score cache filtering.

NetworkScoreCaches registered with a filter type will now only
receive updates that match their filter criteria.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34127291
Change-Id: I3d5e6e57b6682707b0734259a2530658ad75dbb7
etworkScoreServiceTest.java
7f7372ae2abeecb564d426ec3efbfa039c797885 24-Jan-2017 Sunny Goyal <sunnygoyal@google.com> Adding AppWidgetManager.isRequestPinAppWidgetSupported

Launchers can choose to implement support pin shortcut or pin appwidget
or both by specifying different actions in the intent filter

Test: Automated tests and CTS
Bug: 34174006
Change-Id: I4456dbb943cfba11d465556f0732f0ed629ab3ba
ppwidget/AppWidgetServiceImplTest.java
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest8.java
m/ShortcutManagerTest9.java
01e4eeb0e86c5517bbdb51527e1c0dacd1f98779 25-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added StackWindowContainerController"
f32d909df0d5e5519414642d117b73f1c4bdfedb 25-Jan-2017 Hongming Jin <hongmingjin@google.com> Merge "Test: AccountManagerService APCT test."
b08c9f387a039a47b470c654db88e9cd8b03e452 25-Jan-2017 Daniel Nishi <dhnishi@google.com> Merge "Only count user 0 for diskstats package logging."
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.
m/AppWindowTokenTests.java
m/DisplayContentTests.java
m/StackWindowControllerTests.java
m/TaskStackContainersTests.java
m/TaskWindowContainerControllerTests.java
m/WindowTestsBase.java
a0c4d1d6bfd026de36a542d6d5cd82cd12740ee5 24-Jan-2017 Hongming Jin <hongmingjin@google.com> Test: AccountManagerService APCT test.

More APCT tests for AccountManagerService for session based functions:
hasFeatures, removeAccountAsUser, getAuthTokenLabel, getAuthToken,
addAccountAsUser

Bug: 31346530
Change-Id: Ie57973547aa676b83b56ee8664dd2de661ec4a7e
ccounts/AccountManagerServiceTest.java
ccounts/AccountManagerServiceTestFixtures.java
ccounts/TestAccountType1Authenticator.java
0d4b8f8b0c963d9a1f5cb6aff11a11195a3df225 24-Jan-2017 Calin Juravle <calin@google.com> Notify DexManager about new package installs

This will update the internal cache so that the secondary dex files of
the new package can be found when loaded.

Test: runtest -x .../DexManagerTests.java

Bug: 32871170
Change-Id: I0cb7158af249feeb01cf578a7544dda978eede9d
m/dex/DexManagerTests.java
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
m/WindowFrameTests.java
m/WindowTestsBase.java
0cbc19e4a66f7db51596b57ca91afc6f5b27f3b4 09-Dec-2016 Rubin Xu <rubinxu@google.com> Add unit tests for LockSettingsService

Add infrastructure and first sets of unit tests for LockSettingsService

Bug: 33126408
Test: runtest frameworks-services -c com.android.server.LockSettingsServiceTests
Change-Id: I4f3b7f6eaef7122f72b06bd11ce49134a093fe35
aseLockSettingsServiceTests.java
ockSettingsServiceTestable.java
ockSettingsServiceTests.java
ockSettingsStorageTestable.java
ockSettingsStorageTests.java
ockGateKeeperService.java
ockLockSettingsContext.java
ockStorageManager.java
d37c4a99b2602dd4483ca2985e63b5316e8f4f63 23-Jan-2017 Nicolas Prevot <nprevot@google.com> Allow DO to provision even if it has set disallow remove mp.

If the device owner has set DISALLOW_REMOVE_MANAGED_PROFILE,
and there is already a managed profile:
it should be allowed to provision a new managed profile by
deleting the old one.
Test: adb shell am instrument -e class
com.android.server.devicepolicy.DevicePolicyManagerTest
-w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
BUG:34116228

Change-Id: I9e6f39924107aee40b57d22e638487a1ea3132de
evicepolicy/DevicePolicyManagerTest.java
45d29078635372e6c6b230d3de4e9d94c0d324b1 18-Jan-2017 Nicolas Prevot <nprevot@google.com> Update DPM unit tests checking isProvisioningAllowed for comp.

Two of the tests were actually checking the same thing. Removed one.
Refactore another test to make it easier to read.

Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
BUG:32629873

Change-Id: Id4ca9bd8c113a858b016fb02d04bf4c76bbcb027
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
evicepolicy/DpmTestBase.java
829b9cd100ddea44fadb9931c0ff11b11aaba059 23-Jan-2017 Jorim Jaggi <jjaggi@google.com> Fill task snapshot with background color

Make sure to fill the portions that are not covered by the
snapshot are filled with the task background color.

Also fix an issue where the starting window was removed across
configuration changes.

Test: runtest frameworks-services -c
com.android.server.wm.TaskSnapshotSurfaceTest
Bug: 31339431
Change-Id: I2451be87aff79b337015ab4bba72cfa03c0d3582
m/TaskSnapshotSurfaceTest.java
m/WindowFrameTests.java
m/WindowTestsBase.java
9bafc7150ea41758cf40ba60eb90deb62217fc34 19-Jan-2017 Jorim Jaggi <jjaggi@google.com> Starting window tests, yay!

Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowContainerControllerTests
Fixes: 34364463
Fixes: 34361417
Change-Id: Ie1b8debc894e5cad8fe517912a1991a38661dfaa
m/AppWindowContainerControllerTests.java
m/TestWindowManagerPolicy.java
m/UnknownAppVisibilityControllerTest.java
m/WindowTestsBase.java
7439b7cb61296a009ead55df32f68429b4220ed6 24-Jan-2017 Hongming Jin <hongmingjin@google.com> Merge "Test: AccountManagerService APCT test."
c1a892a967a902ba0407f206aede78b0a2c49e1e 23-Jan-2017 Hongming Jin <hongmingjin@google.com> Test: AccountManagerService APCT test.

Add tests for startUpdateCredentials, finishSession and isCredentialsUpdateSuggested.

Bug: 31346530
Change-Id: I8c93b6b0db50086a83894eadfcf6a2398be81b6c
ccounts/AccountManagerServiceTest.java
ccounts/TestAccountType1Authenticator.java
6500b1450d277b40a9059bd80694028ac58a7d01 23-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Do not allow ephemeral apps to access ShortcutManager"
0fd8eb2342e5f7d35a721656958a4cd7ff84176e 23-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Better error message for privapp-permissions test"
66e4a2b801fe0ff2ee1db5e0578a3e7cb6e1f6d6 23-Jan-2017 Makoto Onuki <omakoto@google.com> Do not allow ephemeral apps to access ShortcutManager

Bug: 34178279
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: I5672f15705a1bf6568a8df58b66e48c802c11852
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest2.java
eeb4e1d2193a6a070606870b2a3f3dd4ba608017 23-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Change WebView fallback mechanism to consider all users' package states."
e47eac74f7c80738017734342f66b615189e7596 19-Jan-2017 Daniel Nishi <dhnishi@google.com> Only count user 0 for diskstats package logging.

This avoids sizing issues and allows us to be accurate within
a subset of the users, rather than less accurate over the entire
user base.

Bug: 34457425
Test: services instrumentation tests
Change-Id: Ic460a564a9ab9805c7739b4f40502e96bbfe7953
torage/DiskStatsFileLoggerTest.java
cd2377c6b5aa2ec89b5d7a6cc635465d774e8f30 23-Jan-2017 Fyodor Kupolov <fkupolov@google.com> Better error message for privapp-permissions test

Bug: 31008485
Test: manual
Change-Id: Ia1acaa83c6d64ff5a7010f222e4e879fee20414e
m/PackageManagerPresubmitTest.java
045ae6dab7d97fb27c299ad53eb1c4288bbb7c0b 23-Jan-2017 Guang Zhu <guangzhu@google.com> Merge "adapt package manager presubmit test to GlobalPresubmit annotation"
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
m/TaskSnapshotCacheTest.java
m/TaskSnapshotPersisterLoaderTest.java
m/TaskSnapshotPersisterTestBase.java
364e16029017a4e16ed727a5e501f70363d04e5a 14-Dec-2016 Gustav Sennton <gsennton@google.com> Change WebView fallback mechanism to consider all users' package states.

MultiProcess WebView will use a Service to start a separate process (the
renderer process). This Service can only be started if the WebView
package is enabled for the current user. To ensure that the current
WebView package is usable by all users on a single device we now only
use a WebView package as WebView implementation if that package is
enabled and installed for all user on the device. This also means that
the WebView-fallback mechanism will trigger when disabling the primary
WebView package for any user (not just the system user).

Also add multi-user unit tests to cover this new change.

Bug: 32894152
Test: run unit tests in WebViewUpdateServiceTest
Test: ensure the standalone WebView package becomes enabled (for all
device users) when disabling Chrome for a secondary user.
Test: load WebView (both using Monochrome, and using the standalone
WebView).

Change-Id: Iad3fc48aa50273062c2f29ae48a343c2dea38116
ebkit/TestSystemImpl.java
ebkit/WebViewUpdateServiceTest.java
6788212d17f54475ca9c3dd689a863e031db868f 12-Dec-2016 Svet Ganov <svetoslavganov@google.com> Platform support for static shared libraries

This change adds support for static shared libraries that
emulate static linking allowing apps that statically link
against the same library version to share a common
implementation. A library is hosed by a package in a standard
APK.

Static shared libraries have a name and a version declared
by a dedicated manifest tag. A client uses also a new tag
to refer to the static library it uses by specifying the
lib name, version, and the hash of the signing certificate.
This allows two apps to rely on two different library versions
and prevents impersonation of the shared library by a side-loaded
app with the same package name.

Internally apps providing static libs use synthetic package
name generated from the manifest package name and the library
version. This allows having different "versions" of the same
package installed at the same time.

An application cannot be installed if a static shared lib it
depends on is missing. A used shared library cannot be uninstalled.
Shared libraries can rotate certificates like normal apps. The
versions of these libs should be ordered similarly to the version
codes of the hosting package. Such libs cannot use shared user
id, cannot be ephemeral, cannot declare other libraries, cannot
rename their package, cannot declare child-packages. They must
target O SDK. Also they cannot be suspended or hidden or their
uninstall blocked. Generally, speaking policy regarding code in
static shared libs should be applied to the packages using the
library as it could have just statically linked the code.

We now have APIs to query information about the shared libraries
on the device in general. To clients static shared libraries are
presented as multiple versions of the same package which is how
they are declared and published. Therefore, one can have two
versions of the same package which means we need way to query
for and uninstall a specific version of a package. Also static
shared libs can depend on other static shared libs which are
versioned packages. To ease representation we add the concept
of a versioned package which should be used in the case of
static shared libs.

A client can see only the static shared libs it depends on and
more specifically only the versions it depends would be retrieved
by using the standard package manager APIs. There is a new
dedicated API to get info about all shared libraries which
would provide data about all static shared lib versions. Also
these libraries must use v2 signing scheme.

Test: CTS tests pass

bug:30974070

Change-Id: I4f3d537ee7a81f880950377b996e1d9d4813da5c
m/KeySetManagerServiceTest.java
m/PackageManagerSettingsTests.java
a78fe62f1f5d1e661b17fa24d9dfff0b4c0a9385 22-Jan-2017 Guang Zhu <guangzhu@google.com> adapt package manager presubmit test to GlobalPresubmit annotation

Bug: 34464569
Test: make ... tests
Change-Id: Ief707a2a1d3438212f88f78c3deb9b86261adaf5
m/PackageManagerPresubmitTest.java
4cbec883f103b9c6bf553ef4f77df492287d30dc 21-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Set permissions for launching on private displays"
75ca7b8eddd790d0117ff9573c44ce35be93e94c 21-Jan-2017 Makoto Onuki <omakoto@google.com> Merge "Do not allow work profile apps to access main profile app."
fb1bf69d5d7fc8c45e3ddbb8916e21ae57432ff1 17-Jan-2017 Andrii Kulian <akulian@google.com> Set permissions for launching on private displays

- System UIDs must be allowed to launch anything and everywhere.
- Display owner must be allowed to launch activities on it.
- Apps that are already on target display must be allowed to launch
there.
- All other apps mustn't be allowed to launch on private displays.

Bug: 34230873
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testPermissionLaunchFromSystem
Test: #testPermissionLaunchFromAppOnSecondary
Test: #testPermissionLaunchFromOwner
Test: #testPermissionLaunchFromDifferentApp
Change-Id: Ic98005649a6368370c512e822cba4e9decc18ae9
m/TestWindowManagerPolicy.java
907b467e91e6419e30a53902bea73a8625f4fd94 21-Jan-2017 Sunny Goyal <sunnygoyal@google.com> Merge "Fixing dimensions for AppWidgetProviderInfo not getting updated properly for PinItemRequest"
aecbd037514af1bff0f5ca50932241776d6c5fc3 19-Jan-2017 Makoto Onuki <omakoto@google.com> Do not allow work profile apps to access main profile app.

Bug: 34340531

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases -t 'android.content.pm.cts.shortcuthost.ShortcutManagerMultiuserTest#testManagedUser'
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.LauncherAppsProfileTest'

Change-Id: I34e9f351d2a8addf65a5a928c3dd4363f08611dc
m/BaseShortcutManagerTest.java
444d64749df82407382184f580c4bd6518af4fd6 20-Jan-2017 Makoto Onuki <omakoto@google.com> Merge "requestPinShortcut for pinned shortcut still notifies launcher"
e47d2cd4154f1b350c6e2bdb693f2abd2eba4687 20-Jan-2017 Jorim Jaggi <jjaggi@google.com> Merge "Persist task snapshots to disk"
3465cd9e30e132a551ed522e313c8a7aa924dc25 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED." am: b5b00857eb am: 0af25e62c9
am: 5418f151cc

Change-Id: I74ce97c93e640a601e811b571f37fe1fed114391
5418f151ccbe125abd2a45f4c428e18ae35ebc63 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED." am: b5b00857eb
am: 0af25e62c9

Change-Id: Ied883055a0b85a1df53491a88f6bd7eac594c5f5
0af25e62c9791262aca1e8a6380872c73499d048 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED."
am: b5b00857eb

Change-Id: I54a69f11284efb07ee6be58650d7a246540010dc
261b5c4c49a10d8e0e1feed2774292232e2ffec6 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Pass more data through the recommendation request." am: 00514f1dc0 am: ddfbe07e96
am: ec630d0bf0

Change-Id: I20ce25072262a7aef36b9fdaa317210283ca495f
ec630d0bf06ee1a1b3f9bfe9736d76d41483e4a3 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Pass more data through the recommendation request." am: 00514f1dc0
am: ddfbe07e96

Change-Id: Ib831f420dd6ca976f9ce72476028b18ea61e2211
b5b00857ebd53e23377d00c947012fee418ecc76 20-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED."
ddfbe07e96abdfe0dc16fee6b905de6b5341bb10 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Pass more data through the recommendation request."
am: 00514f1dc0

Change-Id: I97e11e876bcb7ccdb55a333b31f9970ae5edd001
c4982553b92a753e6436f1dd4e1f173d63dfc395 19-Jan-2017 Jeremy Joslin <jjoslin@google.com> Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33752149
Change-Id: I559e8f47c5edb491ea7cd0d03010736c81fcee9b
Merged-In: If261cf25c227eeeb4155e43afd9354e6ff8df3b4
etworkScoreServiceTest.java
122957b0b0585068d82934afa2b02f8f0ad8a584 18-Jan-2017 Jeremy Joslin <jjoslin@google.com> Pass more data through the recommendation request.

Expanding the API so it can accept the WiFi config of the currently
connected network (if any) and the set of connectable WiFi
configurations. Also renamed currentRecommendedWifiConfig to
defaultWifiConfig so the name was more representative of the
parameter's purpose and added more documentation throughout.

Test: adb shell am instrument -e class android.net.RecommendationRequestTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: adb shell am instrument -w com.android.networkrecommendation.tests/android.support.test.runner.AndroidJUnitRunner
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34387385
Change-Id: Ib8c3cab8f92b5c9da806070d32412f688690f82f
Merged-In: I1089b70303b0396def7e6bf3737fdc67e40c9dcd
etworkScoreServiceTest.java
0c280710320368e82c52c9b135e2ab3015d0c924 20-Jan-2017 Makoto Onuki <omakoto@google.com> requestPinShortcut for pinned shortcut still notifies launcher

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Bug: 34391829
Change-Id: Iac652790f2aa02dab6afbe52f2e40be99543f325
m/ShortcutManagerTest8.java
9971919b6403161a1a9ba81f0e343bebce46c0e8 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> New setting for recommendation request timeout. am: 44e2b84b27 am: 820ad03ba8
am: 00ccf31dbd

Change-Id: If14705a0e4c41dbd40ae90b46b37e5ad2b6e5c4b
6a4faba753d65045fe9c03669705cee403a0b810 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> Implemented the async recommendation request call. am: bc1308a3be am: 08031e0d0e
am: 61a4bd412d

Change-Id: I53549134c264ff5d282d1e6d5138581c9f5bcb5b
00ccf31dbdd8e6837f087cfe932337234264caf9 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> New setting for recommendation request timeout. am: 44e2b84b27
am: 820ad03ba8

Change-Id: Ib4999e09073c74bb4594ce2e744032d3349dce94
970d4b462652cab66ce34da551d089f385bf39d8 20-Jan-2017 Sunny Goyal <sunnygoyal@google.com> Fixing dimensions for AppWidgetProviderInfo not getting updated properly
for PinItemRequest

Test: Manually tested on device
Change-Id: I7bbf7e93e052ef25c2a4a98ff0795ef500f68cc0
m/ShortcutManagerTest9.java
61a4bd412dfc4c4d90a2a24bbb1115a6462bf631 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> Implemented the async recommendation request call. am: bc1308a3be
am: 08031e0d0e

Change-Id: Idc136d72820fbf7c1d747068d87c505ec7e3cc5c
820ad03ba8c91cd7647a11edc3df2fe51ec55e0e 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> New setting for recommendation request timeout.
am: 44e2b84b27

Change-Id: I8fd6e0c75d22d0f83db414a389c4d8caaf745469
08031e0d0e077d27be2904c9314ec290d3e20062 20-Jan-2017 Jeremy Joslin <jjoslin@google.com> Implemented the async recommendation request call.
am: bc1308a3be

Change-Id: I8cd3365a053527c8f4da6c35b1c646281eda74be
44e2b84b27dea139796299528e5cdd3abc4640f7 04-Jan-2017 Jeremy Joslin <jjoslin@google.com> New setting for recommendation request timeout.

Added a new global setting, NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS,
to control the maximum amount of time a recommendation request can
take.

Updated the NetworkScoreService to monitor the value and to update
its cached copy on observed changes.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34060959
Change-Id: I6ff80178440794e4a5da39ee7b5164621316e7bd
Merged-In: I7650ee024e53dbc856cf20d7520a6eb252c73bdf
etworkScoreServiceTest.java
bc1308a3bec3a097af377a1c3ca58da5d7c85e66 29-Dec-2016 Jeremy Joslin <jjoslin@google.com> Implemented the async recommendation request call.

Implemented requestAsyncRecommendation() by introducing a Handler
implementation to handle requests that time out and a OneTimeCallback
class to prevent multiple callbacks from being sent back for the same
request.

Change-Id: I03875cf1d789cbc92aa4c6b500c6b519bff8e165
Merged-In: Ida2ff860d78d86185ab9ab22232b5b6dc1e4b310
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG:33784158
etworkScoreServiceTest.java
0ae1a7d9e97b99b63397030fee4deec3f5eb47b2 19-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED."
f9084ecae2e0f042730ab32b9c94204a0e21bb2a 16-Jan-2017 Jorim Jaggi <jjaggi@google.com> Persist task snapshots to disk

So they can be used again after rebooting or when the process gets
killed, but the snapshot is still used for recents.

Also implement TaskSnapshotLoader, to restore it from disk. The
infrastructure around restoring and caching snapshots for recents
will be implemented in the next CL.

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

Bug: 31339431
Change-Id: Iaec03c4cc92e04b6dd7e623bca755ddc92613bce
m/TaskSnapshotPersisterLoaderTest.java
96415fb6038623c59c392bf8a4112ce04a1c71a7 19-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Pass more data through the recommendation request."
aba241892e204a050562e5889c1b94e0f75eaaeb 19-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Notify task about display change when moved to new stack"
1d5e668fcdd4a8db8772075904c61cbfc0737c8c 19-Jan-2017 Hongming Jin <hongmingjin@google.com> Merge "Test: AccountManagerService APCT test."
7cd7c2d333c1b4f77a5b1a9f08cbaaebb242700c 18-Jan-2017 Andrii Kulian <akulian@google.com> Notify task about display change when moved to new stack

Bug: 34176283
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testMoveTaskBetweenDisplays
Test: bit FrameworksServicesTests:com.android.server.wm.TaskWindowContainerControllerTests
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackContainersTests
Change-Id: If085246926790089e014a94093d788805e812489
m/TaskStackContainersTests.java
m/TaskWindowContainerControllerTests.java
m/WindowTestsBase.java
106fe732050f3d75a08c3bc48fdbcf84cac20b41 23-Nov-2016 Phil Weaver <pweaver@google.com> New accessibility shortcut.

Removing accessibility gesture from power dialog.

Adding new accessibility shortcut activated by holding both volume
buttons down. This shortcut is configurable by OEMs and users to
work with any installed accessibility service.

Bug: 30160335

Test: Added automated testing for the EnableAccessibilityController.
Manually toggled various services on and off.
Change-Id: I546bd29a2ab1ba64a0cbfd11e2004cdf85ee6cfd
olicy/AccessibilityShortcutControllerTest.java
6804d4de65cd5a30c4746c3e097b0713119c4e27 19-Jan-2017 Sunny Goyal <sunnygoyal@google.com> Merge "Adding support for apps to return PinItemRequest to launchers as a result of Intent.ACTION_CREATE_SHORTCUT"
6397ab5411bc25c695f7b4fd73222080e27e5f3a 19-Jan-2017 Jeremy Joslin <jjoslin@google.com> Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33752149
Change-Id: If261cf25c227eeeb4155e43afd9354e6ff8df3b4
etworkScoreServiceTest.java
26a45e5b13e9d300e28c524d71675c29c50cd162 18-Jan-2017 Jeremy Joslin <jjoslin@google.com> Pass more data through the recommendation request.

Expanding the API so it can accept the WiFi config of the currently
connected network (if any) and the set of connectable WiFi
configurations. Also renamed currentRecommendedWifiConfig to
defaultWifiConfig so the name was more representative of the
parameter's purpose and added more documentation throughout.

Test: adb shell am instrument -e class android.net.RecommendationRequestTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: adb shell am instrument -w com.android.networkrecommendation.tests/android.support.test.runner.AndroidJUnitRunner
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34387385
Change-Id: I1089b70303b0396def7e6bf3737fdc67e40c9dcd
etworkScoreServiceTest.java
b4050d80427afe56fea20868f6b93a66d6c8d98b 18-Jan-2017 Tamas Berghammer <tberghammer@google.com> Merge "DO NOT MERGE: Revert "Update package names to work with the proto3 compiler"" into nyc-mr1-dev-plus-aosp
24d8553316c6239d79f3ff509f68b707d1330451 18-Jan-2017 Tamas Berghammer <tberghammer@google.com> DO NOT MERGE: Revert "Update package names to work with the proto3 compiler"

This reverts commit cbd3f0c59a75e0b46dbb0635e81f82b8b9617791.

Change-Id: I6e8d193fa22e0e7e30b214c13ae0480d3c9b0dc6
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/IpConnectivityMetricsTest.java
a6be88a10d6f6391b09f626ead051d0c698fb2d1 13-Jan-2017 Sunny Goyal <sunnygoyal@google.com> Adding support for apps to return PinItemRequest to launchers
as a result of Intent.ACTION_CREATE_SHORTCUT

> Adding API to allow launchers to query shortcut config activities in
managed profiles.
> Adding API to allow the default Launcher to start the shortcut config
activity in managed profiles.
> Updating the ACTION_CREATE_SHORTCUT documentation to represend changes
in the expected result.

Test: Manual tests and all the unit tests
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to test10

Change-Id: I785c4f2fba782b864cc401ac7905330ea4498289
m/ShortcutManagerTest10.java
m/ShortcutManagerTest8.java
e24743203591fde0f3b1fe7d5e250f2b21ec0b6a 18-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix test DevicePolicyManagerTest#testSetRequiredStrongAuthTimeout_DeviceOwner"
81c4c8af206624f902efbd913fc3b26bb6842307 10-Jan-2017 Hongming Jin <hongmingjin@google.com> Test: AccountManagerService APCT test.

Setup test authenticators, add tests for startAddAccountSession.

Bug: 31346530
Change-Id: I0fb460a8a1c35e2c88c624d0e291b20051110b34
ccounts/AccountAuthenticatorDummyActivity.java
ccounts/AccountManagerServiceTest.java
ccounts/AccountManagerServiceTestFixtures.java
ccounts/PreNTestDatabaseHelper.java
ccounts/TestAccountType1Authenticator.java
ccounts/TestAccountType1AuthenticatorService.java
ccounts/TestAccountType2Authenticator.java
ccounts/TestAccountType2AuthenticatorService.java
094119df3ebc49b7158aa448fe3cc24ad4267569 18-Jan-2017 Bartosz Fabianowski <bartfab@google.com> Merge "Allow system to retrieve permission grant state"
4b0624fee452138951de919bbe74003258e9bc19 16-Jan-2017 Bartosz Fabianowski <bartfab@google.com> Allow system to retrieve permission grant state

To inform the user which apps were granted permissions by the admin,
the Settings app needs to access this information without being a DO/PO.

Bug: 32692748
Test: FrameworksServicesTests unit test

Change-Id: I3770ec6343b85be9c6f7655675ed6db5cb50612c
evicepolicy/DevicePolicyManagerTest.java
d084ca5fad1cef70aac9eed8d5d79fc87d6e5397 18-Jan-2017 Michal Karpinski <mkarpinski@google.com> Fix test DevicePolicyManagerTest#testSetRequiredStrongAuthTimeout_DeviceOwner

1) Started returning the default value for getLong() on SystemProperties mock
2) Added a test that the minimum timeout cannot be changed using a system
property on non-debuggable builds
3) Added new within range test for completeness.
4) Started using TimeUnit instead of ms constants.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Bug: 34317979
Change-Id: I0409451ae39e74ec3d96a098042302291ec3408f
evicepolicy/DevicePolicyManagerTest.java
9ecde449454100f62c725c3ef544f99726d0e971 18-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Handle multiprocess flag in WebView update service."
3db5d42f90f38506fc73938266a1ee71b1553eb1 18-Jan-2017 Tamas Berghammer <tberghammer@google.com> Merge "Update package names to work with the proto3 compiler" into nyc-mr1-dev-plus-aosp
2ec59897cf892666146f378825d2adcf972248ac 18-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I01e81b9c,I532c2d74

* changes:
Add a listener when task snapshots change
When app dies, destroy snapshot
eaed75d923c132f7bb7679d3246a89eff78e6811 18-Jan-2017 Pavel Grafov <pgrafov@google.com> Merge "Make ENSURE_VERIFY_APPS global even when set by PO."
c926b7399a041fb82f15baa889bbf7ee0fa45643 21-Oct-2016 Stephen Chen <stewchen@google.com> DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.

Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 25147878974f82f875062e99cdee85dd33f3f078)

(cherry picked from commit 963e8ddf6d5ea3bc34216fa03fe24402bf13940a)

Change-Id: I79e401fc4159264a075febba82bd8c295b8e677f
et/NetworkStatsObserversTest.java
et/NetworkStatsServiceTest.java
d445c5553805d7b519f128258c21e29ebfc6c17a 19-Aug-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.

Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.net.NetworkStatsServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

BUG: 30943463

(cherry picked from commit b8f946dc4b24998f14e28573e452ab13ed533347)

(cherry picked from commit e4c029918f32f9dacc7e6a1e8102b71f3ca1018c)

Change-Id: I93cdfc8753dcded141732c0587783d1fa2085f5a
et/NetworkStatsServiceTest.java
c97d8b7464f0c60165ac9abb6b35323583fad2b5 22-Aug-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Use @Ignore to explicitly disable a @Test method.

BUG: 30839080
BUG: 31007021

(cherry picked from commit fc7d7a359f800d7320d29055ef3b4b75157aaf13)

(cherry picked from commit 2026ca147b6460807b19c997600315806ecb3197)

Change-Id: I45efc93b40e526467c97d0735289db1404ccd22d
et/NetworkStatsServiceTest.java
fe46a2f8689f96e75c491d5c2477fe2caec2f289 19-Aug-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4.

Most tests were failing because due to a null NetworkCapabilities.
Example:

1) testNetworkStatsWifi(com.android.server.net.NetworkStatsServiceTest)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkCapabilities.hasCapability(int)' on a null object reference
at
com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:983)

BUG: 30839080

(cherry picked from commit 574f370c6da52eeffe747248d68ef044617c7bcf)

(cherry picked from commit 77cba4bdf6de8aec02efe0da7e84f17603912b21)

Change-Id: I6eee96178ade6adfc1406e06d5376206ca2420e5
et/NetworkStatsServiceTest.java
2fbc934cd97a289071ae3284a87150038905b7ba 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> DO NOT MERGE: Move the connectivity tests to frameworks/base/tests/net.

This will give us a good place to put all the networking tests.

Fix: 31479480
Test: adb shell am instrument -w -e notClass com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest 'com.android.frameworks.tests.net/android.support.test.runner.AndroidJUnitRunner' # PASS

(cherry picked from commit ecc986d430f4b8158f177ed97d2edb741f11ff71)

Change-Id: I4c417c2ba0747d2085169e47ae4a99e93c4d8814
onnectivityServiceTest.java
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/IpConnectivityMetricsTest.java
onnectivity/LingerMonitorTest.java
onnectivity/MetricsLoggerServiceTest.java
onnectivity/MetricsTestUtil.java
onnectivity/NetdEventListenerServiceTest.java
onnectivity/TetheringTest.java
onnectivity/VpnTest.java
onnectivity/tethering/TetherInterfaceStateMachineTest.java
073e5e94ad95b540501df6ea6937003359f23ac0 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> DO NOT MERGE: De-guava BroadcastInterceptingContext and move it to testutils.

Removing the static dependency on guava reduces test compile time
by about 20 seconds on a Z840, thus substantially speeding up the
compile/test cycle.

Make FutureIntent public instead of package-private because it is
used directly by NetworkPolicyManagementServiceTest, which as of
this CL is now in a different package.

(cherry picked from commit 281a17c9580de5c9898be7d9654d428801976511)

Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.NetworkPolicyManagerServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.net.NetworkStatsServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.NetworkManagementServiceTest # Already failing.
Bug: 31479480

(cherry picked from commit 3c295b59f5767904656235db48692906148ab631)

Change-Id: I8a95d4618dced81f173d2b38b9c1dfe3860b348a
roadcastInterceptingContext.java
onnectivityServiceTest.java
etworkManagementServiceTest.java
etworkPolicyManagerServiceTest.java
et/NetworkStatsServiceTest.java
9997f1489a56a4d11b3381d04ea4a18ef5f73c3d 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> DO NOT MERGE: Move FakeSettingsProvider to a common location.

(cherry picked from commit 7df1a82802cdf842d07a86a80383c7d5ea7ae53a)

Test: runtest frameworks-util -c com.android.internal.util.test.FakeSettingsProviderTest
Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest
Test: runtest frameworks-services -c com.android.server.retaildemo.PreloadAppsInstallerTest
Test: runtest frameworks-services -c com.android.server.retaildemo.RetailDemoModeServiceTest
Bug: 31479480

(cherry picked from commit b8df76e413d0b8235d0bd71adf8f368f00391fcb)

Change-Id: Ib82b162f354b8cbb521bc0783556f3225b4d12ac
onnectivityServiceTest.java
86e2765777d0f4cf726f5cac8a581f5769394716 17-Oct-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE: ConnectivityServiceTest: mark flaky test as such

This patch extracts into its own independent test a test sub-block looking
for a race condition when not waiting on handlers to become idle:
there is no way to prevent the race from not happening when looking for
it this way. This makes the test flakky.

This new independent test is tagged with @FlakkyTest(tolerance = 3).

Test: ConnectivityServiceTest passes, with higher probability.
Bug: 31479480

(cherry picked from commit c8c1027762d66c12c9c153ccbb8f80acdee8571c)

Change-Id: I32632bb763585c23f1de5bb1811a384a35bf9f64
onnectivityServiceTest.java
e9e251fcfb0bb0d8bcaaeff5f905cc93981da910 24-Nov-2015 Erik Kline <ek@google.com> DO NOT MERGE: Support timeouts for requestNetwork() invocations.

(cherry-pick of 06c3ef1367e850746eef0a5462bdce8674d74c30)
(cherry picked from commit 57faba9ec73fbb311d5ca1df3278aee9728589d5)

Bug: 21414325

(cherry picked from commit 3841a48d0a093bbbd6ffe6338170e1e2dbc11997)

Change-Id: I640c43315a071ecbf881e5ce898164915e0b787f
onnectivityServiceTest.java
b3a20ee45a23cfc65fb09f4a4841270fa885518c 11-Jan-2017 Sunny Goyal <sunnygoyal@google.com> Adding some tests for AppWidgetServiceImpl

Test: adb shell am instrument -e class com.android.server.appwidget.AppWidgetServiceImplTest \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: I785d8997405261f644b3f4feed58a3be9188cd4c
ppwidget/AppWidgetServiceImplTest.java
90bd8930e5ca47b89c4394d267e2decc140c3fdf 18-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Only measure each UID once in InstallerTest." am: 32aac7b9c9 am: 7b6d21b37e am: 5092952317
am: a199722ed6

Change-Id: I1164f2786b55f029283d309a951dddeb610fcb47
a199722ed6a771ac46bb70333e5a3ff8137ca46a 18-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Only measure each UID once in InstallerTest." am: 32aac7b9c9 am: 7b6d21b37e
am: 5092952317

Change-Id: Ib352977f7f01e97bc3afefb743f3ccb7725cbaec
50929523174008fec8f65d601d97812df3eacdb1 18-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Only measure each UID once in InstallerTest." am: 32aac7b9c9
am: 7b6d21b37e

Change-Id: I99a0c70e339a75da752be5dfb141b6835ca83cb3
7b6d21b37e593e920979bd6f6669a2189f9db38d 18-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Only measure each UID once in InstallerTest."
am: 32aac7b9c9

Change-Id: Ie4b85e22fe74d8d07424edeacfc285a3cbd67dd0
fb9d78afb77b1d304b24f470a637244d52a7e1df 05-Jan-2017 Jorim Jaggi <jjaggi@google.com> Add a listener when task snapshots change

Since we start recents before we take the snapshot, we need to add
a mechanism to inform recents about task snapshots changes.

We add a new method to TaskStackChangedListener,
onTaskSnapshotChanged, which gets called whenever a task snapshot
changes. Then, SystemUI registers such a listener and updates the
task thumbnail view for the specific task.

Test: Open app, press recents, make sure thumbnail is up-to-date
Bug: 31339431
Change-Id: I01e81b9cd11886da734da671c68d5732aa51009f
m/WindowTestsBase.java
10abe2fe297ce1ec60c15a3bd947757aee5b14b3 03-Jan-2017 Jorim Jaggi <jjaggi@google.com> When app dies, destroy snapshot

Also destroy snapshot when we remove the AppWindowToken.

Test: runtest frameworks-services -c
com.android.server.wm.SnapshotCacheTest
Test: Open app, go home, kill app, make sure snapshots are
destroyed.

Change-Id: I532c2d7499a86164175f9fcbc8b77c6eb6bfeae6
m/TaskSnapshotCacheTest.java
dd0edac92f15d009f0da7db832f80c520f137fb1 17-Jan-2017 Jeff Sharkey <jsharkey@android.com> Only measure each UID once in InstallerTest.

Test: builds, boots
Bug: 34341727
Change-Id: Ic8250b7383f52adf30139ceed02469a9d278dc18
m/InstallerTest.java
cb594f363dd10a203a90fd5ee2a02f44dbc40454 04-Jan-2017 Jeremy Joslin <jjoslin@google.com> New setting for recommendation request timeout.

Added a new global setting, NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS,
to control the maximum amount of time a recommendation request can
take.

Updated the NetworkScoreService to monitor the value and to update
its cached copy on observed changes.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34060959
Change-Id: I7650ee024e53dbc856cf20d7520a6eb252c73bdf
etworkScoreServiceTest.java
ce73c6f296f583223cee4385e20c640ead3ae4de 29-Dec-2016 Jeremy Joslin <jjoslin@google.com> Implemented the async recommendation request call.

Implemented requestAsyncRecommendation() by introducing a Handler
implementation to handle requests that time out and a OneTimeCallback
class to prevent multiple callbacks from being sent back for the same
request.

Change-Id: Ida2ff860d78d86185ab9ab22232b5b6dc1e4b310
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG:33784158
etworkScoreServiceTest.java
059df13f3253dceb9d38c29d708e355221faedab 17-Jan-2017 Andrii Kulian <akulian@google.com> Merge "Add unit tests for 180 degree rotation"
e3099e5363216a833313bea504b7cf285cad3317 17-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Have better separation between adding, positioning, and reparenting task"
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
m/AppWindowContainerControllerTests.java
m/TaskWindowContainerControllerTests.java
m/WindowContainerTests.java
m/WindowTestsBase.java
1bb70191766c25a6463295c88bd2e2b5886dc2f8 17-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow removing non-enabled profiles"
92d053b459513dc15bc3cb349a6a11cf2798a4c1 17-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Unit tests for wipeData for a managed profile."
c9c1b2f03a67b1ff3fb743e612fe3ef0ba23eac1 12-Jan-2017 Nicolas Prevot <nprevot@google.com> Unit tests for wipeData for a managed profile.

BUG:31952368
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: If3cf2fee3edf5b16fe169e65337f215544557815
evicepolicy/DevicePolicyManagerTest.java
6a40f09083fc52acc3309d0b04401fca02df6372 25-Oct-2016 Pavel Grafov <pgrafov@google.com> Make ENSURE_VERIFY_APPS global even when set by PO.

Currently only device owner can set global user restrictions.
With this CL ENSURE_VERIFY_APPS will be global no matter who
enforces it, DO or PO.

To make it possible for system apps to check who enforces a
particular restriction in this case a new API method is added
to UserManager: getUserRestrictionSources which returns a list
of users who enforce the restriction.

Bug:31000521
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.UserRestrictionsTest (ag/1732744)
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
Test: installed M on a Nexus5x device, created a managed profile with some user restrictions, and checked that after upgrading M->O all restrictions are preserved and split correctly into base, global and local.
Change-Id: I543d3ec9ef0cf2b730da6f7406021c0bba43b785
evicepolicy/DevicePolicyManagerTest.java
m/UserRestrictionsUtilsTest.java
ef99fb85f95a2cc17e5d41f452d4632f0ec12fb7 16-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Make device wide DO features available if all users affiliated"
c8776157eefc3764ad4a5a1964cd3a1f8c50e418 06-Jan-2017 Benjamin Franz <bfranz@google.com> Allow removing non-enabled profiles

Bug: 31668514
Test: runtest -c
com.android.server.pm.UserManagerServiceCreateProfileTest
frameworks-services
Change-Id: If8db670d6f253a44b2aa91df97349dd0ffd85f02
m/UserManagerServiceCreateProfileTest.java
d36dd15d9bf9f65270b9bee16d6419b96b18bd86 15-Dec-2016 Esteban Talavera <etalavera@google.com> Make device wide DO features available if all users affiliated

Currently, those features are available on single user devices only
(since they collect privacy sensitive data device wide). Now making
them available as long as all users are affiliated.

It'll take a certain amount of time between user creation and the DPC
of that new user setting the appropriate affiliation ids. The DO won't
be able to access the logs during that time (and won't get any "logs
ready" callback). Once the affiliation ids are set, if they match,
logs become available again - this includes logs collected while the
user was being setup. Some logs might be lost though if the amount of
data exceeds the internal limit.

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services

Test: cts-tradefed run cts -a armeabi-v7a --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.DeviceOwnerTest

Bug: 32326223

Change-Id: Idfe881dd6497d3ad2bead10addfd37b98b8a6e2b
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
2c05563e78c90cd446c047c296e41afd764aafc0 16-Jan-2017 Hugo Benichi <hugobenichi@google.com> Merge "ConnectivityServiceTest: some fixes in CallbackInfo" am: 37727596cc am: 036ab4d193
am: a5e0160f03

Change-Id: Ifc208e00e05efb29eaa2ab37abdc66d8c7ed8f4f
a5e0160f03634165d48f75cdc25e7eaa971b689f 16-Jan-2017 Hugo Benichi <hugobenichi@google.com> Merge "ConnectivityServiceTest: some fixes in CallbackInfo" am: 37727596cc
am: 036ab4d193

Change-Id: I839ed526e802b88bbed490b611f90d829b952f26
036ab4d1938a582e7dd4341b21862786f40c0d47 16-Jan-2017 Hugo Benichi <hugobenichi@google.com> Merge "ConnectivityServiceTest: some fixes in CallbackInfo"
am: 37727596cc

Change-Id: I636b7b0ef210aaa3e130e1c1a162a35cdc099295
18de051c986b0871848a77d2c2dd11659af365c9 14-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Send EXTRA_USER with DevicePolicy lock broadcasts"
9e0642287e1f6d907356f1724272332f0db7f7af 14-Jan-2017 Bartosz Fabianowski <bartfab@google.com> Merge "Add install reason"
284d9401ac1dbbb5f2030a2968c15fd79575fda1 13-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Refactor LockSettingsService to unify the handling of pattern and password"
a34f53f61be31b7171d6cbcb12490ee143acffff 11-Jan-2017 Bartosz Fabianowski <bartfab@google.com> Add install reason

This CL allows a reason to be specified when installing a package. The
install reason is a sticky piece of metadata: When a package is e.g.
installed via enterprise policy and an update is then manually
installed or sideloaded, the install reason will remain "policy."
The install reason is tracked separately for each user.

With this CL, two install reasons exist: "policy" and "unknown." Other
install reasons will likely be supported in the future.

Bug: 32692748
Bug: 33415829
Test: Tested manually with "adb install" / "adb uninstall"

Change-Id: I0c9b9e1b8eb666bb6962564f6efd97e41703cd86
etaildemo/PreloadAppsInstallerTest.java
4ede3e0d0a9e76c701db19e073d2d1ff487d2a64 12-Jan-2017 Andrii Kulian <akulian@google.com> Add unit tests for 180 degree rotation

These tests if an app window token reports resize when device is
rotated from landscape to seascape.
There is also some additional plumbing to be able to perform a
rotation in unit test. Also dynamic stacks are now allowed to
influence the orientation of the device.

Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
Bug: 33607506
Change-Id: I7b23e2de48d56c9fe485eae6a165378dbbbd08bb
m/AppWindowTokenTests.java
m/TestWindowManagerPolicy.java
m/WindowTestsBase.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
m/TaskSnapshotControllerTest.java
m/TestWindowManagerPolicy.java
m/WindowTestsBase.java
1de89b3bec2f296763f3ecde9a36ecbca2110f3d 30-Nov-2016 Rubin Xu <rubinxu@google.com> Refactor LockSettingsService to unify the handling of pattern and password

Also fix LockSettingsStorageTests. More unit tests on LockSettingsService
to be added in the next CL.

Bug: 33126408
Test: runtest frameworks-services -c com.android.server.LockSettingsStorageTests
Change-Id: I0f143b26fed1d5ae122fba3b57bd39c7793ad8d9
ockSettingsStorageTests.java
1a4c4e35397adb964fb53695f66e1ac1ace39ff1 10-Jan-2017 Torne (Richard Coles) <torne@google.com> Handle multiprocess flag in WebView update service.

Instead of letting DevelopmentSettings manage the setting directly and
observing the changes from WebViewUpdateService, have the update service
manage the setting and just expose IPCs for the settings app to use to
get/set the setting. This means we can set a more flexible policy for
whether multiprocess is enabled by default and change it without
touching the settings code, though for now this CL does not change the
behaviour and is just a refactoring.

Bug: 21643067
Test: Toggle multiprocess WebView in developer settings
Change-Id: I3057c09d99f5f6f472a5195a8e14e9164ea5733a
ebkit/TestSystemImpl.java
dfbfca2015c33d3cbdf438d54774d0bab85b5986 12-Jan-2017 Pavel Grafov <pgrafov@google.com> Merge "Fix DevicePolicyManagerServiceMigrationTest."
9fa89381bfc47447fc6ef42edba1766f321323a3 11-Jan-2017 Phil Weaver <pweaver@google.com> Merge "Add flag and listener for a11y volume requests."
feffb056e8d0f22db630f7d768bd78c349420cb6 11-Jan-2017 Pavel Grafov <pgrafov@google.com> Fix DevicePolicyManagerServiceMigrationTest.

DISALLOW_ADD_MANAGED_PROFILE is enabled for device owners by default
and should be expected for device owner after migration.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
Change-Id: I8e1d8bcf84a242fa50985d4fed9c3c594e19451a
evicepolicy/DevicePolicyManagerServiceMigrationTest.java
ad9ff9c59af367f51f24ce72492eb3eaa5eac27a 11-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Move getActiveScorerPackage() to the score service." am: b5488ec3b3 am: 425a0fdc95
am: ab9eb11e2f

Change-Id: Iede47bf5a625ac4183919b4253c6d5e3f92520bc
ab9eb11e2f960346b8eeb52587431ca3cf3f3aaf 11-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Move getActiveScorerPackage() to the score service." am: b5488ec3b3
am: 425a0fdc95

Change-Id: Icd1e76d7987cc9937cce5079dedf610fcd21c903
425a0fdc95f2f3105ab2677a7fb469d5b19d8a78 11-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Move getActiveScorerPackage() to the score service."
am: b5488ec3b3

Change-Id: I8819c482a87a8c78ad0a1a39dda74b5ee2e7da4c
b5488ec3b3c2d7e353c6b1e83bfc2b0c4d8d0af5 11-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Move getActiveScorerPackage() to the score service."
3c6f28aa5968b1edb823495efa15e7358de5261e 11-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added TaskWindowContainerController"
b6aa0cc60ccfb4e1d8bd02f5a05ebae15fc55713 11-Jan-2017 Andrii Kulian <akulian@google.com> Merge "Fix typo that caused excessive display config updates"
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
m/AppWindowContainerControllerTests.java
m/TaskWindowContainerControllerTests.java
m/WindowFrameTests.java
m/WindowTestsBase.java
d8f2268e3c2c009b30446611b984aefeedc52f74 11-Jan-2017 Jorim Jaggi <jjaggi@google.com> Merge "Clean up starting window to prepare for saved surfaces"
cbd3f0c59a75e0b46dbb0635e81f82b8b9617791 22-Jun-2016 Tamas Berghammer <tberghammer@google.com> Update package names to work with the proto3 compiler

Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
(cherry picked from commit 383db5ebcc3a4a615faf249bf4f126f42e80b82e)
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/IpConnectivityMetricsTest.java
d68501e66dabe30dd7bb2ac9e50f8cbac29f698c 11-Jan-2017 Andrii Kulian <akulian@google.com> Fix typo that caused excessive display config updates

Applied incorrect configuration object while doing original
configuration refactoring.

Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Test: #testDisplayOverrideConfigUpdate
Change-Id: Ief5979feebb50f689b6cb532e1dba93e47dcbc40
m/DisplayContentTests.java
a9911290edcda9a0e2b6f430e3bc28f91697014f 11-Jan-2017 Calin Juravle <calin@google.com> Record data about dex files use on disk am: 5a9094c1b6 am: dc10a3bdb0
am: ea1c34d45e

Change-Id: Ie9f489ff2ec89e9014eb683e269139ba633762bb
edc6306402826f04e42a833dca54aba0281623b0 11-Jan-2017 Calin Juravle <calin@google.com> Add logic for recording dex files use on disk am: 6ea5ace7b3 am: 34bdf1680a
am: bc7f234daa

Change-Id: Iaf2ffd60d374eef179705e35743338ff3d8105c3
ea1c34d45eacd9d20860b5dee1559be7fbfbfb9d 11-Jan-2017 Calin Juravle <calin@google.com> Record data about dex files use on disk am: 5a9094c1b6
am: dc10a3bdb0

Change-Id: Ife1e626d722ba129cdcb6cd4a8f454cf28ca267c
bc7f234daa95e9ca2d42e24ab71e445ab7ac25d8 11-Jan-2017 Calin Juravle <calin@google.com> Add logic for recording dex files use on disk am: 6ea5ace7b3
am: 34bdf1680a

Change-Id: I075e6c5224b374f2d03d711e4d5492d60e4da572
dc10a3bdb0e07aaa6a093a4f97e536278eb48e19 11-Jan-2017 Calin Juravle <calin@google.com> Record data about dex files use on disk
am: 5a9094c1b6

Change-Id: I50378b1351a5ae83ac55f1b26e2e0c5f3230c6d2
34bdf1680a7b9f621fc9026ad75045ccc4273a31 11-Jan-2017 Calin Juravle <calin@google.com> Add logic for recording dex files use on disk
am: 6ea5ace7b3

Change-Id: I82246efd8e78c1c4ac18a67f0274b10545605207
619d6282c3c263672113efee8e1e386de480e119 11-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge changes I5b94a8f0,Ie6cdd846,Ie6b5f5e6,Ib962edf6,I9d779b2d, ...

* changes:
Add an extra debug flag to BackgroundDexOptimizer
Some refactoring in BackgroundDexOptService.
Do not try to resolve realpath in DexManager.
Log DexManager realpath errors only in debug mode.
Record data about dex files use on disk
Add logic for recording dex files use on disk
99ca0df8d4ccb2bc3442e4c48d4922b7aa88e36d 11-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Moved isCallerActiveScorer() to the score service." am: 663b444196 am: 5fbd2791ac
am: 11b1311e21

Change-Id: I9e00b4593005729cdf2b01e2347f0513a6d52cf0
11b1311e211465202a0587e563346f95290e8cbc 11-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Moved isCallerActiveScorer() to the score service." am: 663b444196
am: 5fbd2791ac

Change-Id: If5649294845f01a390bccd47fe99add3b27b0829
5fbd2791acd31837f36ea337f18defcafd97f07a 11-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Moved isCallerActiveScorer() to the score service."
am: 663b444196

Change-Id: I44134284edc88567703435ce663b3d0efd9cff26
5a9094c1b6e5797327674d4f12fa1ac4ade7275c 16-Dec-2016 Calin Juravle <calin@google.com> Record data about dex files use on disk

Add DexManager to keep track of how dex files are used.

Every time a dex file is loaded, PackageManager will notify DexManager
which will process the load. The DexManager will look up what package
owns the dex file and record its use in package-dex-usage.list (through
PackageDexUsage).

Test: device boots, package-dex-usage.list is created and contains valid data, after device reboot the list is succesfully read from disk.
runtest -x .../PackageDexUsageTests.java
runtest -x .../DexManagerTests.java

Bug: 32871170

(cherry picked from commit b8976d8f22fecaa9ed39276d9d8ded17d35b51a6)

Change-Id: I9d779b2d39814d7c54fc7a888df93d403a001df5
m/dex/DexManagerTests.java
6ea5ace7b3a8ddf19a7389592eb9df3b33c673f3 01-Dec-2016 Calin Juravle <calin@google.com> Add logic for recording dex files use on disk

Add PackageDexUsage to handle the I/O operations of dex usage data. It
is responsible to encode, save and load dex

Test: runtest -x .../PackageDexUsageTests.java

Bug: 32871170

(cherry picked from commit 0318162abcbd07a0472989df43e00e353fac731b)

Change-Id: I6d483d480d62aa14cb1663560fd88092469a2835
m/dex/PackageDexUsageTests.java
d7670f6d7c2fd0e0c6bf204613fbb33f68267679 10-Jan-2017 Jeremy Joslin <jjoslin@google.com> Move getActiveScorerPackage() to the score service.

Implemented getActiveScorerPackage() in the NetworkScoreService to
make it more efficient (no need to query PM).

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 33781558
Change-Id: Iee7610e4982b44aefa1ef8b6c208292b8f9adcf8
Merged-In: I2144351c2c09cad30f80399069364f3572e38445
etworkScoreServiceTest.java
9b442faa9193173753ea2669009bb5c2bed29079 10-Jan-2017 Jeremy Joslin <jjoslin@google.com> Moved isCallerActiveScorer() to the score service.

Implemented isCallerActiveScorer() in the NetworkScoreService to make
it more efficient (no need to query PM). Exposed the call as a new
internal API on NetworkScoreManager and deprecated the call on
NetworkScorerAppManager.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 33781558
Change-Id: I8ad232f8ef34b6e2f155ebb232e64300303300f0
Merged-In: I0e2142af95b068d322343f7c9362ac53d46b545e
etworkScoreServiceTest.java
917bb57021d8d325394bc47b687f4f06ff478228 11-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Move getActiveScorerPackage() to the score service."
460e9104d09cd15543ba28eb95b3869018b81733 11-Jan-2017 Makoto Onuki <omakoto@google.com> Merge "Allow adding target activity via requestPinShortcut()."
24d5a0bae29c7696624038ffc76bc3b3294e10c0 10-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Cleanup test method names." am: 8e9fd295c8 am: 361412ced4
am: f41881b7fe

Change-Id: I779562d42a399beaa8df47050d68a6fc95f47fba
f41881b7fe7567fda79f25f528f05b2b630d2f0f 10-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Cleanup test method names." am: 8e9fd295c8
am: 361412ced4

Change-Id: I160b077d4faff67a721e9557f7dae10682dc2d81
361412ced421d7de600055b997e7fa26e1abb211 10-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Cleanup test method names."
am: 8e9fd295c8

Change-Id: Idb000e2b6cd8b7ba2046d329e039f6b05424686e
255461f676f09db9be3876c156d571f4e08981ee 10-Jan-2017 Makoto Onuki <omakoto@google.com> Allow adding target activity via requestPinShortcut().

Also now ShortcutManager tries to fill in the main activity as the target
activity if the caller has one.

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: Running: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases

Bug 34047091

Change-Id: I2bf2b20e94a2384cfa6e6b7d40d56cfe96a94fd9
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest8.java
6c1ca280b3bf5646afd5f0ef57beceb52233c782 10-Jan-2017 Jeremy Joslin <jjoslin@google.com> Move getActiveScorerPackage() to the score service.

Implemented getActiveScorerPackage() in the NetworkScoreService to
make it more efficient (no need to query PM).

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 33781558
Change-Id: I2144351c2c09cad30f80399069364f3572e38445
etworkScoreServiceTest.java
23f1fcd5ef2b2afd3b364cde00c4c5244eaaf6f5 10-Jan-2017 Jeremy Joslin <jjoslin@google.com> Cleanup test method names.

Renamed some test methods to reflect the proper permission.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 1764042
Change-Id: Ia7db8826ad18c3b8f119aa063cb2c7b3793a9d17
Merged-In: I5551ddcb411432c6aeb14c03d9a284aa68f1bd1b
etworkScoreServiceTest.java
134c9d3311debd96aa63510835d31465e97155e1 10-Jan-2017 Jeremy Joslin <jjoslin@google.com> Moved isCallerActiveScorer() to the score service.

Implemented isCallerActiveScorer() in the NetworkScoreService to make
it more efficient (no need to query PM). Exposed the call as a new
internal API on NetworkScoreManager and deprecated the call on
NetworkScorerAppManager.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 33781558
Change-Id: I0e2142af95b068d322343f7c9362ac53d46b545e
etworkScoreServiceTest.java
558097a03bc4e8c40a9e82cf1264d7e741337c64 10-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Cleanup test method names."
ba41f4b9e3629c097cdd7b6538c5bcf4602728b8 15-Dec-2016 Jorim Jaggi <jjaggi@google.com> Clean up starting window to prepare for saved surfaces

- Move all starting window logic to AppWindowContainerController
- Use startingView to hold any kind of contents for startingWindow
- Remove some conflicting code which looks very old and doesn't
apply anymore.

Test: Make sure starting window still works.

Bug: 31339431
Change-Id: I018dd013ab7e64a44932b6d54ae9bb4a47f315d3
m/TestWindowManagerPolicy.java
06d1fd7077c1dd4da3b8c1d6e02931c5b76b3670 10-Jan-2017 Jeremy Joslin <jjoslin@google.com> Cleanup test method names.

Renamed some test methods to reflect the proper permission.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 1764042
Change-Id: I5551ddcb411432c6aeb14c03d9a284aa68f1bd1b
etworkScoreServiceTest.java
c3bd7b78d80370f21102bae155b05f2567f2a31d 10-Jan-2017 Nicolas Prevot <nprevot@google.com> Additional unit tests for isProvisioningAllowed

Test it with disallow add / remove managed profile user restrictions.

BUG:32629873
Test: adb shell am instrument -e class
com.android.server.devicepolicy.DevicePolicyManagerTest -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ic6b01c2b0ed9081204801a6c5719b0fd25eafbba
evicepolicy/DevicePolicyManagerTest.java
8dedad31f7fa604028ee6d28963bcc564e76c467 10-Jan-2017 Jeff Sharkey <jsharkey@android.com> Wire up storage stats API to installd.

Now that installd has the implementation details we need, we can wire
up the public APIs to use them.

Shuffle APIs around a bit so that StorageStats can be reused for both
UID and UserHandle results, and rename StorageSummary to
ExternalStorageStats. Provide getTotalBytes() and getFreeBytes() as
first-class methods so we can answer those questions quickly without
paying the cost of measuring external storage details.

Current costs on a typical device with a test account after flushing
dentry caches:

queryStatsForUid() manual: 6922ms
queryStatsForUid() quota: 525ms

queryStatsForUser() manual: 1686ms
queryStatsForUser() quota: 113ms

queryExternalStatsForUser() manual: 42ms
queryExternalStatsForUser() quota: 2ms

For verification purposes, a new "fw.verify_storage" system property
can be set to compute both manual and quota statistics, and log any
discrepancies.

Test: builds, boots
Bug: 27948817, 32206268
Change-Id: I4ea3df3372a7379aa8cf4c20c44120c8f0702c15
m/InstallerTest.java
bd439dcef072fd9a853a6bc9055cfa347ad7c969 10-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Methods to calculate user and external disk usage." am: 6a9ad14172 am: 7beb2b75a9 am: 669affdb8e
am: 91b91b7f86

Change-Id: I7859db9f53560ad602bb26f37854bdfc02f15d09
91b91b7f86d890ef4c0210b1dfb78e2aa3a7dc10 10-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Methods to calculate user and external disk usage." am: 6a9ad14172 am: 7beb2b75a9
am: 669affdb8e

Change-Id: I698dd15a397f16dd2358729362860443f7e81a33
669affdb8e70043e3ecb8274251f609cb529bbf0 10-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Methods to calculate user and external disk usage." am: 6a9ad14172
am: 7beb2b75a9

Change-Id: I236eb3357b597cac26f5234a72551a471919a411
7beb2b75a92c22a6bfcc9caeece737e4ea0fd562 10-Jan-2017 Jeff Sharkey <jsharkey@android.com> Merge "Methods to calculate user and external disk usage."
am: 6a9ad14172

Change-Id: Ie4ab045a5425b35ce1bdd245f7c6ab248c796df2
82ca90171fdd5b76f58225bacbf9939a76350712 09-Jan-2017 Jeff Sharkey <jsharkey@android.com> Methods to calculate user and external disk usage.

Add method to calculate user disk usage, which will be faster than
making a Binder call for every single appId under a user. Add method
to calculate external disk usage, which uses file extensions to track
usage with "audio", "video", and "images" categories.

Start measuring internal and external storage space separately; new
GIDs are coming in a future CL. Pass down all package names, inodes,
and code paths, since shared UIDs host more than one.

Test: builds, boots, stats are consistent
Bug: 27948817, 32206268
Change-Id: Icbb82a30fe711ef05e9a16bb1dc740dc943a9ddc
m/InstallerTest.java
2ddcb077ac2b5a4d5d36ff82b4959b6d83b43a03 09-Jan-2017 Eugene Susla <eugenesusla@google.com> Merge "Unit test to keep a11y cache critical events up to date"
6cf53d0ab86c69fbf35fd20675028cad910a1b7c 09-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED." am: 4c456d7ddf am: 542aad4c75
am: f91d9debef

Change-Id: I7436278fa3eab064fe2b416c672bedaa300eb501
f91d9debefd6864764d0f9b9a911af1f65826c0b 09-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED." am: 4c456d7ddf
am: 542aad4c75

Change-Id: I3b35ec04e65f6b14f75f266dfcf15c10a12a4d74
542aad4c75a2039805f3b4bb6fedae337abd552a 09-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED."
am: 4c456d7ddf

Change-Id: I441cae5096b922419763832d5b38faa95818e337
186f3339ab1e7542061ee263bdd2ebbd9813a489 06-Jan-2017 Jeremy Joslin <jjoslin@google.com> Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33752149
Change-Id: I3dd352c98bbc34b128ab9c2a28f81e1261ae2669
Merged-In: I7d91fa9a4f6ef4f9170c6af98567ce443c805e74
etworkScoreServiceTest.java
d2a73ed21152517097a603e03c08eafbce926c3d 19-Dec-2016 Robin Lee <rgl@google.com> Send EXTRA_USER with DevicePolicy lock broadcasts

DeviceAdmins inside profiles may receive broadcasts referring either
to the parent profile or to themselves.

We need a way to differentiate that.

Same commit fixes a bug in DevicePolicyManagerTest where USER_SYSTEM
is returned twice in getProfiles() when called for a managed profile of
USER_SYSTEM. This does not happen in the real API.

Bug: 30185351
Bug: 31001762
Test: runtest -x services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Change-Id: Iea2735357f4019b2b81b6784e7ea6aead63f2636
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
5519d7cf71eefba0009d8b8b5b38e71d9001dfb8 06-Jan-2017 Jeremy Joslin <jjoslin@google.com> Check for REQUEST_NETWORK_SCORES instead of BROADCAST_NETWORK_PRIVILEGED.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33752149
Change-Id: I7d91fa9a4f6ef4f9170c6af98567ce443c805e74
etworkScoreServiceTest.java
2e83edb4b0ebe2406492ba4a67f217b22be8e915 06-Jan-2017 Makoto Onuki <omakoto@google.com> Merge "Revert "ShortcutManager: Floating shortcuts shouldn't have target activities.""
f51b4ff7b1ac09b22772dcbdf7ae24b611c37171 06-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Make sure cleanup is always done when task is removed"
9fd9019cf1f2c69c9bd1b9ea635a2605b3d9208f 06-Jan-2017 Makoto Onuki <omakoto@google.com> Revert "ShortcutManager: Floating shortcuts shouldn't have target activities."

This reverts commit 106ff7a0a1bef974ff04e9e79a25eb5e84555893.

Test: All the unit tests (ShortcutManagerTest1*) CtsShortcutHostTestCases and CtsShortcutManagerTestCases

Change-Id: Iadce2b3785cbf728daa60c4e2ff103e516d85896
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
45a61fe5296d6fd3b9e2872c5dfc8d01f6a5b455 06-Jan-2017 Andrii Kulian <akulian@google.com> Make sure cleanup is always done when task is removed

When Stack#removeImmediately() was called it also recursively
called Task#removeImmediately(), which remove tasks from stack.
This lead to Task#mStack reference being nullified, but task
dim layer user was still registered in DimLayerController.
Therefore there was a crash when dim layer animation occured.

This CL moves most of the logic from Task#removeIfPossible() to
Task#removeImmediately() to make sure that cleanup is performed
every time when task is removed.

Change-Id: Id8d72dc8c66b9eeefbf5c918cf0a0df4ea027fde
Fixes: 34052466
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackTests
Test: #testStackRemoveImmediately
m/TaskStackTests.java
4acc16d1b611074baa9eeb7ec5628350b7eb5fa5 15-Sep-2016 Phil Weaver <pweaver@google.com> Add flag and listener for a11y volume requests.

We're adding a dedicated volume level for accessibility. Services
can use the new flag to request that this volume be activated for
accessibility usages.

To let AudioManager know when the request state changes, adding a
hidden convenience method to check if any active service requests
the a11y volume stream. This method can be used to enable the
stream and to decide when to show the UI to change its volume.

AudioManager wanted a listener for changes to this flag, so rather
than add yet another special-purpose listener, I've added one that
gets called back whenever there are state changes in a11y services.
These changes happen infrequently enough that we shouldn't need
more targeted methods.

Bug: 30448020
Bug: 27899567

Test: Adding CTS in linked CL.
Change-Id: Ifc53314dc7d9a6ee3d50b04ebcc1a87280cafa5e
ccessibilityManagerServiceTest.java
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
m/AppWindowContainerControllerTests.java
m/UnknownAppVisibilityControllerTest.java
m/WindowContainerControllerTests.java
m/WindowContainerTests.java
m/WindowTestsBase.java
5c50e8630164d7d9a1a097f70d2f8bcbf1bd854f 24-Nov-2016 Narayan Kamath <narayan@google.com> PackageManagerService: Implement packageParser cache in ParallelPackageParser.

We save about 2800ms of cold startup time over baseline on a marlin,
and ~1200 ms over the parallel parsing case.

warm cold
---------------
Baseline : 1700ms 4300ms
Parallel : 1400ms 2700ms
Cache : 1000ms 1600ms
Cache & parallel : 900ms 1500ms

Note that further changes will improve the speed of cache processing.

This change also includes support for :
- a flag that been flipped in code (currently set to false).
- disabling the cache via a system property.
- wiping the cache on system upgrades.
- cache versioning.

Bug: 30792387

Test: FrameworksServicesTests
Test: manual timing

Change-Id: I281710c110af5307901dd62ce93b515287c91918
m/ParallelPackageParserTest.java
b4413f694fbb8b03737d3e7a3831896bd371bed5 05-Jan-2017 Nicolas Prévot <nprevot@google.com> Merge "Make disallow add/remove managed profile restriction not global."
2ea46fe658c5a977a11372d7180e8ed9abf261e8 05-Jan-2017 Nicolas Prevot <nprevot@google.com> Make disallow add/remove managed profile restriction not global.

Otherwise: if the DO sets remove managed profile user restriction:
the profile owner of a managed profile cannot remove this managed
profile.

BUG:33854430
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I90b2028ea627a2073298bf9ef3c07b4fdf8d13a1
evicepolicy/DevicePolicyManagerTest.java
8af18a6fa31d7c8b926c1cbebcad293b103a02ce 05-Jan-2017 Narayan Kamath <narayan@google.com> Merge "PackageParser: Add serialization mechanism for parse results."
0872235d4c765681b678a0d299004a0ba3c883da 05-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Fix NetworkScoreServiceTest.testSystemRunning." am: 5b4aec1dc6 am: 01828eb244
am: b68823cab8

Change-Id: I19f5c7179a489e992356f141314582abc803ad2e
b68823cab81f7338387fa3e4b1c36fdab8bb41e8 04-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Fix NetworkScoreServiceTest.testSystemRunning." am: 5b4aec1dc6
am: 01828eb244

Change-Id: I094906527e9baf20f6bcb844f261d0fdcb8f6aa6
01828eb244ac00a5dc9d8404806a0cfbb2f8d872 04-Jan-2017 Jeremy Joslin <jjoslin@google.com> Merge "Fix NetworkScoreServiceTest.testSystemRunning."
am: 5b4aec1dc6

Change-Id: Ic80d796221d94a092ed210dde3d1e3886d950265
b17a5edb65219a0fa453ec15ab8b43c715222a98 30-Dec-2016 Jeremy Joslin <jjoslin@google.com> Fix NetworkScoreServiceTest.testSystemRunning.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33905890
Change-Id: Icc1db79cde26f1445ca925780ff760b7aa0515b1
Merged-In: Idc92fe3669b0efdb20d3899ce4ce7bae70033aff
etworkScoreServiceTest.java
a9d0cfbcc90c3f9567d081cfe7a11ad30b382e40 04-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Always place stacks below pinned stack"
74c6cbaa63dca46cfebff60bda68d6498c6c0c3b 28-Dec-2016 Eugene Susla <eugenesusla@google.com> Unit test to keep a11y cache critical events up to date

Unit test AccessibilityCache.CACHE_CRITICAL_EVENTS_MASK, introduced in Icbdb91803b646fa06aaf11996d350f6f65c1e809

Bug: b/32642665
Test: Ensure the introduced unit test passes
Change-Id: I60741c42334c61af8cd695e20c3a1f6be706824d
ccessibility/AccessibilityCacheTest.java
86d1eb9b4b246ef9775b16c1c538ba5f6becba5b 04-Jan-2017 Makoto Onuki <omakoto@google.com> Get account features before taking lock (cherry-pick from master)
am: fd24353d75

Change-Id: I4d89f492d4186f14516f93be800a6548127be921
a532c3ff8c2101de42281cb71cc411ab1dff64f0 04-Jan-2017 Sunny Goyal <sunnygoyal@google.com> Merge "AppWidgetManager: direct add widget support."
cd5dcb8b3d7d8b6759232a02c0a5c8ae21e22e33 04-Jan-2017 Andrii Kulian <akulian@google.com> Always place stacks below pinned stack

When positioning or adding stacks we must make sure
that no stack is above pinned stack.

Bug: 34049027
Test: runtest frameworks-services -c com.android.server.wm.TaskStackContainersTests
Change-Id: Ic92a4e07e9cde42deed53912ac1419fde4ab2f08
m/TaskStackContainersTests.java
fd24353d75adbb0237fa13d209abe6b790535b8b 15-Dec-2016 Makoto Onuki <omakoto@google.com> Get account features before taking lock (cherry-pick from master)

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.AccountCheckHostSideTest
* without having Id49f2bd5dfa80ecf35b3a23c789100ade38c2656 *

Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w com.android.frameworks.servicestests

Bug: 33481725
Change-Id: Ie2fe9aea87d1a7167581f4cd74ae063ef24a4567
Merged-in: I1e4dd9701a76ca366f86fdaf2fc6c282e9dbe5c1
evicepolicy/DpmMockContext.java
9bab1c4dd505903dbdd7403ea38d8b9d449e9be4 03-Jan-2017 Makoto Onuki <omakoto@google.com> Merge "Get account features before taking lock"
87a563e0707bb7e2be034c195e9827dfe3451cfd 02-Jan-2017 Sunny Goyal <sunnygoyal@google.com> AppWidgetManager: direct add widget support.

Test: Manual test and all the unit tests:
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to test9
adb shell am instrument -e class com.android.server.appwidget.AppWidgetServiceImplTest -w com.android.frameworks.servicestests

Bug 32404406
Change-Id: Icd6d4cbd25d9cdf4508da725d95d6401cc3a46a7
ppwidget/AppWidgetServiceImplTest.java
ppwidget/DummyAppWidget.java
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest9.java
606da7778fffcb8251808ef53903eefebc2db9a7 15-Dec-2016 Makoto Onuki <omakoto@google.com> Get account features before taking lock

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.AccountCheckHostSideTest
* without having Id49f2bd5dfa80ecf35b3a23c789100ade38c2656 *

Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w com.android.frameworks.servicestests

Bug: 33481725
Change-Id: I1e4dd9701a76ca366f86fdaf2fc6c282e9dbe5c1
evicepolicy/DpmMockContext.java
fb2afbf7fa63e972e3de5a9ecf1e246019246792 24-Nov-2016 Narayan Kamath <narayan@google.com> PackageParser: Add serialization mechanism for parse results.

Also adds unit tests that assert that the cached value is equivalent
to the parsed value.

bug: 30792387
Test: PackageParserTest
Change-Id: Ibf6dfd1225243b436e3d7473170c2ccc31cfbbd7
m/PackageParserTest.java
586d36e610d9958dade5958bcb6817cb695fa335 30-Dec-2016 Jeremy Joslin <jjoslin@google.com> Fix NetworkScoreServiceTest.testSystemRunning.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33905890
Change-Id: Idc92fe3669b0efdb20d3899ce4ce7bae70033aff
etworkScoreServiceTest.java
77b165f0af2f4c9c5957c122afadec87a012cf41 28-Dec-2016 Andrii Kulian <akulian@google.com> Merge changes I2ac2cdba,I6ade7874

* changes:
Fix crash when removing a display with activities
Add positionChildAt method to WindowContainer
95f50d73148908c17015da98d89dcd788bf639ec 28-Dec-2016 Jorim Jaggi <jjaggi@google.com> Merge "Reenable test for presubmit"
6cc1a1d65cd2b9eaeeb82ac3fe62e8dfc6a9eb01 28-Dec-2016 Andrii Kulian <akulian@google.com> Fix crash when removing a display with activities

When secondary display is removed current behavior is to
move its stacks to the primary display. This requires app
windows to be reparented, and there was a check missing
for app windows in DisplayContent.reParentWindowToken.

Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Test: #testMoveStackBetweenDisplays
Bug: 33677605
Change-Id: I2ac2cdba273134438c63385887a09c37d42017bb
m/DisplayContentTests.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
m/TaskStackContainersTests.java
m/TaskStackTests.java
m/WindowContainerTests.java
m/WindowTestsBase.java
bca4c7fc0de4909c365c08581456ebea8ca8ce61 22-Dec-2016 Daniel Nishi <dhnishi@google.com> Fix a bug where the package stats query timeout may crash. am: cf76a16e66
am: e76b9dcb62

Change-Id: I341041c0edec8706cc449527b1dd130384a4ab01
e76b9dcb62edc1ffa8c9e38b4466515ceef43e18 22-Dec-2016 Daniel Nishi <dhnishi@google.com> Fix a bug where the package stats query timeout may crash.
am: cf76a16e66

Change-Id: Ibc146f89412387eb05a164c2a1969210fcea4262
cf76a16e660a361670745b043198b797ccd86747 22-Dec-2016 Daniel Nishi <dhnishi@google.com> Fix a bug where the package stats query timeout may crash.

This adds a null-check to verify that we got real data before
trying to use it and increases the timeout time to reduce the
likelihood of timing out.

Test: FrameworkServicesTests
Bug: 33836034
Change-Id: Ia1ad4aba05c5c4fb8688fc9fc94df344f736e396
torage/DiskStatsLoggingServiceTest.java
7af07643f3df25dc01de533833ed25082d87f5f0 22-Dec-2016 Jeremy Joslin <jjoslin@google.com> Clear and restore the calling ID. am: 29ed4a99bf am: 3588b8d44c
am: 3f32d12be0

Change-Id: I2cbf3ca1ff0a743de1b08fad467027ec59333def
aedc94bf11eb8c9132905a3c19663b5895f48550 22-Dec-2016 Alex Klyubin <klyubin@google.com> resolve merge conflicts of a9888fc to master

Change-Id: I6ad00bf5bc1b18406b7fc8969c35bf7970fd1967
3f32d12be0d3acb4bd0c01aaa6df39c1a583ce88 22-Dec-2016 Jeremy Joslin <jjoslin@google.com> Clear and restore the calling ID. am: 29ed4a99bf
am: 3588b8d44c

Change-Id: I43b6f2899b5d82d4781937766907d6d7afa6b2bd
a9888fc0c42d643e29e80bd0f2394d87f3339f44 22-Dec-2016 Alex Klyubin <klyubin@google.com> resolve merge conflicts of febd982 to stage-aosp-master am: 5c53fdb893
am: b824658494

Change-Id: Ic1dd2aef96889f0f68a55093cfb04b4d90f34818
3588b8d44c8dce4d7ca8a2346e148c9bd3c964df 22-Dec-2016 Jeremy Joslin <jjoslin@google.com> Clear and restore the calling ID.
am: 29ed4a99bf

Change-Id: Ie5752ca772e6f5c8fed8092d23e0604f44598b24
b82465849450a54820758161fefe05cf61ea960f 22-Dec-2016 Alex Klyubin <klyubin@google.com> resolve merge conflicts of febd982 to stage-aosp-master
am: 5c53fdb893

Change-Id: Ib0878f0f17c3799ff9ffb92d7e85904fc91fdab7
5c53fdb89367481c2a65d7c8d188415c8e485131 22-Dec-2016 Alex Klyubin <klyubin@google.com> resolve merge conflicts of febd982 to stage-aosp-master

Change-Id: I40c27e3159b8f7acd60c6fa42509bb23d146b937
43769ddb2c348325c9d571626251a233c7ee9b7f 22-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add DISALLOW_ADD_MANAGED_PROFILE to existing device owners"
29ed4a99bf3fae207f2359de34d3b37edf15e3dc 20-Dec-2016 Jeremy Joslin <jjoslin@google.com> Clear and restore the calling ID.

Clear and restore the calling identity in IPC methods after asserting
the caller has the required permissions.

Fixed 2 tests in NetworkScoreServiceTest that were failing due to a
recent refactor.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33781319
Change-Id: I562713df3d9455cdc02bf80a687940fb9daecd8f
Merged-In: Icd79751d12dcfe4af8026980aaa1f7bd463468dc
etworkScoreServiceTest.java
febd982cdd61ecad34c4d463fb63d2a4836d26ea 21-Dec-2016 Jeff Sharkey <jsharkey@android.com> Merge "Avoid Calendar's unexpect change in snapToCycleDay()"
9926363b0938f6ce8bdc6b1146867a0f1d65a97f 21-Dec-2016 Amin Shaikh <ashaikh@google.com> Merge "Expose ScanResult#untrusted as a @SystemApi." am: a93e57f1ac am: a3943850ab
am: 471093b58e

Change-Id: I129d3abd329d9e00de1177ca39cf3ce0ff06946b
471093b58e97ab2ea310c7743acb7674a07f7391 21-Dec-2016 Amin Shaikh <ashaikh@google.com> Merge "Expose ScanResult#untrusted as a @SystemApi." am: a93e57f1ac
am: a3943850ab

Change-Id: Id763d2f82e10dd5843258ef09d0e65824e2c2de6
a3943850ab67dc2df1639202de6735c3991e4dc8 21-Dec-2016 Amin Shaikh <ashaikh@google.com> Merge "Expose ScanResult#untrusted as a @SystemApi."
am: a93e57f1ac

Change-Id: I9cac16dbceb36d6ff72e92d2ab8de20bd8d70e36
3d18c621cbff73fb6fe4bf68ae55c17c8545d3e9 10-Dec-2016 Amin Shaikh <ashaikh@google.com> Expose ScanResult#untrusted as a @SystemApi.

- Expose ScanResult#untrusted to inform NetworkRecommendationProviders
that a ScanResult does not correspond to a saved network.
- Add static construction methods and assertions to RecommendationResult

Test: runtest frameworks-services

Bug: 33490132
Change-Id: If7006040f63843c1c468c9d95c5c017383c5c5dd
Merged-In: If7006040f63843c1c468c9d95c5c017383c5c5dd
etworkScoreServiceTest.java
d18ffd8223282285ab5e6a576976c115e50bd509 25-Oct-2016 Shunta Sato <Shunta.Sato@sonymobile.com> Avoid Calendar's unexpect change in snapToCycleDay()

Symptom:
Calendar object's certain field is unexpectedly changed after
using Calendar.add() method.

Detail and sample:
Following patch causes this issue.
- Switch network cycle calculation to use Calendar.
https://android.googlesource.com/platform/frameworks/base/+/f2bead5

Call of Calendar.add() method might make a smaller field value
invariant. The smaller field means such a field of
Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND and so on
if Calendar.MONTH field is focused.
According to above, sometimes correct Calendar value won't be
acquired by original code.
To avoid unexpected change, it requires initialization toward
each smaller field after Calendar.add() call.

Solutions:
Calendar.DAY_OF_MONTH, Calendar.HOUR_OF_DAY, Calendar.MINUTE,
and Calendar.SECOND fields is set to 0 after added value to
Calendar.MONTH field.

Bug: 32724903
Author: Shigeki Yokomichi <shigeki.x.yokomichi@sonymobile.com>
Change-Id: I7af6391653be21786b662b2f8eaad10c413733c1
etworkPolicyManagerServiceTest.java
e83feea26acbeb61de0daa8b0d1076eb662e7b09 21-Dec-2016 Calin Juravle <calin@google.com> Merge "Record data about dex files use on disk"
0f3fa9e3cc4a7cdd22d12e96d8d4bd003ba2e0a6 21-Dec-2016 Calin Juravle <calin@google.com> Merge "Add logic for recording dex files use on disk"
548a04b8f894c55e0612790ee6bc222e4398f33e 20-Dec-2016 Esteban Talavera <etalavera@google.com> Add DISALLOW_ADD_MANAGED_PROFILE to existing device owners

For device owners set pre-O, that restriction will not
be set via setDeviceOwner(). Therefore set it during
first boot after O OTA.

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services

Bug: 31952368

Change-Id: I7db9b14c49a75ae2760e6923a1f3f7cde0e2784b
evicepolicy/DevicePolicyManagerTest.java
f1312cd68e093a1ef429c0d411dad7e83acc7d2b 21-Dec-2016 Daniel Nishi <dhnishi@google.com> Augment diskstats dumpsys to have categorization and apps.
am: 090b2d9d6c

Change-Id: I2c923293a1baf91b14ab50e25c880bfeb191403d
a9d86027878810c718a53a5140fb4e7398ccb99c 21-Dec-2016 Daniel Nishi <dhnishi@google.com> Add a file collector to the platform.
am: be770dce08

Change-Id: I2b908b6df1ad305207fca596d6c865dfeaecd5c9
f5e2f1ae38d84fd3a823de3bb23ad1c9c8eaee4f 21-Dec-2016 Daniel Nishi <dhnishi@google.com> Add an app size collector.
am: c7d9de59bf

Change-Id: I83bdc3b47eda2658d7467b7c298652e39ad3f238
639f95dd13270805fd5914fec2ea785e941aa516 21-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'diskstats-mr2' into nyc-mr2-dev

* changes:
Augment diskstats dumpsys to have categorization and apps.
Add a file collector to the platform.
8f5521aa679f21bc106dec90ecf21cd2283747a7 20-Dec-2016 Jeremy Joslin <jjoslin@google.com> Clear and restore the calling ID.

Clear and restore the calling identity in IPC methods after asserting
the caller has the required permissions.

Fixed 2 tests in NetworkScoreServiceTest that were failing due to a
recent refactor.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33781319
Change-Id: Icd79751d12dcfe4af8026980aaa1f7bd463468dc
etworkScoreServiceTest.java
0e4b9cd97d3794b0e1cb7da41d5955ab97907520 20-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Expose ScanResult#untrusted as a @SystemApi."
090b2d9d6c73ad1b92fd6374aaaa26a384333239 13-Dec-2016 Daniel Nishi <dhnishi@google.com> Augment diskstats dumpsys to have categorization and apps.

This adds a new service which opportunistically saves the
file system categorization information and the app sizes. This
information is fetched during a diskstats dumpsys call from a file
stored on the disk. This allows us to keep the dumpsys running quickly
while adding information which is costly to calculate.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: Id59e84b9ad38a9debf3e46e5133ef06f7353829d
torage/DiskStatsFileLoggerTest.java
torage/DiskStatsLoggingServiceTest.java
c7d9de59bfa083472a5c8fcfc02c2363b33e204f 13-Dec-2016 Daniel Nishi <dhnishi@google.com> Add an app size collector.

The app collector gets a list of app sizes for packages on a given
storage volume. This information will be exposed as part of an
expansion of the diskstats dumpsys.

When the collector runs, it sets up a handler on a BackgroundThread
which asks the PackageManager for the package sizes for all apps and
all users. The call for the information is blocked using a
CompletableFuture until the call times out or until we've received
all of the package stats. After the stats are all obtained, the
future completes.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: I3a27dc4410effb12ae33894b561c02a60322f7b0
torage/AppCollectorTest.java
be770dce086413618d05917ebb967e0414346dce 10-Nov-2016 Daniel Nishi <dhnishi@google.com> Add a file collector to the platform.

The file collector takes in a file path and recursively
classifies and provides the amount of storage provided by
each classification. This information can be surfaced in
Settings or to fulfill storage telemetry calculations.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: Iff03260859cd4bbd11e7d60b1825115aad540d48
torage/FileCollectorTest.java
74dfc6b1774bd55fa3a2216c92c6db58a403a61a 20-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'diskstats-update'

* changes:
Augment diskstats dumpsys to have categorization and apps.
Add a file collector to the platform.
f9d47b79b2a307da1a16a8e0c16b3f9847ff5414 10-Dec-2016 Amin Shaikh <ashaikh@google.com> Expose ScanResult#untrusted as a @SystemApi.

- Expose ScanResult#untrusted to inform NetworkRecommendationProviders
that a ScanResult does not correspond to a saved network.
- Add static construction methods and assertions to RecommendationResult

Test: runtest frameworks-services

Bug: 33490132
Change-Id: If7006040f63843c1c468c9d95c5c017383c5c5dd
etworkScoreServiceTest.java
77a78c6f4412dccc58075685ad77f3e41d85f2e4 13-Dec-2016 Daniel Nishi <dhnishi@google.com> Augment diskstats dumpsys to have categorization and apps.

This adds a new service which opportunistically saves the
file system categorization information and the app sizes. This
information is fetched during a diskstats dumpsys call from a file
stored on the disk. This allows us to keep the dumpsys running quickly
while adding information which is costly to calculate.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: Id59e84b9ad38a9debf3e46e5133ef06f7353829d
torage/DiskStatsFileLoggerTest.java
torage/DiskStatsLoggingServiceTest.java
a59272eb5edde2230ba7ae5c1a6788dc25c2a18c 13-Dec-2016 Daniel Nishi <dhnishi@google.com> Add an app size collector.

The app collector gets a list of app sizes for packages on a given
storage volume. This information will be exposed as part of an
expansion of the diskstats dumpsys.

When the collector runs, it sets up a handler on a BackgroundThread
which asks the PackageManager for the package sizes for all apps and
all users. The call for the information is blocked using a
CompletableFuture until the call times out or until we've received
all of the package stats. After the stats are all obtained, the
future completes.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: I3a27dc4410effb12ae33894b561c02a60322f7b0
torage/AppCollectorTest.java
3c7febdbd86070337810d1ff741d35430707726a 10-Nov-2016 Daniel Nishi <dhnishi@google.com> Add a file collector to the platform.

The file collector takes in a file path and recursively
classifies and provides the amount of storage provided by
each classification. This information can be surfaced in
Settings or to fulfill storage telemetry calculations.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: Iff03260859cd4bbd11e7d60b1825115aad540d48
torage/FileCollectorTest.java
2abde827c588109474a16139fbde7e8225089fd0 20-Dec-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE Stricter NetworkNotificationManagerTest
am: a865790a5b

Change-Id: I94ea5c6994d181e730ec4f49e98001eb81ed8740
71909ea39a575b64cb6afdb1117d6c4c84010f52 20-Dec-2016 Jeremy Joslin <jjoslin@google.com> Merge "Implement the request and recommend calls." am: 1e814b3928 am: b50fdc7faa
am: 949893f5b2

Change-Id: Ibd03bace49bc277a2777c8483da6b4ebfc56d217
949893f5b2b91a9aedb141d551c3a619acb1051e 20-Dec-2016 Jeremy Joslin <jjoslin@google.com> Merge "Implement the request and recommend calls." am: 1e814b3928
am: b50fdc7faa

Change-Id: I81f998b6934715f43797247f411919a4ceee5631
b50fdc7faa0202993c830f80542d222fb2b10549 20-Dec-2016 Jeremy Joslin <jjoslin@google.com> Merge "Implement the request and recommend calls."
am: 1e814b3928

Change-Id: I91c905ab2fc7e061462fb96c2c81a783aa93a391
a865790a5b30a2d5e29e3d443e7b02a5d8aa01a4 20-Dec-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE Stricter NetworkNotificationManagerTest

This patch changes NetworkNotificationManagerTest to populate extraInfo
of NetworkInfo in order to catch regressions in malformed format Strings
of log statements in NetworkNotificationManager.

Test: verified that the test fails when reintroducing the format String
bug.
Bug: 33737715

Change-Id: If14063554b8246d9d80cd222cb41c30dee121c5a
onnectivity/NetworkNotificationManagerTest.java
d0d32e238e8a36c4cbb2971cab1ee61b1b1aaec8 20-Dec-2016 Jeremy Joslin <jjoslin@google.com> Merge "Implement the discovery of a network recommendation provider." am: 470d256519 am: 8fbeb1d74a
am: af811c2650

Change-Id: I18d4c618f78796cbbe6d895c5b2f888c4a9a55ff
af811c265004184f54caedc5155b7de4c4575648 20-Dec-2016 Jeremy Joslin <jjoslin@google.com> Merge "Implement the discovery of a network recommendation provider." am: 470d256519
am: 8fbeb1d74a

Change-Id: I322592326e0a409131a4dd33ab1f907b9262dbf2
8fbeb1d74a0321f44038ec0c3c7c0bf2cd8bf302 20-Dec-2016 Jeremy Joslin <jjoslin@google.com> Merge "Implement the discovery of a network recommendation provider."
am: 470d256519

Change-Id: I804df594669be3b42704dead7007790666bef0f6
36d4c48496cc35c5d4f07e1793cedf4249d85826 09-Dec-2016 Jeremy Joslin <jjoslin@google.com> Implement the request and recommend calls.

Implemented requestRecommendation() and requestScores() to call
through to the bound network recommendation provider if available.

BUG: 33593157
BUG: 33668692
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Change-Id: I055251fa94d93d4ea4e5001c4ec6c1dfb626d1b2
Merged-In: I8e2ed73dc6876deb1a8bd47bcaeaca8db68f3a44
etworkScoreServiceTest.java
b8418ac89aa9d8e904b848d92c1729b7c7d90a16 06-Dec-2016 Jeremy Joslin <jjoslin@google.com> Implement the discovery of a network recommendation provider.

Updated the NetworkScorerAppManager to examine the list of configured
network recommendation providers and to select the first valid
provider.

As part of this update the old logic of looking for a valid network
scorer has been removed. Scorers/recommendation providers are only
selected from the configured list now. The setActiveScorer() method
has been deprecated as a result.

The NetworkScoreService has been updated to monitor the list of
potential recommendation providers and to reevaluate the binding
whenever they change. It also monitors the new setting for
NETWORK_RECOMMENDATIONS_ENABLED to connect or disconnect from the
provider as needed.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33158362
Change-Id: I450981261aa5355c1c91ec2e3a0a3b58cc65316b
Merged-In: I42aeb5223da794f71f7e58cb1bdf18817200cbf2
etworkScoreServiceTest.java
b8976d8f22fecaa9ed39276d9d8ded17d35b51a6 16-Dec-2016 Calin Juravle <calin@google.com> Record data about dex files use on disk

Add DexManager to keep track of how dex files are used.

Every time a dex file is loaded, PackageManager will notify DexManager
which will process the load. The DexManager will look up what package
owns the dex file and record its use in package-dex-usage.list (through
PackageDexUsage).

Test: device boots, package-dex-usage.list is created and contains valid data, after device reboot the list is succesfully read from disk.
runtest -x .../PackageDexUsageTests.java
runtest -x .../DexManagerTests.java

Bug: 32871170
Change-Id: If5496c3b95820b537260c326d4eaa04eb50b1d8c
m/dex/DexManagerTests.java
0318162abcbd07a0472989df43e00e353fac731b 01-Dec-2016 Calin Juravle <calin@google.com> Add logic for recording dex files use on disk

Add PackageDexUsage to handle the I/O operations of dex usage data. It
is responsible to encode, save and load dex

Test: runtest -x .../PackageDexUsageTests.java

Bug: 32871170
Change-Id: I2acc5430080a7e937c798513d8959ab631decfd9
m/dex/PackageDexUsageTests.java
805e893e35748393edf4a30473db8f8b15bb04d0 19-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Enforce DISALLOW_ADD_MANAGED_PROFILE"
01576869a3f46923d1d893866677e3bf9a00fc2b 15-Dec-2016 Esteban Talavera <etalavera@google.com> Enforce DISALLOW_ADD_MANAGED_PROFILE

Only the device owner should be able to create a managed
profile if that restriction is set

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services

Bug: 31952368

Change-Id: Ia5170e54594ccba1e5bcedffaec98c2af42264c0
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmTestBase.java
e55546a1271894f8e69609db3912024d72a3bf73 19-Dec-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE IP Connectivity metrics: add connect() statistics
am: 2299a1c401

Change-Id: I7ad93b1b3a3446ffd6dce7c0799ddb9a2b43955f
6b480eca3f80a2ff790a82eb2d3c779a527af263 19-Dec-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE Fix IP connectivity metrics tests
am: 93c0de0a35

Change-Id: Ia6a28b09263729caa72786062e134f8c684e3ccb
145c34316649ba0a5cdb8f7954a63419785f379d 09-Dec-2016 Jeremy Joslin <jjoslin@google.com> Implement the request and recommend calls.

Implemented requestRecommendation() and requestScores() to call
through to the bound network recommendation provider if available.

BUG: 33593157
BUG: 33668692
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Change-Id: I8e2ed73dc6876deb1a8bd47bcaeaca8db68f3a44
etworkScoreServiceTest.java
fa4f08ecee6579b1a4e4503312956ea19dd0b80e 06-Dec-2016 Jeremy Joslin <jjoslin@google.com> Implement the discovery of a network recommendation provider.

Updated the NetworkScorerAppManager to examine the list of configured
network recommendation providers and to select the first valid
provider.

As part of this update the old logic of looking for a valid network
scorer has been removed. Scorers/recommendation providers are only
selected from the configured list now. The setActiveScorer() method
has been deprecated as a result.

The NetworkScoreService has been updated to monitor the list of
potential recommendation providers and to reevaluate the binding
whenever they change. It also monitors the new setting for
NETWORK_RECOMMENDATIONS_ENABLED to connect or disconnect from the
provider as needed.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33158362
Change-Id: I42aeb5223da794f71f7e58cb1bdf18817200cbf2
etworkScoreServiceTest.java
46a26a84af520cf9f13874b6c2646f15b38be683 16-Dec-2016 Jorim Jaggi <jjaggi@google.com> Reenable test for presubmit

Bug: 33498346
Change-Id: Ie08b8da82efa897eb80b78e61962031db70b8960
m/UnknownAppVisibilityControllerTest.java
a01f4f03e920277a48369b06983c728a73b8dcd4 16-Dec-2016 Makoto Onuki <omakoto@google.com> ShortcutManagre: foreground check, more tests.

Test: Manual test and all the unit tests:
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to test8

Bug 32908854

Change-Id: I30ba421e9730741776c1936e40ccf7b7431289da
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest8.java
ab99c11c55c82e39a601a0b6f59005011f9fa109 15-Dec-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: direct pin shortcut support."
1548d5c43b789b6d5b3ab0929dcb55a2f12c57a9 15-Dec-2016 Nicolas Prévot <nprevot@google.com> Merge "Use affiliation ids when checking bind target users."
2299a1c4015ac786f49302ad26a586a39a5ba6a1 25-Nov-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE IP Connectivity metrics: add connect() statistics

This patch adds a ConnectStats class to aggregate connect() statistics
gathered in NetdEventListenerService. ConnectStats is uploaded once a
day by IpConnectivityMetrics.

Test: $ runtest frameworks-net + new unit test
Bug: 32198976

(cherry picked from commit 4f71a15973f7048076ed10f63d708f020e1a21e0)

Change-Id: I1450c126b90b628d9f1c73ddf054b4742f5e84c5
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/IpConnectivityMetricsTest.java
onnectivity/NetdEventListenerServiceTest.java
93c0de0a35c45d1d63617afea09aa3e1269a8d6e 24-Nov-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE Fix IP connectivity metrics tests

So that test assumptions match previous changes in ipconnectivity.proto.

This patch also tags metrics tests with @SmallTest.

Test: $ runtest frameworks-net
Bug: 32561414
Bug: 32198976

(cherry picked from commit 80df43ea8a4286f2b7e0678be35dbca3f16f3766)

Change-Id: I8926a92248ac2d46fc78749afc40bc5f0de10878
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/IpConnectivityMetricsTest.java
06fd71abdf4c76d5f4ec357146f61280fb5580fa 14-Dec-2016 Esteban Talavera <etalavera@google.com> Merge "Create DISALLOW_{ADD,REMOVE}_MANAGED_PROFILE user restrictions"
d5b036014d632c7c28f8499f39bafd4b95ac49d1 06-Dec-2016 Nicolas Prevot <nprevot@google.com> Use affiliation ids when checking bind target users.

BUG:32764274
Test: adb shell am instrument -e class
com.android.server.devicepolicy.DevicePolicyManagerTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ic79b58dcb583b1d9eb9e7af0d1501cf8cfd0ee86
evicepolicy/DevicePolicyManagerTest.java
d1c710d5cff55b632e91d95cdba158bbc3879bc8 14-Dec-2016 Michal Karpinski <mkarpinski@google.com> DO NOT MERGE [DPM] Management and retrieval of network logs
am: 4c47adef60

Change-Id: I39486c9d6116023f1ee9bd576b7fcd0fe20023a1
b2e8690507f64f935d20a7ce75cefbaf6cf2c160 14-Dec-2016 Michal Karpinski <mkarpinski@google.com> DO NOT MERGE [DPM] DO can start network logging and listen for events
am: c3abd34cfe

Change-Id: I7952d67d22a141040f3ee3ac2b6c3aa2cfccbbf7
6ce0fb8ddbdc726d55c81a4bf797f028e441e448 13-Dec-2016 Wale Ogunwale <ogunwale@google.com> Fixed issue with ordering of non-app token windows

We tried to fix this issue in I83357975c87c704af9d0702c939ca99984462365
but the fix introduced other problems. So, we are going to have sys-ui
create a separate binder for object for each type of window it adds.
Long term we want to allow one binder object to map to multiple window
tokens on the same display in window manager.

Change-Id: Iee53b8bf95b87f79ab7a1b574a54111c678f7413
Fixes: 33567674
Fixes: 33538278
Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
m/DisplayContentTests.java
m/WindowTestsBase.java
6c9116a6430ca5cd55b1b926213a5e8de77e4fc6 24-Nov-2016 Esteban Talavera <etalavera@google.com> Create DISALLOW_{ADD,REMOVE}_MANAGED_PROFILE user restrictions

Bug: 31952368

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services
Test: runtest -c com.android.server.pm.UserManagerTest frameworks-services
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.UserRestrictionsTest

Change-Id: I240ab99c2409bbabffbc574bef202f2457026905
evicepolicy/DevicePolicyManagerTest.java
m/UserManagerTest.java
2d895c3efd625e09e9f2cc4d0c7131b34f52f154 03-Dec-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: direct pin shortcut support.

Test: Manual test and all the unit tests:
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to test8

Bug 32908854

Change-Id: I11b81656959cccfb4efa83f08380b915e6eb84a6
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest6.java
m/ShortcutManagerTest8.java
4c47adef60ca0326bdbe124dfdd335382e5c0787 12-Oct-2016 Michal Karpinski <mkarpinski@google.com> DO NOT MERGE [DPM] Management and retrieval of network logs

This CL follows up on ag/1530343 and adds:
1) Various network events.
2) Retrieval method in DPM and APIs in DeviceAdminReceiver.
3) Extension of NetworkLogger and it's NetworkLoggingHandler.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
Bug: 29748723
Change-Id: I42a1a477e7c75c109a3982f809c22732b814e8b2
evicepolicy/NetworkEventTest.java
c3abd34cfed63d5b71366901d19f6d9cd8319306 12-Oct-2016 Michal Karpinski <mkarpinski@google.com> DO NOT MERGE [DPM] DO can start network logging and listen for events

This CL adds:
1) Setter and getter in DPM to manipulate logging switch (retrieval
method to come in a subsequent CL(s)).
2) A way for DPM to register to listen for events.
3) Skeleton of NetworkLogger class (more to come in subsequent CL(s)).

Bug: 29748723
Change-Id: I5c04662ccc6febd2ba294b0eaca1ed1da9c16e47
onnectivity/NetdEventListenerServiceTest.java
b37d43b83c0a92a71257f2fa282dbb9a0ffeba81 13-Dec-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE IpConnectivityMetrics: rate limit ApfProgramEvents
am: 97d10ffcad

Change-Id: I266f7b8da58513b1e6c1a9c2b37e528ba777a7d6
fbbf03a3c2c5132423e84a5d5b19efe836db8139 13-Dec-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE IpConnectivityMetrics reads buffer size in settings
am: ff0b58627f

Change-Id: I5c433faa0d43202ae1169fdba4c42c09dd9c17dd
064d4f183c5bb55bd45db90f82daf3834f68fe33 13-Dec-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE IpConnectivity metrics: add version number
am: 31cf55bdfe

Change-Id: Iccdf7d09ef4dc80f05c76774c456b5effb2c08c7
8b43f6eb02ea9f7103f96eb59861f0fad769ae34 13-Dec-2016 Hugo Benichi <hugobenichi@google.com> Merge "DO NOT MERGE IpConnectivityMetrics: rate limit ApfProgramEvents" into nyc-mr2-dev
6674f7a3b41b64bbf036e81c1cc5c469b3372bcd 13-Dec-2016 Hugo Benichi <hugobenichi@google.com> Merge "DO NOT MERGE IpConnectivityMetrics reads buffer size in settings" into nyc-mr2-dev
0bb1f8919e9ce5a0f9c7d88806db2fbc8b085fe9 13-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixed window ordering issue with TYPE_VOICE_INTERACTION."
97d10ffcaddfd5de32e02590594eee97ee918ced 18-Oct-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE IpConnectivityMetrics: rate limit ApfProgramEvents

This patch uses the previously introduced TokenBucket to rate limit
ApfProgramEvents, still allowing for burst of ApfProgramEvents when a
new interface is set up (due to ipv4 provisioning, multicast lock, ipv6 RAs
triggering new APF program events in short amounts of time).

Test: new test in IpConnectivityMetricsTest
Bug: 1550402

(cherry picked from commit e1c173d2240a8eedf7685c9371087dc047a6931f)

Change-Id: Ibe41e9a76db36ea502697a5f19fc0d91c40a3087
onnectivity/IpConnectivityMetricsTest.java
ff0b58627f8a0c54c057d828eaee36dd0cc68d76 19-Oct-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE IpConnectivityMetrics reads buffer size in settings

Test: IpConnectivityMetricsTest passes. Also manually changed the new
setting and verified the buffer size is as expected after flushing the
buffer.
Bug: 32198637

(cherry pick from commit 05686dbb6b965eb1a54591d2ed2334337886c6ee)

Change-Id: Ie7ca1638533479601c5983bb6e54705003561b6c
onnectivity/IpConnectivityMetricsTest.java
31cf55bdfe7d536d5f6116cf830bee4131efc1a1 13-Oct-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE IpConnectivity metrics: add version number

This patch adds a version field to ipconnectivity.proto and populates it
to 2, which is the logical version number for NYC-MR2.

Test: IpConnectivity{EventBuilder,Metrics}Test pass
Bug: 32127906

(cherry picked from commit d680d4c856f54bea0c60dea74ba4204822391e49)

Change-Id: I5f37633afd9ec82f5402c5b6670fe2febae82a14
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/IpConnectivityMetricsTest.java
2894d0ac51d6dbcbdf5025f01de3e9fedc10c877 13-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Untangle creation of Task from addition of AppToken in WM."
5d7e7f136e349e6cde86943dd03e7edd9ec92e6e 12-Dec-2016 Wale Ogunwale <ogunwale@google.com> Fixed window ordering issue with TYPE_VOICE_INTERACTION.

WC.forAllWindows returns windows based on their token order in the
hierarchy and the non-app windows are ordered in the hierarchy based
on their types. For most window tokens their types is specified when
the token is added, but for some others we use the type of the first
window added to the token. This becomes a problem if various window
types are added to the same token (sys-ui I am looking at you...) and
someone adds another token with a window type that should be z-ordered
in-between the windows of the first token.
For now we work around the problem by collecting all the non-app windows
and making sure they are in order before return any window to the caller.
Long term we want to change sys-ui and other callers to use different
window tokens based on the window types they are adding.

Fixes: 33538278
Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Change-Id: I83357975c87c704af9d0702c939ca99984462365
m/DisplayContentTests.java
m/WindowTestsBase.java
72919d2c310db04fdb860e926ccb0bfe6e3aef08 09-Dec-2016 Wale Ogunwale <ogunwale@google.com> Untangle creation of Task from addition of AppToken in WM.

Makes it easier to follow what is going on and also clean-up in
preparation of stand way for AM to interact with containers in WM.

Test: Existing tests pass and manual testing
Change-Id: I91754b6d974dce2f696453cdaed175efb0f10c73
m/WindowFrameTests.java
m/WindowTestsBase.java
5ae2cd5d7659ae8bf25a8330c2e883ec7da19555 13-Aug-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Migrate NetworkPolicyManagerServiceTest to JUnit 4.

BUG: 30839080
Test: runtest --path
frameworks/base/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java

(cherry picked from Ic192334389eed7596e1f7cb8ce98a5169262418c)

Change-Id: I90cf55ad948bbe0883473431f40201cf4206dc82
etworkPolicyManagerServiceTest.java
4ef40087be75b2125ee72f1347099c556d533d42 10-Aug-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Fixed NetworkPolicyManagerServiceTest.

NetworkPolicyManagerServiceTest had many tests there were @Suppressed
because they were obsolete and harder to fix using Easymocks.

This CL replaced EasyMock by Mockito and re-enabled most tests, although
some tests were removed because:
- It's underlying logic changed too much that.
- It would be hard to mock all external entities they interact with.
- They are covered by CTS tests.

Bug: 30764608
Test: runtest --path
frameworks/base/services/tests/servicestests/src/com/android/server/NetworkPolicyManagerServiceTest.java

(cherry picked from commit I53ff86fc9b64cb058846f1aefa244771630d9e1e)

Change-Id: Ia9cdb780cb0917477b310dc38d2e39731d6a7609
etworkPolicyManagerServiceTest.java
37437b7a480b064c7c0e5003f4ec8fbea851f87e 12-Dec-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Always delete from CE table in removeAccountInternal"
a6c72cb0baf0b49a555537ecd2bee1f4ed9e7fe5 10-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Disabling presubmit tests until they fixed"
c6dc9b53d80565a2a9d17f84ebf673d310ac70c3 10-Dec-2016 Fyodor Kupolov <fkupolov@google.com> Disabling presubmit tests until they fixed

Test: manual
Bug: 33498338
Bug: 33498346
Change-Id: I50f15d39e2bf1195b192fc882b38601ba2372740
m/TaskPositionerTests.java
m/UnknownAppVisibilityControllerTest.java
5364e2b82b641ef55381f3864d63ec6a3e95364a 10-Dec-2016 Jeremy Joslin <jjoslin@google.com> Merge "Update registerNetworkScoreCache() to accept a filter type." am: a511a07fa3 am: 4150ec18e9
am: 9f38345a08

Change-Id: I13f01dbfa300463a34c34d7c49f3dc97e42391d8
9f38345a08cf56c56217836a6617265c290e1ace 10-Dec-2016 Jeremy Joslin <jjoslin@google.com> Merge "Update registerNetworkScoreCache() to accept a filter type." am: a511a07fa3
am: 4150ec18e9

Change-Id: I589bead5cf4e9f57f21c234d7d0b5d62cdb1e2b3
4150ec18e9a901cdbd74dbcdc9a67de85f24fa46 10-Dec-2016 Jeremy Joslin <jjoslin@google.com> Merge "Update registerNetworkScoreCache() to accept a filter type."
am: a511a07fa3

Change-Id: I51983da8fe63db15d9b38e3ebe4a20cb95cb5f13
98e9e855438405cf5b760495a74cdf6e66e8b297 09-Dec-2016 Fyodor Kupolov <fkupolov@google.com> Always delete from CE table in removeAccountInternal

Test: AMSTest passes
Bug: 32660831
Change-Id: Iad40bf151f885a86eb6b4e074e9ec83159277e47
ccounts/AccountManagerServiceTest.java
823db059e44811f7306d3afad884d2dabf6d3c4b 01-Dec-2016 Jeremy Joslin <jjoslin@google.com> Update registerNetworkScoreCache() to accept a filter type.

Defined a new IntDef in NetworkScoreManager named CacheUpdateFilter
with 3 values. Caches must be registered with a filter value and will
only receive updates based on their registered filter. Actual
filtering implementation will follow.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 32912120
Change-Id: I3ce0bee171e6405176358479fa8a532fd5193824
Merged-In: I8940e0ed1a7bbcb5a81fb3b6a7fafe4fbbc33875
etworkScoreServiceTest.java
5db8b0ac50cc408523e36b3a03b1463be608bf34 09-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Update registerNetworkScoreCache() to accept a filter type."
963e8ddf6d5ea3bc34216fa03fe24402bf13940a 21-Oct-2016 Stephen Chen <stewchen@google.com> DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.

Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 25147878974f82f875062e99cdee85dd33f3f078)

Change-Id: I46da93ba4afa968facf98f7c3d844fd0c469095a
et/NetworkStatsObserversTest.java
et/NetworkStatsServiceTest.java
e4c029918f32f9dacc7e6a1e8102b71f3ca1018c 19-Aug-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.

Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.net.NetworkStatsServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

BUG: 30943463

(cherry picked from commit b8f946dc4b24998f14e28573e452ab13ed533347)

Change-Id: Ia9929295ab2396a7ebb133e65d157f98414e4dfa
et/NetworkStatsServiceTest.java
2026ca147b6460807b19c997600315806ecb3197 22-Aug-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Use @Ignore to explicitly disable a @Test method.

BUG: 30839080
BUG: 31007021

(cherry picked from commit fc7d7a359f800d7320d29055ef3b4b75157aaf13)

Change-Id: I35942e60493adebb22871541a34240368c691ee7
et/NetworkStatsServiceTest.java
77cba4bdf6de8aec02efe0da7e84f17603912b21 19-Aug-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4.

Most tests were failing because due to a null NetworkCapabilities.
Example:

1) testNetworkStatsWifi(com.android.server.net.NetworkStatsServiceTest)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkCapabilities.hasCapability(int)' on a null object reference
at
com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:983)

BUG: 30839080

(cherry picked from commit 574f370c6da52eeffe747248d68ef044617c7bcf)

Change-Id: Ie09b2f43cf6ec745e404d5ec98bd0b072d211ea3
et/NetworkStatsServiceTest.java
6175bf40b20b1c26fef1900a2fdb30052914c2b0 09-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Do enforcement check before granted check"
c5ac587bf3bd23a18964f1344da5e71236012014 01-Dec-2016 Jeremy Joslin <jjoslin@google.com> Update registerNetworkScoreCache() to accept a filter type.

Defined a new IntDef in NetworkScoreManager named CacheUpdateFilter
with 3 values. Caches must be registered with a filter value and will
only receive updates based on their registered filter. Actual
filtering implementation will follow.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 32912120
Change-Id: I8940e0ed1a7bbcb5a81fb3b6a7fafe4fbbc33875
etworkScoreServiceTest.java
7bfe074c7852cc16af2952f9ac0f17359bb7a7c3 09-Dec-2016 Fyodor Kupolov <fkupolov@google.com> Do enforcement check before granted check

The enforcement assertion provides better explanation of the problem and fix
instructions.

Test: Removed permission from a privapp xml and verified that test fails
Bug: 31008485
Change-Id: I58454d1b38722a232764dea14ebe2e4ada09e24f
m/PackageManagerPresubmitTest.java
14dc13a8ad0fcaf33815e9190b0dd790aca32a75 08-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Don't return null in WS.getTopParentWindow on child detach"
38724a234d8d45b25fa8c38eba637a30c4212a9b 08-Dec-2016 Amin Shaikh <ashaikh@google.com> Merge "Support multiple caches in NetworkScoreService." am: 78f3f0049e am: a7c0b73971 am: b45a4a5d1b
am: 5456cdbc27

Change-Id: I421cff1c47959c40088a31f72556630a8acd007e
ea92d977333bef11c6ab243d785a1b2d9c1f66ff 08-Dec-2016 Wale Ogunwale <ogunwale@google.com> Don't return null in WS.getTopParentWindow on child detach

Fixed issue with WindowState.getTopParentWindow() returning null when
the child window is removed from it's parent. In this case it should
return itself as the method documentation states.

Change-Id: Iae40ca21241306048cae136887afc88593a6898d
Fixes: 33446267
Test: bit FrameworksServicesTests:com.android.server.wm.WindowStateTests
m/WindowStateTests.java
b92aa5bdfde63e56f1e1e63fbe913638c440ffba 08-Dec-2016 Lorenzo Colitti <lorenzo@google.com> Merge changes from topic 'framework-net-aosp'

* changes:
DO NOT MERGE: [CS] Remove timeout event after first available
DO NOT MERGE: ApfTest: tag tests with @SmallTest or @MediumTest
DO NOT MERGE: Unbreak TetherInterfaceStateMachineTest.
DO NOT MERGE: Move the connectivity tests to frameworks/base/tests/net.
DO NOT MERGE: De-guava BroadcastInterceptingContext and move it to testutils.
DO NOT MERGE: Move FakeSettingsProvider to a common location.
DO NOT MERGE: ConnectivityServiceTest: mark flaky test as such
DO NOT MERGE: Add option to skip and avoid captive portals.
DO NOT MERGE: ApfFilter: use elapsedRealTime for RA lifetime
DO NOT MERGE: Do not synchronize boolean reads/writes
DO NOT MERGE: ApfFilter: systematically use u8, u16, u32 getters
DO NOT MERGE: Add fuzzing tests to ApfFilter RA processing
DO NOT MERGE: Support timeouts for requestNetwork() invocations.
DO NOT MERGE: Silence the obnoxious MTU 0 error message that occur when no MTU is specified for a given network.
7ceef950a02b22bdf90609bdab8119b4bcd88edf 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> DO NOT MERGE: Move the connectivity tests to frameworks/base/tests/net.

This will give us a good place to put all the networking tests.

Fix: 31479480
Test: adb shell am instrument -w -e notClass com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest 'com.android.frameworks.tests.net/android.support.test.runner.AndroidJUnitRunner' # PASS

(cherry picked from commit ecc986d430f4b8158f177ed97d2edb741f11ff71)

Change-Id: I993eeaa5dec001c39389023f355f506129b356e7
onnectivityServiceTest.java
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/IpConnectivityMetricsTest.java
onnectivity/LingerMonitorTest.java
onnectivity/MetricsLoggerServiceTest.java
onnectivity/MetricsTestUtil.java
onnectivity/NetdEventListenerServiceTest.java
onnectivity/TetheringTest.java
onnectivity/VpnTest.java
onnectivity/tethering/TetherInterfaceStateMachineTest.java
3c295b59f5767904656235db48692906148ab631 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> DO NOT MERGE: De-guava BroadcastInterceptingContext and move it to testutils.

Removing the static dependency on guava reduces test compile time
by about 20 seconds on a Z840, thus substantially speeding up the
compile/test cycle.

Make FutureIntent public instead of package-private because it is
used directly by NetworkPolicyManagementServiceTest, which as of
this CL is now in a different package.

(cherry picked from commit 281a17c9580de5c9898be7d9654d428801976511)

Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.NetworkPolicyManagerServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.net.NetworkStatsServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.NetworkManagementServiceTest # Already failing.
Bug: 31479480
Change-Id: Ifab32c9214e9caab71dbf93b3d3ca88df6f49636
roadcastInterceptingContext.java
onnectivityServiceTest.java
etworkManagementServiceTest.java
etworkPolicyManagerServiceTest.java
et/NetworkStatsServiceTest.java
b8df76e413d0b8235d0bd71adf8f368f00391fcb 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> DO NOT MERGE: Move FakeSettingsProvider to a common location.

(cherry picked from commit 7df1a82802cdf842d07a86a80383c7d5ea7ae53a)

Test: runtest frameworks-util -c com.android.internal.util.test.FakeSettingsProviderTest
Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest
Test: runtest frameworks-services -c com.android.server.retaildemo.PreloadAppsInstallerTest
Test: runtest frameworks-services -c com.android.server.retaildemo.RetailDemoModeServiceTest
Bug: 31479480
Change-Id: I8d4d4de2937012dd33924f53e68f96241a9b2b4f
onnectivityServiceTest.java
5d540d141027d818d1beb8b030d35ee9489b2e8a 17-Oct-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE: ConnectivityServiceTest: mark flaky test as such

This patch extracts into its own independent test a test sub-block looking
for a race condition when not waiting on handlers to become idle:
there is no way to prevent the race from not happening when looking for
it this way. This makes the test flakky.

This new independent test is tagged with @FlakkyTest(tolerance = 3).

Test: ConnectivityServiceTest passes, with higher probability.
Bug: 31479480

(cherry picked from commit c8c1027762d66c12c9c153ccbb8f80acdee8571c)

Change-Id: I3c702bd981ed80ed606be0fb52d61eb3d7195a6f
onnectivityServiceTest.java
1f64f3fd14caca5ace9bfdbb036e3711d5484de3 12-Oct-2016 Calvin On <con@google.com> DO NOT MERGE: Add option to skip and avoid captive portals.

Test: ConnectivityServiceTest updated with test cases.
Test: Manually tested against att-wifi in B42.
Bug: 30222699

(cherry picked from commit be96da11ccb5dd500f920c3ba90d350857293b3d)

Change-Id: I90c0f97fe0e41de4059bceae7b56ab3a70145696
onnectivityServiceTest.java
3841a48d0a093bbbd6ffe6338170e1e2dbc11997 24-Nov-2015 Erik Kline <ek@google.com> DO NOT MERGE: Support timeouts for requestNetwork() invocations.

(cherry-pick of 06c3ef1367e850746eef0a5462bdce8674d74c30)
(cherry picked from commit 57faba9ec73fbb311d5ca1df3278aee9728589d5)

Bug: 21414325
Change-Id: I1a58823a372154589f972b98c4c428eab0e0523e
onnectivityServiceTest.java
6cd5d2f8385fa363edfb8c214b29876321486695 08-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adding orientation preserving resizing"
322347ba58f02b960dc87eca3cb0ebe0455c9253 02-Dec-2016 skuhne@google.com <skuhne@google.com> Adding orientation preserving resizing

Adding freeform resizing to activities which require
a certain orientation. This is needed for e.g. ARC++.

Bug: 33267688
Test: runtest frameworks-services -c com.android.server.wm.TaskPositionerTests
Test: Visually on ARC++
Change-Id: If708c1602cb2ff464174389af4648ad767b0b079
m/TaskPositionerTests.java
5456cdbc27f0d1e4be4ed18162806418172f1469 08-Dec-2016 Amin Shaikh <ashaikh@google.com> Merge "Support multiple caches in NetworkScoreService." am: 78f3f0049e am: a7c0b73971
am: b45a4a5d1b

Change-Id: If0080f344e53c4cddf4605879614a664c80b62ee
b45a4a5d1b81f433503dd72a7fedd90a45c5d816 08-Dec-2016 Amin Shaikh <ashaikh@google.com> Merge "Support multiple caches in NetworkScoreService." am: 78f3f0049e
am: a7c0b73971

Change-Id: Idf846f55436c44930f5db2a07b7362412274f46e
972e236e84fd4073f7ecc40f2de326b388203dfb 07-Dec-2016 Amin Shaikh <ashaikh@google.com> Support multiple caches in NetworkScoreService.

- Use RemoteCallbackList for managing multiple callbacks
- Add unregisterNetworkScoreCache to the service interface
- Added NetworkScoreServiceTest

Test: runtest frameworks-services

Bug: 32913019
Change-Id: I16ca1682acca9cbe403812e520394688a026414b
etworkScoreServiceTest.java
evicepolicy/MockUtils.java
805d9ecc476134ffafc85a07b05e94a14b1d398c 07-Dec-2016 Wale Ogunwale <ogunwale@google.com> Don't allow IME windows to be IME targets

IME targets are required to be below the IME windows and that wouldn't
be possible if the IME window is its own target which leads to issues
elsewhere in the code where that is expected to be the case.

Change-Id: I34a723ff4ce2519cd80e0eea0eaea04712b6cf8f
Fixes: 33336368
Test: bit FrameworksServicesTests:com.android.server.wm.WindowStateTests
m/WindowStateTests.java
m/WindowTestsBase.java
e35aff17e9c58c1c28325e77e53e5e4f71a07580 06-Dec-2016 Fyodor Kupolov <fkupolov@google.com> Merge "2-phase initialization of NetworkPolicyManagerService"
877ab7f9fd165b2f93adc325858fd6b1d93dc100 06-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert "Revert "WindowList be gone!"""
6213caa42d89cc446de4f8f9ba00630f166f23cc 02-Dec-2016 Wale Ogunwale <ogunwale@google.com> Revert "Revert "WindowList be gone!""

This reverts commit ffa5a9de0c127cb77ddec625fea101ddddb7ad32.

Bug: 33098800
Bug: 33098294
Test: Existing tests pass.
Change-Id: I5803a010c5a224dd1cf452a4a7beb3a4c0a043f4
m/WindowStateTests.java
579e2faf3851b205838e25621bfdb4d8d7a506d5 06-Dec-2016 Narayan Kamath <narayan@google.com> Merge "PackageParser: Add support for caching parse results on the file system."
988149c925b583f5c77f567fa622e39309bc4ae9 01-Dec-2016 Narayan Kamath <narayan@google.com> PackageParser: Add support for caching parse results on the file system.

The exact scheme for serializing parse results is left undefined, and
will be implemented in a follow-up change.

Also adds a unit test for this functionality.

Test: PackageParserTest
Bug: 30792387

Change-Id: I5be6a3f97b5688d0a1aa9e024e946d590ad92c13
m/PackageParserTest.java
b97196b1de9e73e42e0c1a9e63e579657c97749e 06-Dec-2016 Michal Karpinski <mkarpinski@google.com> Merge changes from topic 'netd-benchmark-and-logging-nyc-mr2-dev' into nyc-mr2-dev

* changes:
DO NOT MERGE Add connect event reporting
DO NOT MERGE Extending DNS event reporting
abf86385f8ba14d4f4789df59adec619a682b238 06-Dec-2016 Mahaver Chopra <mahaver@google.com> Merge "Return error code from isProvisioningAllowed"
598e9a7f41c714b6ccac05dea0d63e9274af7739 06-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Prevent orphaning of windows when token is removed"
311b9fac00c9298479340244ffedf4825e0a7756 03-Dec-2016 Fyodor Kupolov <fkupolov@google.com> 2-phase initialization of NetworkPolicyManagerService

Split systemReady() into 2 callbacks:
1) networkScoreAndNetworkManagementServiceReady - called when required
services are ready. NetworkPolicyManagerService starts its initialization
on the worker thread
2) systemReady - wait for phase (1) to finish so that the service is fully
initialized

NetworkPolicyManagerService is now prepared in parallel with
ConnectivityService and NetworkStatsService

Test: device boots without errors
Test: HostsideRestrictBackgroundNetworkTests and NetworkPolicyManagerServiceTest pass
Bug: 32315581
Change-Id: Ic9755ed096900247fa0bbb43f396d8bcb97ae6db
etworkPolicyManagerServiceTest.java
3d0bfd9530bc51c52aec027eaf6d0dba918efc99 05-Dec-2016 Wale Ogunwale <ogunwale@google.com> Prevent orphaning of windows when token is removed

When the owner of a window token requests window manager to remove the
token, we were removing it from it's parent which orphaned the token
and all it's windows and prevented them from being accessed from calls
like forAllWindows(). This problem wasn't visible before as the token
windows would still be in the window list, so they can still be accessed
for the exit animation transition which eventually removes them.
We no longer remove tokens from their parent we when are asked to remove
them from the system. We just set WindowToken.setExiting() so the token
can be removed once all its windows are removed at the end of the exit
animation.

Also,
- In AppWindowToken.removeIfPossible() and Task.removeIfPossible(), call
removeImmediately() instead of parent.removeChild() to make sure the
token and its windows are properly clean-up and avoid orphaning if they
aren't.
- Added DisplayContent.reParentWindowToken() for changing the display a
window token is on which is different from DisplayContent.removeWindowToken
which prepares the token and it's windows to be removed from the system.
- Renamed WindowToken.explicit to WindowToken.mPersistOnEmpty which is
what it does.

Fixes: 33098800
Test: bit FrameworksServicesTests:com.android.server.wm.WindowTokenTests
Test: Make sure toast windows don't persist on screen.
Change-Id: I40e0e8832141514b614e79d8e95cd27f24e52366
m/AppWindowTokenTests.java
m/WindowTestsBase.java
m/WindowTokenTests.java
96bc5dece761ec3994e99aaf5ac2a51c03960b78 06-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixed Mockito expectation."
5e998e63ce10efe0d648506618f83cd14b8bdfd6 05-Dec-2016 Christine Franks <christyfranks@google.com> TwilightService: Ignore (0,0) coordinate location updates am: cc2801296d
am: bc0bd475da

Change-Id: I10691fe0ee6b1d788611db17a84a960fa40d3901
bc0bd475dae073341226624b7be6e892a4d8eb6d 05-Dec-2016 Christine Franks <christyfranks@google.com> TwilightService: Ignore (0,0) coordinate location updates
am: cc2801296d

Change-Id: Ic74955ff78956953288de96d261dc1eab8fc6137
b8d572eb86a24718002d51fa856823f8ad5ab2a5 05-Dec-2016 Felipe Leme <felipeal@google.com> Fixed Mockito expectation.

Bug: 33349775

Test: most tests from NetworkPolicyManagerServiceTest passes (there are still
3 failures, but they're unrelated).

Change-Id: I291a2d8404ba540d9922e5de62f5224d2d9b9314
etworkPolicyManagerServiceTest.java
cf1f77b574981d5545ebd218d636a598b2ea5ac2 05-Dec-2016 Phil Weaver <pweaver@google.com> Merge "Support continuing dispatched a11y gestures."
cc2801296dd1829196fcaa7b4018e372121e36e5 30-Nov-2016 Christine Franks <christyfranks@google.com> TwilightService: Ignore (0,0) coordinate location updates

Location providers may erroneously return (0.0, 0.0) when they
fail to determine the device's location. These location updates
can be safely ignored since the chance of a user actually being
at these coordinates is quite low.

Bug: 31009261
Test: added TwilightServiceTest; both tests pass

Change-Id: Ie9d7d10f81ade9b0be10f98ed74978539efaa658
wilight/TwilightServiceTest.java
849fd6f58e92476af3e3eeb802e71fddf372d6f2 03-Nov-2016 Mahaver Chopra <mahaver@google.com> Return error code from isProvisioningAllowed

Added hidden pre condition codes for PO and DO provsioning.
Added hidden api checkProvisioningPreCondition, which returns codes
instead of boolean. Managed provisioning can use this to show
useful debug information and user facing error dialogs.

Test: All DevicePolicyManagerTest pass

Bug: 27467633
Change-Id: I7d2a79921bc3ac2e12d506629a35563fc7ff62bf
evicepolicy/DevicePolicyManagerTest.java
6b4061f895608de1e7f155dd196614330cfad05d 03-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Have forAllWindows return IME windows in order with IME target"
2f165944ce6109134e7285a71da32d1a1647960b 21-Sep-2016 Phil Weaver <pweaver@google.com> Support continuing dispatched a11y gestures.

Test: Ran the tests in this CL, as well as new CTS tests for
the new API.

Bug: 29477207
Change-Id: Ie5aba553286e954f7afe76ccfa97a7e8be9d75af
ccessibility/GestureDescriptionTest.java
ccessibility/MotionEventInjectorTest.java
3c1170d849dc0af79623dc0f67eda0fbc66a724f 02-Dec-2016 Wale Ogunwale <ogunwale@google.com> Have forAllWindows return IME windows in order with IME target

If there is an IME target make sure to return the IME windows next
to the IME target when processing WindowContainer.forAllWindows().
Several users of forAllWindows are expecting this to be the cases so
it is close to the visual order.

Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowLayersControllerTests
Change-Id: I737f88ca607ab2694391419d0d38060c03b53840
m/DisplayContentTests.java
m/WindowLayersControllerTests.java
m/WindowTestsBase.java
0730df7369147a5f21ef95eef347361d9ad308b3 02-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow some app windows to display above the IME."
cf81eac79359399dfc3175a19ae607639b70fe48 02-Dec-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Test permission grants for all privapps"
70444d3ad5091c068de61a773a5ca58a9274135b 27-Sep-2016 Michal Karpinski <mkarpinski@google.com> DO NOT MERGE Extending DNS event reporting

This adds hostname, array of addresses, total count of IP addresses
and uid to the existing pipeline.
Currently ignores the new data it receives, further work will be
done in the subsequent CLs.

Test: for now just the benchmarking, in the future unit and CTS

Bug: 29748723

(cherry picked from commit 14c9d2d0df7fab2b0470c3c404f600d87d4f0f93)

Change-Id: I3941b8d6fc1dd578e2af6ed4d3c3d0a722c39918
onnectivity/NetdEventListenerServiceTest.java
54365465897a0fbb2d61c3fb2460698384328ad4 02-Dec-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Floating shortcuts shouldn't have target activities."
ca9e061256861a86d7d1c2770c666451d3fb53de 02-Dec-2016 Wale Ogunwale <ogunwale@google.com> Allow some app windows to display above the IME.

- Display child windows of the current IME target above the IME.
- Display app windows above the current IME target above the IME.

Regression in the functionality was introduce in
I6f8bf15ba246fac69c4a496ebb1d9e0b9b6a95a2 when we switch away from using
the window list for z-ordering and using the hierarchy which has the IME
above all app windows.

Change-Id: I399aab7fd5ad7327ef6bc29d48f6d9bf48a6ac6c
Fixes: 33128382
Test: bit FrameworksServicesTests:com.android.server.wm.WindowLayersControllerTests
m/WindowLayersControllerTests.java
3db0a14ab0e4b396e9c71cf4363b1bebdc4748c6 02-Dec-2016 Michal Karpinski <mkarpinski@google.com> Merge "DO NOT MERGE Rename the DnsEventListenerService to NetdEventListenerService" into nyc-mr2-dev
a97c9066a2252324c65d9fa28fb37122ceeec1ab 02-Dec-2016 Fyodor Kupolov <fkupolov@google.com> Test permission grants for all privapps

Test that requested signature|privileged permissions are granted to all privileged apps.
If the mode is enforcing, also make sure permissions are whitelisted.

Test: test passes
Bug: 31008485
Change-Id: Id7f007a79477c46f40c12765873c563df6bc92cf
m/PackageManagerPresubmitTest.java
106ff7a0a1bef974ff04e9e79a25eb5e84555893 01-Dec-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Floating shortcuts shouldn't have target activities.

Previously, even floating shortcuts (pinned but not dynamic nor
manifest) had target activities. Now we're going to allow headless
apps to have pinned shortcuts, in which cases shortcuts won't have
target activities, let's just always remove target activities
from floating shortcuts.

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to Test8.

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases

Change-Id: I10e5b87338cafb90e6566b3526f892c5330c73e9
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
b36c45fe3069bff85585759f6fad82b64d1e1953 01-Dec-2016 Makoto Onuki <omakoto@google.com> Fix issue with apps restored to lower versions. am: fac592f64c
am: affadd52af

Change-Id: I159f53023179cb67b7225969f4c7220ddd0c03dc
affadd52afb18fb02b9fd227e933afcf1ed85cd4 01-Dec-2016 Makoto Onuki <omakoto@google.com> Fix issue with apps restored to lower versions.
am: fac592f64c

Change-Id: I01601d1638a1ad23dcf2c57df75b81819ee3dce7
325fa50d8df2927c38c17e903e71c2d45213c9e3 30-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow setting managing organization for the device"
fd4f73c76c867e572f5a48b5516fb1f20959caf8 30-Nov-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Support disabled/log/enforce in ro.control_privapp_permissions"
365a3db47001c1298fd01146e866997a9cbc3c8c 30-Nov-2016 Bartosz Fabianowski <bartfab@google.com> Allow setting managing organization for the device

The Profile Owner of a managed profile can set a string that will be
shown in the UI to identify the organization managing the profile.
This CL extends the functionality to the Device Owner of a managed
device.

Bug: 32692748
Test: DevicePolicyManagerTest unit test + CTS test in separate CL

Change-Id: I47295da2fd6485ebf0e890da13990a044accaf17
evicepolicy/DevicePolicyManagerTest.java
dd7f8dafd862fa1a6132b37b47f1b160a4065a9e 30-Nov-2016 Bartosz Fabianowski <bartfab@google.com> Allow DO to access DevicePolicyManager.isDeviceManaged()

This CL makes DPM.isDeviceManaged() accessible to the DO so that it
can be CTS-tested.

Bug: 32692748
Test: Device policy manager unit test + CTS & GTS in separate CLs

Change-Id: I5326e86b0ffee81d04bd48f0267044463a899b78
evicepolicy/DevicePolicyManagerTest.java
9f9e453b649b3507e25049c94990717dc92b269e 30-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Unit test for getBindDeviceAdminTargetUsers"
d072d1415452abffd55a5742e3fef5abdaadf791 30-Nov-2016 Fyodor Kupolov <fkupolov@google.com> Support disabled/log/enforce in ro.control_privapp_permissions

Possible values:
- disable - the feature is completely disabled - signature|privileged
permissions are granted automatically without logging. Default behavior
- log - log grants of signature|privileged permissions to privileged apps
that were not whitelisted in /etc/permissions/privapp-permissions.xml.
- enforce - enforce that only whitelisted permissions are granted.
Only devices with ro.control_privapp_permission=enforce will pass CTS tests.

Test: Manual - device boots, permissions are granted
Bug:31008485
Change-Id: I24e0c75d2efc326c9fbec35efc92489313667212
m/PackageManagerPresubmitTest.java
84884684feb33086faf82bee14579989379d08ee 30-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Some cleanups for window cropping functionality."
fbbde85b045dde25450ce5cef075934102e28339 18-Oct-2016 Robert Carr <racarr@google.com> Some cleanups for window cropping functionality.

At a high level I had two sorts of goals:

1. To remove the weird pinned logic in setSurfaceBoundariesLocked
2. To seperate base crop calculation, and animation exceptions, between
window state and window state animator.

Itemized changes are as follows:

1. Rename updateSurfaceWindowCrop and calculateSurfaceWindowCrop to
applyCrop/calculateCrop. It doesn't feel that "SurfaceWindow" was
adding much.
2. Split screen space and window space (final v non) clip rect
computation, to make clarity about when each one should be used.
3. Eliminate weird case for pinned stack in setSurfaceBoundaries by
building it in to calculateFinalClipRect.
4. Extract calculateSystemDecorRect to WindowState as it mostly accesses
window members.
5. Extract part of calculateCrop to WindowState as
"calculatePolicyCrop". This was the part that fills mSystemDecorRect.
6. Extract wallpaper animation logic outside of calculatePolicyCrop

Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Change-Id: I8ff1dc6ec1206a34994f50ba44d765ab619efbff
m/WindowFrameTests.java
58feeac96b585867195444ce6c2dd794abe61869 29-Nov-2016 Kenny Guy <kennyguy@google.com> Merge "Allow overriding max profile in debugable builds."
b57bd791bf55215110839322ef7c0f72ed915a7b 29-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add user affiliation APIs"
d25cf04e9880c69d370bab21de0068cec5502267 29-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add explicit method to dismiss Keyguard"
02c8990bd6125f05cb32561727d559dc9327a601 15-Nov-2016 Kenny Guy <kennyguy@google.com> Allow overriding max profile in debugable builds.

Support a system property on debugable builds to
override the max number of managed profiles to
allow easier dogfooding of multiple profiles.
Support 3 different badge colours for managed profiles.

Bug: 30473760
Test: runtest -c com.android.server.pm.UserManagerServiceCreateProfileTest frameworks-services
Test: runtest -c com.android.server.pm.UserManagerServiceUserInfoTest frameworks-services
Test: manual - attempting to create 2 profiles with adb fails, passes once I set the property.
Change-Id: Ie7fb19048a04a01572666f229283152254d0ffc3
m/UserManagerServiceCreateProfileTest.java
m/UserManagerServiceUserInfoTest.java
c9bb378a8b3633bc427dd2439ab4ae8e3b17771a 11-Nov-2016 Esteban Talavera <etalavera@google.com> Add user affiliation APIs

Make setAffiliationIds public so that it can be used for COMP.
That way we can allow network logging and other features to
work on devices that have a DO and a managed profile.
Those features are currently restricted to single user devices but we'll
open them up to devices where all users are affiliated.

Also create a getter for that API.

Bug: 32326223
Test: m FrameworksServicesTests &&
adb install \
-r ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ie443be887a6ca61a7f7a07e137757dceab7eb3d3
evicepolicy/DevicePolicyManagerTest.java
fd6f4fb264d56726cd0e2fed731ad60bbe4aa06f 18-Nov-2016 Fyodor Kupolov <fkupolov@google.com> Parse packages in parallel

Introduced ParallelPackageParser. Parsing requests are processed by a
thread-pool (currently 4 threads). At any time, at most 10 results are kept
in RAM. This is enforced by the blocking queue.

scanDir has become a two-stage process:
1) Collects files for parsing and submit them to the parallel parser
2) Sequentially take elements from the parsing queue and process them by
calling scanPackageLI (as before)

Test: manual - device boots, all packages are parsed
Test: ParallelPackageParserTest passes
Bug: 30792387
Change-Id: I07a64da4d83e355b2b1f1ab350e6d8087dfd2feb
m/ParallelPackageParserTest.java
2f26b79eea905f88c872804be01431020e4efb2e 28-Nov-2016 Tony Mak <tonymak@google.com> Unit test for getBindDeviceAdminTargetUsers

Was meant to write test for bindDeviceAdminServiceAsUser, but
it can't be done without having tests for
getBindDeviceAdminTargetUsers first as bindDeviceAdminService depends
on getBindDeviceAdminTargetUsers.

A bit shocked by we didn't have any managed profile tests in
DevicePolicyManagerTest. Added managed profile support in the CL.

Bug: 32764274

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java

Change-Id: If412e4f44c3ae998f69e17411f2503a97f80149f
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
evicepolicy/DpmTestBase.java
8d76e72251eb6f83580cd8b70000d6904fe24096 25-Nov-2016 Bartosz Fabianowski <bartfab@google.com> Allow DO to access bookkeeping information about its own actions

The getLastSecurityLogRetrievalTime(), getLastBugReportRequestTime()
and getLastNetworkLogRetrievalTime() methods are meant to be used by
system code. However, there is no harm in allowing the DO to access the
information they return - because it is information about actions that
the DO itself took.

The advantage of opening up these methods to the DO is that we can
CTS-test them.

Bug: 32692748
Test: DevicePolicyManager unit test + CTS test in separate CL

Change-Id: I1470fca2a82b9955f7aed5e8b50220bea8b56fc9
evicepolicy/DevicePolicyManagerTest.java
7f9014bb9d155cce28f6da375675a4338c60590e 21-Nov-2016 Michal Karpinski <mkarpinski@google.com> DO NOT MERGE Rename the DnsEventListenerService to NetdEventListenerService

The service will be extended to include listening for connect events as well.

Test: this is just a renaming change

Bug: 29748723
Change-Id: I073187e354fc987222ec0108d7f0d3a422397d5e
onnectivity/DnsEventListenerServiceTest.java
onnectivity/NetdEventListenerServiceTest.java
058b69e58a55329169ca3e2d3fc6b7a278ec6b14 23-Nov-2016 Jorim Jaggi <jjaggi@google.com> Merge "Revert "WindowList be gone!""
ffa5a9de0c127cb77ddec625fea101ddddb7ad32 23-Nov-2016 Jorim Jaggi <jjaggi@google.com> Revert "WindowList be gone!"

This reverts commit 4551c8bbee4114fa884938dbe90ac0d06ca78fc5.

Reason for revert: Broke a lot of things!

Bug: 33098800
Bug: 33098294
Change-Id: I307b1c7ee39445d6155a4bbce2bf5f289de55285
m/WindowStateTests.java
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
m/TestWindowManagerPolicy.java
3f5de07e92f46b3a3873a9fb90d86e7c888f99b8 23-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add visibility table to account manager database."
e5768621de9a41eb7b5449b6aa5a7a9579682a0a 21-Nov-2016 Dmitry Dementyev <dementyev@google.com> Add visibility table to account manager database.

Bug: https://b.corp.google.com/issues/33046496
Test: unit tests.
Change-Id: I92e94fb2185dbba965a5328048ada59fc2b5512a
ccounts/AccountsDbTest.java
23c25e7a3c2dcfe75e07a0b009baf65c9a55000f 22-Nov-2016 Wale Ogunwale <ogunwale@google.com> Merge "WindowList be gone!"
d4f9d37424752a0774cdf9190dc12887c70daec2 22-Nov-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Presubmit test for PackageManager"
fac592f64c55004e9048e30e03d6dc65bdb4f00a 21-Nov-2016 Makoto Onuki <omakoto@google.com> Fix issue with apps restored to lower versions.

When restoring to a new device, if a restored app is not compatible
with the old version (e.g. lower version or different signature),
then we won't restore shortcuts, which is working as expected.

However when it happens, the shortcut manager forgot to "un-shadow"
the package information, causing the app to not have shortcuts at all.

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests

Bug 32999759

Change-Id: I89832360114de0ce1c57d763bcaccab4fdb87b6d
m/ShortcutManagerTest1.java
4551c8bbee4114fa884938dbe90ac0d06ca78fc5 10-Nov-2016 Wale Ogunwale <ogunwale@google.com> WindowList be gone!

The use of DisplayContent.mWindow list to track all windows is
no longer needed as we can now get windows through the window
container hierarchy with methods like forAllWindows. The window
list was also a very complicated logic to understand and maintain,
so it won't be missed :)

Bug: 30060889
Test: Existing tests pass
Change-Id: I590cb33aa0f42bcd4a26ddce102f05e657f54144
m/WindowStateTests.java
7cebbc8b22b94f3df8bee594f68ce271499e7369 18-Nov-2016 Fyodor Kupolov <fkupolov@google.com> Presubmit test for PackageManager

Added PackageManagerPresubmitTests. testPrivAppPermissions method
tests that core apps like systemui are getting all requested
signature|privileged permissions.

Test: PackageManagerPresubmitTests passes
Bug: 32935038
Bug: 31008485
Change-Id: I31c5c1a2613b8c1ddf927d2708d0361407342b87
m/PackageManagerPresubmitTest.java
29993074b0708d71b9d752f562ed6aee2a360fa1 17-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Keep track of admin actions for DO disclosures"
b21b241f0f12377c115e9c4f5bae26814fdab3fb 17-Nov-2016 Bartosz Fabianowski <bartfab@google.com> Keep track of admin actions for DO disclosures

This CL adds bookkeeping to DPMS which will allow us to tell the user
in the Settings UI whether/when the admin requested a bug report or
retrieved logs from the device.

Bug: 32692748
Test: Full DevicePolicyManagerTest unit test coverage; end-to-end tests
will follow as Settings CTS verifier tests

Change-Id: I89728fce4b7e0ff061b354c73caf3742e95a3a3e
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
554140fc8954044d455cfe25f63339f14c985a25 17-Nov-2016 Nicolas Prévot <nprevot@google.com> Merge "Check user restriction DISALLOW_REMOVE_USER in isProvisioningAllowed."
782b247fdbef531c04b839cd43cbcc3d42b27318 16-Nov-2016 Wale Ogunwale <ogunwale@google.com> Merge "Fixed issue with IME displaying on-top of nav bar."
93726a41a0b724e2aea865e7c0ce505c9cc095e1 16-Nov-2016 Wale Ogunwale <ogunwale@google.com> Merge "Don't include sysUI insets on secondary displays"
44fbdf5b1e13398e35d4bafb7236d194a51ee7af 16-Nov-2016 Wale Ogunwale <ogunwale@google.com> Fixed issue with IME displaying on-top of nav bar.

Caused by some recent refactoring. We now make sure the IME
has the higher animation layer in its base layer of the window
it is targeting.
Also, consolidated some of our test functions.

Bug: 32916670
Test: bit FrameworksServicesTests:com.android.server.wm.WindowLayersControllerTests
Change-Id: I0b1abd6fead981cfc810488cc785261abba5341d
m/AppWindowTokenTests.java
m/DisplayContentTests.java
m/WindowLayersControllerTests.java
m/WindowStateTests.java
m/WindowTestsBase.java
m/WindowTokenTests.java
56400a445fa29b0a90e92d15daf6246cfc3f310d 10-Nov-2016 Nicolas Prevot <nprevot@google.com> Check user restriction DISALLOW_REMOVE_USER in isProvisioningAllowed.

If DISALLOW_REMOVE_USER is set and there is already a managed profile:
isProvisioningAllowed() should return false

BUG:32629873
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I093bed0a4a54f83decf11716ebfd50dd4f17c089
evicepolicy/DevicePolicyManagerTest.java
db8e106fa35ca75f4a8bf9795edc7676fbf8e003 16-Nov-2016 Andrii Kulian <akulian@google.com> Don't include sysUI insets on secondary displays

Currently there is a single instance of WindowManagerPolicy
used in Window Manager and it is configured according to
primary display settings. Because of that it reports display
size with navigation bar insets even for secondary displays.

This CL adds displayId param, so it can adjust reported metrics
correctly when requested.

Bug: 32910901
Test: android.display.cts.DisplayTest
Change-Id: I14967fc13907c4fde17aed6a769d03cbde3ec1be
m/TestWindowManagerPolicy.java
3c9006d842d25468760abc5935c50676bcf97f74 16-Nov-2016 Jorim Jaggi <jjaggi@google.com> Merge "Fix that window was not hidden after policy hiding animation"
af221d16de434c3550cb4e645135e95992ce1203 15-Nov-2016 Jorim Jaggi <jjaggi@google.com> Fix that window was not hidden after policy hiding animation

When we removed WindowState.isOnScreenIgnoringKeyguard we forgot
to change WindowState.isOnScreen to also check policy visibility.

Test: runtest frameworks-services -c com.android.server.wm.WindowStateTests
Test: Open camera app, make sure status bar is hidden

Change-Id: I780f50c8ed3e675f2fab623fdba4fcfc5b6f1d5b
Fixes: 32890266
m/WindowStateTests.java
7c73dd6a204f82794bac25fa13a4e5f6b9e4a99e 15-Nov-2016 Wale Ogunwale <ogunwale@google.com> Merge "Removed WallpaperController dependency on WindowList."
dc589ac82b5fe2063f4cfd94c8ae26d43d5420a0 11-Nov-2016 Sudheer Shanka <sudheersai@google.com> Update usage of ActivityManagerNative.

- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
m/ActivityManagerTest.java
m/TaskStackChangedListenerTest.java
f4ebe2e2ccfcbce9de7ad0c3b5399971201f66fd 09-Nov-2016 Wale Ogunwale <ogunwale@google.com> Removed WallpaperController dependency on WindowList.

WallpaperController now accesses the container hierarchy directly
to determine the state of the wallpaper windows and targets.

Bug: 30060889
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test \
android.server.cts.ActivityManagerTransitionSelectionTests

Change-Id: Ib70beaf340f257ad4e1093cc127f81e7adf41636
m/DisplayContentTests.java
b783fd8a0866ad0c18dff333af73e2d49ff2b680 04-Nov-2016 Wale Ogunwale <ogunwale@google.com> Traverse window hierarchy without window list

Added support for to get all windows in the hierarchy without needing
to use WindowList concept which is a very complicated implementation
in the code base.
This implementation walks the hierarchy node by node returns windows
in order to the caller using a callback.

Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Change-Id: I2719f7c96f26dad23f91c1c589be88712bd224b8
m/AppWindowTokenTests.java
m/DisplayContentTests.java
m/WindowTokenTests.java
fd869cfe53814d427ecf07bed6ec5f6c44b0537c 09-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add ability to modify credential via shell command"
2fef6f7b155f2ff0d3531fe63b8e1c745bb3dc9d 02-Nov-2016 Jorim Jaggi <jjaggi@google.com> Add ability to modify credential via shell command

Test: adb shell locksettings set-pattern 1234
Test: adb shell locksettings set-pin --old 1234 1234
Test: adb shell locksettings set-password --old 1234 1234
Test: adb shell locksettings clear --old 1234
Test: runtest frameworks-services -c
com.android.server.LockSettingsShellCommandTest

Change-Id: I8f541effc7eab0d7453cd9a9b46c280a6425e258
ockSettingsShellCommandTest.java
80361c9ea7f3ff694425b6bd9e42e8c933b1196c 09-Nov-2016 Dianne Hackborn <hackbod@google.com> Merge "Move code for handling uid obs "cutoff" to activity manager"
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
etworkPolicyManagerServiceTest.java
248a0ef3aa119f92858a2bb95d20595824b8d07b 03-Nov-2016 Makoto Onuki <omakoto@google.com> Always scan all apps after each OTA for manifest shortcuts

(W/ reverting Ia05363b30a5eeb989dc4c44cf5dbd71cde96de96)

Test: FrameworksServicesTests

Bug 32590013

Change-Id: I8f45c330d0b102a6a112e774205e6611c1c61af3
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
0eca566f9689361199faa10818dfbcefd7b74af1 07-Nov-2016 Rob Carr <racarr@google.com> Merge "Tests for computeFrameLw docked type scenarios."
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
etworkPolicyManagerServiceTest.java
25147878974f82f875062e99cdee85dd33f3f078 21-Oct-2016 Stephen Chen <stewchen@google.com> Implement metered tracking for NetworkStats summary queries.

Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

Change-Id: I968b9e3352d7880e3fc438f12de628a2da057e0a
et/NetworkStatsObserversTest.java
et/NetworkStatsServiceTest.java
a46f009bbfc693319290c273b4e647dea2eebe10 04-Nov-2016 Phil Weaver <pweaver@google.com> Merge "Add tests for MagnificationController."
15dd7efeb7491b80add341b0599027e246d07c6f 03-Nov-2016 Robert Carr <racarr@google.com> Tests for computeFrameLw docked type scenarios.

Add some computeFrameLw unit tests for non fullscreen
windows. A test a day keeps the chase-list away.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Change-Id: Ifd7c07f5d174b35aa73b78ddc3432520fb096bf9
m/WindowFrameTests.java
89e3ffc66c5a05f188ff9748b48abebc247f664b 19-Sep-2016 Phil Weaver <pweaver@google.com> Add tests for MagnificationController.

Also refactoring the class to make it easier to test and
chaning behavior where the current behavior seemed poorly
defined.

Refactoring:
- Combined all handlers into one.
- Simplified animation to use a ValueAnimator.
- Eliminated ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE
setting. Move rest of settings reading into mockable class.
- Move callbacks from WindowManager into the main class.
- Pulled out my instrumented Handler from the
MotionEventInjectorTest into its own class so I can reuse
it.

Behavior changes:
- Always constraining out-of-bounds values rather than
refusing to change them.
- Constraining offsets on bounds changes. We previously
left them alone, even if they were out of bounds.
- Keeping track of the animation starting point. We were
interpolating between the current magnification spec
and the final one. This change means the magnification
animates to a different profile.

Test: This CL adds tests. I've also run a11y CTS.

Bugs: 31855954, 30325691

Change-Id: Ie00e29ae88b75d9fe1016f9d107257c9cf6425bb
ccessibility/MagnificationControllerTest.java
ccessibility/MessageCapturingHandler.java
ccessibility/MotionEventInjectorTest.java
ab5d0ba22ee2dcd90c6ba12b1c5ce94b7783bacb 03-Nov-2016 Torne (Richard Coles) <torne@google.com> resolve merge conflicts of 0d16fa4 to master

Change-Id: I3c01fe6f5439885d28c6d28415004b26845f06b0
0092dbabe00af3bb5134ab0c9e7a03caa5c38f0e 03-Nov-2016 Richard Coles <torne@google.com> Merge "Fix WebViewUpdateServiceTest failures when using Thread without Looper." am: be19fe5e8a
am: 9c47f5c87a

Change-Id: Ia5d867468080e0e48a4e5b3c08b1ee627e16cebe
9c47f5c87acf5f23b9af7a1fd42f4383afa7219e 03-Nov-2016 Richard Coles <torne@google.com> Merge "Fix WebViewUpdateServiceTest failures when using Thread without Looper."
am: be19fe5e8a

Change-Id: I85e2e13f395dac085616838670c19ddbedc67e9d
02e17d27b1d9289059fd18d512ae978f0dfd666e 03-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "[DPM] Management and retrieval of network logs"
82df4ef603b7565748407b2e9b6c5335795dacf7 02-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added support for window TYPE_PRESENTATION"
5b6714c2fa3cdd87642766e3fb0a1478d2422ec2 02-Nov-2016 Wale Ogunwale <ogunwale@google.com> Added support for window TYPE_PRESENTATION

Switched presentation feature to use new window TYPE_PRESENTATION
and also add its own window token to the display the presentation
is running on. This is needed as window manager no longer allows
tokens to have windows on multiple displays.

Bug: 32566372
Test: Presentation mode works.
Change-Id: I9c2998311b65640743b8e23ec4f10bf1ffbfd785
m/TestWindowManagerPolicy.java
668868baf59cdb9ec2cec4d144fe8143fdfe2815 02-Nov-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Do not exclude partial users that are not being removed"
b879cc614f58cf0237bdc50393db129afe2b9403 01-Nov-2016 Geoffrey Pitsch <gpitsch@google.com> Move notification tests into separate APK.

This will allow us to hook into a presubmit step without
bringing in the other tests.

Compile notification source directly into test APK, for
faster development.

Test: runtest --path
frameworks/base/services/tests/notification/
Change-Id: I04dbcec892cbd375ba1334f59e6b58bcafe80151
otification/BuzzBeepBlinkTest.java
otification/GroupHelperTest.java
otification/ImportanceExtractorTest.java
otification/RankingHelperTest.java
otification/RateEstimatorTest.java
otification/SnoozeHelperTest.java
otification/ValidateNotificationPeopleTest.java
f77ee4f1b79929a77f603e5e879f3616ae464e3e 12-Oct-2016 Michal Karpinski <mkarpinski@google.com> [DPM] Management and retrieval of network logs

This CL follows up on ag/1530343 and adds:
1) Various network events.
2) Retrieval method in DPM and APIs in DeviceAdminReceiver.
3) Extension of NetworkLogger and it's NetworkLoggingHandler.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
Bug: 29748723
Change-Id: I42a1a477e7c75c109a3982f809c22732b814e8b2
evicepolicy/NetworkEventTest.java
5974b4df49eb3c861d87962ea47580eee4beae31 02-Nov-2016 Jorim Jaggi <jjaggi@google.com> Merge changes from topic 'keyguard_refactor'

* changes:
The big keyguard transition refactor (6/n)
The big keyguard transition refactor (5/n)
The big keyguard transition refactor (4/n)
The big keyguard transition refactor (3/n)
The big keyguard transition refactor (2/n)
The big keyguard transition refactor (1/n)
73481c88376ce5e861a50f8d11d313e5b7b1aae2 02-Nov-2016 Julia Reynolds <juliacr@google.com> Merge "Some channel model updates"
6e99d3f0445698cee87e391c9cf2dd90932e8e13 02-Nov-2016 Fyodor Kupolov <fkupolov@google.com> Do not exclude partial users that are not being removed

Otherwise maxSupportedUsers limit can be exceeded by creating users in
parallel.

Test: Manual cmd line + UI guest create/switch/remove + UserManagerTest
Bug: 32485535
Change-Id: I490a70501f3643980bbfb1c95940b9ae3f20ccee
m/UserManagerTest.java
73294b6cf79910dc688e5b62d673082a3dec773b 27-Oct-2016 Jorim Jaggi <jjaggi@google.com> The big keyguard transition refactor (4/n)

Nuke KeyguardScrim

Test: Kill SystemUI while lockscreen is showing, make sure nothing
is visible when being killed.

Bug: 32057734
Change-Id: I9f8d1e5a0e0f968460d8170627a849623c6a7245
m/TestWindowManagerPolicy.java
77e104322920cb93c0ac3d5f101115826728d3d1 27-Oct-2016 Jorim Jaggi <jjaggi@google.com> The big keyguard transition refactor (3/n)

Notify activity manager when dreaming showing state changed so
KeyguardController can update the occluded state when the device
is dreaming.

Test: Set dreaming while charging, wait until screen times out,
make sure that dream is occluding Keyguard.
Bug: 32057734
Change-Id: Ied6f485d9b4a1526cb4cd5f0701f86b1ea05830a
m/TestWindowManagerPolicy.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
m/UnknownAppVisibilityControllerTest.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
m/AppTransitionTests.java
m/TestWindowManagerPolicy.java
85769915e7ef10bef2b5338ed8f04d9b787924fb 25-Oct-2016 Julia Reynolds <juliacr@google.com> Some channel model updates

- Apps cannot update their channel settings after creation.
- Importance is required when creating a channel.
- Some method name changes.
- Ranker can't modify fields a user has changed.
- High and Max importance mean the same thing.
- The default channel adopts app wide settings on creation.
- The default channel is limited to importance low once target api is post n mr1
unless the user changed it.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/notification

Change-Id: I73c449a6abe6d709046de79c5c54339cb2edf0b8
otification/BuzzBeepBlinkTest.java
otification/ImportanceExtractorTest.java
otification/RankingHelperTest.java
otification/SnoozeHelperTest.java
86f7bbe134a274a4936b73e2fc2287482ac0157e 24-Oct-2016 Gustav Sennton <gsennton@google.com> Fix WebViewUpdateServiceTest failures when using Thread without Looper.

Add some more methods to SystemInterface to avoid calling into the rest
of the framework from WebViewUpdateServiceTests.

Also convert WebViewUpdateServiceTest to use non-deprecated test
utilities.

Test: make sure tests in WebViewUpdateServiceTest pass.
Bug: 32364900
Change-Id: I8cf67568bb7e551e1c011028e0bb4e15c0e9f2bb
ebkit/TestSystemImpl.java
ebkit/WebViewUpdateServiceTest.java
e4ee8f8ab836ee115e9cbab360f35773e37fd5d5 31-Oct-2016 Robert Carr <racarr@google.com> Add some more computeFrameLw tests.

This time for producing insets in the fullscreen case.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Change-Id: I2566572af996f024d4b07c3bac945bc8ef7005b9
m/WindowFrameTests.java
c3a0627f10310c4bb0ceb4b727d7a7fc13ee4def 31-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes If8232b90,I3176837e

* changes:
Deobfuscate computeFrameLw parameters.
Begin series of computeFrame unit tests
423af758c91a25ce99cd3387009d53e19b4423a3 31-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Introduced ReadOnlyWindowList"
f7cab10b796d0f66eb690867ba327b4bb00165e3 26-Oct-2016 Wale Ogunwale <ogunwale@google.com> Introduced ReadOnlyWindowList

7th and Final step in making the modification of a display's
WindowList private to DisplayContent.
ReadOnlyWindowList provides an interface for external classes to
DisplayContent to access the window list without being able to
modify it. This will be important in upcoming CLs where it is
important for us to keep track of when the window list changes.

Bug: 30060889
Test: Manual testing and existing tests pass.

Change-Id: I4de0b258a40fd4b21ef9cc9e3401488f76d25f83
m/WindowContainerTests.java
fed503cb461f884b4589cadd6ee9d48381500749 31-Oct-2016 Yorke Lee <yorkelee@google.com> Merge "Add new methods to ITaskStackListener"
7072f32b32e1104a4127fdada87f298bee1b07ff 31-Oct-2016 Lorenzo Colitti <lorenzo@google.com> Merge changes from topic 'frameworks-net-tests'

* changes:
Move the connectivity tests to frameworks/base/tests/net.
De-guava BroadcastInterceptingContext and move it to testutils.
Move FakeSettingsProvider to a common location.
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
m/TaskStackChangedListenerTest.java
16a4e3cbf7068504e4628ed6e81e7700a6f8edbc 28-Oct-2016 Robert Carr <racarr@google.com> Begin series of computeFrame unit tests

Start with a fixture and some simple unit tests
for WindowState.computeFrame.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Change-Id: I3176837ee60dbd474f22a3b1857f19b4e82afee7
m/WindowFrameTests.java
07bcab787ea7ce65081dffe7da196f872a1be37a 15-Oct-2016 Wale Ogunwale <ogunwale@google.com> Add windows to window tokens in expected z-order

Decouple the logic for adding window to a position in the parent
window token from the position we are adding the window to in the
window list. The window token now adds the windows in order based
on the rules the rest of the system is using which makes the code
a little more straightforward to follow.

Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
Change-Id: Ic9b724fba02279a0c4e92508d39e5e35171b6d8d
m/AppWindowTokenTests.java
m/WindowTokenTests.java
ecc986d430f4b8158f177ed97d2edb741f11ff71 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> Move the connectivity tests to frameworks/base/tests/net.

This will give us a good place to put all the networking tests.

Fix: 31479480
Test: adb shell am instrument -w -e notClass com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest 'com.android.frameworks.tests.net/android.support.test.runner.AndroidJUnitRunner' # PASS
Change-Id: I4b389f7f4e33a996885b38670f585e58ca66f777
onnectivityServiceTest.java
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/IpConnectivityMetricsTest.java
onnectivity/LingerMonitorTest.java
onnectivity/MetricsLoggerServiceTest.java
onnectivity/MetricsTestUtil.java
onnectivity/NetdEventListenerServiceTest.java
onnectivity/TetheringTest.java
onnectivity/VpnTest.java
onnectivity/tethering/TetherInterfaceStateMachineTest.java
281a17c9580de5c9898be7d9654d428801976511 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> De-guava BroadcastInterceptingContext and move it to testutils.

Removing the static dependency on guava reduces test compile time
by about 20 seconds on a Z840, thus substantially speeding up the
compile/test cycle.

Make FutureIntent public instead of package-private because it is
used directly by NetworkPolicyManagementServiceTest, which as of
this CL is now in a different package.

Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.NetworkPolicyManagerServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.net.NetworkStatsServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.NetworkManagementServiceTest # Already failing.
Bug: 31479480
Change-Id: Ifab32c9214e9caab71dbf93b3d3ca88df6f49636
roadcastInterceptingContext.java
onnectivityServiceTest.java
etworkManagementServiceTest.java
etworkPolicyManagerServiceTest.java
et/NetworkStatsServiceTest.java
7df1a82802cdf842d07a86a80383c7d5ea7ae53a 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> Move FakeSettingsProvider to a common location.

Test: runtest frameworks-util -c com.android.internal.util.test.FakeSettingsProviderTest
Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest
Test: runtest frameworks-services -c com.android.server.retaildemo.PreloadAppsInstallerTest
Test: runtest frameworks-services -c com.android.server.retaildemo.RetailDemoModeServiceTest
Bug: 31479480
Change-Id: I82a1a1a7219cf1385092b84d85eddf9dda90c685
onnectivityServiceTest.java
etaildemo/PreloadAppsInstallerTest.java
etaildemo/RetailDemoModeServiceTest.java
8c32fd2d33a0ced355d2c7999785621c36b9dc41 27-Oct-2016 Michal Karpinski <mkarpinski@google.com> Extending DNS event reporting
am: 6e54239e50

Change-Id: I64e6a48fbbaa734447069b073c3499ef71af907c
6e54239e501110a00c31143a3583ce206fc854b4 27-Sep-2016 Michal Karpinski <mkarpinski@google.com> Extending DNS event reporting

This adds hostname, array of addresses, total count of IP addresses
and uid to the existing pipeline.
Currently ignores the new data it receives, further work will be
done in the subsequent CLs.

Test: for now just the benchmarking, in the future unit and CTS

Bug: 29748723
Change-Id: Ice7db208282934e74f0e1808ffbae96d476c4216
(cherry picked from commit 14c9d2d0df7fab2b0470c3c404f600d87d4f0f93)
onnectivity/NetdEventListenerServiceTest.java
8902f81589a48c9c9b5f186199a60d900cb9cfcb 27-Oct-2016 Glen Kuhne <kuh@google.com> Merge "Move ipconnectivity.proto to services-proto.jar"
0ef948d76c95fe80f21b7464a4199945f4679453 27-Oct-2016 Hugo Benichi <hugobenichi@google.com> Merge "ConnectivityServiceTest: mark flaky test as such"
c8c1027762d66c12c9c153ccbb8f80acdee8571c 17-Oct-2016 Hugo Benichi <hugobenichi@google.com> ConnectivityServiceTest: mark flaky test as such

This patch extracts into its own independent test a test sub-block looking
for a race condition when not waiting on handlers to become idle:
there is no way to prevent the race from not happening when looking for
it this way. This makes the test flakky.

This new independent test is tagged with @FlakkyTest(tolerance = 3).

Test: ConnectivityServiceTest passes, with higher probability.
Bug: 31479480
Change-Id: Ic0e2ffbe669f2ea8cc62e8a0d4763703368db019
onnectivityServiceTest.java
0719940ce4c877c3b627b276accba9ebcfdeeeef 26-Oct-2016 Glen Kuhne <kuh@google.com> Move ipconnectivity.proto to services-proto.jar

Moved ipconnectivity.proto from services.core.jar to
framework-protos.jar.
Replaced 'mergeFrom' MessageNano base class calls, with 'parseFrom'
IpConnectivityLog calls.

This solves an issue where the services.jar would conflict with
duplicate nano proto base class definitions in other .jars
(wifi-service.jar).

Bug: 32261442
Test: Existing unit tests pass
Change-Id: I49100935fcae2e85e12eaa7f3462864f3a340b97
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/IpConnectivityMetricsTest.java
fbc27b1e9e104a60eaf17f3ada7276366c96e778 25-Oct-2016 Christopher Wiley <wiley@google.com> Merge "Add unit tests for Tethering.isTetherProvisioningRequired" am: 836ffa6e1c am: c29f2575f2 am: a7bb5ad809
am: 2ae41619ae

Change-Id: Iee7c8575ee22a494e2657e15e1aaae9b05a37045
a7bb5ad8097df828efe0271a63e581b19c2b96f0 25-Oct-2016 Christopher Wiley <wiley@google.com> Merge "Add unit tests for Tethering.isTetherProvisioningRequired" am: 836ffa6e1c
am: c29f2575f2

Change-Id: Ica704d0a64dde80ae0a9f1cef0250bfbdafcd49a
c29f2575f2f1224a3b08fe688975317f0d03c51b 25-Oct-2016 Christopher Wiley <wiley@google.com> Merge "Add unit tests for Tethering.isTetherProvisioningRequired"
am: 836ffa6e1c

Change-Id: I1dab386e3891c01a2917c32847d2aecdbfa10102
836ffa6e1c1e25b501d4134a46a7e88298ecf363 25-Oct-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Add unit tests for Tethering.isTetherProvisioningRequired"
497c147b821cf1c441f5047a5035281dc23e8bd9 11-Oct-2016 Christopher Wiley <wiley@google.com> Add unit tests for Tethering.isTetherProvisioningRequired

Check that we tolerate various dependencies not being available.

Bug: 31946071
Test: These are tests

Change-Id: Ic0a9cd6f255ba9ff4c774dee640df1a0bdf8dc39
onnectivity/TetheringTest.java
03db8e4b58342d5ada64f29b049cf30da0ba9369 24-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I1a544a8d,Ie78d3fb0

* changes:
IpConnectivityMetrics: rate limit ApfProgramEvents
IpConnectivityMetrics reads buffer size in settings
e1c173d2240a8eedf7685c9371087dc047a6931f 18-Oct-2016 Hugo Benichi <hugobenichi@google.com> IpConnectivityMetrics: rate limit ApfProgramEvents

This patch uses the previously introduced TokenBucket to rate limit
ApfProgramEvents, still allowing for burst of ApfProgramEvents when a
new interface is set up (due to ipv4 provisioning, multicast lock, ipv6 RAs
triggering new APF program events in short amounts of time).

Test: new test in IpConnectivityMetricsTest
Bug: 1550402
Change-Id: I1a544a8d62e6b02f0ed0088ab76c4bad338d2f44
onnectivity/IpConnectivityMetricsTest.java
05686dbb6b965eb1a54591d2ed2334337886c6ee 19-Oct-2016 Hugo Benichi <hugobenichi@google.com> IpConnectivityMetrics reads buffer size in settings

Test: IpConnectivityMetricsTest passes. Also manually changed the new
setting and verified the buffer size is as expected after flushing the
buffer.
Bug: 32198637
Change-Id: Ie78d3fb03cea7883585549dac4f2063f0a8d9f4b
onnectivity/IpConnectivityMetricsTest.java
02bf0b6dbcf9f219001e10ff21c8b98f73cbf0cf 22-Oct-2016 Robert Sesek <rsesek@google.com> Merge "Create the WebViewZygote and implement WebViewZygoteInit." am: 8be2850546 am: f80fab010a
am: aa544e975e

Change-Id: I561fff0f56bdbfdeb6c92c11c3fce12cf3fe28be
aa544e975ed95edb854ca3d004089046ad85a859 22-Oct-2016 Robert Sesek <rsesek@google.com> Merge "Create the WebViewZygote and implement WebViewZygoteInit." am: 8be2850546
am: f80fab010a

Change-Id: I37d0d62662ee96a9eefe2dfa71670d8e4b724889
f80fab010a46f322a2bcb33586665bdaf4afe6ce 22-Oct-2016 Robert Sesek <rsesek@google.com> Merge "Create the WebViewZygote and implement WebViewZygoteInit."
am: 8be2850546

Change-Id: I608ea53be52cb91f0e8cf73998de4578b39e099a
3c46e09267d67f57ec9607823e7ee2a6a7375b56 21-Oct-2016 Andrii Kulian <akulian@google.com> Merge "Fix NPEs when display is added or removed"
1ca2ee78377589440adf18bc43a4cf7c62202948 21-Oct-2016 Hugo Benichi <hugobenichi@google.com> Merge "IpConnectivity metrics: add version number"
b94292e5fe18a459aa521b9b9631d2db0485ac1b 19-Oct-2016 Andrii Kulian <akulian@google.com> Fix NPEs when display is added or removed

- In WindowContainer set parent of the child after it is actually
added. This way if the child class depends on this in overridden
methods it will be in correct state.
- Reconfigure display only if it is attached. Otherwise there is no
corresponding DisplayContent record with configuration.

Change-Id: I20c51522d82f9d0ca98f098070585e6472a23e98
Test: Updated WindowContainerTests.
m/ConfigurationContainerTests.java
m/WindowContainerTests.java
4a048f99649c425a8fa5acfab0d9f46d2623530e 20-Oct-2016 Calvin On <con@google.com> Add option to skip and avoid captive portals.
am: 4bc78eba6f

Change-Id: Id38d5c03d06822f9b20abd65db9dd04c90110b63
4bc78eba6f16ef84206aaed9edd5ca4bb4f6c420 12-Oct-2016 Calvin On <con@google.com> Add option to skip and avoid captive portals.

Test: ConnectivityServiceTest updated with test cases.
Test: Manually tested against att-wifi in B42.
Bug: 30222699
Change-Id: Ibe63942da04748ab0406e24e0f44be31d47710a0
(cherry picked from commit be96da11ccb5dd500f920c3ba90d350857293b3d)
onnectivityServiceTest.java
e2b77a55b3a7eeff12378e01c3101dce7e02bc45 20-Oct-2016 Julia Reynolds <juliacr@google.com> Merge "Move autogrouping into framework."
b9df32d1ffa371ca9c6834b213c964d6a6279827 20-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add option to skip and avoid captive portals."
be96da11ccb5dd500f920c3ba90d350857293b3d 12-Oct-2016 Calvin On <con@google.com> Add option to skip and avoid captive portals.

Test: ConnectivityServiceTest updated with test cases.
Test: Manually tested against att-wifi in B42.
Bug: 30222699
Change-Id: Ibe63942da04748ab0406e24e0f44be31d47710a0
onnectivityServiceTest.java
8f488d3f2f754bc6e8f4e87f40031a3f6a0b00db 14-Oct-2016 Julia Reynolds <juliacr@google.com> Move autogrouping into framework.

Test: runtest systemui, and post and dismiss notifications, checking that they
are grouped (or not) appropriately.

Change-Id: I8f3ec497cebcb14a7853fac98b844a3fd4503141
otification/GroupHelperTest.java
cfca258639f81b33dd60aa9c05dbc4f4190ac11e 19-Oct-2016 Wale Ogunwale <ogunwale@google.com> Fixed monkey test failure

Avoid duplicate attempt to remove WindowToken from its parent
container when removeImmediately is called by first removing the
token from the display before calling super.removeImmediately
which only tries to remove the child from the parent container
if it is still attached to the parent.

Also, added test for the failure case the monkey test was
triggering.

Bug: 32239922
Test: WindowTokenTests.testChildRemoval passes
Change-Id: I4153669d18260d956c4b570944d2f48516d692ac
m/TestWindowManagerPolicy.java
m/WindowTokenTests.java
905e807ee255e4e6f59d04ef0fba9a7cf4eabb20 17-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add an API for retrieving information about the current WebView package."
c12469bd90d309e6c804c92481289179804dba2c 17-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Show notification for always-on app VPN"
bf683e07c350ed7cd2c8e877b447e1dd41863a94 15-Sep-2016 Gustav Sennton <gsennton@google.com> Add an API for retrieving information about the current WebView package.

Now that WebView can be loaded from one out of a set of packages we
provide an API for fetching information about this package.
Such API is especially useful for debugging crashes.

Bug: 30597460

Change-Id: I13dd746f7efcf2917b517053010b73ea35241325
ebkit/WebViewUpdateServiceTest.java
d680d4c856f54bea0c60dea74ba4204822391e49 13-Oct-2016 Hugo Benichi <hugobenichi@google.com> IpConnectivity metrics: add version number

This patch adds a version field to ipconnectivity.proto and populates it
to 2, which is the logical version number for NYC-MR2.

Test: IpConnectivity{EventBuilder,Metrics}Test pass
Bug: 32127906
Change-Id: I1439f012b7f9b4211d5d5429c274ad03d2ac9d6b
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/IpConnectivityMetricsTest.java
3752e507667f9142a901377a2a7fdfe0f689448f 14-Oct-2016 Julia Reynolds <juliacr@google.com> Merge "Add support for snoozing notifications"
e56e9b65070d11ab01e0f5191922262e199715c2 14-Oct-2016 Andrii Kulian <akulian@google.com> Merge "Use ConfigurationContainer for holding configs in AM hierarchy"
fd0d22750f1747ffb694bfcb77d4686d8fda55c8 14-Oct-2016 Michal Karpinski <mkarpinski@google.com> Don't expose default strong auth timeout as constant am: 6dbf67fc48
am: bc755da55c

Change-Id: Idb118df5cf1a763645f4187bcddfa4bb9b8b42ee
72f1cbb3b988d6daa61c45a69aa9f8024c029b06 19-Sep-2016 Julia Reynolds <juliacr@google.com> Add support for snoozing notifications

To a notification listener, snoozing will appear as a cancel
(with reason snoozed) followed by a post (when the snooze period
ends).

Apps can repost a snoozed notification, but the updates will not be shown
to the user until the snooze period ends.

Snoozing is canceled if the posting app or a notification listener
cancels the notification.

Any notification listener can snooze a notification. Technically apps
can snooze their own notifications also, though that's not public.

In this iteration snoozed notifications will be lost on device reboot.

Test: included. Also, various post, snooze, update, cancel tests with
a listener.

Bug: 30997603
Change-Id: I568a6448196f0992a17d20a4dac296321ec5092b
otification/SnoozeHelperTest.java
f4006d9b0be123b2a4e874b89eb4a431d3d49c8b 08-Oct-2016 Felipe Leme <felipeal@google.com> Implemented a PriorityDump helper.

dumpsys / dumpstate will soon dump services in buckets (CRITICAL, HIGH,
NORMAL) and services must check the --dump_priority argument to select
which sections to dump.

PriorityDump parses the args checking for that argument, making it
easier to implement bucket dumping.

BUG: 27429130

Test: com.android.server.utils.PriorityDumpTest passes

Change-Id: Ia5ee08a3dc5bd0fde80b8a5616e1311e1b3bf7ba
tils/PriorityDumpTest.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.
m/ConfigurationContainerTests.java
360a8bce7386dc9b231c698af1730e04362b6c2e 10-Oct-2016 Wale Ogunwale <ogunwale@google.com> Switch WindowState to get display content from its window token

WindowState no longer needs to track what display it is on now
that the window token can only be on one display.

Test: Existing tests pass.
Change-Id: Ia0530d73da0b1ecc17f596ec62c933637bd1c2c3
m/AppWindowTokenTests.java
m/WindowStateTests.java
m/WindowTokenTests.java
02319a61927041cc4d3632e94c501b7277f0bda5 27-Sep-2016 Wale Ogunwale <ogunwale@google.com> Associate WindowToken object with only one display at a time

WindowTokens were global objects that contained windows that could
be on multiple displays. This model does not work with the
WindowContainer hierarachy as children (window tokens) can not have
mulitple parents (displays).
We now:
- Track the mapping of binder tokens to window tokens per display
instead of globally . So, you can have a binder token map to
individual WindowToken objects per display.
- WMS.addWindowToken is used to create a WindowToken that clients
can then later add windows to. However, when addWindowToken is called
we don't know the display the client(s) would like to add window to.
So, we track binder tokens that we are allowed to add window for in
the RootWindowContainer and create a window token for the binder on
a specific display when we try to add a window.

Bug: 30060889
Test: Manual testing and existing tests pass.
Change-Id: I81a52a32b01c33ed32169d2da0506b688ea9bc8a
m/AppWindowTokenTests.java
m/WindowStateTests.java
m/WindowTokenTests.java
5f9b85ff4c285d6d5cee02754626f1ca8e94d1a8 12-Oct-2016 Michal Karpinski <mkarpinski@google.com> Merge "Extending DNS event reporting"
6dbf67fc4889c49151415e986be98f70816f81ec 06-Oct-2016 Michal Karpinski <mkarpinski@google.com> Don't expose default strong auth timeout as constant

The admin can instead use the value of 0 to reset to default.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java

Bug: 31430135
Change-Id: I0d6b29ca4eca65d7ca72a8975a0c28c9050a946c
(cherry picked from commit 943aabd11cce3ab453762d3912395363720e1f5d)
evicepolicy/DevicePolicyManagerTest.java
d227a66aade35f61f1401e73f888eda153be2a55 11-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Don't expose default strong auth timeout as constant"
6dc428f677f2b80b085466961e9495972e1c88c9 10-Oct-2016 Tony Mak <tonymak@google.com> Allow device owner to inflate managed profile

1. Modify DPM.isProvisioningAllowed to allow it to happen
2. Introduce hidden API createProfileForUserEvenWhenDisallowed for
ManagedProvisioning app to create profile under DO.
Apps with MANAGE_USERS permission can clear the
DISALLOW_ADD_USER restriction anyway, so they do not gain extra power.

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.CustomDeviceOwnerTest#testIsProvisioningAllowed

Bug: 31895999

Change-Id: I10dc3043653130ae717a1d3d8256c9e73231bb21
m/UserManagerTest.java
943aabd11cce3ab453762d3912395363720e1f5d 06-Oct-2016 Michal Karpinski <mkarpinski@google.com> Don't expose default strong auth timeout as constant

The admin can instead use the value of 0 to reset to default.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java

Bug: 31430135
Change-Id: I0d6b29ca4eca65d7ca72a8975a0c28c9050a946c
evicepolicy/DevicePolicyManagerTest.java
14c9d2d0df7fab2b0470c3c404f600d87d4f0f93 27-Sep-2016 Michal Karpinski <mkarpinski@google.com> Extending DNS event reporting

This adds hostname, array of addresses, total count of IP addresses
and uid to the existing pipeline.
Currently ignores the new data it receives, further work will be
done in the subsequent CLs.

Test: for now just the benchmarking, in the future unit and CTS

Bug: 29748723
Change-Id: Ice7db208282934e74f0e1808ffbae96d476c4216
onnectivity/NetdEventListenerServiceTest.java
ba039066d817608f0599dd2b8729ae5648699c28 08-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow some packages to be excluded during during work profile creation."
7cb54a34c44547b55200e4be15be397f6a363c55 16-Sep-2016 Sudheer Shanka <sudheersai@google.com> Allow some packages to be excluded during during work profile creation.

Bug: 31657192
Test: adb shell am instrument -e class com.android.server.pm.UserManagerTest#testAddManagedProfile_withDisallowedPackages -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I37eab6084e0f911d0e2407186b789875588194a2
m/UserManagerTest.java
ded209843616a98e6f97db0d1784f6d630cbd5e9 15-Aug-2016 Robert Sesek <rsesek@google.com> Create the WebViewZygote and implement WebViewZygoteInit.

This adds a new init-spawned daemon, webview_zygote, that starts a JVM and
acts as a zygote process for WebView isolated_app services.

Test: m
Test: angler boots
Test: Turn on Settings>Developer>Multiprocess Webview. webview_zygote32 or
webview_zygote64 start (requires dependent CLs).

Bug: 21643067
Change-Id: Ida98bd04b4d77736b672b03af651c4eb97ce88c1
ebkit/TestSystemImpl.java
a6c7c5dc58af67c73bad60b3636ac15d5c926f22 07-Oct-2016 Erik Kline <ek@google.com> Refactor "avoid bad wifi" logic into a utility class am: 065ab6ee40 am: 23cdacbec6 am: 0cb8d5247e
am: 73b9d8061c

Change-Id: Ie3d058d6c9da43763d10b0a2bc96171d07673e9d
73b9d8061c65b8ad15ae1ea3d64469e8562eb8dd 06-Oct-2016 Erik Kline <ek@google.com> Refactor "avoid bad wifi" logic into a utility class am: 065ab6ee40 am: 23cdacbec6
am: 0cb8d5247e

Change-Id: I7db61e54c80ec836d00bf4ae087137bb296c30f1
1a405fe300950d6ceae2166fd074b596d8110dbe 30-Jun-2016 Tony Mak <tonymak@google.com> Show notification for always-on app VPN

This is the same notification as the one shown during legacy lockdown
mode, sans the 'reset' button.

The notification is only shown during times when VPN has not yet
established or has failed, for example during boot or after a crash.

Bug: 29123115
Change-Id: If0e2eb4f8fb220a21d6d462363a05869e27c7b6e
onnectivity/VpnTest.java
8cad623c92005bda8bc9cb7e6ca43c7d92a7df46 06-Oct-2016 Todd Kennedy <toddke@google.com> remove peekPackageLPr

no longer needed, so, removed

Bug: 30219944
Change-Id: I0cf8ef4e8e2abc1d98b1f584ae448f9097095c6d
Test: adb shell am instrument -w -e class com.android.server.pm.PackageManagerSettingsTests com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
m/PackageManagerSettingsTests.java
79d138e43fe9532ccc5a37f3ba20a0b1ee5aea78 04-Oct-2016 Fyodor Kupolov <fkupolov@google.com> Tests for AccountsDb

Test: AccountsDbTest pass
Bug: 30639520
Change-Id: I410c19cbb5f6056179297ce57a7e286d04268304
ccounts/AccountsDbTest.java
23cdacbec61c130fc35b1c9e84cb8f9b991fd092 04-Oct-2016 Erik Kline <ek@google.com> Refactor "avoid bad wifi" logic into a utility class
am: 065ab6ee40

Change-Id: I4a6ad3791ac551b0d64b37dd4e2afef1e8e8ee10
065ab6ee407dc8b3b5b477e483b6f48e50720113 02-Oct-2016 Erik Kline <ek@google.com> Refactor "avoid bad wifi" logic into a utility class

Additionally, add this utility class to IpManager for compatibility
verification. A follow-on CL will make use of IpManager's local
AvoidBadWifiTracker.

Bug: 31827713
Change-Id: If8c56c3f8076d6a5157ea180e361bbdadc2bc1dd
onnectivityServiceTest.java
501247bab13b558b29c1fde65dc9d2ed3e4653ac 03-Oct-2016 Sudheer Shanka <sudheersai@google.com> Fix flaky test.

Change-Id: I657ed11acc0173768cebd293faad84ade1047668
Fixes: 31906795
Test: adb shell am instrument -e class com.android.server.retaildemo.RetailDemoModeServiceTest -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
etaildemo/RetailDemoModeServiceTest.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
etaildemo/RetailDemoModeServiceTest.java
e540c9a1f5cf9ff6b6ac8424e7f19b715424eb40 30-Sep-2016 Jorim Jaggi <jjaggi@google.com> Merge "Fix case in which onTaskStackChanged was not called"
90de8e82f9bd0d2285fcbd14724fde5c3ccfef35 30-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added test for enabling wifi for demo user"
cd47cec57d082aab910fd7a2094cd01baa4c65f3 30-Sep-2016 Suprabh Shukla <suprabh@google.com> Added test for enabling wifi for demo user

Earlier change to resolve merge conflicts was breaking the current test
because mocked context was used to get wifi manager. Mocking wifi
manager to fix the test and added a check that setWifiEnabled is called
when wifi is not already on.

Test: adb shell am instrument -e class
com.android.server.retaildemo.RetailDemoModeServiceTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Bug: 31833031
Change-Id: Idd123d50df6ee6db51417645fc877abebe555dc0
etaildemo/RetailDemoModeServiceTest.java
834bbbd753b73e7a84403910cab9e27f688b74a8 30-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add override and merged config to WindowContainer"
441e4494682144aec2ec7f19060464af3d29c319 30-Sep-2016 Andrii Kulian <akulian@google.com> Add override and merged config to WindowContainer

This consolidates usages of override and full (merged)
configs in WM objects and also adds support of per-display
configurations. Having full configs allows us to get
current applied config at any level.

Test: Manual tests pass. Added some new to WindowContainerTests.
Change-Id: I996770433c80da41265f3e14048bd23cead097f9
m/WindowContainerTests.java
f5ac9e64836bdc78839e1313988f43cfc28689cd 29-Sep-2016 Dianne Hackborn <hackbod@google.com> Merge "New infrastructure to switch remaining commands to "cmd" calls."
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
m/ShortcutManagerTest7.java
7b614376bc96cae1885fd62b1e6cee39caa7b62e 28-Sep-2016 Jorim Jaggi <jjaggi@google.com> Fix case in which onTaskStackChanged was not called

In completeResumeLocked, visibility was changed but we didn't set the
flag so the listeners didn't get notified.

Test:
runtest -c com.android.server.am.TaskStackChangedListenerTest frameworks-services

Change-Id: I4b4076a895baafc877f312d24211a2fc69a98e3b
Fixes: 31527783
m/TaskStackChangedListenerTest.java
d7c7f5b3f366daa2ab560ddd2cda5424aea4814e 29-Sep-2016 Hugo Benichi <hugobenichi@google.com> Captive portal detection uses 3rd fallback probe am: d953bf853d am: bc739d0bbc
am: 2b04d1234b

Change-Id: I221cf47aa43105d4094ec724f8d6f4f6c98d0757
2b04d1234bef6cd257b9994030dfb5fa3cac8a9e 29-Sep-2016 Hugo Benichi <hugobenichi@google.com> Captive portal detection uses 3rd fallback probe am: d953bf853d
am: bc739d0bbc

Change-Id: Iec8ccdbcd433d8b2f5538d7b4bed5c945b5b688a
da993806c2e40e88117dbe2ae5b0d8580318b1a1 21-Sep-2016 Fyodor Kupolov <fkupolov@google.com> Added dependency injection for testing

Also fixed an issue when tests occasionally were crashing on APCT.
Now tearDown waits for async logging tasks to complete before
removing db files.

Test: AMS tests are passing

Bug: 31630010
Change-Id: I98f7b0899e54f4927b493e36d16dd946b9ca13a9
ccounts/AccountManagerServiceTest.java
d953bf853d233026c9064e6a0c962b14cf4658d6 27-Sep-2016 Hugo Benichi <hugobenichi@google.com> Captive portal detection uses 3rd fallback probe

This patch adds the possitibility to send a 3rd fallback validation
probe in sendParallelHttpProbes when neither the 1st http probe nor the
https probe came back with a conclusive answer.

This 3rd probe is only used for trying again captive portal detection
and does not return success, so that network validation always fails if
the https probe fails.

In addition, the url reveals a captive portal is now sent to the
CaptivePortalLoginActivity so that all three probes can use different
urls.

Bug: 29367974

Change-Id: I7385fde1aa1316d94aac350af0e956cb193aa4ee
onnectivityServiceTest.java
0d54a95b62d09cd5f40e323f0fbfec4a00af75fc 26-Sep-2016 Michal Karpinski <mkarpinski@google.com> Fix naming of the service in NetdEventListenerServiceTest

Bug: 29748723
Change-Id: I285cb77fba824036df80a9ed2560ee95d1d1919c
(cherry picked from commit 4f26103fdd4dad3cc720f4ba2f6bf9a9b0469c22)
onnectivity/NetdEventListenerServiceTest.java
4f26103fdd4dad3cc720f4ba2f6bf9a9b0469c22 26-Sep-2016 Michal Karpinski <mkarpinski@google.com> Fix naming of the service in NetdEventListenerServiceTest

Bug: 29748723
Change-Id: I285cb77fba824036df80a9ed2560ee95d1d1919c
onnectivity/NetdEventListenerServiceTest.java
357ca56f8b3b419d6b05294adae1fefcf0e63d3a 25-Sep-2016 Makoto Onuki <omakoto@google.com> Fix DPM unit tests, also fix a log message. am: 6ad5f92512 am: 2f78ab5387
am: 4001a2b4c4

Change-Id: Ifc1735798074af6758da5cc3a40d9adada1376cb
8472efa08766ffaa3cfd5b4a68051d4bce2e715e 25-Sep-2016 Hugo Benichi <hugobenichi@google.com> resolve merge conflicts of 00f07be to nyc-mr1-dev-plus-aosp
am: e69608f864

Change-Id: I4bfd7a9bc5ef4c3c5a30bed63b92eaef90b1a30e
3f92736b49628a88adcf25dc1ac1dd22eeaec63c 24-Sep-2016 Hugo Benichi <hugobenichi@google.com> Add ipconnectivity.proto to services jar am: 50a84c6210 am: 446a3847b4
am: 7b6171821d

Change-Id: Id194acbb25c8f3dd8fdf03af67912f7a0f0f770f
4001a2b4c4f9196e84f182422f90fa14de2ffc1a 23-Sep-2016 Makoto Onuki <omakoto@google.com> Fix DPM unit tests, also fix a log message. am: 6ad5f92512
am: 2f78ab5387

Change-Id: Id42c0cda2542eb5cc2325d8c6747e8bbe7d3a1ef
2f78ab5387341982b81259ec574cfca09ee7085a 23-Sep-2016 Makoto Onuki <omakoto@google.com> Fix DPM unit tests, also fix a log message.
am: 6ad5f92512

Change-Id: Ieab914cf8538e3086fb32cc351e45e6a5c2017c5
18fb24c5d3e8f9e2a66e78f13a7fa2567fbd3231 23-Sep-2016 Makoto Onuki <omakoto@google.com> Merge "Fix DPM unit tests, also fix a log message." into nyc-mr1-dev
e69608f8648e8d7f21c712be3bbf50b05ce8b1e3 23-Sep-2016 Hugo Benichi <hugobenichi@google.com> resolve merge conflicts of 00f07be to nyc-mr1-dev-plus-aosp

Change-Id: I82865b2847c584f8a1d728ef76113e3969f222ca
7b6171821d851a6fd2b736c9c079256b2d8f4f09 23-Sep-2016 Hugo Benichi <hugobenichi@google.com> Add ipconnectivity.proto to services jar am: 50a84c6210
am: 446a3847b4

Change-Id: I1fc947f98715a7a352753d85cd4ef4970be2b027
525ef7c20664d03ce9f5d7d1cf48fa72afc47b75 23-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Switched DisplayContent to use WindowContainer"
1012458343643e899ed8ca2684380b92d73fb47b 16-Sep-2016 Wale Ogunwale <ogunwale@google.com> Switched DisplayContent to use WindowContainer

Bug: 30060889
Test: Manual testing and existing tests still pass.
Change-Id: I99f2e38da417f62e8aa65bb6582aba53fd528c1b
m/WindowContainerTests.java
b3fe65004127a2487da0195409cc0722ed712156 22-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixed mRestrictBackgroundWhitelistRevokedUids usage."
00a42d4c885bf7440c2677750ad8b10974b16d7f 13-Sep-2016 Hugo Benichi <hugobenichi@google.com> IpConnectivityLog uses new metrics service

This patch connects existing IpConnectivityLog to the new
IpConnectivityMetrics service:
- IpConnectivityLog is now an independent class that pushes events
directly to the new IpConnectivityMetrics service.
- DnsEventListenerService is moved from MetricsLoggerService to
IpConnectivityMetrics.
- this patch also features end to end tests from IpConnectivityLog to
IpConnectivityMetrics dumpsys output.

Bug: 31254800
Change-Id: I4fe4a209eedde2814d5f13c574a1a0d854bd05c9
onnectivity/IpConnectivityMetricsTest.java
50a84c6210f4f165b489dd1bf1c535d86dda2fba 02-Sep-2016 Hugo Benichi <hugobenichi@google.com> Add ipconnectivity.proto to services jar

This patch moves ipconnectivity.proto and companion serialization
classes from /vendor/google/app/ConnectivityMetrics into the framework
services jar.

This will allow to implement a dumpsys interface for IpConnectivity
metrics events defined in android.net.metrics that output metrics as
a serialized proto.

Bug: 31254800
Change-Id: Ia4449103fd7222c9d899352fea2dce47a790a49c
onnectivity/IpConnectivityEventBuilderTest.java
onnectivity/MetricsTestUtil.java
a2d5860a5f9e791e88a61d8d983868998cd52cd8 21-Sep-2016 Michal Karpinski <mkarpinski@google.com> Rename DnsEventListenerServiceTest to NetdEventListenerServiceTest

Change-Id: I67e645306444938a4675e91a9db5d716c0bd4881
(cherry picked from commit d82fccd368ca605c8efc21b198e667fd30c4182e)
onnectivity/DnsEventListenerServiceTest.java
onnectivity/NetdEventListenerServiceTest.java
d82fccd368ca605c8efc21b198e667fd30c4182e 21-Sep-2016 Michal Karpinski <mkarpinski@google.com> Rename DnsEventListenerServiceTest to NetdEventListenerServiceTest

Change-Id: I67e645306444938a4675e91a9db5d716c0bd4881
onnectivity/DnsEventListenerServiceTest.java
onnectivity/NetdEventListenerServiceTest.java
7203d62563e8877449ad40356dee0592ff6b005a 21-Sep-2016 Brian Carlstrom <bdc@google.com> Track new WindowManagerPolicy methods

Test: make checkbuild
Change-Id: Id6a0c2c0b408e356afdaa8e2e3437a515a1aa54f
m/TestWindowManagerPolicy.java
f700a6e87fe4d2e6657f98953b56afa0bdecbe25 21-Sep-2016 Lorenzo Colitti <lorenzo@google.com> Support "don't ask again" in the avoid bad wifi dialog. am: 165c51c0eb am: aab02df195 am: 63275aba54
am: 3f67cbec46

Change-Id: I60ebe27ec892658c5a051457b13506e59ba33824
aab02df1957927797ba745e5a2b42df0722f076b 20-Sep-2016 Lorenzo Colitti <lorenzo@google.com> Support "don't ask again" in the avoid bad wifi dialog.
am: 165c51c0eb

Change-Id: Ic6a1917a83e2d847bd673790e2c36f7316ca7acd
165c51c0eb9834a3d95ce0b31b07c7c8975a54d7 18-Sep-2016 Lorenzo Colitti <lorenzo@google.com> Support "don't ask again" in the avoid bad wifi dialog.

This contains the following changes:

1. Make NETWORK_AVOID_BAD_WIFI a tristate: 0 means never avoid
bad wifi, unset means prompt the user, 1 means always avoid.
2. Look at NETWORK_AVOID_BAD_WIFI only if the carrier restricts
avoiding bad wifi (previously, we relied on the setting being
null and defaulting to the value of the config variable).
3. Add an avoidUnvalidated bit to NetworkAgentInfo to track
whether the user has requested switching away from this
unvalidated network even though avoiding bad wifi is generally
disabled. This is set to true when the user selects "switch"
in the dialog without setting the "Don't ask again" checkbox.
4. Add a hidden setAvoidUnvalidated API to ConnectivityManager to
set the avoidUnvalidated bit.
5. Additional unit test coverage.

Bug: 31075769
Change-Id: I1be60c3016c8095df3c4752330149ce638bd0ce1
onnectivityServiceTest.java
6ad5f92512462f774a2ff7e59abdf5edbfd215b3 19-Sep-2016 Makoto Onuki <omakoto@google.com> Fix DPM unit tests, also fix a log message.

Bug 31446501

Change-Id: I37debbe2f4e983fb8bad026f8dd9bd91b7448dce
evicepolicy/DpmTestBase.java
03f9029bed18338eaca0741eb95649cffb0f1874 09-Sep-2016 Felipe Leme <felipeal@google.com> Fixed mRestrictBackgroundWhitelistRevokedUids usage.

mRestrictBackgroundWhitelistRevokedUids used to be set on
removeRestrictBackgroundWhitelistedUidUL(), which has been refactored
into setUidPolicy().

Fixes: 28791717

Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.NetworkPolicyManagerServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

Change-Id: I097fddd236bf279890a8f466927fdc330360477f
etworkPolicyManagerServiceTest.java
f6192868fa4fcf85130ef40a90d0c96fbbca761d 10-Sep-2016 Wale Ogunwale <ogunwale@google.com> Switched Task to use WindowContainer

Bug: 30060889
Test: Manual testing and existing tests still pass.
Change-Id: Ia56767e47ad3df400e3aa2650f6386cca14659a7
m/WindowContainerTests.java
d90546abd1425873f9a8baa8e6ba6c8fa35f970d 10-Sep-2016 Wale Ogunwale <ogunwale@google.com> Changed WindowContainer to take child type as a generic

Removes the need for sub-classes to cast the children list.
Also means the children list can only contain a single type,
but that is okay.

Bug: 30060889
Test: Existing unit tests still pass.
Change-Id: Ie880f389b8ab790ee65adcdba23b32bdb568854f
m/WindowContainerTests.java
60c326beafb9264e569ac179154d80856ec66f35 16-Sep-2016 Wale Ogunwale <ogunwale@google.com> Merge "Added WindowManager unit tests to pre-submit"
798e6401cf443e0b233691175c6567478398921d 16-Sep-2016 Makoto Onuki <omakoto@google.com> Don't update publisher version code without scanning manifest am: c8c3329dd9 am: 318df80280
am: f4d5e96d0e

Change-Id: Ib121bbf11637d9586f6c20c12cf505e562bd913b
318df80280d9ca5f78b58eae05b3a9816da4e40a 16-Sep-2016 Makoto Onuki <omakoto@google.com> Don't update publisher version code without scanning manifest
am: c8c3329dd9

Change-Id: Idcf25b8710a137b3920b1395df6e98cb4cfa6973
845096ffa36d38f010f4bc1b34c7891ccaf74e93 16-Sep-2016 Makoto Onuki <omakoto@google.com> Merge "Don't update publisher version code without scanning manifest" into nyc-mr1-dev
bfce228eda859a089995807d572b7894ce4b4a5f 16-Sep-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Recycle userIds after hitting the limit"
90eba6d81c22116f537816e37fb3090f9753e792 16-Sep-2016 Julia Reynolds <juliacr@google.com> Merge "Add Notification channels"
5fc70966a770eb33dac2928fb5c4a6a85a872f60 10-Sep-2016 Wale Ogunwale <ogunwale@google.com> Added WindowManager unit tests to pre-submit

Change-Id: Iaba2de367ab478916610d96b0e3f69d34e0b471c
m/AppWindowTokenTests.java
m/WindowContainerTests.java
m/WindowStateTests.java
m/WindowTokenTests.java
0f4533d8a185cdefbbe79b5eb8ff13eef924382c 19-May-2016 Fyodor Kupolov <fkupolov@google.com> Recycle userIds after hitting the limit

Previously the system had to be rebooted to allow reusing IDs of removed
users.

Now removed userIds will be recycled after hitting MAX_USER_ID limit.
In this stage all mRemovingUserIds are released, with the exception of ids
stored in an LRU queue - mRecentlyRemovedIds

Added debug flag RELEASE_DELETED_USER_ID to allow reusing of userIds
immediately after the user is deleted.

Bug: 28822373
Change-Id: Ibde562c69efc1533dbca2f1f8d919bee7473644f
m/UserManagerServiceIdRecyclingTest.java
fdfefdfbcb46ef92bcda5ffb1f9cd8d4774d4059 16-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "More refactoring"
3cd658e1a598e59738bc129c35eecf4cd0f20680 17-Aug-2016 Todd Kennedy <toddke@google.com> More refactoring

* Break apart getSettingsWithBenefits() into separate methods for creating
new settings and updating settings, etc...
* Add more hooks to test equality of setting clones
* Create tests for each subset of functionality

Bug: 30219944
Change-Id: I1fb3d07bb9279f93ba81ada2ff802989ec2c5965
m/PackageManagerSettingsTests.java
be2b3720693fbe61199c8d34b4524fafb04d6c75 15-Sep-2016 Phil Weaver <pweaver@google.com> Merge "Reduce overhead of obtain/recycle a11y checking."
62d20fabf239e26e7dc6bbb2fbf0b1118a51aff0 15-Sep-2016 Phil Weaver <pweaver@google.com> Reduce overhead of obtain/recycle a11y checking.

Change-Id: I643ab028aa23c4727b9e0be0db83238034a23960
ccessibility/AccessibilityCacheTest.java
8d4d235a068a9e7ca778840762b243b0db4b5a2f 15-Sep-2016 Lorenzo Colitti <lorenzo@google.com> resolve merge conflicts of b97129e to master

Change-Id: Ib09134090aa135d88bb807034b262a23c8b40e5f
40b707ed3910b130e499873bc20447c582548ec5 15-Sep-2016 Lorenzo Colitti <lorenzo@google.com> Unit tests for avoid bad wifi networks setting.
am: 73b20938c7

Change-Id: I6491f1a93f93f222e23ef6e5e437631556637e44
73b20938c7b0a27c027204a7d4bdcf18766cb167 15-Sep-2016 Lorenzo Colitti <lorenzo@google.com> Unit tests for avoid bad wifi networks setting.

Bug: 31075769
Change-Id: I21ba20df59ddce5731ef1ebe8846b3f00578a674
onnectivityServiceTest.java
b5e44b796618c376cf535e43aaa86ea4522e7770 16-Aug-2016 Julia Reynolds <juliacr@google.com> Add Notification channels

In this iteration:
-Every app gets a default channel that notifications will be posted
to if they don't specify a channel themselves. The default channel
inherits app-wide settings on upgrade.
-Apps can create new channels without user approval, but apps
cannot change the name of a channel once created, nor can they ever
set the importance.
- When a notification is posted:
- If the channel is marked as 'vibrates', vibration will be
applied to notifications that lack a vibration. unlike the default
notification flag, notifications will retain their custom vibration
if given
- Same with sound and lights
- A notification's importance is the min of the app and channel
importance
- A notification can bypass dnd if: either the app or channel settings
say it can
- A notification's show on lockscreen setting comes from the app first,
and the channel second if the app has no preference

Tests: in cl. also there's a cl for cts and a test app.

Change-Id: I630f99df655800b00586dcfab538d320d04fe0f0
otification/BuzzBeepBlinkTest.java
otification/ImportanceExtractorTest.java
otification/RankingHelperTest.java
63d4ecc7a5c23f1ebbd3d71e5054041d90df9762 09-Sep-2016 Wale Ogunwale <ogunwale@google.com> Moved window focus calculation to DisplayContent

In prep. for using WindowContainer.

Bug: 30060889
Change-Id: Ide3022b3129b3d190f631a07d7589a27c434e0c3
m/WindowContainerTests.java
944b003747f7475ac7b81820f49d17693799f33e 14-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Support for specifying orientation in WindowContainer"
b53fa5bb2e7cf44ebd6bbf95a17c94f2b74933fd 14-Sep-2016 Lorenzo Colitti <lorenzo@google.com> Add test coverage for background networks. am: e14d49ad59 am: 815bbf5678
am: 52e5564427

Change-Id: Ibbb14bd30b9b18799d301f023eb6770affbca518
5136249a7147fb205e1b861c1d42a7d1f13b73cc 09-Sep-2016 Wale Ogunwale <ogunwale@google.com> Support for specifying orientation in WindowContainer

Also,
- Fixed failing tests when they are ran as a package vs.
individual classes due to multiple window manager instance.
- Correct some isVisible logic to so a window container that
is invisible is not said to be visible, because one of its
children is visible.

Bug: 30060889
Change-Id: I1bb8730361be2a9f5ce88cd59b7d57d5a459bde6
m/AppWindowTokenTests.java
m/TestWindowManagerPolicy.java
m/WindowContainerTests.java
m/WindowStateTests.java
m/WindowTokenTests.java
c8c3329dd918b8ea16d6317d19ddee12325800f3 13-Sep-2016 Makoto Onuki <omakoto@google.com> Don't update publisher version code without scanning manifest

- It was (theoretically) possible for shortcut manager to update
the version code for a publisher package without rescanning manifest
shortcuts, if backup happens right after unlocking a user before
SM searches for updated packages. If it happens, then SM will not
scan the manifest for this package until it's updated next time.

So don't refresh the version code during backup, which we only
have to do for launchers but not publishers.

- Also fix the owner-user-id for launchers. (Luckily it's not causing
any issues.)

Bug 31402152

Change-Id: I5d898eb3882b74edaca8b2d5f960849370ffc23b
m/ShortcutManagerTest1.java
e14d49ad5962330a112d46b12d456ecd6bc593b5 20-Jul-2016 Lorenzo Colitti <lorenzo@google.com> Add test coverage for background networks.

Bug: 23113288
Change-Id: Idad62f5f025825f99007ccf7b20f530dc3cf6daa
onnectivityServiceTest.java
9bf04523b49bd4493b5bb1dcdfb3bfcc60e62e41 09-Sep-2016 Winson <winsonc@google.com> Merge commit 'e0b767153ef978a4ca841c9891074717fd979400' into manual_merge_e0b7671

Change-Id: I6b6810db33e4b244cc872abd69d5b18a90547b35
4a8a09d1aba286a36eceaad62f33a57727974e58 09-Sep-2016 Winson Chung <winsonc@google.com> Revert "Fixing issue with old tasks being visible in Overview"
am: 36f3f0337d

Change-Id: Ic89b6a3b204a6f55667df5c1459449092930d859
99cf874cc37727d0a4f5d167a9f0c730860e5ebd 09-Sep-2016 Winson Chung <winsonc@google.com> Merge "Revert "Fixing issue with old tasks being visible in Overview"" into nyc-mr1-dev
36f3f0337de86baf8cf8a5fdd67a95e61dff4bcd 09-Sep-2016 Winson Chung <winsonc@google.com> Revert "Fixing issue with old tasks being visible in Overview"

Bug: 28908500

This reverts commit b258f6a4bd685e5efcb36c02d5817f659e10479b.

Change-Id: I9b3c04358d6ca693ed3fdcd9220af13f81eb704e
m/TaskPersisterTest.java
a14864c78a34b7d6daa75141adcf4aca71b6a1bd 07-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Refactored INetworkPolicyListener callbacks."
dfe07b99b2b9d02a6637c8183fd3a430544d931a 06-Sep-2016 Wale Ogunwale <ogunwale@google.com> Merge "Converted window manager unit tests to use JUnit4"
94cee2b6125db6cc47e210c9dd45906d6a7c4382 06-Sep-2016 Wale Ogunwale <ogunwale@google.com> Merge "Added WindowContainer.removeImmediately to support immediate removal"
0ecfcd1e3a158ab5ee54d822d1a1166b15ba7a3c 06-Sep-2016 Felipe Leme <felipeal@google.com> Refactored INetworkPolicyListener callbacks.

Methods onRestrictBackgroundWhitelistChanged() and
onRestrictBackgroundBlacklistChanged() were replaced by a more generic
onUidPoliciesChanged().

Test: m javac-check RUN_ERROR_PRONE=true
Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.NetworkPolicyManagerServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

BUG: 28791717
Change-Id: I18b2ee4af06802e0d23822b153d1be9b429d5811
etworkPolicyManagerServiceTest.java
c79ad2c006d5ba8c9bc924ded9be21d219f5d8e2 05-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Annotate WebViewUpdateServiceTest so that it will be run continuously."
84d156bc1a2de8d02a8d1a635d2b61b1783caef6 03-Sep-2016 Andreas Gampe <agampe@google.com> NetworkPolicyManager: Annotate test

Annotate test introduced in 57e3d310913ff61ae63c66fcf3d7b64ab9d741a6
with @Test. Fixes the error-prone build.

Bug: 28791717
Test: m javac-check RUN_ERROR_PRONE=true
Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.NetworkPolicyManagerServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"
Change-Id: I03c1cde093be91fe52d83f2f2ffeb69a126a27d5
etworkPolicyManagerServiceTest.java
1de7186c927716ce16b8d383ce2da3b3d32e04dc 03-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Removed deprecated methods from INetworkPolicyManager."
57e3d310913ff61ae63c66fcf3d7b64ab9d741a6 23-Aug-2016 Felipe Leme <felipeal@google.com> Removed deprecated methods from INetworkPolicyManager.

Removed the following methods:

- addRestrictBackgroundWhitelistedUid(int uid)
- removeRestrictBackgroundWhitelistedUid(int uid);
- getRestrictBackgroundWhitelistedUids();

They've been replaced by getUidsWithPolicy() and setUidPolicy().

Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.NetworkPolicyManagerServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

BUG: 28791717

Change-Id: I8f6a569cef84c2be60e3277756283026c0fb5b29
etworkPolicyManagerServiceTest.java
70f21570bfeae8ac7b6d5e670be1e20d144f7805 03-Sep-2016 Winson <winsonc@google.com> Fixing issue with old tasks being visible in Overview am: b258f6a4bd am: f4806c80ca
am: 2a4cd1518e

Change-Id: I8a229f3515bebca4cd8456afae963bb97dac96d6
f4806c80ca1d9f8d275f7c81cd339c27b9c9635a 03-Sep-2016 Winson <winsonc@google.com> Fixing issue with old tasks being visible in Overview
am: b258f6a4bd

Change-Id: I27ba3d057147b5200ac75b9f079d26423c9d0b05
a8c0fe6606dcd5f494cfb7963f12bf2301a2c8a0 02-Sep-2016 Winson Chung <winsonc@google.com> Merge "Fixing issue with old tasks being visible in Overview" into nyc-mr1-dev
a7e3b64507250ab19a1294d58febea03cfa2b327 29-Aug-2016 Wale Ogunwale <ogunwale@google.com> Converted window manager unit tests to use JUnit4

Change-Id: I5248d5fcc9f0f5b44bab1d57f16d1cf2ad4b8209
m/AppWindowTokenTests.java
m/WindowContainerTests.java
m/WindowStateTests.java
m/WindowTokenTests.java
571771c3fc912e63f83b75693c0f3c85ec9622da 26-Aug-2016 Wale Ogunwale <ogunwale@google.com> Added WindowContainer.removeImmediately to support immediate removal

There are 2 types of window conatiner removals. The ones that happen
immediately and the ones that are deferred until the system is in
a good state to handle them. WindowContainer and its child classes
now support both through WC.removeImmediately() and WC.removeIfPossible()
methods.
The method names create a consistency in the codebase and also makes is
obvious what the methods will do.

Bug: 30060889
Change-Id: I459c2eef17e20cefc42e9cc542c9a3c69fc9b898
m/WindowContainerTests.java
148cb3eb64fa81f7d4b2e0f149153edb4924039f 02-Sep-2016 Gustav Sennton <gsennton@google.com> Annotate WebViewUpdateServiceTest so that it will be run continuously.

For tests to be run continuously they (or their classes) must be
annotated to declare their sizes.

Bug: 31261994
Change-Id: I4a6e59adaf26ae6ed451a21056066afe3a9a30af
ebkit/WebViewUpdateServiceTest.java
14a46075fe435460fb0d3e7a0b751aa65c712dc3 02-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes Ia13c8ed5,Ia82aedfd,I99ca0d18

* changes:
Removed debug code that is never.
Switched WindowToken/AppWindowToken to use WindowContainer
Removed child windows from WindowToken window list
d1c3791659572529dbc749b70d1c33bda1bdbc32 16-Aug-2016 Wale Ogunwale <ogunwale@google.com> Switched WindowToken/AppWindowToken to use WindowContainer

Bug: 30060889
Change-Id: Ia82aedfd9ea86410acdcd3a55a7a7fc456be2fc3
m/AppWindowTokenTests.java
m/WindowContainerTests.java
m/WindowStateTests.java
m/WindowTokenTests.java
9ec275cac4c00a825c372a415877354d034c7570 02-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix UserManagerTest#testGetUserCreationTime."
133c627fa011ab139d5aed832f2b36fe28016e81 24-Aug-2016 Sudheer Shanka <sudheersai@google.com> Fix UserManagerTest#testGetUserCreationTime.

Fixes: 31152306
Test: adb shell am instrument -e class com.android.server.pm.UserManagerTest -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I80de0899390d3dd9d7cd058cd9598665cb1f767b
m/UserManagerTest.java
5ef2e14b5953bee86c29b81dce01cb056bead6f3 01-Sep-2016 Phil Weaver <pweaver@google.com> Merge "Add tests for accessibility cache."
e22143e85544295ff518c3977161f71bdcc358a8 01-Sep-2016 Lorenzo Colitti <lorenzo@google.com> Network switch notifications: rate & daily limits am: 84e6f1232c am: 858499b2c0 am: 2c535a4f7c
am: 98ed392cf7

Change-Id: I0c067ec355eb2a50af3c828b1fe3ee8a78e44536
3c947bbba975c1c315ccfa2f645236cde4620b31 01-Sep-2016 Hugo Benichi <hugobenichi@google.com> Network Switching Notifications: add unit tests am: a43a095106 am: 56f1281888 am: cf5f5785c9
am: 216bd99039

Change-Id: Idf4986df6f0f2b232aeaa5e43feb51615089dc71
b118e414cddb767f72d712be45e8e0b52406c8bc 01-Sep-2016 Makoto Onuki <omakoto@google.com> Shortcut: Improve backup & restore am: fc4cf2da34 am: 27b36f4789
am: cecc0916a1

Change-Id: Ib4af06a42b6d940f422c749aeb706cafa828b49a
5b0434ae7bff5c57dbead006c81c6125ccb05214 31-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixed tests that were wrongly merged."
72b817d1e6e5288ce1adf426d77a72a986be7d3a 31-Aug-2016 Tony Mak <tonymak@google.com> Merge "Send ACTION_DEVICE_OWNER_CHANGED broadcast after clearing device owner"
b258f6a4bd685e5efcb36c02d5817f659e10479b 26-Aug-2016 Winson <winsonc@google.com> Fixing issue with old tasks being visible in Overview

- This CL does two things, firstly, it ensures that all first & last
active times are monotonically increasing and independent of the
current system time. This allows us to better keep track of which
tasks are historical and should be hidden, and which are not.
Secondly, this CL moves the tracking of the last visible active time
into the system (per user) where it can be adjusted along with the
task active times when they are loaded.
- Following this CL, all active times in the future will be adjusted on
boot such that old tasks are made relative to the current boot time.
It’s not important exactly what time they are, only that they are
adjusted along with the last visible task active time so that we
always keep track of what is visible.

Bug: 28908500
Change-Id: I4f789df3a6bd825517cf3a70e26fb60deff89d06
m/TaskPersisterTest.java
858499b2c017d9df23a54c7dd058314f59bcab72 30-Aug-2016 Lorenzo Colitti <lorenzo@google.com> Network switch notifications: rate & daily limits
am: 84e6f1232c

Change-Id: Ibf6fa695c5f8ef11c99fe075b59a36f52c5c177b
56f12818883964ab075328f290e1d19e5d0dfa97 30-Aug-2016 Hugo Benichi <hugobenichi@google.com> Network Switching Notifications: add unit tests
am: a43a095106

Change-Id: I940870a6df6a8f57966a52535ed22ec8123fb27d
27b36f4789e6d56e059b46312748fcb9b6e97171 30-Aug-2016 Makoto Onuki <omakoto@google.com> Shortcut: Improve backup & restore
am: fc4cf2da34

Change-Id: I28f431158929dd585b0c7523ee6e16798650f98a
dec5726c43b988d58f73f1f6951644b056233f9b 30-Aug-2016 Makoto Onuki <omakoto@google.com> Merge "Shortcut: Improve backup & restore" into nyc-mr1-dev
c08ecdf36f88c3f24cd34f6da5e4984fb2a63fcb 30-Aug-2016 Felipe Leme <felipeal@google.com> Fixed tests that were wrongly merged.

BUG: 28791717
Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.NetworkPolicyManagerServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"
Change-Id: I6f8b54b0e2113a32af440a8e981e5d1e4e882f64
etworkPolicyManagerServiceTest.java
51a63642408bb5daeb9450eed98162c8a5463846 30-Aug-2016 Felipe Leme <felipeal@google.com> Added missing @Test

BUG: 28791717
Test: none
Change-Id: Iaa574218d2232b3bd8fbce0a9259d25708baebed
etworkPolicyManagerServiceTest.java
a08ca06b7be3abba34d45849b7ecbdb4ba8f94ce 30-Aug-2016 Felipe Leme <felipeal@google.com> Merge "Moar test cases for NetworkPolicyManagerServiceTest."
d6d2855043ae26f8f8b1dadc84a0f7ae25594f2f 30-Aug-2016 Fyodor Kupolov <fkupolov@google.com> Fix AccountManagerServiceTest am: d954357860 am: 658b8e7e4b
am: eac40d9949

Change-Id: I27b4175f949e5416943a2a3782b772ce65b846e6
1970f97e4758224132329a3e0dbe9c3946c4499b 30-Aug-2016 Tony Mak <tonymak@google.com> Send ACTION_DEVICE_OWNER_CHANGED broadcast after clearing device owner

Change-Id: Iaac182c69a30e941da3a017a923247d813881521
Fix: 27261692
evicepolicy/DevicePolicyManagerTest.java
84e6f1232c92988617a1155fd7356f90e6c84b4e 29-Aug-2016 Lorenzo Colitti <lorenzo@google.com> Network switch notifications: rate & daily limits

This patch adds a daily limit to the maximum number of notifications
shown when switching networks.

It also adds a rate limit to prevent rapid successive notifications in
flapping scenarios.

Bug: 31132499
Change-Id: Iccb6d0899646ea6df3cfad32a421922263e0eb85
onnectivity/LingerMonitorTest.java
a43a095106ae71842574115ed69fed2171b4c48c 30-Aug-2016 Hugo Benichi <hugobenichi@google.com> Network Switching Notifications: add unit tests

BUG: 31132499
Change-Id: I9c50a59fe48efdcb51d2517f0a756691700c3ebe
onnectivity/LingerMonitorTest.java
3f98ea1eeef5bed165f77d1cf64b8d4b2dd3f0b4 30-Aug-2016 Victor Chang <vichang@google.com> Merge "forceUpdateUserSetupComplete should have no effect in user build"
888a45960a0f3b8089319a6a4f40c9be29ebf7fb 30-Aug-2016 Suprabh Shukla <suprabh@google.com> Resolving race condition while writing recent taskids am: fd0bd4f39d am: c9e7c49def
am: e59b5664ab

Change-Id: I0a603cc99a2901147a65ded2b54e28d3545ff851
78142789bd81ea1f875a3d6c8012132a2efbe978 29-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix RetailDemoServiceTest."
233cc3ef10d025276ffa280e8d4b58969860ac24 28-Aug-2016 Sudheer Shanka <sudheersai@google.com> Fix RetailDemoServiceTest.

Currently we are using PreloadAppsInstaller initialized with
mock objects. This is creating issues since we are not defining
the behavior of these mock objects. One way to fix this is by
defining the behavior of the mock objects but since we are not
interested in the PreloadAppsInstaller behavior, just create a
dummy PreloadAppsInstaller with no functionality.

Test: Test is passing locally after this patch.
Change-Id: Ic6328303fec99a8eed0aff1b694fa2622e554263
etaildemo/RetailDemoModeServiceTest.java
3d3308d3e476f62664a9c3c31e6bc95bc879e49e 24-Aug-2016 Felipe Leme <felipeal@google.com> Moar test cases for NetworkPolicyManagerServiceTest.

Before refactoring restrict-background into a UID policy, it's important
to make sure apps receive the proper ACTION_RESTRICT_BACKGROUND_CHANGED
intents.

BUG: 28791717

Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.NetworkPolicyManagerServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

Change-Id: I32b2e36750ce4640b57d9b1d29dc53ec641456fa
roadcastInterceptingContext.java
etworkPolicyManagerServiceTest.java
32228e4748b65da1c16094c82ab3ade1b063f7fe 29-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Convert notification tests to use JUnit4"
0ffe755d9fbabaffc5975bff3e81c165ae5f4a81 29-Aug-2016 Geoffrey Pitsch <gpitsch@google.com> Convert notification tests to use JUnit4

Change-Id: I3d59b67819981a110bc77932fd2d9b6625a19ada
otification/BuzzBeepBlinkTest.java
otification/RankingHelperTest.java
otification/RateEstimatorTest.java
otification/ValidateNotificationPeopleTest.java
b79f06a47610d87a2eb81ae83ccdaf9336229bff 10-Aug-2016 Felipe Leme <felipeal@google.com> Removed screen on/off callbacks from NPMS.

NetworkPolicyManagerService (NPMS) used to depend on screen on/off
changes to determine if a foreground activity should have network
restrictions, but such check is now redundant since ActivityManager
already changes the proper UID state (like going from TOP to
TOP_SLEEPING) when the screen status is changed.

Removing such code decreases the NPMS lock contention when the screen is
turned on in about 3-5ms.

Change-Id: I2853443efedbf14961ae9a5b2e72689d4d1a646c
BUG: 30785671
(cherry picked from commit 88f40ad9a721ee30708be82f66fb58c64f1d36b5)
(cherry picked from commit f8dd7b4e8d548274c680644a2225951b97e94a4f)
etworkPolicyManagerServiceTest.java
34a752d4ecf26bc6fb93b941989b9b340040a7b1 27-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixed getUidsWithPolicy()."
0f149f412b5491911ec975c051f8cf76d02c4e2c 26-Aug-2016 Fyodor Kupolov <fkupolov@google.com> Update services info before returning authenticators am: 814464894c am: 7540b79fee am: 69192b00e6
am: 44811aba74

Change-Id: Ie65a1d569c78860b4f5212ddf257408328267398
e90e0a74adf33f3d0ed0f2617520ab72b3b5d624 31-May-2016 Christopher Wiley <wiley@google.com> Fix race conditions between Tethering and TetherInterfaceStateMachine

Previously, Tethering would answer requests for current tethering state
by calling methods on instances of TetherInterfaceStateMachine to build
up that state. This is incorrect, since state queries can come in on an
arbitrary thread, independent of updates to the state machines
instances.

Fix this by:
- Altering TetherInterfaceStateMachine to push consistent state
snapshots to Tethering via notifyInterfaceStateChange()
- Storing the last state snapshot in Tethering.mTetherStates
- Removing public methods to query TetherInterfaceStateMachine state.
- Consistently synchronizing access to Tethering.mTetherStates

Bug: 29009601
Test: WiFi Tethering continues to work, unittests continue to pass

Change-Id: Ied334f5e8739bc3aff1b08a1079095b9cc2a7958
(cherry picked from commit de4819dc82b734036b22416228327d2712e01884)
onnectivity/tethering/TetherInterfaceStateMachineTest.java
cd0cfbbc61168b61360a6247b4a826494deb3912 31-May-2016 Christopher Wiley <wiley@google.com> Tethering: Own WiFi tethering state and lifetime

- Add logic to Tethering to track whether the user has requested
tethering via WiFi.
- Subscribe to intents regarding soft AP state to enable and
disable tethering when the AP comes up or goes down.
- Refactor IP configuration logic to do configuration for WiFi
as well as USB.

Bug: 29054780
Test: WiFi tethering continues to work on angler
Tethering related unittests continue to pass.

Change-Id: I6eff2573ca3fd11fabcf138c468ba517ff2daf65
(cherry picked from commit f1315c3cd6d77e812ae32fe038b4e8bf2e70d5bf)
onnectivity/tethering/TetherInterfaceStateMachineTest.java
f972edcae7386d0dfc596aaa01e97d039dd1e0e2 24-May-2016 Christopher Wiley <wiley@google.com> Consolidate cleanup logic in TetherInterfaceSM.TetheredState

This pushes all TetheredState cleanup logic into a single place.
All new unittests fail without the changes to TetherInterfaceSM.

Bug: 28915272
Test: Compiles, unittests pass, WiFi tethering continues to work.

Change-Id: Ia7bf210e00e9a54f2797baebc2e5333ce314c947
(cherry picked from commit f54c5a932a9ac4a491ce775b21ff8288e40b5bad)
onnectivity/tethering/TetherInterfaceStateMachineTest.java
9bc0df24827336889d3100542536595c2809c3ce 25-May-2016 Christopher Wiley <wiley@google.com> Annotate TetherInterfaceStateMachineTest for APCT

APCT needs a little additional magic to pick up JUnit4 tests.

Bug: 28958508
Test: Tests continue to pass

Change-Id: Ia45d91bb3b06e60e3a46ffe738d4468356e066b3
(cherry picked from commit d905add4747d6060355c44dac1dce0eccd8014fb)
onnectivity/tethering/TetherInterfaceStateMachineTest.java
afc46a7cbfec7150c35716b3aba0f20b08115e92 23-May-2016 Christopher Wiley <wiley@google.com> Rely on Tethering mutex for TetherInterfaceSM

Stop passing Tethering's mutex into TetherInterfaceSM, and instead
simply rely on Tethering to acquire its own mutex when accessing
instances of TetherInterfaceSM.

While here, remove some boolean fields (previously guarded by the mutex)
which duplicate state information.

Change-Id: Ie6b2128970981786a5d64fbf700c9f3d0a6721fb
Test: Compiles, unittests pass, WiFi tethering continues to work.
Bug: 28910007
(cherry picked from commit 4bc8d6b1ac0cb7d4192c829a44d988516f0adbdb)
onnectivity/tethering/TetherInterfaceStateMachineTest.java
4622c2d8b65e267ede15bffd903faaf917642d7e 24-May-2016 Mitchell Wills <mwills@google.com> Rename TetherInterfaceSM to TetherInterfaceStateMachine

Change-Id: I324690b20f37cef6d58872e21b126a87d16f7ec8
(cherry picked from commit c5baad02503d17a812ee1b44cc817c7e18935ff1)
onnectivity/tethering/TetherInterfaceSMTest.java
onnectivity/tethering/TetherInterfaceStateMachineTest.java
179ea1b19c5a93b01a359d80d24286ed30ab6447 21-May-2016 Christopher Wiley <wiley@google.com> Remove dead code from TetherInterfaceSM

Because no code outside of unittests ever issued these commands
to TetherInterfaceSM, we never executed any of the removed codepaths.

Change-Id: Id54f6e4eaeff8b3486cd78ddcc8c2a31011e6436
Test: Compiles. Unittests continue to pass.
Bug: 28798823
(cherry picked from commit 2ea4166c74e70d3796b06c91f37eb03eecdf4773)
onnectivity/tethering/TetherInterfaceSMTest.java
0f6605721e1778f67c3bca08401dab95712a6f9a 21-May-2016 Christopher Wiley <wiley@google.com> Remove transient StartingState from TetherInterfaceSM

This state immediately switched into the TetheredState.
We can safely remove it at only the expense of a misleading state
broadcast.

Bug: 28798823
Test: runtest frameworks-services -c
com.android.server.connectivity.tethering.TetherInterfaceSMTest

Change-Id: I295d830dbdb11717d6e05161d97787ffe871beb3
(cherry picked from commit 79e7fde00d74c2b6d329f7341029ea6b04ac2d97)
onnectivity/tethering/TetherInterfaceSMTest.java
279eca3de6f0eb3cd9a947991fe9d1d5d2cd13c1 20-May-2016 Christopher Wiley <wiley@google.com> Expand test coverage of TetherInterfaceSM

Add tests for most normal case operations:
- State machine startup.
- Entering a tethered state (as USB interface and not)
- Handling the first notification of an upstream interface
- Handle changes in upstream interface
- Handle unrequested teardown correctly

Bug: 28833951
Test: These tests pass

Change-Id: I2c0c9141bab9eaa92faec8de10fa653fb6236a74
(cherry picked from commit 1b3830a2afab565a38572ac5c3238a171b2d56d4)
onnectivity/tethering/TetherInterfaceSMTest.java
08725a8c4042aee177774f6275811aa88f26ef30 19-May-2016 Christopher Wiley <wiley@google.com> Add demonstration unittest for TetherInterfaceSM

Prove that the concept works by writing a trivial test.

Bug: 28833951
Test: `runtest frameworks-services -c
com.android.server.connectivity.tethering.TetherInterfaceSMTest`

Change-Id: I51911cef7f0d5165221845070befd085497c21a6
(cherry picked from commit 1cc6ffd2b32846996520fdf43125da3ec2bbdf49)
onnectivity/tethering/TetherInterfaceSMTest.java
3577ed2556f20f7ab09e58b6b286217c7e1560c9 25-Aug-2016 Victor Chang <vichang@google.com> forceUpdateUserSetupComplete should have no effect in user build

Bug:30031808
Change-Id: I908a495633e03ace770a8ec19196841d19dfd41d
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
658b8e7e4bcaf66b71d0b4a62140153d6a79302a 26-Aug-2016 Fyodor Kupolov <fkupolov@google.com> Fix AccountManagerServiceTest
am: d954357860

Change-Id: Iefa213fafbfb9893af659b5300d662e365667e85
4be496d2d035b356f4e1a0019127939ce1681724 26-Aug-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Fix AccountManagerServiceTest" into nyc-mr1-dev
c9e7c49defee81a66459fbdd6b60e4cd94495c9d 26-Aug-2016 Suprabh Shukla <suprabh@google.com> Resolving race condition while writing recent taskids
am: fd0bd4f39d

Change-Id: I2bfd5c68c6a5a9989a9dab6038313a5d5849b765
769bc6c8b105abb37af10ac384b451510c789287 26-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Resolving race condition while writing recent taskids" into nyc-mr1-dev
b010b1270fc524befdb9ebc3b3687a37ef1b71b9 18-Aug-2016 Phil Weaver <pweaver@google.com> Add tests for accessibility cache.

Also adding ability to check for unrecycled objects.

Also fixing a few missing recycles and making sure we
track initial focus if it arrives without an event.

Change-Id: I4d22565ae69946a19f4acb1ac726832f4347340d
ccessibility/AccessibilityCacheTest.java
d9543578609c6035aa97844b45143a2ce6ff1bfe 26-Aug-2016 Fyodor Kupolov <fkupolov@google.com> Fix AccountManagerServiceTest

Unregister AccountManagerInternal before creating a new instance of
AccountManagerService, otherwise it will cause:
java.lang.IllegalStateException: Overriding service registration

Also overrode MockPm.addOnPermissionsChangeListener to be a noop and
not throw an exception.

Bug: 31071079
Change-Id: I0d24232eba655a68bf3fb38d7aa9edb92d469cea
ccounts/AccountManagerServiceTest.java
f0b83021095de3c922be9ecdfa2e66e0cdea9228 25-Aug-2016 Phil Weaver <pweaver@google.com> Revert "Dispatch a11y events in separate thread."
am: 5de2feab26

Change-Id: I0dcc9172c397dd44888de3295e5a34245b122096
1bb2cc8cc3065923c9dc69a17dcdd0094f758a1d 25-Aug-2016 Phil Weaver <pweaver@google.com> Merge "Revert "Dispatch a11y events in separate thread."" into nyc-mr1-dev
5de2feab261831e2d6fbe28eab53b884860cd6ea 25-Aug-2016 Phil Weaver <pweaver@google.com> Revert "Dispatch a11y events in separate thread."

This reverts commit c34649411d053185b3572c4cd924e6f14295d8cd.

Dispatching accessibility events in their own thread is causing Chrome and gmail to crash. We've identified two issues: Chrome is allocating strings natively using references that aren't valid outside of their thread, and the text is being set to values that are changed in the UI thread.

I'm going to resolve these issues on master by making deep copies of the strings, but that change will have its own performance implications.

Since we were bit almost immediately by an unexpected result of this change, and I need to erode its benefit by making deep copies, I think it's a bad bet to push it into MR1.

Bug: 31042124
Change-Id: I6f5c225a9197036db43fd0ac6008447b22617525
ccessibilityManagerTest.java
7540b79fee975d9b6f46ab0aadcc05da88450071 25-Aug-2016 Fyodor Kupolov <fkupolov@google.com> Update services info before returning authenticators
am: 814464894c

Change-Id: I3d7eb42ef73ad77cb44c251a493ae967bcc0f651
814464894c16cc53bae7ba80b784bd3179123847 24-Aug-2016 Fyodor Kupolov <fkupolov@google.com> Update services info before returning authenticators

Added RegisteredServicesCache.updateServices method which allows callers
to request an update to services for which package has been updated.

Added a call to updateServices in getAuthenticatorTypesInternal

Test: Manually tested update flow on test authenticator with an artificial
delay in broadcast handling
Bug: 30979262
Change-Id: I499b2ee0be53fed01201c56068d929b6d621a78e
ccounts/AccountManagerServiceTest.java
6f51a0afe9237d36c374d5c202842292b9ba2a46 25-Aug-2016 Felipe Leme <felipeal@google.com> Fixed getUidsWithPolicy().

UID polices are stored as flag, but getUidsWithPolicy() was checking for
their exact values.

Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.NetworkPolicyManagerServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

BUG: 28791717
Change-Id: I923b4f63636a32e42cadda5bbb59268267e899c0
etworkPolicyManagerServiceTest.java
fd0bd4f39deb2efdcc2f01911fc74bd5593cf6b0 24-Aug-2016 Suprabh Shukla <suprabh@google.com> Resolving race condition while writing recent taskids

There was a race condition, due to which, by the time
TaskPersister started writing the taskids to the file,
the user was stopped and its data from memory was unloaded,
resulting in a NullPointerException

Bug: 30944155
Change-Id: Iac3333b7744241c90a7769686983e3f16e6880c1
m/TaskPersisterTest.java
d3ca5980f7d85e706d39af6da26686b6632f1d46 24-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Refactored whitelist restrict background uids."
fc4cf2da34335fd7e84c020f51eea1a341d3f134 24-Aug-2016 Makoto Onuki <omakoto@google.com> Shortcut: Improve backup & restore

* Catch RuntimeException from restore, in case restoring from a
partner device with an incompatible file format.

* When a restore target app is already installed, and
- if it has allowBackup=true, we'll restore normally, so all
existing shortcuts will be replaced. (but manifest shortcuts
will be re-published anyway.) We log a warning on logcat.

- if it has allowBackup=false, we don't touch any of the
existing shortcuts.

Bug 31057974
Bug 30766177

Change-Id: Ic3f7e860e7ea0d086fc589d8cbed8c4cebdd4bc6
m/ShortcutManagerTest1.java
e959e8f9ab539d52f6910e3c6c3c3459a5736888 24-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix UserManagerTest#testSwitchUser."
66f73a87b132c9f9ec04e685e361e11de05ef65b 24-Aug-2016 Sudheer Shanka <sudheersai@google.com> Fix UserManagerTest#testSwitchUser.

ActivityManager.getCurrentUser() will return the targetUserId right
after ActivityManager.switchUser() is called. So, it is not a good
signal for the test to figure out if user switching is completed or
not. Instead just rely on the USER_SWITCHED broadcast.

Bug: 31045777
Change-Id: I58bff8a42ef4fa15c8667708f5956865b6417934
m/UserManagerTest.java
6b457506a4006e619d9323fcc8c09619e15f8fdf 24-Aug-2016 Makoto Onuki <omakoto@google.com> Do not scan system apps unless after OTA am: 3366328245 am: 140f6f5b8c
am: b26e2ed76c

Change-Id: I339086fae6129c53970356cf86019258dd394604
eabb482ab833c6c7e5117e33d2039bdcfce3fb69 23-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Removed the POLICY_ALLOW_BACKGROUND_BATTERY_SAVE constant."
46b451fa7da6c0323e80616409cf467d5b1fd01f 19-Aug-2016 Felipe Leme <felipeal@google.com> Refactored whitelist restrict background uids.

On Android N, the list of UIDs whitelisted was kept in a separate array
and XML tag, while in reality it should be a new UID
policy (POLICY_ALLOW_METERED_BACKGROUND).

This change refactors NetworkPolicyManagerService to use the new UID
policy, although without removing any of its existing methods (but
marking them as deprecated).

Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.NetworkPolicyManagerServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

Test: cts-tradefed run commandAndExit cts --skip-device-info --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker --skip-preconditions -m CtsHostsideNetworkTests --abi armeabi-v7a -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests

BUG: 28791717

Change-Id: I39869efda554ca0b736dd2380e439474f91dfbe6
etworkPolicyManagerServiceTest.java
8546a444800b331d0c373b12aa196050049c57bb 23-Aug-2016 Felipe Leme <felipeal@google.com> Removed the POLICY_ALLOW_BACKGROUND_BATTERY_SAVE constant.

That constant was created back in 2014 in the intial Battery Saver
implementation, but it's not used anymore (since the power saving
whitelist is fetched from DeviceIdleController).

Test: m -j32 FrameworksCoreTests && adb install -r -g
${ANDROID_PRODUCT_OUT}/data/app/FrameworksCoreTests/FrameworksCoreTests.apk
&& adb shell am instrument -e class
"android.net.NetworkPolicyManagerTest" -w
"com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner"

BUG: 28791717

Change-Id: Ic2c0bcb9736ce8b40e04fd644953e68241d06a69
etworkPolicyManagerServiceTest.java
017eecace1c97ef23c04ee37046c03149510c5ba 23-Aug-2016 Phil Weaver <pweaver@google.com> Merge "Merge ag/1290921 to master."
0dbf913d78059a83944d85a4859429412f6d6054 23-Aug-2016 Phil Weaver <pweaver@google.com> Merge ag/1290921 to master.

Original commit:
Dispatch a11y events in separate thread.

Moves the IPCs into a separate thread, where they should affect
jank a lot less.

Bug: 30183085
Change-Id: I7bc8a777fe76dd76f661cc3e3e1d45a2a28df0d2
ccessibilityManagerTest.java
3366328245621fa6e8fd764a4d3c2f073774d096 23-Aug-2016 Makoto Onuki <omakoto@google.com> Do not scan system apps unless after OTA

Bug 30956231

Change-Id: I4af34cdd39cfaf0b8712b9ded1ef119efa3e04b0
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
ee7ca454d603e7dbd6a97c0d9acc16c4aaf50ef5 22-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock."
b8f946dc4b24998f14e28573e452ab13ed533347 19-Aug-2016 Felipe Leme <felipeal@google.com> Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.

Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.net.NetworkStatsServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

BUG: 30943463
Change-Id: I3fbdb0918f1d0e68f32afe07ca38d4ef217025df
et/NetworkStatsServiceTest.java
964972c47a4de0ac262c7871aa1e0dd980debdc2 22-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added test case for restrict background lists."
8b47748b9ca75bb071c4637b847ad636f8349108 22-Aug-2016 Makoto Onuki <omakoto@google.com> Merge "Off-load unlocking users onto a worker thread" into nyc-mr1-dev
e88729d3a106807a094ed15891e0d2ef4fb7f73d 18-Aug-2016 Felipe Leme <felipeal@google.com> Added test case for restrict background lists.

BUG: 28791717

Change-Id: I33372bf7732b0fcb75006844dea387af50bc2582
etworkPolicyManagerServiceTest.java
fc7d7a359f800d7320d29055ef3b4b75157aaf13 22-Aug-2016 Felipe Leme <felipeal@google.com> Use @Ignore to explicitly disable a @Test method.

BUG: 30839080
BUG: 31007021
Change-Id: Ia93f6b3c8fd1d2d2826c3b04b05f66339672a7e6
et/NetworkStatsServiceTest.java
3cceca4d58d5c7869caa059f4987fc2b5d6b00f5 20-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add unit tests for RetailDemoModeService."
afe9ccf17e43fe5d6f95b01ceac2dacca1b9e923 20-Aug-2016 Phil Weaver <pweaver@google.com> Merge "Dispatch a11y events in separate thread." into nyc-mr1-dev
085a05cd864252314bcf5c339017a16b68105204 19-Aug-2016 Makoto Onuki <omakoto@google.com> Off-load unlocking users onto a worker thread

Bug 29645168

(cherry picked from commit 3107ff78454d54c0494911bf69ca952152af7cf0)

Change-Id: I3f8e768f6afeb6386a08ba9ac48e0e206395da2b
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
3107ff78454d54c0494911bf69ca952152af7cf0 19-Aug-2016 Makoto Onuki <omakoto@google.com> Off-load unlocking users onto a worker thread

Bug 29645168

Change-Id: I50dce4f9227b2f30470ddd5799d8e2cdb90d4d79
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
c34649411d053185b3572c4cd924e6f14295d8cd 04-Aug-2016 Phil Weaver <pweaver@google.com> Dispatch a11y events in separate thread.

Moves the IPCs into a separate thread, where they should affect
jank a lot less.

Bug: 30183085
Change-Id: Ib76159d158e7a867e76cdd5c8ea3a318949fcc5b
ccessibilityManagerTest.java
d9fcb69b81e49cc106d6c53884fdc3aee4822e81 02-Aug-2016 Sudheer Shanka <sudheersai@google.com> Add unit tests for RetailDemoModeService.

Bug: 30571518
Change-Id: I33b1ae9f22a609088c0ad0cd247fe91ccc23bdaa
etaildemo/PreloadAppsInstallerTest.java
etaildemo/RetailDemoModeServiceTest.java
574f370c6da52eeffe747248d68ef044617c7bcf 19-Aug-2016 Felipe Leme <felipeal@google.com> Fixed NetworkStatsServiceTest and converted it to JUnit4.

Most tests were failing because due to a null NetworkCapabilities.
Example:

1) testNetworkStatsWifi(com.android.server.net.NetworkStatsServiceTest)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkCapabilities.hasCapability(int)' on a null object reference
at
com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:983)

BUG: 30839080

Change-Id: Ib81d81df2828fc573c40b26c23af9d80ae43d3f6
et/NetworkStatsServiceTest.java
f8dd7b4e8d548274c680644a2225951b97e94a4f 10-Aug-2016 Felipe Leme <felipeal@google.com> Removed screen on/off callbacks from NPMS.

NetworkPolicyManagerService (NPMS) used to depend on screen on/off
changes to determine if a foreground activity should have network
restrictions, but such check is now redundant since ActivityManager
already changes the proper UID state (like going from TOP to
TOP_SLEEPING) when the screen status is changed.

Removing such code decreases the NPMS lock contention when the screen is
turned on in about 3-5ms.

Change-Id: I2853443efedbf14961ae9a5b2e72689d4d1a646c
BUG: 30785671
(cherry picked from commit 88f40ad9a721ee30708be82f66fb58c64f1d36b5)
etworkPolicyManagerServiceTest.java
e70b54215381c8dd7da6d9791191bc0e6674634c 18-Aug-2016 Adam Lesinski <adamlesinski@google.com> AppIdleHistory: Only write screen on durations during regular sync am: f2d87eba75 am: a61092650c
am: 05f023dcd1

Change-Id: Ie3c9299f999e9c8bb7200606589f796598c64b55
f2d87eba750d15093c996c1dbae7b755a7462478 18-Aug-2016 Adam Lesinski <adamlesinski@google.com> AppIdleHistory: Only write screen on durations during regular sync

Stop writing to disk every time the display goes off. Only write to
disk periodically.

Consequences

Previously, if the device rebooted after the screen duration was written
to disk, apps would appear more stale than they actually were.

Now apps will always look fresher, which is a better scenario.

Bug:30807864
Change-Id: Ia69a2e51fc9e397789215b449fae56fa3e29c74a
sage/AppIdleHistoryTests.java
fb5b680514400241400e3a56189e11c0b6570537 17-Aug-2016 Etan Cohen <etancohen@google.com> Merge "Support timeouts for requestNetwork() invocations."
57faba9ec73fbb311d5ca1df3278aee9728589d5 24-Nov-2015 Erik Kline <ek@google.com> Support timeouts for requestNetwork() invocations.

(cherry-pick of 06c3ef1367e850746eef0a5462bdce8674d74c30)

Bug: 21414325
Change-Id: I08118be8e8cf92fc406d431e99a6c9191a863ff3
onnectivityServiceTest.java
53f7d933be4e618a2ac61a67dd64b2b3a7ba80ea 15-Aug-2016 Todd Kennedy <toddke@google.com> Merge "More settings cleanup"
9f27e7ad34054e7e1d742845983a355eea63f205 13-Aug-2016 Felipe Leme <felipeal@google.com> Migrate NetworkPolicyManagerServiceTest to JUnit 4.

BUG: 30839080
Change-Id: Ic192334389eed7596e1f7cb8ce98a5169262418c
etworkPolicyManagerServiceTest.java
788c8423d19972389b82a23dec297eb27d819c86 10-Aug-2016 Todd Kennedy <toddke@google.com> More settings cleanup

* While parsing the packages.xml file, don't call getPackagesLPw(); we'll
never find a package unless something has gone horribly wrong. Instead,
build the PackageSetting like a sane person and add it to internal
structures.
* Add methods to create a proper copy of the PackageSetting object and
not just the data from one class in the middle of the hierarchy.
* Stop converting Sets into Lists back into Sets when creating
IntentFilterVerificationInfo objects
* Remove the name argument when adding a package setting; it should always
be the name in the package setting

Bug: 30219944
Change-Id: I7fa2c540621fb5d70a59b15919bfd31d8465e25d
m/KeySetManagerServiceTest.java
m/PackageManagerSettingsTests.java
ef13466e4505e5320d376ab5b831c13d0ffa31b4 10-Aug-2016 Felipe Leme <felipeal@google.com> Fixed NetworkPolicyManagerServiceTest.

NetworkPolicyManagerServiceTest had many tests there were @Suppressed
because they were obsolete and harder to fix using Easymocks.

This CL replaced EasyMock by Mockito and re-enabled most tests, although
some tests were removed because:
- It's underlying logic changed too much that.
- It would be hard to mock all external entities they interact with.
- They are covered by CTS tests.

Fixes: 30764608

Change-Id: I53ff86fc9b64cb058846f1aefa244771630d9e1e
etworkPolicyManagerServiceTest.java
88f40ad9a721ee30708be82f66fb58c64f1d36b5 10-Aug-2016 Felipe Leme <felipeal@google.com> Removed screen on/off callbacks from NPMS.

NetworkPolicyManagerService (NPMS) used to depend on screen on/off
changes to determine if a foreground activity should have network
restrictions, but such check is now redundant since ActivityManager
already changes the proper UID state (like going from TOP to
TOP_SLEEPING) when the screen status is changed.

Removing such code decreases the NPMS lock contention when the screen is
turned on in about 3-5ms.

Change-Id: I2853443efedbf14961ae9a5b2e72689d4d1a646c
BUG: 30785671
etworkPolicyManagerServiceTest.java
0ea8fbdb5022405636c48b7842064645d8f3bacc 10-Aug-2016 Makoto Onuki <omakoto@google.com> Fix two shortcut manager issues am: 1e1732399a am: 07974e4f56
am: 4aa8d8b0f0

Change-Id: Ic0b8e958833b301f7809951c24ca3809a3797700
07974e4f56090c397ce4dc31450e6c08c062a850 10-Aug-2016 Makoto Onuki <omakoto@google.com> Fix two shortcut manager issues
am: 1e1732399a

Change-Id: Ie4ea05bbfd65c3bb2bcbefab234fa5c56443dba4
fc134485070712ad90adcabf2f41b19491a6dac1 10-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix two shortcut manager issues" into nyc-mr1-dev
1e1732399a48c9521eea7a117f1f0e87ca64d2ab 10-Aug-2016 Makoto Onuki <omakoto@google.com> Fix two shortcut manager issues

- isUserUnlocked check is still racy
We used a local copy of each user state in mUnlockedUsers, and updated
it in the service lifecycle events. However because
SystemService.onUnlockUser() is called on Handler, there was a brief
window between when the user was actually unlocked and the shortcut
manager thought the user was unlocked.
So now check with activity manager for the latest state too. We still
check with the local copy first, because we want to consider STOPPING
as "unlocked".

- Messenger loses all bitmap icons.
Because we delay-save the shortcuts.xml file, if the device shut down
before we save the XML file but after removing the bitmap files,
we'd lose the bitmaps.

(Apparently SystemService.onCleanupUser() may not be called even when
a device is cleanly shutting down.)

So don't remove bitmap files synchronously, ever, and instead after
saving the XML just run the dangling file cleanup.

Bug 30784267
Bug 30730471

Change-Id: Ie58656efba2dca2b00582e145613bc56266a091e
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
9d7c1ed1254d57933f88e6a3bbd91561d857bab3 10-Aug-2016 Evan Rosky <erosky@google.com> Merge "Add UI-disabled tests for UserController"
081dc35b03e2593a4192cfb1f8223792c9c71bcb 10-Aug-2016 Suprabh Shukla <suprabh@google.com> Fixing admins not being removed from DpmMockContext am: 3cb2b49f44 am: b133a72f8b
am: 91a75a3a82

Change-Id: I6c4738d526cab8ec3b1f5a16f71580e6f8306c55
b133a72f8ba71e4c1609ff324f2f82af84ac2e03 10-Aug-2016 Suprabh Shukla <suprabh@google.com> Fixing admins not being removed from DpmMockContext
am: 3cb2b49f44

Change-Id: I9baefc5e069a2b8d37fa2b6c1e55d9eaebd02f26
521e27d6524fecc2585d29eb8c4cc2ba78fa5dba 10-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixing admins not being removed from DpmMockContext" into nyc-mr1-dev
3cb2b49f443a31b1bb043d0450e350b95acecc8b 10-Aug-2016 Suprabh Shukla <suprabh@google.com> Fixing admins not being removed from DpmMockContext

We were not calling setActiveAdmin before calling setDeviceOwner or
setProfileOwner in these tests. They were passing because the admins
were not being properly removed in the first place. The admin is
actually removed from the admin list inside onReceive of the receiver
passed in sendOrderedBroadcastForUser, which was not overridden to call
onReceive in DpmMockContext.

Bug: 30726135
Change-Id: I08cab5821228738196b229a8f885f7488aaafa34
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
3e0c25bf099e2942ee98b908ee01f82ce5e0bc82 09-Aug-2016 Evan Rosky <erosky@google.com> Add UI-disabled tests for UserController

Added dispatchUserSwitchComplete and failedStartUserInForeground tests
to make sure that WM.setSwitchingUser is called appropriately.

Also set the default for UserSwitchUIEnabled to true.

Bug: 30751014
Change-Id: I9143178cb5da49c0c9524560e9fca2ab6f0d2b00
m/UserControllerTest.java
ffb4fdd8e58b163a1901f8b41887cc7b9cb9f6c9 10-Aug-2016 Makoto Onuki <omakoto@google.com> Rescan apps after restore and re-publish manifest shortcuts am: 377b7970ad am: 51aec5dce5
am: 88223473e5

Change-Id: I26c47df340d751a4234b58fe27e3a1169e7010fb
377b7970ad70e87f8137ea7d9e7a6b00de1826ae 09-Aug-2016 Makoto Onuki <omakoto@google.com> Rescan apps after restore and re-publish manifest shortcuts

Originally when I wrote backup & restore for ShortcutManager,
there was no manifest shortcuts, so there was no need to
handle preintalled apps specially.

However, now we have manifest shortcuts, which are published
when the user is unlocked, by the time restore happens preinstalled
apps may already have manifest shortcuts, which will be overwritten
by the restored shortcuts.

So we need to re-publish manifest shortcuts after restore.

Bug 30746028

Change-Id: I6afbae7790c9ed38483637f33c381ecb6f854677
m/ShortcutManagerTest1.java
43bd311510d65ef22e9723acd0822929b395a210 09-Aug-2016 Makoto Onuki <omakoto@google.com> ShortcutManager improve app udpate check am: 64183d5188 am: bb5db91bf3
am: ce186d4722

Change-Id: Ia3818e54bba40b95c7feaa02d3948bdeae1dfe8e
64183d518813cc65efcaeaf0d4c28de092b32868 08-Aug-2016 Makoto Onuki <omakoto@google.com> ShortcutManager improve app udpate check

- Don't use lastUpdateTime for system apps since it's not reliable.

- Scan downgraded apps too.

Bug 30708050
Bug 30734178
Change-Id: I98253f4c635466197548385275ab08c5e3a1a10b
m/ShortcutManagerTest1.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
m/TestWindowManagerPolicy.java
91355d5901f51b24ac1166a3197f5f9226a92389 06-Aug-2016 Guang Zhu <guangzhu@google.com> add missing dummy implementation of new method in test code

Change-Id: I91b6da823d7e3e44f9a70f9726d45b490b6783b2
m/TestWindowManagerPolicy.java
a28418bfe4977f483cb68c0e02e59747dbc37215 04-Aug-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Update foreground check. am: 33525d2f1a am: 386fd915fc
am: d7f86b7115

Change-Id: I4ebd4315910b35849e970319fa1e265e5b79a4b8
3dc99ea200e3d877af03bf2e67f00b173ee34222 04-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Break out static update method"
13715d521f340d24f1de6e06ceaaf2a945910c0d 01-Aug-2016 Todd Kennedy <toddke@google.com> Break out static update method

Simply getting package settings could changes stored state. Break out
the majority of the method to modify local variables and not change
any stored state. The top-level getPackageLPw() method will still
mutate stored state. This will be changed in a future CL.

Also add a set of tests to verify the behaviour of updatePackageSetting()

Bug: 30219944
Change-Id: I3360a36ce238e816246ee8ca7ecabfbbcdf0b89d
m/PackageManagerSettingsTests.java
m/PackageUserStateTest.java
9bc8543d45fc7f2edf857181940d3719e480a597 04-Aug-2016 Fyodor Kupolov <fkupolov@google.com> Added UserController tests for continuous testing

Bug: 28817048
Change-Id: Iff318652ff2a2e3c58de94b0f74d0d4ad34873b3
m/UserControllerTest.java
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
m/BaseShortcutManagerTest.java
c7381e313d53a3f48b04f707adf2cf0eaf0e9edb 03-Aug-2016 Fyodor Kupolov <fkupolov@google.com> Added AccountManagerService tests for continuous testing

Also removed public visibility modifiers where it was not required

Bug: 30605114
Change-Id: I95be896cdd0c402d2759df7abf2d3517d182f32e
ccounts/AccountManagerServiceTest.java
b3941d2aee8f562a5d16818cfdca7b45dd5e0749 02-Aug-2016 Makoto Onuki <omakoto@google.com> LauncherApps should also throw when user is locked am: 02f338e23d am: 897a4f84d0
am: 88870a84ed

Change-Id: I5f098c71a128c9e51b957e5b391b2d57eca663f9
02f338e23d06499790c6948709afb1587416eb40 29-Jul-2016 Makoto Onuki <omakoto@google.com> LauncherApps should also throw when user is locked

otherwise it'd be racy.

Bug 30406401

Change-Id: I953eb6ae58e029d254d9fdbd5d05a0090b8d2391
m/BaseShortcutManagerTest.java
010b6ce6fd9a7e0ba698d60948631708aed3623f 31-Jul-2016 Winson <winsonc@google.com> Defaulting wallpaper offset to edge of the screen. am: 4b4ba90d66 am: 18faeaa5fa
am: 48f732db3a

Change-Id: I86d0616df8f938b1b80651be83802796a24250b9
f9fdf87af2fe0cb9b70ffa81a0912448f4ef4207 28-Jul-2016 Hugo Benichi <hugobenichi@google.com> IpConnectivityMetrics: no metrics upload in tests

Similarly to ApfTest, this patch changes ConnectivityServiceTest to use
a mock object instead of IpConnectivityLog so that running
ConnectivityServiceTest does not generate android.net.metrics events.

Bug: 30450301
Change-Id: Ibc0479f381f26e60baefbae15407c62aecbf6666
onnectivityServiceTest.java
4830a0c5cabdd8f2c983c3d7c20df5d440fc09ec 29-Jul-2016 Makoto Onuki <omakoto@google.com> Prevent shortcut access when user is locked am: 9c850012ca am: cab2462e38
am: 890f85d70f

Change-Id: Ie6653dcc55b37598a45987d938f07ba31e173ef5
f31c001c2caaa457c7551b90a2fe90e49c73787d 28-Jul-2016 Fyodor Kupolov <fkupolov@google.com> Merge "More tests for UserController"
9c850012cacf0af4a392294566a8c7c897dc8771 27-Jul-2016 Makoto Onuki <omakoto@google.com> Prevent shortcut access when user is locked

Also add some test utility methods that'll be used by CTS.

Bug 30406401

Change-Id: I9396acebbdb3cbe64f6e85877ee62a2131cd6e61
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
m/ShortcutManagerTest6.java
m/ShortcutManagerTest7.java
3b24e5b9d06be5740383e132c02929ff9bfe8715 27-Jul-2016 Fyodor Kupolov <fkupolov@google.com> More tests for UserController

Tests for dispatchUserSwitch and continueUserSwitch. Added TestHandler to
record messages being sent.

Bug: 28817048
Change-Id: Ica2a8de473e5955cd7b1291c1796ee7e2f80ddb3
m/UserControllerTest.java
266ceaf011e118f5a28c8930ba04d3725522dbf7 27-Jul-2016 Todd Kennedy <toddke@google.com> Fix tests

These have been broken for a long time [not sure how long]. Also take
the opportunity to convert these to JUnit4 tests.

Change-Id: Ie80207f905868a0cc1a73cb1f540828d11b21d11
m/PackageManagerSettingsTests.java
b0da71d9a14c9e0836e4ec82dba9b43bcc1c2237 22-Jul-2016 Makoto Onuki <omakoto@google.com> Fix intent flags am: 7e5c3e8542
am: bada0535d5

Change-Id: Iefd569a147aea40118be645bbfe55456ecced810
7e5c3e85420a255bd79242dd97b90340c6e3a4df 22-Jul-2016 Makoto Onuki <omakoto@google.com> Fix intent flags

Bug 30307198

Change-Id: If127001320dcabdc53ee73860dbb9983cb25b611
m/ShortcutManagerTest1.java
518b88eed32f3ec0986b1780f0a9e695f86a1e5e 22-Jul-2016 Makoto Onuki <omakoto@google.com> Unit tests for \\"cmd shortcut\\" am: 0b9d1db5c1
am: 7d9f3e2ba3

Change-Id: I08ea6a4a92bdd23357d11b4624bd10c3704d3734
df4e733bf729ec74757dd24c2a24867444fa01db 22-Jul-2016 Makoto Onuki <omakoto@google.com> Follow-up to multiple intents support am: 0eed441c0c
am: b6ed7b7552

Change-Id: I1034eaa7670c7fa983ddffcce295979ec86bde89
7d9f3e2ba3deb870e95ec4eb479c9a74beba4d8b 22-Jul-2016 Makoto Onuki <omakoto@google.com> Unit tests for \"cmd shortcut\"
am: 0b9d1db5c1

Change-Id: I7461b7b5427a8c597bf5b3903c66a98a3dca25f8
3fa345b5c2cf5d7fd8c87e44d1887f011787c548 22-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Unit tests for "cmd shortcut"" into nyc-mr1-dev
0eed441c0cf3bd03b8ac780e62fbeae5d7fcac4b 21-Jul-2016 Makoto Onuki <omakoto@google.com> Follow-up to multiple intents support

- More unit tests
- LauncherApps.startShortcut() now supports sourceBounds
(again)
- Updated the javadoc.

Bug 30218829

Change-Id: Iae208ffd4911d149246ccfd0c4380544c2aafffc
m/ShortcutManagerTest2.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
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
m/ShortcutManagerTest4.java
c46befc7cb8260e6bdcaedaf0e8c63418d74f13b 20-Jul-2016 Wale Ogunwale <ogunwale@google.com> Merge changes Ia451b623,I1dd2c460

* changes:
Switched WindowState to use WindowContainer for managing children
Added WindowContainer and WindowContainerTest classes.
c4e7f7abb4b75aaab8d33aae92ffa5ca1f53aba4 20-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Made WindowState.mParentWindow private scoped."
7bf6080e967a34ce405b62edba5668c2e82dbbca 20-Jul-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Added unit tests for UserController"
140df85b137e620bdc98652a08a81fc03b51cc1c 20-Jul-2016 Phil Weaver <pweaver@google.com> Merge "Add tests for accessibility motion event injector."
d63594a8d116b9fb25a031cb489ca033f716226a 18-Jul-2016 Wale Ogunwale <ogunwale@google.com> Added WindowContainer and WindowContainerTest classes.

The WindowContainer class defines common functionality for objects that
can hold windows directly or through their children
(e.g. WindowState, Task, AppWindowToken, ...). The WindowContainerTest
class as the name implies contains tests for the WindowContainer class.

Bug: 30060889
Change-Id: I1dd2c460c56cfc82aee67c033032a96843ed051d
m/WindowContainerTests.java
caa53afa0cae85a69da1b5bfb9b8368b152c917b 17-Jul-2016 Wale Ogunwale <ogunwale@google.com> Made WindowState.mParentWindow private scoped.

Bug: 30060889
Change-Id: Ic1d702cb6329fb2f03d006939f5610681d1d07bd
m/WindowStateTests.java
e1f90ac94a2648cc3dfef5e12676f2343fa97edf 20-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Stop adding FLAG_ACTIVITY_RESET_TASK_IF_NEEDED when...\\" into nyc-mr1-dev am: ceadb1a86a
am: c74ed0d6dc

Change-Id: I0c66444e1352af26bf7c039271a5bee952eb5e52
347a6bd82059bc7581b1dcd229228f622c5cfca1 19-Jul-2016 Makoto Onuki <omakoto@google.com> Stop adding FLAG_ACTIVITY_RESET_TASK_IF_NEEDED when...

starting a shortcut.

- Also add API surface to support launching multiple intents

- Also add SM.isRateLimitingActive() which was supposed to be
added but was not due to a bad rebase.

Bug 30218829

Change-Id: I82d60ec0df1e2b889538705f9f8870ee727dd55d
m/ShortcutManagerTest2.java
d6038db83d06524daa4f411081fbe48e595e7a2c 23-Jun-2016 Fyodor Kupolov <fkupolov@google.com> Added unit tests for UserController

Initial version UserControllerTest. So far it only tests startUser method.

Bug: 28817048
Change-Id: I56a9e1e0b7c9419402dc27204d2ee95e273e23cd
m/UserControllerTest.java
adde52ee32b656bb436f7e92f39f7d0d97cc9306 16-Jul-2016 Wale Ogunwale <ogunwale@google.com> Made WindowState.mChildWindow private scoped

This involved:
- Moving method that operated on mChildWindows and mostly touched
WindowState fields into WindowState class.
- Creating new methods for getting information about child windows
outside WindowState class instead of accessing the child list directly.
- And, tests ;)

Bug: 30060889
Change-Id: I339cecb926b44b5db7ead1970e356304d5429c8f
m/TestWindowManagerPolicy.java
m/WindowStateTests.java
9d14790d299d1e2b96db287601c86f82850019c9 16-Jul-2016 Wale Ogunwale <ogunwale@google.com> Track hidden state of window in itself vs. all child windows.

It makes the code easier to follow if the hidden state of a window
is tracked in itself vs. all chils windows. Child windows can call
WS.isParentWindowHidden to get the hidden state of their parent window.

Also, moved the performShowLocked method from WindowStateAnimator to
WindowState since most of the fields modified in the method belong to
WindowState.

And, don't forget the test for the change ;)

Bug: 30060889
Change-Id: I5be13b936a2284fd8fe10218b80fe41cc197d1a7
m/WindowStateTests.java
4ce896ca7afb2d32e58f340856d077491be23016 19-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Added foundation for supporting unit tests in WindowManager"
b699ce0d06eb6be91c0be0a791d8d8d7c68b4f41 18-Jul-2016 Wale Ogunwale <ogunwale@google.com> Added foundation for supporting unit tests in WindowManager

- Check for null where appropriate when using WM from a test
- Inject WindowManagerPolicy for test can have its own policy
- Added skeleton for WindowStateTests that will contain tests
for WindowState class.

Bug: 30060889
Change-Id: I0cd7d50c98de16c7412759401075c4bb48d13dfe
m/TestIWindow.java
m/TestWindowManagerPolicy.java
m/WindowStateTests.java
0b9d1db5c1aab9017daf05abd0ba0f4de2c7192d 18-Jul-2016 Makoto Onuki <omakoto@google.com> Unit tests for "cmd shortcut"

Also removed unnecessary commands.

Bug 29612099

Change-Id: Id554163c861fb144cb5140d7eb709178347f7868
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest6.java
m/ShortcutManagerTest7.java
m/UserRestrictionsUtilsTest.java
cd74b3050d2e271556cabc7870a9b8bc3ba67fed 18-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Implement dumpsys --checkin for shortcut manager\\" into nyc-mr1-dev am: 121480cda8
am: 3991a376e5

Change-Id: I3ccc92a0a9f6bfcce5207ef29db73063ec50a9f8
d03dd1dcd30e3ca9a7d2f44923db759eb65929b2 18-Jul-2016 Sudheer Shanka <sudheersai@google.com> Merge "Add more UserMananger related tests."
121480cda876f2a6ec3d5ce59c85922721b42890 18-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Implement dumpsys --checkin for shortcut manager" into nyc-mr1-dev
17e94691c2fe290d3ed9e06aa48709d062e82b40 16-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Don\\'t accept resource references in string fields\\" into nyc-mr1-dev am: 6fa0e4d518
am: 3d3e2e2b17

Change-Id: Ib5a83728239cfa074fb9800b76bc217dcf990b30
6fa0e4d518a67380fada76bb78b4e7b697b4d7a4 16-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Don't accept resource references in string fields" into nyc-mr1-dev
d36651717e591ed687f4964d13656c0a52390dba 16-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Cache the default launcher.\\" into nyc-mr1-dev am: cf99263662
am: 6406be311c

Change-Id: If7d3f5325388242a196d78f8429c4aba65ef041e
76269928e677725e2d9b28e2e3aa79961a60a1d0 15-Jul-2016 Makoto Onuki <omakoto@google.com> Implement dumpsys --checkin for shortcut manager

Dump the very basic stuff for now.

We need to update GMS-core to actually collect the information.

Bug 28535604

Change-Id: I6ce17ee2014786a0ef97f3dc973b8a01c2d2a814
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest2.java
a7dcedc65fbdae3625f25e1a40756d251a5a586b 15-Jul-2016 Phil Weaver <pweaver@google.com> Add tests for accessibility motion event injector.

Change-Id: If871f0a67d9265683fcbbabea382d54f3898a4c5
ccessibility/KeyEventDispatcherTest.java
ccessibility/MotionEventInjectorTest.java
1030520822c42cc7357b463d301c7e97e928ba22 15-Jul-2016 Makoto Onuki <omakoto@google.com> Cache the default launcher.

Originally we always checked with PM for the default launcher,
which would take ~2ms.

Now we cache the result, and clears the cache when (any) preferred
activities change.

Bug 30126557

Change-Id: Iceef288cd372c8bb9b119aa493e5173d894f2302
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest6.java
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
6771d73703d35f2b28b8602dcbbed88fdffb9a0b 14-Jul-2016 Makoto Onuki <omakoto@google.com> Don't accept resource references in string fields

Detect it when a developer accidentally uses @string/... in string fields
and log an error rather than publishing shortcuts with wrong values.

Bug 30140672

Change-Id: I98a60afd7f52282019a94a7a8c30a85ea4c7806b
m/ShortcutManagerTest1.java
a12eeeb4ef4fa1c6a07c984c334c83ecb373f05d 14-Jul-2016 Philip P. Moltmann <moltmann@google.com> Merge \\"Always trigger a write if no pages are written\\" into nyc-mr1-dev am: 965a706282
am: 0c1814a153

Change-Id: I7d7021e4ff9074bf60c22caa2b897245fe8a5f4b
13260b6ff0438a02bd0f1c5bbcfb4fef71c82135 14-Jul-2016 Makoto Onuki <omakoto@google.com> Don't allow shortcuts with non-main activities

Bug 30122758

Change-Id: Id9ead6706d5460fec3d68c7457e3097f30a9a080
m/ShortcutManagerTest2.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
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
c7b4815f232b3bf3dd19e1f8f164303ebcb4692a 13-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Revert \\"Revert \\"Revert \\"Handle package broadcasts before apps do\\"\\"\\"\\" into nyc-mr1-dev am: 6eefe67b2c
am: a74fce83ae

Change-Id: I8dcd074a8075e38416da0d6e3570545f17d6bc15
f34c308dfd9cdda428b8ead8bf655de1608501a9 13-Jul-2016 Makoto Onuki <omakoto@google.com> Revert "Revert "Revert "Handle package broadcasts before apps do"""

This reverts commit 886ba78dfb105eb45416587b73b6c6b336448de5.

With the tests updated.

Change-Id: I162e6ca23c667f90feddc1e9f42b554a416295cf
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest3.java
m/ShortcutPendingTasksTest.java
2adc0c392e3e98e8fccb16f219acbd8b8a3585e2 13-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Revert \\"Revert \\"Handle package broadcasts before apps do\\"\\"\\" into nyc-mr1-dev am: 98802f6007
am: 80dd14e061

Change-Id: I32fcfdc3fb90fe7b0ac14239a721769234c7cb2f
98802f6007eef7a36237087111c38a998a388903 13-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Revert "Revert "Handle package broadcasts before apps do""" into nyc-mr1-dev
886ba78dfb105eb45416587b73b6c6b336448de5 13-Jul-2016 Makoto Onuki <omakoto@google.com> Revert "Revert "Handle package broadcasts before apps do""

This reverts commit efbbe7ea9db8adab6bff407db1d7fc54bbaf31ee.

Change-Id: I3dbb080db5121307f533a7d411f4f5d47225500e
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest3.java
m/ShortcutPendingTasksTest.java
d0866414f962267ba2cee2f06cce70df4ff9568c 13-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Revert \\"Handle package broadcasts before apps do\\"\\" into nyc-mr1-dev am: 7f3187bb0d
am: 5f18bbe034

Change-Id: I05af5e8eb457c19e3dbce414e0e2351c936703ff
7f3187bb0d12d288bc7211549c08adeb5ff651aa 13-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Revert "Handle package broadcasts before apps do"" into nyc-mr1-dev
83118dd723e31a4b352c519e21e1021de651d8f9 13-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Don\\'t backup & restore disabled shortcuts.\\" into nyc-mr1-dev am: 4885b274c1
am: bc15e3ca2b

Change-Id: I457db12fdcc884a121b82320b7d32646133632ca
4885b274c1502b8e478e16d4418b7fd86ab6c865 13-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Don't backup & restore disabled shortcuts." into nyc-mr1-dev
efbbe7ea9db8adab6bff407db1d7fc54bbaf31ee 12-Jul-2016 Makoto Onuki <omakoto@google.com> Revert "Handle package broadcasts before apps do"

And fix b/29939691 (don't try to load locked users) in a different way

Bug 29939691
Bug 29895275

Change-Id: Ib55f9c5d5547c54daa4e05c1e50bf4bbceaf1991
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest3.java
m/ShortcutPendingTasksTest.java
37906f78328dd9d8d148b51fcfceb9fc649df49f 26-May-2016 Sudheer Shanka <sudheersai@google.com> Add more UserMananger related tests.

Fixes: 29077949
Change-Id: Ib0eb24170ee2fff3f43395846d869b88167f297d
m/UserManagerTest.java
f3ba2e04be20d33fee989e782ba1966322e7e263 12-Jul-2016 Makoto Onuki <omakoto@google.com> Don't backup & restore disabled shortcuts.

Also a backup & restore test where an app has manifest shortcuts.

Bug 30016960
Bug 29921267

Change-Id: I8c4c3ece50f26d778b2f8f42251c317eb25d1e14
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.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
2afa465e2c718e63d33fd49e2cdef64c8214f057 12-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Handle package broadcasts before apps do\\" into nyc-mr1-dev am: ae13eee9c6
am: fcf7db9eed

Change-Id: Idfe3e8ed29c9a5fe8870527e5c5d7470455f4989
177c82be7931a5b4df9fe019462bfe24e49864f6 12-Jul-2016 Erik Kline <ek@google.com> Support requesting async LinkProperties/NetworkCapabilities updates am: acdd639513
am: 915d09b5d4

Change-Id: If177966a19c830a106ce689c7e07a7835bb2c1a1
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
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
a2241834a54dc91e2eef858741f1a56a743c27b2 06-Jul-2016 Makoto Onuki <omakoto@google.com> Handle package broadcasts before apps do

- Have PM to call the shortcut manager directly before sending a
pacakge broadcast.

- The shortcut manager will enqueue a task to handle a package
broadcast, which will be executed on Handler.

- At the entry points of all external facing methods, block until
all pending tasks are finished.

Bug 29895275

Change-Id: Ib29fa3c9c8d9b9e0ca5c8f1e9da2a390324960a4
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest3.java
m/ShortcutPendingTasksTest.java
acdd639513858629f804316e9dd4105634504a90 07-Jul-2016 Erik Kline <ek@google.com> Support requesting async LinkProperties/NetworkCapabilities updates

Bug: 9580643
Change-Id: I1d7ba7645c20d7d53f6eef777dfce43727940f13
onnectivityServiceTest.java
1656aa5b7d5afbdf7f887c93cab1e88bc26107a4 07-Jul-2016 Lorenzo Colitti <lorenzo@google.com> Merge \\"Rewrite lingering.\\" into nyc-mr1-dev am: b0a574fbfc
am: 2249ae1c47

Change-Id: Ieff4a63ad1d5959760e69f68e832ca256ec2c2ae
b0a574fbfcb1e81a23e28e1eff1d4b633d2deb9a 07-Jul-2016 Lorenzo Colitti <lorenzo@google.com> Merge "Rewrite lingering." into nyc-mr1-dev
b57578ca4f0fa64406ffad09ad9250391e3bbfa5 30-Jun-2016 Lorenzo Colitti <lorenzo@google.com> Rewrite lingering.

The two major changes here are:

- Move lingering out of NetworkMonitor. The fact that lingering
is currently its own state in NetworkMonitor complicates the
logic there: while a network is lingering it cannot be in any
other state, we have to take care not to leave LingeringState
for the wrong reason, etc.
- Instead of keeping a single per-network boolean to indicate
whether a network is lingered or not, keep a linger timer for
every request. This allows us to fix various corner-case bugs
in lingering.

The changes in behaviour compared to the current code can be seen
in the unit test changes. Specifically:

1. Bug fix: when a network is lingered, and a request is added
and removed to it, the existing code tears the network down
immediately. The new code just sends another CALLBACK_LOSING
and resumes lingering with the original timeout.
2. Bug fix: if cell is unvalidated and wifi comes up and
validates before cell does (as might happen on boot), the
existing code immediately tears down cell. The new code
lingers cell, which is correct because unvalidated cell was
the default network, so an app might have been using it.
3. Correctness improvement: always send CALLBACK_AVAILABLE for
the new network before sending CALLBACK_LOSING. This was not
really an issue in practice, because the usual flow is:
- Network A is the default.
- Network B connects, CALLBACK_AVAILABLE.
- Network B validates, CALLBACK_LOSING.

Bug: 23113288
Change-Id: I2f1e779ff6eb869e62921a95aa9d356f380cf30a
onnectivityServiceTest.java
2e2c64556c491c486b337d8d646595eb81d28489 07-Jul-2016 Jeff Sharkey <jsharkey@android.com> Merge \"Merge \\"Switch network cycle calculation to use Calendar.\\" into nyc-mr1-dev am: 3a4408640a\" into nyc-mr1-dev-plus-aosp
am: 54a704bfcd

Change-Id: I2924d4f96cf0ab52131570a270091d0d9480af0f
f2bead51174374aa92b71ee439ed719d4518a44a 07-Jul-2016 Jeff Sharkey <jsharkey@android.com> Switch network cycle calculation to use Calendar.

The older Time class is deprecated and doesn't handle edge cases
very well. So migrate the cycle calculation logic to use the
long-standing and well-supported Calendar API.

Bug: 28689087
Change-Id: Ic1802b3f8556402f99bfea4cd625c35dfed81ac0
etworkPolicyManagerServiceTest.java
83f104b604509fe102e06741c760570194b60976 05-Jul-2016 Lorenzo Colitti <lorenzo@google.com> Merge \\"Add test coverage for a bug in the lingering code.\\" into nyc-mr1-dev am: b4db945883
am: 759fe4598e

Change-Id: I19439c95167bf215edc67068fb5a6859ab845814
09e202103d160efcb721e3b1ed699416e2b3a5bb 04-Jul-2016 Lorenzo Colitti <lorenzo@google.com> Add test coverage for a bug in the lingering code.

Bug: 23113288
Change-Id: I573ee5908b9d973931234eb7d2db8ea0aaa4b31e
onnectivityServiceTest.java
8c1e36b440e8484123604975620b8675f0ad64a5 25-Jun-2016 Phil Weaver <pweaver@google.com> Add tests for KeyEventDispatcher.

Some minor but needed changes to the class under test to
gain visibility for tests to do things like make events
on Handlers happen on demand to verify various event ordering.

Change-Id: I5096de697906f8d28b47f47dc2be2f8199ee4e19
ccessibility/KeyEventDispatcherTest.java
88dece9144e4806ef54f41cc9273d7c07ee53371 01-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"Make sure re-published dynamic shortcuts are always enabled\\" into nyc-mr1-dev am: 7df9ce075f
am: 39e24512a1

Change-Id: Icfb06157a5fda86708c5a56afe9491ad902caaae
a1fbcadb57e4bb18eef948bed837c1626ec6c387 01-Jul-2016 Makoto Onuki <omakoto@google.com> Merge \\"ShortcutManager: Make sure persisted default launcher still exists.\\" into nyc-mr1-dev am: 5b080d4e90
am: dfbe377b1d

Change-Id: I83ae3f8be3291c3bc2d8a9a4eb3fe5b66957ce19
7df9ce075fddc8f3b4e5f177b41bab864c759e8b 01-Jul-2016 Makoto Onuki <omakoto@google.com> Merge "Make sure re-published dynamic shortcuts are always enabled" into nyc-mr1-dev
ee6b6e4a1861336f8db52d8c93dbf32ee9615cfa 30-Jun-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Make sure persisted default launcher still exists.

- Also make sure to ignore unexported activities.
(e.g. unexported activities shouldn't have shortcuts.)

- Also add unit tests for package manager related operations.

- Also remove stale TODOs (per-activity shortcut count check is
implemented already.)

Bug 29699769
Bug 29516954

Change-Id: Ia18301baf6bec1ad71ae195d9ae3d10bd8386fc4
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest4.java
m/ShortcutManagerTest5.java
m/ShortcutTestActivity.java
ff14f73152775f91fe211729e2cb16a5da6933ab 01-Jul-2016 Makoto Onuki <omakoto@google.com> Make sure re-published dynamic shortcuts are always enabled

- Originally there was explicit code to take over the disabled flag,
which was simply not necessary.

- Also fix the startShortcut() tests that have temporarily
been disabled.

(Also remove the stale TODOs to avoid conflict with Ia18301ba)

Bug 29633681

Change-Id: I58b12ad6918d7fef4b79059b0c2c7f2df6e32269
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.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
4c1cba64f10b2d138b4b96b84198bff2c1ad466d 30-Jun-2016 Lorenzo Colitti <lorenzo@google.com> Merge changes I65784f35,Ib6937335 into nyc-mr1-dev am: 74f7f2ec0d
am: e80e63331d

Change-Id: I5cdfe7e952ceb9da89f775f4cd451cc26ed52401
7369d8d1b6a5118d9b20d72931e22c645945f3bc 28-Jun-2016 Lorenzo Colitti <lorenzo@google.com> Add detailed test coverage for lingering.

Bug: 23113288
Change-Id: I65784f3589378d97f3c824e600f21f361be8741e
onnectivityServiceTest.java
6ee0a92ca04f89081094842487a279cc47e8b5ad 27-Jun-2016 Lorenzo Colitti <lorenzo@google.com> Add more test coverage for requests and callbacks.

1. Support multiple callbacks in TestNetworkCallback. This is
necessary to test situations where multiple callbacks are
generated by the same event (e.g., CALLBACK_LOSING on cell
with CALLBACK_AVAILABLE on wifi when wifi connects), which is
necessary to test callback order. So far this has not been
covered because all callback testing was using per-network
callbacks.
2. Add a benchmark test for registering NetworkRequests and for
sending onAvailable and onLosing callbacks.

Bug: 23113288
Change-Id: Ib69373358ad766ab1bd989e864a5a51ef762c73c
onnectivityServiceTest.java
ea11db15bd0cfe6ecbc44dd80a988ddf0e8c1ce7 25-Jun-2016 Makoto Onuki <omakoto@google.com> Start shortcuts as if publisher apps did using PendingIntent

Bug 29639471

Change-Id: I2aad115669b431cbea785ba92040b1958117ab47
m/BaseShortcutManagerTest.java
79e98777b462be2608b059c6ef458aaba3dfd625 30-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \\"Fix updateShortcuts() with icons\\" into nyc-mr1-dev am: bc8e0052fd
am: 2194bf522c

Change-Id: Ic8dd1a04bf651ef9fa1a969117a7a7c6fcd6089e
0ba4ec6b9243789c22f9017da1076ec3d582b02c 30-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \"Merge \\"Address API council feedback (continued)\\" into nyc-mr1-dev am: 01e51e59dd\" into nyc-mr1-dev-plus-aosp
am: bd7d03ab6a

Change-Id: I4a2dd860bdf4ebdcc6ab420d162579307734fa6f
0f5130bd951ae31e1c02ce4ede44b9c690057c75 30-Jun-2016 Jeff Sharkey <jsharkey@android.com> Move getRecentTasks() to ParceledListSlice. am: 479212cf50 am: ce3c8ac0f4
am: 38b322d171

Change-Id: Id28e985eff80210d5f25d8632db1e98fd111b896
bd7d03ab6af4ebad1bc21eca9a45b654c5f31f5b 30-Jun-2016 Android Build Merger (Role) <android-build-merger@google.com> Merge "Merge \"Address API council feedback (continued)\" into nyc-mr1-dev am: 01e51e59dd" into nyc-mr1-dev-plus-aosp
38b322d1717154d2a0ddf24d4e3f4ce0205cd65d 30-Jun-2016 Jeff Sharkey <jsharkey@android.com> Move getRecentTasks() to ParceledListSlice. am: 479212cf50
am: ce3c8ac0f4

Change-Id: Ie0c3873c46832d1a10b016bafb26e860eba4ec07
bc8e0052fdf92efd0471b97092ee6a7e1eb2320d 30-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "Fix updateShortcuts() with icons" into nyc-mr1-dev
9f22e79625bb914fe59eadce4cf3d927dfe6bfbc 30-Jun-2016 Android Build Merger (Role) <android-build-merger@google.com> Merge "Move getRecentTasks() to ParceledListSlice. am: 479212cf50" into nyc-mr1-dev
3362400aa5a22ded3ec256bc6bbff06d036fdc41 30-Jun-2016 Jeff Sharkey <jsharkey@android.com> Move getRecentTasks() to ParceledListSlice.
am: 479212cf50

Change-Id: Ic76f624396117d922aac60eac9c2caae4f1d7e27
01e51e59dda2253dbbb2ab7eb3f951bf5fa940be 30-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "Address API council feedback (continued)" into nyc-mr1-dev
d6880797f72e1e397e18c6e709c0125f795c7d2e 29-Jun-2016 Makoto Onuki <omakoto@google.com> Address API council feedback (continued)

Got a second set of comments.

Bug 29757958

Change-Id: Ib3a3ffd28bc3e35eb0218b0819870eb5c6ebadb5
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
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
m/ActivityManagerTest.java
dd097812fa84b898a46cb5dd253422e78779a150 29-Jun-2016 Makoto Onuki <omakoto@google.com> Fix updateShortcuts() with icons

But 29822569

Change-Id: I72a0903ccc8acffc42f40d9df7b99ed6de26b66d
m/ShortcutManagerTest1.java
0654d88867965c6414a77a92642b1e34e74243fb 29-Jun-2016 Hugo Benichi <hugobenichi@google.com> Adding tests for DnsEventListenerService am: 5e055187be
am: cc19f2e9bd

Change-Id: I70ac910d67a1e4a7c4f9f3d24f983dce99957151
5e055187bea4f4c96799a3e7fcc5aaaf57740ea3 01-Jun-2016 Hugo Benichi <hugobenichi@google.com> Adding tests for DnsEventListenerService

Bug: 29035129
Change-Id: Iaf0d9ec781da7a473b6f7d8623060ecde44b9cbd
onnectivity/DnsEventListenerServiceTest.java
21b6b821df10c82ca184dccb9c880b3fd4212c41 29-Jun-2016 Hugo Benichi <hugobenichi@google.com> Merge changes I9b4e55c2,I429562a0 into nyc-mr1-dev am: 41a3acc55a
am: ca9a575a79

Change-Id: I948403eb8ff92b2de87d8ce402921b3ede7e0b82
a4abd91a7329d49d7fe542c7a5f27ad07dd7a910 06-Jun-2016 Hugo Benichi <hugobenichi@google.com> Add tests for MetricsLoggerService

Bug: 29035129
Change-Id: I9b4e55c20f4ed3a2a642419369a5d95efbbcb54d
onnectivity/MetricsLoggerServiceTest.java
49f187249d8c14e89c7389827b6e0c46e28bd2a9 27-Jun-2016 Chris Wren <cwren@android.com> Merge \\"use an observer for the default sound\\" into nyc-mr1-dev am: 4e4d325b56
am: f7021b5e06

Change-Id: I9c347978011b65075b33146d268f3dc579170733
4e4d325b56996f4aa72f48d669ddfe8ad628f7b4 27-Jun-2016 Chris Wren <cwren@android.com> Merge "use an observer for the default sound" into nyc-mr1-dev
a9d2a39bb1f2482b03bc8e8473d16b8471c5286e 24-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \\"Shortcut: Only \\"main\\" activities can have shortcuts.\\" into nyc-mr1-dev am: 1af9a58956
am: 312933e043

Change-Id: I26419c323a33bf26f2dea4666e07c64a4e7d6254
d405431bc97087184d1ecb77e4fa495a6ca4709a 24-Jun-2016 Chris Wren <cwren@android.com> use an observer for the default sound

matches other settings use, and also improves testability of buzzbeepblink

Change-Id: I9445448c4c4f24f4f49f7cb1fdcd2f5362944606
otification/BuzzBeepBlinkTest.java
b08790c3b2f3bdb0c2e2f7ff46e4584fb1127769 23-Jun-2016 Makoto Onuki <omakoto@google.com> Shortcut: Only "main" activities can have shortcuts.

- Don't publish shortcuts when their target activities are not main.
- Only scan manifest shortcuts for main activities.
- When an app is updated, remove shortcuts that no longer belong to
valid main activities.

- Also re-publish manifest shortcuts after 'clear data'
- Also listen to PACKAGE_CHANGED and disable/re-publish shortcuts
properly.

Bug 29355786
Bug 29582255
Bug 29601844

Change-Id: I6c701ce669cf30a227bc2af4aa01de467ef73e3a
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
02f355df6b9da34d8e9345d66126058cb2abf88e 22-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \"Merge \\"Shortcut Manager: Address API council feedback and fix TODOs\\" into nyc-mr1-dev am: 3c67b3e47c\" into nyc-mr1-dev-plus-aosp
am: 24c52732d7

Change-Id: Ib54aff79c823b6819d94ef0ef6194e4541bf734f
b5a012fd6f088629746057a3902b5926f9fe8e08 21-Jun-2016 Makoto Onuki <omakoto@google.com> Shortcut Manager: Address API council feedback and fix TODOs

Bug 29515722
Bug 29516909
Bug 29515090
Bug 29516954
Bug 29515088

Change-Id: Ibe1d27033cbd0fd50d37e3d9945b47551211c568
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
m/ShortcutManagerTest4.java
7e346ef8532c28d691236015dba9a79750d326a0 20-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \\"Launcher shortcut callback should deliver manifest shortcuts too\\" into nyc-mr1-dev am: 901c03faba
am: c07a7518d6

Change-Id: Ibc270d83d7c8544195ce1f6e9eee245db7e095f5
901c03faba8c73194e694222477ce8d2c594d324 20-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "Launcher shortcut callback should deliver manifest shortcuts too" into nyc-mr1-dev
8a147b8656d0a7486a65014ca07b31b2df8500a4 20-Jun-2016 Chris Wren <cwren@android.com> Merge \\\"assume a generous prior in the rate estimator\\\" into nyc-dev am: fddf5df01f am: 5e27227b68
am: 50121f5520

Change-Id: I7b9425de720a1b310f642d81b5d902ae582395a3
5e27227b685575408e7333429c9badef0d694179 20-Jun-2016 Chris Wren <cwren@android.com> Merge \"assume a generous prior in the rate estimator\" into nyc-dev
am: fddf5df01f

Change-Id: I73dc1cb6a2a13bac21ff576319e7b9123aee09b3
4d6b87ffdf06df3303239130ced685bc1a3fae50 17-Jun-2016 Makoto Onuki <omakoto@google.com> Launcher shortcut callback should deliver manifest shortcuts too

- Also include "activity" in the key fields, as this is now an
important field.

- Also optimize ShortcutInfo parceling for the "key field only" case.

Bug 29394043
Bug 29451629

Change-Id: I61b2bc2f61ad6ebdcbaf6d02f1bd88777c45a7f0
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
cb0f366fe21c8fd4fd52cd853dce8bfa3affdbf9 17-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \\"Update manifest shortcut XML schema\\" into nyc-mr1-dev am: a65d8b6609
am: 5a533c9ae3

Change-Id: If46b8c1763b3682c780dcbaef1a790c1a5b9ded6
888b7a8faf7d6c2aa4272bebeb875eac9a2ff21c 17-Jun-2016 Chris Wren <cwren@android.com> assume a generous prior in the rate estimator

currently with one data point the estimator is biased high. If we don't
have any data we want to be biased low to allow the first interaction
to be an isolated burst.

Also add metrics for enqueue rate to make it easier to debug this
code in the future (currently we only have metrics after the
rate limiter).

Bug: 29379789
Change-Id: I7b1d379290a55f120d039fd29d1bc0abbc6d4932
otification/RateEstimatorTest.java
df6da040e00cba255cad64d2d231aae62928607a 16-Jun-2016 Makoto Onuki <omakoto@google.com> Update manifest shortcut XML schema

Use the standard <intent> tag instead of custom tags.

- Also fix setDynamicShortcuts(), which was broken in the previous CL.
- Also tolerate runtime exceptions while parsing XMLs
- Also fix b/29422018 while I'm at it

Bug 29390156
Bug 29077932
Bug 29422018

Change-Id: I2756c9d66c6d7b2962a982d9e57a7d84a5755b28
m/ShortcutManagerTest1.java
fd222fc2f8c27ebea1bad050f6fd61ab3b954ea2 16-Jun-2016 Gustav Sennton <gsennton@google.com> resolve merge conflicts of 6cbf137 to master

Change-Id: Idc548a46e96464c11193cf8480d9fb4e07aa438f
939f8caec2d64826cdc479faa3a76b978c07537b 16-Jun-2016 Gustav Sennton <gsennton@google.com> Merge \"Support using uninstalled WebView packages as WebView implementation.\" into nyc-dev
am: e25c8532b6

Change-Id: Ie9f405765c146d21f1399037dd236d440902f0f9
e25c8532b6dd05cf339f21c564f6300c5cc94971 16-Jun-2016 Gustav Sennton <gsennton@google.com> Merge "Support using uninstalled WebView packages as WebView implementation." into nyc-dev
092d4e91e8723e6d3cd5df9a8bc5683e2d5c1fc4 16-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \\"Shortcut: Reset throttling upon inline reply\\" into nyc-mr1-dev am: 489bafbb4b
am: 58b2258506

Change-Id: I7034cc9ef130c9dccfa35a8cb75940d717a2a15d
489bafbb4ba53fd104c898975cf48c8815a1cb59 16-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "Shortcut: Reset throttling upon inline reply" into nyc-mr1-dev
0df2c5566a9d7d71ca84cb072114f051bbe7a344 14-Jun-2016 Gustav Sennton <gsennton@google.com> Support using uninstalled WebView packages as WebView implementation.

A package can be uninstalled for the system user but still be installed
on the device. Currently, we do not use such a package as WebView
implementation which means we fall back to using the fallback WebView
package.
However, if the fallback package is not valid (because it needs to be
updated first) loading WebView will fail.

With this change we fetch allow the fetching of information from
packages that are uninstalled for the system user so that we can still
load WebView when the only valid WebView provider is uninstalled for the
system user.

Also listen to package additions/changes/removals for all users -
otherwise we won't notice when a package becomes replaced if it was
already uninstalled for the system user.

Bug: 29321185
Change-Id: Ia23c4493844877aea1b4eab7e666fd37540c4f97
ebkit/WebViewUpdateServiceTest.java
a8607b119d1816b5e251e83f0f2120dc139ba81e 16-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \\"ShortcutManger: Auto-adjust ranks.\\" into nyc-mr1-dev am: 70a91541e9
am: 35f77b2b74

Change-Id: If3e4a6387085b6a58154619af326e39f497158db
70a91541e9eb2acc6ee5a34785abdc420127a5ec 15-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManger: Auto-adjust ranks." into nyc-mr1-dev
9e1f5595bd7ffe3af6ca35b3235dfca0ecd07978 08-Jun-2016 Makoto Onuki <omakoto@google.com> ShortcutManger: Auto-adjust ranks.

Spec: go/shortcutmanager-spec-ranks

Bug 28984376
Bug 28536066

Change-Id: Ibffb92233c62792af06eeadc5a9a6379d0506a3c
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
m/ShortcutManagerTest3.java
68dd6233bdfb7c33299ecf0c37a70460d31bb794 15-Jun-2016 Kevin Gabayan <gabayan@google.com> Compute AnyMotionDetector angle using atan2. Bug: 29232136 am: db843c913f
am: e46d4fd7ad

Change-Id: I666fc7432cf6140c938423ec4370ca7727996bd6
d6e1f3bec18167f726ccc20f9bcbc6526dfc78fe 14-Jun-2016 Makoto Onuki <omakoto@google.com> Shortcut: Reset throttling upon inline reply

When the user does an "inline reply", we consider the notification
publisher app is "activated" and reset the shortcut throttling.

Bug 28705275

Change-Id: Ic9ffa13635274ead7e9d1e832cd31dea997830aa
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
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
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
8aabf5e997a6143f08345f5b1231cfc36cf03480 13-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \\"Fix some exception messages and enhance unit tets\\" into nyc-mr1-dev am: 5b8f5fd38b
am: 1c14929ae8

Change-Id: I29fe2b8c212d8447792b5c721fd794933ae14a96
5b8f5fd38be1ea9aa3202f747d14f3b8f4b61c01 13-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "Fix some exception messages and enhance unit tets" into nyc-mr1-dev
db843c913f67230da010aa60d4e83632556e98c3 10-Jun-2016 Kevin Gabayan <gabayan@google.com> Compute AnyMotionDetector angle using atan2.
Bug: 29232136

Change-Id: Ie57d0228eb42246c4ac1d7a01e2782a621b7e78f
(cherry picked from commit b070577d35436ca0f5463e6ed19a28ae431cfbfb)
ector3Test.java
e73207f5d68ccecd16558699b4fef015d0901f85 11-Jun-2016 Kevin Gabayan <gabayan@google.com> Merge \\"Compute AnyMotionDetector angle using atan2. Bug: 29232136\\" into nyc-mr1-dev am: 21f47bcf8c
am: 3182b29404

Change-Id: I09cc04b8e564b247434db22cd05e5ae1860c8eb3
21f47bcf8c477ec51191cdfcd777ca6a799b6c3b 11-Jun-2016 Kevin Gabayan <gabayan@google.com> Merge "Compute AnyMotionDetector angle using atan2. Bug: 29232136" into nyc-mr1-dev
b070577d35436ca0f5463e6ed19a28ae431cfbfb 10-Jun-2016 Kevin Gabayan <gabayan@google.com> Compute AnyMotionDetector angle using atan2.
Bug: 29232136

Change-Id: Ie57d0228eb42246c4ac1d7a01e2782a621b7e78f
ector3Test.java
a1d38b3c95cd6a38ee7336fd90729d3b3be6ae25 11-Jun-2016 Makoto Onuki <omakoto@google.com> Fix some exception messages and enhance unit tets

Bug 29275393

Change-Id: Idaa8564d41f86de2a2cbefa4ff3c08b89a3a6dd2
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest2.java
d985dde8ccfd38a50377a8ab2378b36c92b0d7c7 31-May-2016 Christopher Wiley <wiley@google.com> Fix race conditions between Tethering and TetherInterfaceStateMachine

( cherry-pick of de4819dc82b734036b22416228327d2712e01884 )

Previously, Tethering would answer requests for current tethering state
by calling methods on instances of TetherInterfaceStateMachine to build
up that state. This is incorrect, since state queries can come in on an
arbitrary thread, independent of updates to the state machines
instances.

Fix this by:
- Altering TetherInterfaceStateMachine to push consistent state
snapshots to Tethering via notifyInterfaceStateChange()
- Storing the last state snapshot in Tethering.mTetherStates
- Removing public methods to query TetherInterfaceStateMachine state.
- Consistently synchronizing access to Tethering.mTetherStates

Bug: 29009601
Test: WiFi Tethering continues to work, unittests continue to pass

Change-Id: Ied334f5e8739bc3aff1b08a1079095b9cc2a7958
onnectivity/tethering/TetherInterfaceStateMachineTest.java
afcde2d13268bee17f648a237fcf388a9c86b05d 09-Jun-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix race conditions between Tethering and TetherInterfaceStateMachine"
281ec3272f8335513bf85f17465f55b241ae0725 08-Jun-2016 Christopher Wiley <wiley@google.com> Merge changes from topic 'tethering-ownership' into nyc-mr1-dev

* changes:
Tethering: Own WiFi tethering state and lifetime
Use an ArrayMap instead of HashMap to track tether interfaces
Consolidate cleanup logic in TetherInterfaceSM.TetheredState
Annotate TetherInterfaceStateMachineTest for APCT
Rely on Tethering mutex for TetherInterfaceSM
Rename TetherInterfaceSM to TetherInterfaceStateMachine
Remove dead code from TetherInterfaceSM
Remove transient StartingState from TetherInterfaceSM
Expand test coverage of TetherInterfaceSM
Add demonstration unittest for TetherInterfaceSM
Extract TetherInterfaceSM to its own class.
Make Tethering.TetherInterfaceSM more self contained
Clean up class members in Tethering.TetherInterfaceSM
Fix trivial warnings in Tethering.java
c29f62c7388f550da2c7368c5dbc0aec7d1564fe 07-Jun-2016 Makoto Onuki <omakoto@google.com> Push DO/PO package names from DPMS to PM

Bug 29126573

Change-Id: I95ea1559f6acf5d2f0e1b0953568cdfc938e83b9
evicepolicy/DevicePolicyManagerServiceTestable.java
c4e64bc449475f16c0ef3afa76ca168ac24a9a41 08-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \\"ShortcutManager: deal with changing resource IDs on app update\\" into nyc-mr1-dev am: 3bb4366006
am: a3a56ab9d1

Change-Id: Id5e39a35db803223a89100a8e23a7b3309cd9dd3
3bb436600654e4da253a4b77a86c1dbfa208da8e 08-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: deal with changing resource IDs on app update" into nyc-mr1-dev
78d14004f4a3627f19c7f4f7309a54a96ada4caf 08-Jun-2016 Makoto Onuki <omakoto@google.com> Merge \\"ShortcutManager: Optimize package scanning\\" into nyc-mr1-dev am: 3e27d1254b
am: a495123fc6

Change-Id: Ie210c54c0596de2804f2363b4f4c321603936eaa
3e27d1254b5ceab88a4180842db3c9feec6b5b75 08-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Optimize package scanning" into nyc-mr1-dev
2f310da52e95dd86859d44ae43e9fcae0d0f11a8 08-Jun-2016 Lorenzo Colitti <lorenzo@google.com> Merge changes Ic98e3bcb,Idb0c55fc,Ia8649061,I5e7e5a87 into nyc-mr1-dev am: 3e2bfbd135
am: 3feff1367b

Change-Id: I776625bbc557c747477db70235847dd8b3ab8baf
3e2bfbd1357e3795d87becddcb74415d91192347 08-Jun-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes Ic98e3bcb,Idb0c55fc,Ia8649061,I5e7e5a87 into nyc-mr1-dev

* changes:
Give WakeupMessage the ability to transport an object as well.
Don't treat the lingerExpired broadcast specially.
Add a test for mobile data always on.
Add a FakeSettingsProvider and use it in ConnectivityServiceTest.
9acda9c82577972b8291853978650c24c20e950c 05-Jun-2016 Lorenzo Colitti <lorenzo@google.com> Don't treat the lingerExpired broadcast specially.

NetworkMonitor no longer uses the broadcast for lingering, it
uses WakeupMessage instead.

Bug: 23113288
Change-Id: Idb0c55fc68cb8f45b3213c7134213904f227852e
onnectivityServiceTest.java
762ea7aab7636b33daeee2c4ba169f163c61347f 05-Jun-2016 Lorenzo Colitti <lorenzo@google.com> Add a test for mobile data always on.

Bug: 23113288
Change-Id: Ia8649061a797367d135bb5576600a7cdc85a822e
onnectivityServiceTest.java
6d553f6dfdcc188fa6b17d4abb11d6222009a8fb 04-Jun-2016 Lorenzo Colitti <lorenzo@google.com> Add a FakeSettingsProvider and use it in ConnectivityServiceTest.

This class makes it easier to test code that uses Settings:

1. Real device or emulator settings don't affect the code under
test; all settings always start off empty.
2. It's possible to change settings from the test without
affecting system settings.
3. No changes are needed to the code under test. The changes to
the tests are simple: just add a fake ContentResolver to
whatever mock Context is already used by the test, and make
that ContentResolver use the fake provider.

Bug: 23113288
Change-Id: I5e7e5a87571444ae49ccf551705620675a36cd17
onnectivityServiceTest.java
157b1628fd84dc3ef0355fddd8d281618f94d33e 03-Jun-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: deal with changing resource IDs on app update

- When an app is upgraded, all the resource IDs may change. So
if a shortcut is previously published with an icon for res ID 100
and the publisher is upgraded, resource #100 may refer to something
different.

- So now the service also remembers resource names for icon resources,
as wells as string resources. When an app is updated, the service
fetch the updated resource IDs by name.

- Also extract all string resources when a shortcut is published
and persist them, so that even when the original string resources are
removed from the app, the launcher can still show the extracted strings.

- When the system locale changes, re-extract all string resources.

- Also really hide the constants in ShortcutInfo that were
accidentally made public.

Change-Id: I23c29b45c1de5d76175229190a1533c9c62c5960
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
de4819dc82b734036b22416228327d2712e01884 31-May-2016 Christopher Wiley <wiley@google.com> Fix race conditions between Tethering and TetherInterfaceStateMachine

Previously, Tethering would answer requests for current tethering state
by calling methods on instances of TetherInterfaceStateMachine to build
up that state. This is incorrect, since state queries can come in on an
arbitrary thread, independent of updates to the state machines
instances.

Fix this by:
- Altering TetherInterfaceStateMachine to push consistent state
snapshots to Tethering via notifyInterfaceStateChange()
- Storing the last state snapshot in Tethering.mTetherStates
- Removing public methods to query TetherInterfaceStateMachine state.
- Consistently synchronizing access to Tethering.mTetherStates

Bug: 29009601
Test: WiFi Tethering continues to work, unittests continue to pass

Change-Id: Ied334f5e8739bc3aff1b08a1079095b9cc2a7958
onnectivity/tethering/TetherInterfaceStateMachineTest.java
6dd9fb7004e888ec1efc4676cd3e4d42b7ac68c9 01-Jun-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Optimize package scanning

SM needs to check all packages when a user is unlocked in case
any apps have been upgraded while the user was not running,
in which case it'll publish the manifest shortcuts.

Currently it actually scans all apps' manifests.

This CL optimizes it by remembering the last scan time (for each user)
and checks only the packages that have been updated since then.

Bug 29069154

Change-Id: Id10b6be8915fe7c1e26daccde7951ddbd01ea452
m/BaseShortcutManagerTest.java
5c0b10a4a9eecc5307bb89a271221f2b20448797 31-May-2016 Christopher Wiley <wiley@google.com> Tethering: Own WiFi tethering state and lifetime

( cherry-pick of f1315c3cd6d77e812ae32fe038b4e8bf2e70d5bf )

- Add logic to Tethering to track whether the user has requested
tethering via WiFi.
- Subscribe to intents regarding soft AP state to enable and
disable tethering when the AP comes up or goes down.
- Refactor IP configuration logic to do configuration for WiFi
as well as USB.

Bug: 29054780
Test: WiFi tethering continues to work on angler
Tethering related unittests continue to pass.

Change-Id: I6eff2573ca3fd11fabcf138c468ba517ff2daf65
onnectivity/tethering/TetherInterfaceStateMachineTest.java
e10bfc0ee67ffe72b75969139b738c66eaa1d66a 24-May-2016 Christopher Wiley <wiley@google.com> Consolidate cleanup logic in TetherInterfaceSM.TetheredState

( cherry-pick of f54c5a932a9ac4a491ce775b21ff8288e40b5bad )

This pushes all TetheredState cleanup logic into a single place.
All new unittests fail without the changes to TetherInterfaceSM.

Bug: 28915272
Test: Compiles, unittests pass, WiFi tethering continues to work.

Change-Id: Ia7bf210e00e9a54f2797baebc2e5333ce314c947
onnectivity/tethering/TetherInterfaceStateMachineTest.java
0ab0dd317f6f2f22ed894077c1e4268bbfbdf070 25-May-2016 Christopher Wiley <wiley@google.com> Annotate TetherInterfaceStateMachineTest for APCT

( cherry-pick of d905add4747d6060355c44dac1dce0eccd8014fb )

APCT needs a little additional magic to pick up JUnit4 tests.

Bug: 28958508
Test: Tests continue to pass

Change-Id: Ia45d91bb3b06e60e3a46ffe738d4468356e066b3
onnectivity/tethering/TetherInterfaceStateMachineTest.java
4312a4c433611343e863a5d38497d982ccfc90ae 23-May-2016 Christopher Wiley <wiley@google.com> Rely on Tethering mutex for TetherInterfaceSM

( cherry-pick of 4bc8d6b1ac0cb7d4192c829a44d988516f0adbdb )

Stop passing Tethering's mutex into TetherInterfaceSM, and instead
simply rely on Tethering to acquire its own mutex when accessing
instances of TetherInterfaceSM.

While here, remove some boolean fields (previously guarded by the mutex)
which duplicate state information.

Change-Id: Ie6b2128970981786a5d64fbf700c9f3d0a6721fb
Test: Compiles, unittests pass, WiFi tethering continues to work.
Bug: 28910007
onnectivity/tethering/TetherInterfaceStateMachineTest.java
7040b4ebdfc9d4de5c240db6cde9fc245fb7a696 24-May-2016 Mitchell Wills <mwills@google.com> Rename TetherInterfaceSM to TetherInterfaceStateMachine

( cherry-pick of c5baad02503d17a812ee1b44cc817c7e18935ff1 )

Change-Id: I324690b20f37cef6d58872e21b126a87d16f7ec8
onnectivity/tethering/TetherInterfaceSMTest.java
onnectivity/tethering/TetherInterfaceStateMachineTest.java
9ad83ab607c316c85064af5a84eafcadfa91e4bf 21-May-2016 Christopher Wiley <wiley@google.com> Remove dead code from TetherInterfaceSM

( cherry-pick of 2ea4166c74e70d3796b06c91f37eb03eecdf4773 )

Because no code outside of unittests ever issued these commands
to TetherInterfaceSM, we never executed any of the removed codepaths.

Change-Id: Id54f6e4eaeff8b3486cd78ddcc8c2a31011e6436
Test: Compiles. Unittests continue to pass.
Bug: 28798823
onnectivity/tethering/TetherInterfaceSMTest.java
3b1d92250303e9e20c48fabf25b435ff79897437 21-May-2016 Christopher Wiley <wiley@google.com> Remove transient StartingState from TetherInterfaceSM

( cherry-pick of 79e7fde00d74c2b6d329f7341029ea6b04ac2d97 )

This state immediately switched into the TetheredState.
We can safely remove it at only the expense of a misleading state
broadcast.

Bug: 28798823
Test: runtest frameworks-services -c
com.android.server.connectivity.tethering.TetherInterfaceSMTest

Change-Id: I295d830dbdb11717d6e05161d97787ffe871beb3
onnectivity/tethering/TetherInterfaceSMTest.java
7b61d717604cc4227637dfdf3cc43e67e7df5b34 20-May-2016 Christopher Wiley <wiley@google.com> Expand test coverage of TetherInterfaceSM

( cherry-pick of 1b3830a2afab565a38572ac5c3238a171b2d56d4 )

Add tests for most normal case operations:
- State machine startup.
- Entering a tethered state (as USB interface and not)
- Handling the first notification of an upstream interface
- Handle changes in upstream interface
- Handle unrequested teardown correctly

Bug: 28833951
Test: These tests pass

Change-Id: I2c0c9141bab9eaa92faec8de10fa653fb6236a74
onnectivity/tethering/TetherInterfaceSMTest.java
1ff75bde48fe66d937b99b0655df941b94310fa1 19-May-2016 Christopher Wiley <wiley@google.com> Add demonstration unittest for TetherInterfaceSM

( cherry-pick of 1cc6ffd2b32846996520fdf43125da3ec2bbdf49 )

Prove that the concept works by writing a trivial test.

Bug: 28833951
Test: `runtest frameworks-services -c
com.android.server.connectivity.tethering.TetherInterfaceSMTest`

Change-Id: I51911cef7f0d5165221845070befd085497c21a6
onnectivity/tethering/TetherInterfaceSMTest.java
5a780c0b17cc371cf350a68a1f117edc6b8997db 03-Jun-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Tethering: Own WiFi tethering state and lifetime"
f1315c3cd6d77e812ae32fe038b4e8bf2e70d5bf 31-May-2016 Christopher Wiley <wiley@google.com> Tethering: Own WiFi tethering state and lifetime

- Add logic to Tethering to track whether the user has requested
tethering via WiFi.
- Subscribe to intents regarding soft AP state to enable and
disable tethering when the AP comes up or goes down.
- Refactor IP configuration logic to do configuration for WiFi
as well as USB.

Bug: 29054780
Test: WiFi tethering continues to work on angler
Tethering related unittests continue to pass.

Change-Id: I6eff2573ca3fd11fabcf138c468ba517ff2daf65
onnectivity/tethering/TetherInterfaceStateMachineTest.java
cffb6041d258fff79dd3d4f9ea989d13a8ee43c9 03-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Implement usage report API" into nyc-mr1-dev am: 37087ad710
am: 51c7ce7531

* commit '51c7ce7531f5c1fc1ae442b1c6f206735599cea2':
ShortcutManager: Implement usage report API

Change-Id: Ia713dbbb510d2f848b8866a4d0dc692f67803522
fdb40b93bbf13bcb67b7bebdbb5fbf047ed5917a 03-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "Merge "ShortcutManager: Break down unit tests" into nyc-mr1-dev am: f6be4c023f" into nyc-mr1-dev-plus-aosp
am: 7d9b79c41b

* commit '7d9b79c41b53a8f936cb50be40c57a13412197bb':
ShortcutManager: Break down unit tests

Change-Id: If4e742401c1fa02f48d086f9cbdf50d8100e4f16
ac042501c816fa9a65aed005060ebdcfc0a0f3b2 21-May-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Implement usage report API

Bug 28536054

Change-Id: I293e8eaad523e3b0d76d562fc381601633451ed3
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest2.java
95a079adf280b94ffca16ac82e1cf257ddb6502b 02-Jun-2016 Chris Wren <cwren@android.com> Merge "Give the auto-merger somthing to hang on to." into nyc-mr1-dev am: cf665232f3
am: b58e350e92

* commit 'b58e350e9266b8ced268b21900ab6c065dcac218':
ShortcutManager: Implement max # of shortcuts

Change-Id: Ide9c5923c0dca42b5285ddcadda0716f2f00084b
51ab2b3fd04e24e0ca98afd1c1832d84f3a9e62c 02-Jun-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Break down unit tests

The test file is getting too big and making the IDE very slow.
Now it's split into multiple files

Change-Id: I50ed89f19defd3809f327bc21e7d9ea790dcde4e
m/BaseShortcutManagerTest.java
m/ShortcutManagerTest.java
m/ShortcutManagerTest1.java
m/ShortcutManagerTest2.java
7001a6154088c87a31d56641762ff0c2a48f1d57 27-May-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Implement max # of shortcuts

- Each activity (launcher icon) can have at most 5 dynamic +
manifest shortcuts.

Bug 28536066

Change-Id: Id34371d51c4a1c5e3df7debe3b71b535eb157b6c
m/ShortcutManagerTest.java
9a968df82804dc9f12289546f50afcfe36c1b4da 02-Jun-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: API rename" into nyc-mr1-dev am: 60585d12e7
am: facbcba617

* commit 'facbcba617766402b03c2b1ecc889dfc0fd9c4a2':
ShortcutManager: API rename

Change-Id: If7da8f53354762bb7e035ab8a9c66e73886545ec
eddbfecb8dd751161339a9ed16d07ce2e108a575 01-Jun-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: API rename

The words "title" and "text" implies that "text" is a secondary label
that's shown with the title, but it turned out the launcher would show
only one of those depending on how much space it has.

So now we change them to "shortLabel" and "longLabel"

Note we're only changing the API surface -- in order to mimimize
the impact to the code, internally we'll keep using the old names.

- Also remove "shortcutRank" while I'm here -- it should be implied
from the order of the XML elements.

Bug 29057378

Change-Id: I3203f63b0318c7462c1c61fef43cf9755fa8c008
m/ShortcutManagerTest.java
09c66122884a5bfd083740ed44ea6837e957de23 28-May-2016 Makoto Onuki <omakoto@google.com> resolve merge conflicts of 8de7c95 to master

Change-Id: I04447215323c7582554dc5f6ae8b105308c6f623
22fcc68e6be0edaa98f3dacf79d580a5e5d50005 17-May-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Support manifest shortcuts

- Now apps can publish shortcuts via AndroidManifest.xml
(Sample: I5b127150)

- Rename some APIs per API council feedback

- Publishers can now "disable" shortcuts.
(https://docs.google.com/presentation/d/1raUn1QBURDb1yrd6mSmVxII9ezNh3MWukODdtufJ29U/edit#slide=id.g13ef592464_7_39)

Bug 28785283
Bug 28536066

Change-Id: I4a126841e43e40139bb4baa6d0f98ad7b3a75ac1
m/ShortcutManagerTest.java
f54c5a932a9ac4a491ce775b21ff8288e40b5bad 24-May-2016 Christopher Wiley <wiley@google.com> Consolidate cleanup logic in TetherInterfaceSM.TetheredState

This pushes all TetheredState cleanup logic into a single place.
All new unittests fail without the changes to TetherInterfaceSM.

Bug: 28915272
Test: Compiles, unittests pass, WiFi tethering continues to work.

Change-Id: Ia7bf210e00e9a54f2797baebc2e5333ce314c947
onnectivity/tethering/TetherInterfaceStateMachineTest.java
d905add4747d6060355c44dac1dce0eccd8014fb 25-May-2016 Christopher Wiley <wiley@google.com> Annotate TetherInterfaceStateMachineTest for APCT

APCT needs a little additional magic to pick up JUnit4 tests.

Bug: 28958508
Test: Tests continue to pass

Change-Id: Ia45d91bb3b06e60e3a46ffe738d4468356e066b3
onnectivity/tethering/TetherInterfaceStateMachineTest.java
b4742164b5cbaaa1f2e7ef1c0481df9cb9e77a96 25-May-2016 Sudheer Shanka <sudheersai@google.com> Merge "Merge "Fix usermanager related tests." into nyc-mr1-dev am: bb883ddf59" into nyc-mr1-dev-plus-aosp
am: ff2067f9dc

* commit 'ff2067f9dce6801a7b91e5185a53ee704b802856':
Fix usermanager related tests.

Change-Id: Ifce5de3f6994d50cdfb5e9fb5a92bc47e7c9331c
c32abe8646432126ac4915affa6c7e7beca9659b 24-May-2016 Sudheer Shanka <sudheersai@google.com> Fix usermanager related tests.

- Fix failing test
- Updates to include in continuous test execution

Fixes: 28938682
Change-Id: I17dd9ca5cf2579f0649f3939b00b08fa71a106cf
m/UserManagerServiceTest.java
m/UserManagerTest.java
m/UserRestrictionsUtilsTest.java
f6fbfce696118c54ec87eccbeb6a0d8e1f64331d 24-May-2016 Tony Mak <tonymak@google.com> Doc: delete old test_framework.png am: 05c98d5458 am: 734e7725ac am: 130317181e am: 5e08d12331
am: 3fbe5c0d34

* commit '3fbe5c0d34769ca0237a8bf7ea4c38ed1e4f8edd':
Fix first notification of each app is not shown

Change-Id: I645d0ae0b2f55b72510921b9a2abeb71499a5a68
3fbe5c0d34769ca0237a8bf7ea4c38ed1e4f8edd 24-May-2016 Adarsh Fernando <adarshf@google.com> Doc: delete old test_framework.png am: 05c98d5458 am: 734e7725ac am: 130317181e
am: 5e08d12331

* commit '5e08d12331c53c6db708877b012187c245097bfc':
Fix first notification of each app is not shown

Change-Id: I428894e3442eb90fed192cfd58b44353ab2b03fe
18b1826a8c6e6a1026239478072bf7c725219dcf 24-May-2016 Tony Mak <tonymak@google.com> Merge "Fix first notification of each app is not shown" into nyc-dev
am: ed353f1738

* commit 'ed353f173852551f0dc0b360512a9abc5c77c28e':
Fix first notification of each app is not shown

Change-Id: Ib3702c334b7d41b75684720d36caaa62cc52f074
4bc8d6b1ac0cb7d4192c829a44d988516f0adbdb 23-May-2016 Christopher Wiley <wiley@google.com> Rely on Tethering mutex for TetherInterfaceSM

Stop passing Tethering's mutex into TetherInterfaceSM, and instead
simply rely on Tethering to acquire its own mutex when accessing
instances of TetherInterfaceSM.

While here, remove some boolean fields (previously guarded by the mutex)
which duplicate state information.

Change-Id: Ie6b2128970981786a5d64fbf700c9f3d0a6721fb
Test: Compiles, unittests pass, WiFi tethering continues to work.
Bug: 28910007
onnectivity/tethering/TetherInterfaceStateMachineTest.java
fd303327083fdf309b9d8a15343f9eb70c014b11 24-May-2016 Tony Mak <tonymak@google.com> Fix first notification of each app is not shown

When app tries to post its first notification,
value of now is equal to that of mLastEventTime.
And hence getRate return a very large number.

Bug: 28902358

Change-Id: If5b5b3c46e2bb80a9b40988ba7f7d777e40cc8e7
otification/RateEstimatorTest.java
c5baad02503d17a812ee1b44cc817c7e18935ff1 24-May-2016 Mitchell Wills <mwills@google.com> Rename TetherInterfaceSM to TetherInterfaceStateMachine

Change-Id: I324690b20f37cef6d58872e21b126a87d16f7ec8
onnectivity/tethering/TetherInterfaceSMTest.java
onnectivity/tethering/TetherInterfaceStateMachineTest.java
2ea4166c74e70d3796b06c91f37eb03eecdf4773 21-May-2016 Christopher Wiley <wiley@google.com> Remove dead code from TetherInterfaceSM

Because no code outside of unittests ever issued these commands
to TetherInterfaceSM, we never executed any of the removed codepaths.

Change-Id: Id54f6e4eaeff8b3486cd78ddcc8c2a31011e6436
Test: Compiles. Unittests continue to pass.
Bug: 28798823
onnectivity/tethering/TetherInterfaceSMTest.java
79e7fde00d74c2b6d329f7341029ea6b04ac2d97 21-May-2016 Christopher Wiley <wiley@google.com> Remove transient StartingState from TetherInterfaceSM

This state immediately switched into the TetheredState.
We can safely remove it at only the expense of a misleading state
broadcast.

Bug: 28798823
Test: runtest frameworks-services -c
com.android.server.connectivity.tethering.TetherInterfaceSMTest

Change-Id: I295d830dbdb11717d6e05161d97787ffe871beb3
onnectivity/tethering/TetherInterfaceSMTest.java
1b3830a2afab565a38572ac5c3238a171b2d56d4 20-May-2016 Christopher Wiley <wiley@google.com> Expand test coverage of TetherInterfaceSM

Add tests for most normal case operations:
- State machine startup.
- Entering a tethered state (as USB interface and not)
- Handling the first notification of an upstream interface
- Handle changes in upstream interface
- Handle unrequested teardown correctly

Bug: 28833951
Test: These tests pass

Change-Id: I2c0c9141bab9eaa92faec8de10fa653fb6236a74
onnectivity/tethering/TetherInterfaceSMTest.java
1cc6ffd2b32846996520fdf43125da3ec2bbdf49 19-May-2016 Christopher Wiley <wiley@google.com> Add demonstration unittest for TetherInterfaceSM

Prove that the concept works by writing a trivial test.

Bug: 28833951
Test: `runtest frameworks-services -c
com.android.server.connectivity.tethering.TetherInterfaceSMTest`

Change-Id: I51911cef7f0d5165221845070befd085497c21a6
onnectivity/tethering/TetherInterfaceSMTest.java
2e00a9616236dc28ee5a5e1a3054bad0c6243852 20-May-2016 Chris Wren <cwren@android.com> Merge "rate limit notification enqueues" into nyc-dev am: 585ff8bd12 am: 4ca84fa6b5
am: 2fab26a9ac

* commit '2fab26a9ac3703c33b5b6fdb850de4ce341497bc':
rate limit notification enqueues

Change-Id: I916d6c89709bdee5d1fffcb59defe032cf1eb71b
4ca84fa6b5e3405a66f7e4175408ad11fdb01798 20-May-2016 Chris Wren <cwren@android.com> Merge "rate limit notification enqueues" into nyc-dev
am: 585ff8bd12

* commit '585ff8bd126ffac98164a87d24a9add5c23f9597':
rate limit notification enqueues

Change-Id: I48a05345b210a68e507e648402a2ff19da44b7fc
585ff8bd126ffac98164a87d24a9add5c23f9597 20-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "rate limit notification enqueues" into nyc-dev
c8673a88fed53715d2295a535535c7ce7acbe7b6 17-May-2016 Chris Wren <cwren@android.com> rate limit notification enqueues

This is distinct from and in addition to the limit on the number of
distinct notifications. This includes many updates to a single
notification.

Bug: 28693065
Change-Id: I5ec0911716cace91d3ad85435a5c6123b290b3a2
otification/RateEstimatorTest.java
24f7b92a3c95f76fcea0630f29853c8c4e7a022a 19-May-2016 Robin Lee <rgl@google.com> Merge "Lock down networking when waiting for always-on" into nyc-dev am: d171df660e am: 77ab7fc8d4
am: 22e9213a1c

* commit '22e9213a1c903a4eda75fb09603735753a131c05':
Lock down networking when waiting for always-on

Change-Id: I50583a9738ac51378e5f5dcbbaa396f1aa30f97c
22e9213a1c903a4eda75fb09603735753a131c05 19-May-2016 Robin Lee <rgl@google.com> Merge "Lock down networking when waiting for always-on" into nyc-dev am: d171df660e
am: 77ab7fc8d4

* commit '77ab7fc8d4f4596b1275a7065f05380e22da3a1a':
Lock down networking when waiting for always-on

Change-Id: I4160a61ca437d20df4342a44ed24fc6ad47962c6
43fbfbf94c5b8ae4353b73c36d85ff02fd36fc67 19-May-2016 Robin Lee <rgl@google.com> Merge "Lock down networking when waiting for always-on" into nyc-dev
am: d171df660e

* commit 'd171df660e19bdba4d188beeb8b6023874712413':
Lock down networking when waiting for always-on

Change-Id: I34fffb119eecef0052be673f307ef63c94fc58ee
d171df660e19bdba4d188beeb8b6023874712413 19-May-2016 Robin Lee <rgl@google.com> Merge "Lock down networking when waiting for always-on" into nyc-dev
17e6183b85ba3038acb935aaa01415058b2e6ddd 09-May-2016 Robin Lee <rgl@google.com> Lock down networking when waiting for always-on

Fix: 26694104
Fix: 27042309
Fix: 28335277
Change-Id: I47a4c9d2b98235195b1356af3dabf7235870e4fa
onnectivity/VpnTest.java
1b537cc6233a83b2e210e4021418a2369a3aea37 17-May-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: API changes for DR" into nyc-mr1-dev am: 8295332d83
am: 37d5cb3181

* commit '37d5cb3181b4fc94b5e180f1a011330b893fcd84':
ShortcutManager: API changes for DR

Change-Id: Id585b05388cb487aba19f5c7fee3e13bd467e808
8295332d83d1e664a7ef3a731370ae71242688a1 17-May-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: API changes for DR" into nyc-mr1-dev
01b9528983a75af1b2f7332466cc0bf42cc86ed4 17-May-2016 Robin Lee <rgl@google.com> Merge "Make some of the UID-based VPN code reusable" into nyc-dev am: 4920698e17 am: 607fa836b2
am: 45d4f351ba

* commit '45d4f351ba79e658cb9abc6633b4d7de62e78ffc':
Make some of the UID-based VPN code reusable

Change-Id: I75d9871f8039d14f8d83be4696c3c4d4e864f9c0
45d4f351ba79e658cb9abc6633b4d7de62e78ffc 17-May-2016 Robin Lee <rgl@google.com> Merge "Make some of the UID-based VPN code reusable" into nyc-dev am: 4920698e17
am: 607fa836b2

* commit '607fa836b2b60f411ae239bff5391dcaafbbc799':
Make some of the UID-based VPN code reusable

Change-Id: Ie7c88ba3eebe4af85a69f330cae3df3293113d4e
0867543a064a48a1aca6243a3d1cdf7a12ad94c8 17-May-2016 Robin Lee <rgl@google.com> Merge "Make some of the UID-based VPN code reusable" into nyc-dev
am: 4920698e17

* commit '4920698e17dc8aacd1b0743d313383a8ee1a3400':
Make some of the UID-based VPN code reusable

Change-Id: I0e5b9aa4552ee11ae5ec2d2206cc58487fb9cd4c
4920698e17dc8aacd1b0743d313383a8ee1a3400 17-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Make some of the UID-based VPN code reusable" into nyc-dev
20c95f854e54b71caa49f0efe07d47d1e6afd435 12-May-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: API changes for DR

See https://goto.google.com/shortcutmanager-spec-dr for
the details.

This CL contains changes to ShortcutInfo and all the new API
entry points, but not the implementation of the new APIs.

- ShortcutInfo.activityComponent is now mandatory.
- Publishers can now disable shortcuts. ShortcutInfo can now have
"disabled message".
- ShortcutInfo now supports string resources for all the String
fields.
-> When launcher fetches shortcuts, ShortcutService will
automatically load resources and expose as strings.
- LauncherApps now supports getShortcutIconDrawable() and
getShortcutBadgedIconDrawable() to be consistent with
LauncherActivityInfo.

- ShortcutInfo.weight is replaced with "rank".

- Added ShortcutManager.reportShortcutUsed(), which will be used for
usage tracking / suggestion.

Bug 28536054
Bug 28536066
Bug 28564134
Bug 28594168

Change-Id: Ib8245b39bb1e753991a9de89c0b73accacd90355
m/ShortcutManagerTest.java
4d03abcd49af490dba3850d341b955dd72f24959 09-May-2016 Robin Lee <rgl@google.com> Make some of the UID-based VPN code reusable

By changing some member refs into arguments and having one of the
functions create the UID range instead of adding to mVpnUsers.

This will be useful for other layers of UID filtering like having
UIDs explicitly blocked from the VPN.

Deleted one broken line of code that cleared the status intent when
a restricted profile is removed. Other than that, this commit shouldn't
change any behaviour. If it does, that's a bug.

Bug: 26694104
Change-Id: Ieb656835d3282a8ba63cc3f12a80bfae166bcf44
onnectivity/VpnTest.java
d0cce7064383ff4f78a909d349398490cf193883 13-May-2016 Paul Jensen <pauljensen@google.com> Merge "ApfFilter unit test" into nyc-dev am: b742495cf5 am: c6154624f2
am: a2512d3485

* commit 'a2512d3485159f33737b0d6ffb07b1ff6126d749':
ApfFilter unit test

Change-Id: Ide959b34cd6bd97620b2c14812bd362d203fd85f
a2512d3485159f33737b0d6ffb07b1ff6126d749 13-May-2016 Paul Jensen <pauljensen@google.com> Merge "ApfFilter unit test" into nyc-dev am: b742495cf5
am: c6154624f2

* commit 'c6154624f2b3171a82edaf74b67a15b9a091978a':
ApfFilter unit test

Change-Id: I17ddf9d4823588dd2cad0d5662ec434ae2d027f6
771d9fe0b607a953f2efbb64745c1e68f4fced01 13-May-2016 Paul Jensen <pauljensen@google.com> Merge "ApfFilter unit test" into nyc-dev
am: b742495cf5

* commit 'b742495cf54c09c5780c7c22f4d389b92e22449d':
ApfFilter unit test

Change-Id: Ib0595b9cd72efaa408028983287fea0b81b3bee6
b742495cf54c09c5780c7c22f4d389b92e22449d 13-May-2016 Paul Jensen <pauljensen@google.com> Merge "ApfFilter unit test" into nyc-dev
538c440c33fc2b9e0bf0c680ddbb14f9a079ff6a 11-May-2016 Makoto Onuki <omakoto@google.com> Remove ShortcutManager

Bug 28704708

Change-Id: If7b739adeec38d81d554fc1cf34c81194f5d67b9
m/ShortcutManagerTest.java
7608f5d214112bef263dd9ca0e5534df2cba3a65 11-May-2016 Makoto Onuki <omakoto@google.com> Merge "Refactoring ShortcutManager + bug fixes." into nyc-mr1-dev am: 4a3b597f55
am: c9289b8053

* commit 'c9289b805307ff071ad2b17936bfb4b4a6f4ad84':
Refactoring ShortcutManager + bug fixes.

Change-Id: I9b584cd3ff0125294556fc3ca56cc01895167367
c51b2876ec5c0af449469a0f76bb38c51cfcff04 05-May-2016 Makoto Onuki <omakoto@google.com> Refactoring ShortcutManager + bug fixes.

- Don't pass the ShortcutService instance as an argument. This tiny
optimization is no longer meaningful now that PackageShortcut and
PackageLauncher have reference to ShortcutUser.

- Rename mLauncherComponent to mDefaultLauncherComponent for clarity.

- Don't instantiate ShortcutPackage instances when not needed.

- Don't allow intents with a null action.

- Also improve javadoc.

Bug 28592642
Bug 28474517
Bug 28557169

Change-Id: I8790d3494bf3b92c143c02824b0ed0e514504baa
m/ShortcutManagerTest.java
f8be7f2a5d92745459af631c5ef02f1385f8437c 10-May-2016 Antonio Cansado <acansado@google.com> Merge "Addressing API council comments on NetworkStatsManager." into nyc-dev am: dc5f558640 am: 7598ac2aa7
am: 8b2dd44f2f

* commit '8b2dd44f2f30a9dd22799ee30dd4b9c5a093aae5':
Addressing API council comments on NetworkStatsManager.

Change-Id: Ie6455799758f0bdb67440f72c266effaf412e22f
7f76b902a2eb415983b670c371376445ebc257b9 10-May-2016 Makoto Onuki <omakoto@google.com> Merge "Clean up dangling bitmaps." into nyc-mr1-dev am: 3ff4120047
am: 11745a937b

* commit '11745a937b6082759a495a23c4b4375952409234':
Clean up dangling bitmaps.

Change-Id: Ie0d5ab2f5b47ce450db6538a809f3f41291e9834
8b2dd44f2f30a9dd22799ee30dd4b9c5a093aae5 10-May-2016 Antonio Cansado <acansado@google.com> Merge "Addressing API council comments on NetworkStatsManager." into nyc-dev am: dc5f558640
am: 7598ac2aa7

* commit '7598ac2aa79f328e52e58bdaa2d8e8d858c2c463':
Addressing API council comments on NetworkStatsManager.

Change-Id: Ia886e1ce98520c1618ba501097a2c979a628bbb4
de224ba451547fcc139ec6c565243e0f450ece46 10-May-2016 Antonio Cansado <acansado@google.com> Merge "Addressing API council comments on NetworkStatsManager." into nyc-dev
am: dc5f558640

* commit 'dc5f558640da8785fabc274167ec37a0fda30cd6':
Addressing API council comments on NetworkStatsManager.

Change-Id: I9d884ed999b507ab172418f068c10483422643d3
3ff41200470a05c662d636a22b70d20d44a5917a 10-May-2016 Makoto Onuki <omakoto@google.com> Merge "Clean up dangling bitmaps." into nyc-mr1-dev
6965c1869aa8499706522d057b5143bbc240178b 30-Mar-2016 Antonio Cansado <acansado@google.com> Addressing API council comments on NetworkStatsManager.

Callbacks
- DataUsageCallback renamed to UsageCallback
- DataUsagePolicy removed; passing in params directly to register method
- making it an abstract class
- passing in (networkType, subscriberId) that reached its threshold
- renaming onLimitReached to onThresholdReached to match existing naming
- only monitor single network,subscriberId
- no monitoring of specific uids; using device or user wide instead

Tags
- only owner uid can read its tags
- exposing only TAG_NONE to match service side

BUG: 27530098

Change-Id: I2b2664da71806868a1e937d2bf4d1f234637509b
et/NetworkStatsObserversTest.java
et/NetworkStatsServiceTest.java
9132f34976f16a626c2ec1d3d90624d71e054346 13-Apr-2016 Paul Jensen <pauljensen@google.com> ApfFilter unit test

Bug: 26238573

Change-Id: I5171038228782bd54e91f5bcc663cc529d2c1150
pfTest.java
pf2Apf.java
0e86dfb8028fd4fce7e61291c8628720acc277d9 05-May-2016 Makoto Onuki <omakoto@google.com> Merge "Merge "ShortcutManaegr: bug fixes" into nyc-mr1-dev am: 5b9d876ef5" into nyc-mr1-dev-plus-aosp
am: ccf9c83765

* commit 'ccf9c8376595ddbed64cedd236349cb99a2e8708':
ShortcutManaegr: bug fixes

Change-Id: I2aeb67ca5f46165b63e685c90d8acf6cb909b351
85694526039fb0a80ab74b2dc3ab17bacc1a4a59 04-May-2016 Makoto Onuki <omakoto@google.com> ShortcutManaegr: bug fixes

Fixes 28590035
Fixes 28586105

Change-Id: Ia11d29e4996ad5b47b279a3c04d9586695cdc0a5
m/ShortcutManagerTest.java
6c1dbd577bcf2b8bccb9a0d04d741ff7337898f2 03-May-2016 Makoto Onuki <omakoto@google.com> Clean up dangling bitmaps.

Bug 28471799

Change-Id: I48785ccc533a7499d46e35264c6a0cbf0c5398d5
m/ShortcutManagerTest.java
eeba24d9a015b3ae658b2456169473f0ca24afee 03-May-2016 Hui Shu <hush@google.com> Merge "Fix the unit tests for WebView downgrade logic"
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
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
m/ShortcutManagerTest.java
826a24b2961901bff8d53b4f448efe07a8db2646 26-Apr-2016 Hui Shu <hush@google.com> Fix the unit tests for WebView downgrade logic

Shift the branch numbers by 5 digits to construct the versionCode according to
Chromium versionCode scheme.

Changed "non-system version" to "candidate version" because a package under
comparison could be a system package too.

Also add a new test for the fallback being used case.

BUG: 28050853
Change-Id: I25becb713a8840e579ded55b8882224c6b69e1bb
ebkit/WebViewUpdateServiceTest.java
5cc48412b264d3796e6aa45312a16363461f1ef3 28-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: When app\'s data is cleared, remove all shortcuts," into nyc-dev am: d1c30db548 am: 07f8d94c6e
am: a1bca975ef

* commit 'a1bca975efce3830d3c97a98db785151daeda465':
ShortcutManager: When app's data is cleared, remove all shortcuts,

Change-Id: Ib8af31efc5117528d2599fa03bd5ed74f6606fe7
9ac59d0438833eee817e4b4e5c03ce5ec8fcf4dc 26-Apr-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: When app's data is cleared, remove all shortcuts,

as if it's uninstalled.

Fixes 28196831

Change-Id: I1a410372f9e344a10567b00057fa0770eac9fd76
m/ShortcutManagerTest.java
b483bd391f40096de973bcb23c1c3a5636c6b667 26-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "When app is updated, save the new version code, and update shortcuts with resource based icons." into nyc-dev am: 711ffe6 am: b1acc71
am: 41c1df9

* commit '41c1df9de514eb2f959a275cef36ebed37d754a6':
When app is updated, save the new version code, and update shortcuts with resource based icons.

Change-Id: I1039c773715c4fdfd5fbba484dc425dfcd3b07d6
711ffe620ed06c8517cad8d4d0a8f4fca588f921 26-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "When app is updated, save the new version code, and update shortcuts with resource based icons." into nyc-dev
8923eb742d840e8b8c19d3af14437308339c48eb 21-Apr-2016 Paul Jensen <pauljensen@google.com> Merge "Cap number of NetworkRequests a UID can make to 100" into nyc-dev am: 3f45105353 am: eedfc5457f
am: 3e3de5d7d7

* commit '3e3de5d7d7379d4aa296a43ca41df4c1ded0858b':
Cap number of NetworkRequests a UID can make to 100

Change-Id: I72fe474d3618c2900e972cefdc85e80767610405
3f4510535397bf103d0299440a0299ff8bbeec28 21-Apr-2016 Paul Jensen <pauljensen@google.com> Merge "Cap number of NetworkRequests a UID can make to 100" into nyc-dev
bd1729039591db0e3b81da89ec5d8adc3f6371f6 21-Apr-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Test coverage for new FBE functionality" into nyc-dev am: 366a457 am: fb91c83
am: fdb8147b44

* commit 'fdb8147b44caf5be4223d6c9859cdbb1f25885df':
Test coverage for new FBE functionality

Change-Id: I2eb142f6e8a6c33cce69366a0387a8295ceb1759
390802b6d3d64ea926490a7ff0deeff2ece25105 12-Apr-2016 Fyodor Kupolov <fkupolov@google.com> Test coverage for new FBE functionality

Added testRemovedAccountSync, which removes account when the user is locked,
and verifies that syncDeCeAccountsLocked works as expected.

Added testPreNDatabaseMigration to test that pre-N database with existing
data is properly upgraded and migrated.

Bug: 26279712
Change-Id: I3846c626f616b1c4830965c9f0cb27fa32ce6f54
ccounts/AccountManagerServiceTest.java
ccounts/PreNTestDatabaseHelper.java
4e1d3fdf7a43b3e43efac0a26ca3d0f458ce87d3 08-Apr-2016 Paul Jensen <pauljensen@google.com> Cap number of NetworkRequests a UID can make to 100

This prevents DoSing ConnectivityService with too many requests.

Fixes: 27253080
Change-Id: Id0480d220b2f01b9ef1146bef8ead2fc8287e28d
onnectivityServiceTest.java
b0cde5b7c7049059aa38dd2f9c53bfb5cc108c06 19-Apr-2016 Robin Lee <rgl@google.com> Merge "Unit test for UidRange.java and UidRange.cpp" into nyc-dev am: 79c4dca am: 71edae1
am: fcf5f4c

* commit 'fcf5f4c9bf34666c87dd589df41aaff118241143':
Unit test for UidRange.java and UidRange.cpp

Change-Id: Id7eaab8ce6a2758f175fd855ff7e552c73f08bd9
79c4dca2a8be141d0b2b2ca71eb2acd7e1cb3f30 19-Apr-2016 Robin Lee <rgl@google.com> Merge "Unit test for UidRange.java and UidRange.cpp" into nyc-dev
cfe2669028074a204fc55afebbae630423a806f2 05-Apr-2016 Robin Lee <rgl@google.com> Unit test for UidRange.java and UidRange.cpp

Verifies that:
- UidRange only accepts non-negative UIDs
- UidRange only accepts start UID <= stop UID
- Native implementation is in sync with java implementation (via JNI)

Change-Id: I8b412781efe9cfda6d5e666e37fe0d8f5e2b6ecc
pfTest.java
18c9e151fdf8676a8ad8f66a0bde592c0c1644d3 15-Apr-2016 Gustav Sennton <gsennton@google.com> Add unit tests verifying the webview package versioncode validation

We recently added functionality for ensuring that a webview package
cannot be used unless its version code is at least as high as the
minimum of the version codes of the default webview packages.
This CL contains unit tests for verifying this functionality.

Bug: 28050853
Change-Id: Iaf6d5999e420a7eddc4df06aaeefd68ee545422e
ebkit/TestSystemImpl.java
ebkit/WebViewUpdateServiceTest.java
36f4afbcca81de92e42fe2e1f0700680293ff56c 16-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Categories should be Set, not List." into nyc-dev am: e2be9f4
am: 2870094

* commit '2870094a86531e977898681aef503bb393b24a3e':
ShortcutManager: Categories should be Set, not List.

Change-Id: I114c3ac304bed3b237128c2e330dec0fe19f6613
be73a8068ff3babe5b0a4f12656731ba8eea6149 15-Apr-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Categories should be Set, not List.

Bug 27923857

Change-Id: Ife859da8e66478174f6c4463316886a23e5aa4e0
m/ShortcutManagerTest.java
39686e8cdec3550c941d376929084f59ac0d78cd 14-Apr-2016 Makoto Onuki <omakoto@google.com> When app is updated, save the new version code, and update shortcuts
with resource based icons.

Bug 28152054

Change-Id: I14f537c08b1a0ba48dd508b0c42fc1d3ed4f5eb0
m/ShortcutManagerTest.java
da18a4cabb2b39e440e7743e35a29d71a07efc3c 15-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "Remove all icon bitmaps when a publisher is uninstalled." into nyc-dev am: 1c685d2
am: 0da2457

* commit '0da2457a9b917b215e925dd6d33f5790e67beb70':
Remove all icon bitmaps when a publisher is uninstalled.

Change-Id: I2af330494fe9a69328cb65a246497bbfb4182273
0033b2a190feeda8b41dd62b489aca3a19a09d5b 15-Apr-2016 Makoto Onuki <omakoto@google.com> Remove all icon bitmaps when a publisher is uninstalled.

- Also show the directory sizes on dumpsys.

Bug 28196831

Change-Id: I3202fcd3151da3b26b436732e8103caf93aba525
m/ShortcutManagerTest.java
ed63a70163bca2c2e73d39bdcb1720f46bd87648 14-Apr-2016 Gustav Sennton <gsennton@google.com> Merge "Fix the behaviour for explicitly switching WebView provider" into nyc-dev am: 4f9ad45
am: a660929

* commit 'a66092918e707d4fa934eb8c08e55404048fe2cf':
Fix the behaviour for explicitly switching WebView provider

Change-Id: I2807de28aada663b8ba3aca25051bebd4d63c1eb
efdd58b1df937170082690b350fcea123f2669de 14-Apr-2016 Gustav Sennton <gsennton@google.com> Merge "Update persistent WebView packages setting only when user changes it." into nyc-dev am: 45e2966
am: c08ac79

* commit 'c08ac79a21722bf793d328e652e6f64118d90fca':
Update persistent WebView packages setting only when user changes it.

Change-Id: Ied22fed362a718cff0b1892dc199ac74e336de03
95f7e8e06dd0003a813f7a4b3c718c68d0fa4a01 14-Apr-2016 Gustav Sennton <gsennton@google.com> Fix the behaviour for explicitly switching WebView provider

Before this CL when we tried to change WebView provider through the Dev
setting and failed we would then have the setting point to the provider
used before the change. With this CL we instead let the setting point to
the intended target but also switch to the package which the
WebViewUpdateService see as most fit (rather than just reverting back to
the original choice).

Add unit tests to verify we kill processes depending on WebView
packages when switching WebView provider.

Add unit tests to ensure we can recover from trying to change provider
when there are no providers available.

Bug: 27673076
Bug: 27635535
Change-Id: Ie7bb6afdf8acf4344cfb363947929c0b492775fb
ebkit/TestSystemImpl.java
ebkit/WebViewUpdateServiceTest.java
45e2966da9f81077777bb6df61e9a880790741ec 14-Apr-2016 Gustav Sennton <gsennton@google.com> Merge "Update persistent WebView packages setting only when user changes it." into nyc-dev
a9159040c86d94f7a3d45bdc7fe6c4ea24f58456 11-Apr-2016 Gustav Sennton <gsennton@google.com> Update persistent WebView packages setting only when user changes it.

To ensure that we don't permanently change WebView implementation if the
current package is temporarily uninstalled (e.g. when being replaced) we
don't update our persistent setting unless the user explicitly changes
WebView implementation (and on boot!).

Unfortunately this will means that the Dev Setting for changing WebView
implementation will work in a slightly less intuitive way. The
persistent setting is now persistent across uninstalls and installs.
I.e. the Dev Setting shows the current WebView implementation though
that could differ to the value chosen by the user since the package
chosen by the user could be uninstalled or disabled. In this case
installing/enabling that package would again make the Dev Setting point
to it.
However, as a compromise, we do change the setting at boot so that if
the currently chosen package is not valid we will change the setting so
that it points to the package we currently use instead.

Also ensure we only use WebView packages that are available-by-default
if no WebView packages are enabled.

Add unit test to ensure that if a user-chosen provider is uninstalled we
switch back to using that provider when it is installed again.
Add unit test to ensure we switch user-chosen provider at boot if the
chosen one is uninstalled.

Bug: 27673076
Change-Id: Icd27ae302798ebf695b9ef4bd4d5fd47fe4be02c
ebkit/WebViewUpdateServiceTest.java
45dd59b0f14dce5d27d1a303bfdb56314bff5e4a 13-Apr-2016 Paul Jensen <pauljensen@google.com> Merge "If Internet probe is redirected, pass redirect destination to NetworkAgent." into nyc-dev am: 3e6a6fc
am: 2c1f03a

* commit '2c1f03ade023a61428b7d9101bc10e4c88ae941a':
If Internet probe is redirected, pass redirect destination to NetworkAgent.

Change-Id: I4c5f5cb8591d8729de9036a6c2aabacd4aba0f39
3e6a6fc60ea78994298ff38cfe7230faf24fe6b7 13-Apr-2016 Paul Jensen <pauljensen@google.com> Merge "If Internet probe is redirected, pass redirect destination to NetworkAgent." into nyc-dev
a9a8d44cdcd52cae4dadd5c8adfae960a9bab26b 13-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Address API review feedback." into nyc-dev am: 1d616f0
am: 9d25ead

* commit '9d25ead98b6b09611fd95dfdd2b49ef5191ea030':
ShortcutManager: Address API review feedback.

Change-Id: I663034ac1ae3bdb7b0757efae0396235784b8dce
1d616f0d880d0a4109e811221f3c3ff2e016013b 13-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Address API review feedback." into nyc-dev
b6d3523dfb5d73ddda4b750a82c059cdc42acf8e 05-Apr-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Address API review feedback.

- "delete" -> "remove"
- add/deleteDynamicShortcut() now takes a list.
- Throttling default settings is now 2 calls / hour.

- Add categories to ShortcutInfo.
- getIconResourceId() is now public

Bug 27923857
Bug 27548047

Change-Id: I8457b30e4b2f7c63ab2988648b37178fd16ea45b
m/ShortcutManagerTest.java
1add1e29b05344c5d84833240e4e13eda53fd8c3 12-Apr-2016 Ricky Wai <rickywai@google.com> Merge "Add tests for profile keys in LockSettingsStorage" into nyc-dev am: 321cfa3
am: fbf7eda

* commit 'fbf7edafdc9b35c63374ca1ac2fe59557efb7b0d':
Add tests for profile keys in LockSettingsStorage

Change-Id: I13e982d279bdfc67f3ac478efbafcc58180a2cfb
321cfa379188eee7bcc54c754bd2b7eb8f0b3c8b 12-Apr-2016 Ricky Wai <rickywai@google.com> Merge "Add tests for profile keys in LockSettingsStorage" into nyc-dev
8ff7fa922a5fe6d6ab1a28e0ae7ea8847ea87331 12-Apr-2016 Gustav Sennton <gsennton@google.com> Merge "Add initial unit tests for WebViewUpdateService." into nyc-dev am: ce2cb76
am: bfac3f5

* commit 'bfac3f5ec6cd7a78600dbece8cb451d6866de5e1':
Add initial unit tests for WebViewUpdateService.

Change-Id: If8d72fb7caafdb1a1b43e763b09a806971772417
53b78241ffc32e61d12afc6245633266e592db88 07-Apr-2016 Gustav Sennton <gsennton@google.com> Add initial unit tests for WebViewUpdateService.

The logic in the WebViewUpdateService is now more complex and there
are lots of edge cases that should be tested to make sure we don't
regress anything.

Also refrain from running fallback logic on boot if fallback logic not
enabled (bug found through a failing test, yeeah buddy!).

Catch uncaught MissingWebViewException (very timing-dependent!) and add
test for this.

Add tests for:
Some package setups (single package, non-default vs. default packages,
valid vs. invalid packages).
Ensure correct error codes used
Switching provider through settings-method
Switching provider through adding more prioritized provider
Switching provider in the middle of already running webview preparation
Ensure fallback logic is run when enabled and not run when disabled (at
boot, packageStateChanged, and when adding a new user).

Bug: 27635535

Change-Id: I275ecb0f6129f71258da0fa053e7f7b36a675886
ebkit/TestSystemImpl.java
ebkit/WebViewUpdateServiceTest.java
2324373124f0ba4e59ba6d3de9e274f2fa28cff0 06-Apr-2016 Paul Jensen <pauljensen@google.com> If Internet probe is redirected, pass redirect destination to NetworkAgent.

Transport may use the redirect to make additional determination about network
state.

Bug: 25203607
Change-Id: I07d8918f13fdcbe0b6fd757536bfc1850a2a244f
onnectivityServiceTest.java
a46b40fd5c3603b59c4a0d5d5fa4b0547fc26aff 31-Mar-2016 Ricky Wai <rickywai@google.com> Add tests for profile keys in LockSettingsStorage

Bug: 27940135
Change-Id: Iade153f6607db4c75385bed6f20d3120c10674b0
ockSettingsStorageTests.java
11872394237f94c005a34c01ddc8ac1a85414036 12-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: First cut of CTS" into nyc-dev am: bc20320
am: 0beb56d

* commit '0beb56d4e49f433759f7c825374c90442f2aed53':
ShortcutManager: First cut of CTS

Change-Id: I048150bf9451e8d28dc599673321bd31f8d119a1
bc20320f7f224d1cc5be3c436a1a5ece2067f2ec 12-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: First cut of CTS" into nyc-dev
4108e269f21221e2ebcc6f274a05b8ea11960b40 12-Apr-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Make AccountManagerServiceTest work again" into nyc-dev am: 518bae5
am: 3c4a3bb

* commit '3c4a3bb3c55a68146b3bb5febb2fee674fddd8e7':
Make AccountManagerServiceTest work again

Change-Id: Iad16fed7ec0514f62d9cef91e3aeda3b0e7f04e8
eeca6584cff3858e6993dd4b88f1b55418f07ad2 08-Apr-2016 Fyodor Kupolov <fkupolov@google.com> Make AccountManagerServiceTest work again

It was broken for quite a while. Introduced the following changes:
- Use mockito to mock AppOpsManager and UserManager
- Use MockContext directly and override what is necessary.
RenamingDelegatingContext doesn't work with absolute file names for
database paths, which is the case for system server DBs.

Bug: 26279712
Change-Id: I9f2a3892f9bd7a882d78f0bb7beb8669f7dc8c6f
ccounts/AccountManagerServiceTest.java
5ba0d3e3a3035b67d2ce3a59975145b1e0061ef4 11-Apr-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: First cut of CTS

Bug 27548047

Change-Id: Idd7a768ea4fee44c2cf6e3bd473cea9e67f5f7cd
m/ShortcutManagerTest.java
b29ec1a7e43ff28b977a8db342003ce6d9b7ce2d 11-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "Add UserHandle to ShortcutInfo, and simplify LauncherApps APIs." into nyc-dev am: 390a813
am: 9a98e46

* commit '9a98e4679a64e8293a8b74677bb6b2839dae6a31':
Add UserHandle to ShortcutInfo, and simplify LauncherApps APIs.

Change-Id: Ifb1f6d3331af119893007b46909e0e5ffcb210fc
d0dba8b973e7e14efe99da6d89ca0b79eb01bbb9 11-Apr-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Added getProfileIds method returning array of userIds" into nyc-dev am: 4c74334
am: 036bdca

* commit '036bdcac4499b3ce6932f1ed237797332609c329':
Added getProfileIds method returning array of userIds

Change-Id: If88d4c3d480be43fedae6a976467706bfbaf37b7
390a81302f13a0285e58e550cf786255ce5f8bd8 11-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "Add UserHandle to ShortcutInfo, and simplify LauncherApps APIs." into nyc-dev
4c74334c4425e43dfb53bc2ef707eebb1bef7d5b 11-Apr-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Added getProfileIds method returning array of userIds" into nyc-dev
2890f6053f16ac2836220b8e855cccf8349a38ef 09-Apr-2016 Jack Yu <jackyu@google.com> Merge "Excluded certain APNs (e.g. IMS) from mobile data usage." into nyc-dev am: 2e062ab
am: 6754d23

* commit '6754d237bb8c6e1fba779f90417b4a2fe07d2b3e':
Excluded certain APNs (e.g. IMS) from mobile data usage.

Change-Id: I0f37f4d296de88763019f469a0356e753b9f3636
2e062ab8de3bae82b76a3f3aaeac6994f2555fe5 09-Apr-2016 Jack Yu <jackyu@google.com> Merge "Excluded certain APNs (e.g. IMS) from mobile data usage." into nyc-dev
abe8442951ff88aa01ed882adb54fb1b3472ca3e 07-Apr-2016 Makoto Onuki <omakoto@google.com> Add UserHandle to ShortcutInfo, and simplify LauncherApps APIs.

- Also fixes the bitmap recycle bug in the service.

Fixes 28053541

Change-Id: I2b244feda0f85c60e2c15af427fcad95ad5e6da5
m/ShortcutManagerTest.java
7f98aa4aa93497692f200c553d2d6fff402e3de2 07-Apr-2016 Fyodor Kupolov <fkupolov@google.com> Added getProfileIds method returning array of userIds

Previously many usages of UserManager.getProfiles and getEnabledProfiles
were only using ids of returned users. Given that the list of users needs
to be parceled and unparceled for Binder calls, returning array of ids
minimizes memory usage and serialization time.

A new method getProfileIds was introduced which returns an array of userIds.
Existing method calls were updated where appropriate.

Bug: 27705805
Change-Id: Ic5d5decd77567ba0f749e48837a2c6fa10e812c0
evicepolicy/DpmMockContext.java
66a6be3a4c955e52ea61e0d35f338983f632abf8 30-Mar-2016 Jack Yu <jackyu@google.com> Excluded certain APNs (e.g. IMS) from mobile data usage.

Added not_metered capability to a mobile network if none
of its associated APN types are metered. Also used not_metered
capability to determine if a network should be accounted for
data usage or not instead of using network type, which is
always MOBILE after refactoring. Will add VT usage support
in next phase.

bug: 20888836
Change-Id: Id692cb856be9a47d0e918371112630128965b1bb
et/NetworkStatsCollectionTest.java
et/NetworkStatsObserversTest.java
34afb60a8d681c4415060e0ac06f52ff75231b22 07-Apr-2016 Robin Lee <rgl@google.com> Merge "Internal API for system apps to determine default network for other apps" into nyc-dev am: 1b83651
am: a948f88

* commit 'a948f8872aa045ab22f42285f195fdb413c5ff66':
Internal API for system apps to determine default network for other apps

Change-Id: Ib719f0cebb41afe4aa52241f3797598a7e468d2d
1b83651e7fca620589a6317d3a8559e43a19485c 07-Apr-2016 Robin Lee <rgl@google.com> Merge "Internal API for system apps to determine default network for other apps" into nyc-dev
d2baf792f8b7ae46aa6a35cff25eb7e3923f5125 24-Mar-2016 Robin Lee <rgl@google.com> Internal API for system apps to determine default network for other apps

Callers with CONNECTIVITY_INTERNAL permission can read off the netId
that an application is assigned to by default.

Necessary for making connections as the default network for a client
app eg. when downloading stuff on its behalf.

Bug: 27074270
Change-Id: I8d35e8e99126875f55f3c545090326f3e9be43fb
onnectivityServiceTest.java
fd84a7af4f221d36e0ffc79136ebfd0ce50a67e6 06-Apr-2016 Dianne Hackborn <hackbod@google.com> Merge "More work on issue #26390151: Add new JobScheduler API..." into nyc-dev am: d273f0d
am: cfb4721

* commit 'cfb472112dfac835950b4c53fdf921c569388114':
More work on issue #26390151: Add new JobScheduler API...

Change-Id: Idd203c9daba08a3498c8184028554d5136101085
141f11c82a2dbf042833f75aeae6f028e8ae2084 06-Apr-2016 Dianne Hackborn <hackbod@google.com> More work on issue #26390151: Add new JobScheduler API...

...for monitoring content providers

- Improve media provider change reporting so that observers can
avoid spurious reports of the top-level content directory changing.
- Fix a bug where collected content changes while a job was running
were not being properly propagated to the next job.

Change-Id: I29e3c2960e6fec75b16ee3ee6588d47342bf8c75
ontent/ObserverNodeTest.java
41a457c7688f89cf6de1ab027b44b6074edf1ed6 04-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: More command for CTS, more tests.." into nyc-dev am: 24b7415
am: 3584495

* commit '35844950a9619130959fd5de69feb097737c82b8':
ShortcutManager: More command for CTS, more tests..

Change-Id: Ib4392f9159e22da222a3281b490eece8eec8db02
ac21497f174504472e92b99500709518b8ab2d71 04-Apr-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: More command for CTS, more tests..

and fix flakey tests.

Bug 27548047

Change-Id: Ia5f189278f6111850277ca16aa747469f48c5f14
m/ShortcutManagerTest.java
745b8cea66d2687ba578939d90a3bb9eee1ff7d2 02-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: implement backup & restore" into nyc-dev am: b1a684c
am: e7b5752

* commit 'e7b5752c912622aa71d61fc8a1aae67d78b7a7c6':
ShortcutManager: implement backup & restore

Change-Id: Ib9c1c332c24ac23e8db188b844b969d604b79396
b1a684c6461b2c316798dfd7bc91c7f39ee3c211 02-Apr-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: implement backup & restore" into nyc-dev
2e210c4d0f766e52ea4c087a1d54213c36a4e0ea 30-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: implement backup & restore

Also:
- Fix cross profile pinning. Now ShortcutLauncher correctly keeps
track of target package user IDs.

- Add performance stats for package manager calls and show them on
dumpsys.

Bug 27548047

Change-Id: I2472980b2955b6c70947aaaa9b76f75d0616db6e
m/ShortcutInfoTest.java
m/ShortcutManagerTest.java
e2835571674752045867f761a782fe4910757901 01-Apr-2016 Chris Wren <cwren@android.com> Merge "actually cancel sounds when we get a quiet update" into nyc-dev am: b38fa4e
am: 305db96

* commit '305db96ef3942b5f09f89c3cbc967bd5e278df73':
actually cancel sounds when we get a quiet update

Change-Id: I34b5b565f1ff27a543eb3d2c2ae8ff4d6d200dd3
93bb8b800661653cc1c65b294eab621554af139a 29-Mar-2016 Chris Wren <cwren@android.com> actually cancel sounds when we get a quiet update

Also add some tests to the notification manager service
to make the refactor more palatable.

Bug: 27742532
Change-Id: I745915299aa2b92ab077e0c801d47864cb562325
otification/BuzzBeepBlinkTest.java
33bb07d63275cc56a77a31c709335d4b3f4df1aa 31-Mar-2016 Victor Chang <vichang@google.com> Merge "Unit test for isProvisioningAllowed" into nyc-dev am: e04ac3d
am: 55eed88

* commit '55eed88395da49b87d4ee79ca01486cec8f69961':
Unit test for isProvisioningAllowed

Change-Id: Ie99abee24f7b7d0e083607956230332627c1985b
e04ac3d7d2027ea3149748ca6520405b7e1b1dbb 31-Mar-2016 Victor Chang <vichang@google.com> Merge "Unit test for isProvisioningAllowed" into nyc-dev
3e794afb82228199c0a83bed5463dbeb3c48dd62 04-Mar-2016 Victor Chang <vichang@google.com> Unit test for isProvisioningAllowed

Note:
DevicePolicyManagerService is changed to inject ContentObserver notifier

Test: all test cases in DevicePolicyManagerTest pass

BUG: 25710621
Change-Id: I347cec71769d0e9dd6a334d7d6339d5ce6a3fa6a
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
4f1f7b0167efddde5ca9073da4717640f0e4daab 30-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Support secondary text field." into nyc-dev am: ca0ee28
am: a3d8cdc

* commit 'a3d8cdca997e0577bcb1d9091880a0267e2d3f38':
ShortcutManager: Support secondary text field.

Change-Id: I5262a756c5fe50e498192aea8e247f46d5742edc
8fff90ca7c3bfdb1fd00ad506a78576bbf934ea3 30-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: proper work profile support" into nyc-dev am: d5b745a
am: 4fc3441

* commit '4fc34416fb8d389557934f3000dab7b6fbafb97c':
ShortcutManager: proper work profile support

Change-Id: I1a708988b7e9c505370e2399572dca6caa9d5cef
e3ae7ec14a3204ee502219b6bb46dc9ab8e24a36 30-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Support secondary text field.

Bug 27548047

Change-Id: I2d184bab2c26e351b7326945fa0cacf826f16d1e
m/ShortcutInfoTest.java
m/ShortcutManagerTest.java
estutis/TestUtils.java
9da23fc6ac565b38129d52f4f8f174c833a9bd01 29-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: proper work profile support

Bug 27548047

Change-Id: I8acea3355f8974a551f53814624dec30732f7b2f
m/ShortcutManagerTest.java
48041bea3f8addb552a79c6660801df433074098 29-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Extract signature related utilities" into nyc-dev am: 021a48d
am: 32203d4

* commit '32203d479707b24ebbfe768718aee907f3b00fd4':
Extract signature related utilities

Change-Id: Ib22a38fcfc0e170429433c94d4f67031407131cb
590096a0e372f640fb41d4cb97d8bc68fb7b8ea2 26-Mar-2016 Makoto Onuki <omakoto@google.com> Extract signature related utilities

So that they can be used from services/core.

Bug 27548047

Change-Id: I610e267cba320418e766c0e609fa26c485dc6e1f
m/backup/BackupUtilsTest.java
4824ed486cbe38bcd3df41670dd738522534d556 29-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Fix work profile" into nyc-dev am: bdda585
am: 74b8a65

* commit '74b8a6545d337f49031f28908bce3d9db845cd22':
ShortcutManager: Fix work profile

Change-Id: I022371e785a944c01cf5fe307b53dbad71e8cc6c
d99c6f04bbb68f8be78f2c3ca625a3a8d5645275 28-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Fix work profile

- Pinned shortcuts need to know not only which package
has pinned them, but also on which user's, due to work profile.

- Launcher can always launch shortcuts that it has pinned.

Bug 27548047

Change-Id: I23b4e7dfbb6ecc42099d31008bcfd61d44e2c7fb
m/ShortcutManagerTest.java
e67f4c7ad31f466267d26ec764ddaf3134aeea54 28-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Cleanup package info handling" into nyc-dev am: 7b71a6f
am: 8de4c90

* commit '8de4c909579fecba9f2662d8598dc124c6caabfd':
ShortcutManager: Cleanup package info handling
905e8855e7df111f835fecde32598479058fe4df 28-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Cleanup package info handling

Bug 27548047

Change-Id: I598b25d1901230cec6fb3760fe5efeff3b3fef96
m/ShortcutManagerTest.java
973ead7ce54fd3d146bc8d6b028e2a5aff267eb7 28-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Handle package broadcasts." into nyc-dev am: ec1a2da
am: c15288f

* commit 'c15288facfad39bbfb1c37980d9cb61b9c46612c':
ShortcutManager: Handle package broadcasts.
0acbb14574d859b5f1cc0b7c6bbdfbeba38f3e55 23-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Handle package broadcasts.

- Do a cleanup when an app is gone.
- Record the app version and signatures.
- Also make saveToXml() capable of saving for backup.

Bug 27548047

Change-Id: I7eb2bbec7665b4d625630e7312c0f2a8b03c5ffa
m/ShortcutManagerTest.java
93a8799b6e515bf59f28651da66ec71ce617c2fa 25-Mar-2016 Felipe Leme <felipeal@google.com> Merge "Refactored NetworkManagerService to support Data Saver." into nyc-dev am: 771d0c2
am: 244089a

* commit '244089a3806282e20d603d9be8942d3e550f03b1':
Refactored NetworkManagerService to support Data Saver.
65be3025fd07d53137f5434794d1d1b3a0933aab 22-Mar-2016 Felipe Leme <felipeal@google.com> Refactored NetworkManagerService to support Data Saver.

Netd provides 2 bandwidth control rules to restrict which uids can use
metered networks:

- bw_penalty_box is a blacklist-based firewall chain used to determine
which uids do not have access to metered interfaces.

- bw_happy_box is whitelist-based firewall chain used to determine which
uids have access to metered interfaces.

Currently, both NetworkManagerService (NMS) and
NetworkPolicyManagerService (NPMS) uses just the bw_penalty_box rule,
which makes turning Data Saver mode on / off too slow (since NPMS needs
to build the bw_penalty_box on demand); this CL adds support for both
rules on NMS, although NPMS doesn't take advantage of it yet (it will be
refactored in a separate CL).

BUG: 27127112
BUG: 26685616
Change-Id: Ib954574f7c86269fc9b4cf8ce4ba72ba5878c23d
etworkPolicyManagerServiceTest.java
e8e853ec22e43d6e0993a5d84574770f905723f8 22-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Extract helper classes." into nyc-dev am: 6ebc08b
am: 329cf2a

* commit '329cf2ab3b2d7f8e867984f48e5ea11609d6dbe4':
ShortcutManager: Extract helper classes.
3145924596ad0db9e8f1f5aead90fb50127243cb 22-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Extract helper classes.

Bug 27548047

Change-Id: I08656291a8dd509fde169f229ca9c503362254f3
m/ShortcutManagerTest.java
34f0b4dafe1b4c4a50189391a19e39a338d30c7f 22-Mar-2016 Erik Kline <ek@google.com> Merge "Support registering a request for the default network" into nyc-dev am: d36ba73
am: e96834c

* commit 'e96834c583f99fb31bb9c80bddc8a73387fed028':
Support registering a request for the default network
a2d29407d02ba692a90507db8b6fc2cf5cf89725 16-Mar-2016 Erik Kline <ek@google.com> Support registering a request for the default network

Change-Id: I079f5be97b585cf5692dd4c7a144b993d168a9a5
onnectivityServiceTest.java
7cb8b096adffea9d0d18b02ddf2c91bca562e8e7 22-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: Clean up for uninstalled packages." into nyc-dev am: da70ee4
am: 709432d

* commit '709432d99d340cb7b44b258c95b0a2f5a11937dd':
ShortcutManager: Clean up for uninstalled packages.
cdc78f7137b8036dd96c92ff15fc04ee8fc49c5c 21-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Clean up for uninstalled packages.

Bug 27548047

Change-Id: I95ca832af496fbf71023eb27a7e2647c124ffb86
m/ShortcutManagerTest.java
40240b17c978637b5de55c6b4a89ba8dc0ef0e8b 21-Mar-2016 Victor Chang <vichang@google.com> Merge "Api change of DPM.setApplicationRestrictionsManagingPackage()" into nyc-dev am: d3c0cf5
am: 6918dbc

* commit '6918dbc87144d273fae62dae7c524993f0cbba7b':
Api change of DPM.setApplicationRestrictionsManagingPackage()
d3c0cf50b6c8e71c0c409abcd3b8c32f98f7cb71 21-Mar-2016 Victor Chang <vichang@google.com> Merge "Api change of DPM.setApplicationRestrictionsManagingPackage()" into nyc-dev
cd14c0a9daa42a7ccacef345b3b2ef255790f993 16-Mar-2016 Victor Chang <vichang@google.com> Api change of DPM.setApplicationRestrictionsManagingPackage()

Throws NameNotFoundException instead of IllegalArgumentException

Can't throw NameNotFoundException directly from DPMS as
aidl doesn't support checked exception

Bug: 27532565
Change-Id: I202721f41057f92ad2dd851d4769ba4502a8f9b3
evicepolicy/DevicePolicyManagerTest.java
8eeb4f2b86a0bc4051b1684c1757924b04e6ed74 18-Mar-2016 Suprabh Shukla <suprabh@google.com> Merge "Added a unit test for TaskPersister" into nyc-dev am: 07317df
am: 197b8d3

* commit '197b8d308390aaa629ed0e6e73763d27e8260522':
Added a unit test for TaskPersister
07317df6ab3577a215f5fcbb8076d7e1d9c94e04 18-Mar-2016 Suprabh Shukla <suprabh@google.com> Merge "Added a unit test for TaskPersister" into nyc-dev
f50b458e7107d23483d8c6ba1121d921773e45c6 24-Feb-2016 Suprabh Shukla <suprabh@google.com> Added a unit test for TaskPersister

Added a simple unit test which checks the methods used to save and load the set
of taskids to file. The test creates a user, adds some task ids to the
set of taskids for that user, saves it and loads it to see whether the
set loaded is the same as the one that was saved.

Change-Id: If92be8abf9a7e3ef90630a3786867f0e1ba12f3e
m/TaskPersisterTest.java
fd5e7ab3cf01300bd21c33588a42e0ed60b81dce 18-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Improve ShortcutSrvice" into nyc-dev am: 45c1827
am: 706928d

* commit '706928df5d361e15623108a8f47fae28cad5a9d7':
Improve ShortcutSrvice
aa8b94aa79df94d77d0f7698ce532ac98f197a99 17-Mar-2016 Makoto Onuki <omakoto@google.com> Improve ShortcutSrvice

- Delayed save
- Reset logic update

Bug 27548047

Change-Id: Ibd52f90a7986991974301b7ff1f1d8520f9ef0d9
m/ShortcutManagerTest.java
20c9b4f5efb72e67c979152aca45fa3ea4556069 17-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Support multi-launcher" into nyc-dev am: fb3f3f5
am: 7572efa

* commit '7572efad408d94ecbeed28aa7c2a89437ee8ac40':
Support multi-launcher
e6c88a0c1e469b39aebb9149b19617193c83efa9 17-Mar-2016 Lorenzo Colitti <lorenzo@google.com> Merge changes Idf0cfee8,I27307e2e into nyc-dev am: 7d0e392
am: e77e70d

* commit 'e77e70d00f3da6dd856f2d641d46080fbebacd0a':
Use native netd binder interface in NetworkManagementService.
Fix IdleableHandlerThread.
fb3f3f5b283095cff67ce78b554700958543d4f5 17-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Support multi-launcher" into nyc-dev
5eaaf747b4be27a8ef9d7fb5a2531543db490b89 02-Mar-2016 Lorenzo Colitti <lorenzo@google.com> Fix IdleableHandlerThread.

Occasionally, ConnectivityServiceTest fails with "BUG: only one
idle handler allowed". I have not been able to reproduce this
consistently, but code inspection reveals an unsafe access to
mIdleHandler inside queueIdle. Wrap that in a synchronized block.

Change-Id: I27307e2e55fa8d937d7f043bd436894091c3c667
onnectivityServiceTest.java
de66737ae9c5d5c94155820fad65224a83d04c3d 15-Mar-2016 Makoto Onuki <omakoto@google.com> Support multi-launcher

Each launcher can have its won set of pinned shortcuts.
- Shortcuts pinned by others should look like not pined to this
launcher. This affects how ShortcutQueryFLAG_GET_PINNED works,
as well as what ShortcutInfo.isPinned() returns.

- When pinning a shortcut, it should be a visible one to itself --
a non-dynamic shortcut that's pinned by another launcher but
not by the caller is not visible, so this launcher cannot pin it
either.

- Also clean up the dynamic shortcut adding.

Bug 27548047

Change-Id: Ia478a2ea19b7d35557ec6ea42384c79a84d6b8de
m/ShortcutManagerTest.java
fdc8d14ce5ed411a3d0530d8084ae5fc8ac0ce09 15-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Fix launcher side callback" into nyc-dev am: ed1b89878b
am: de40929c65

* commit 'de40929c65a28525629c962d859758ff5e61e412':
Fix launcher side callback
ed1b89878bdf1fa9b5e4b2dfc766383d531d4315 15-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Fix launcher side callback" into nyc-dev
588ad4a563b1c3054ee092098efde7f7f0eb3f6a 15-Mar-2016 Mahaver Chopra <mahaver@google.com> Merge "Update DPM.reboot with new restriction" into nyc-dev am: 8a8e8ea19a
am: 648c70a3b7

* commit '648c70a3b79264467512916ca7852c4147fd06d3':
Update DPM.reboot with new restriction
1216ae5d023e8f6e4f158a447a5764288e4ccc3e 11-Mar-2016 Mahaver Chopra <mahaver@google.com> Update DPM.reboot with new restriction

DPM.reboot() should not be called when there is an ongoing call on the
device.

Bug:27531799
Change-Id: Idc1fa4c7aa79b20ec9c2afcccf855455ee316787
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
4dbe0ded4ae9faaef580be80184fca0749e27198 15-Mar-2016 Makoto Onuki <omakoto@google.com> Fix launcher side callback

- Fix crash in work profile case
- Calculate shortcuts for each caller
- Add tests

Bug 27548047

Change-Id: I1a5b6a96956abac75d01eb5cc1cec9a9e8e379a3
m/ShortcutManagerTest.java
10938792927cc19cde220fd7011062ce7a0844f4 15-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Make "reset-throttling" per-user" into nyc-dev am: 84dce8cba9
am: 624c917192

* commit '624c9171922da2ad1d2ff4013568434b6b7449cc':
Make "reset-throttling" per-user
4554d0e5b69433ddaa698e976ee584f7f4f14948 14-Mar-2016 Makoto Onuki <omakoto@google.com> Make "reset-throttling" per-user

Also don't reset the counter when the time is invalid

Bug 27549307

Change-Id: Ib9ad030e348ec5e32936709f1284e3c76e88e254
m/ShortcutManagerTest.java
613eb64018c969d3dd9c0f57de2f6cd9bfa79b7b 14-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Implement the launcher side permission." into nyc-dev am: 49f6fbcd1f
am: 6c525ae97b

* commit '6c525ae97b76d9d6dd864c913e32b9249ca93199':
Implement the launcher side permission.
49f6fbcd1f516ec543ada6aeab62eb51a3cdf712 14-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Implement the launcher side permission." into nyc-dev
2d5b465fa9235e66ec176f6d6ffaaa0c18143e41 12-Mar-2016 Makoto Onuki <omakoto@google.com> Implement the launcher side permission.

Only the default launcher can call the LauncherApps shortcut APIs.

Bug 27548047

Change-Id: I6d597fcad80c5201a2f93b8cbecd567fc79926d8
m/ShortcutManagerTest.java
941b85793d9194ace6bca13b29a9f110bb8d4773 14-Mar-2016 Jeff Davidson <jpd@google.com> Merge "NetworkStats.Bucket API polish." into nyc-dev am: 1c0c14febf
am: cb4ad1548e

* commit 'cb4ad1548ec10019760bbfd76268805809301fd6':
NetworkStats.Bucket API polish.
1c0c14febfaab3fac0239328e2f3b0aaeb9bf56d 14-Mar-2016 Jeff Davidson <jpd@google.com> Merge "NetworkStats.Bucket API polish." into nyc-dev
1f7e05eda687279ac9deb894f42ac927bd471ad2 10-Mar-2016 Jeff Davidson <jpd@google.com> NetworkStats.Bucket API polish.

-Add @IntDef constants for STATE_ and ROAMING_.
-Expand docs for ROAMING_ constants.
-Use ROAMING_NO/YES instead of ROAMING_DEFAULT/ROAMING.

Bug: 27531260
Change-Id: I54ecfb4148caa549214df0bee9983036ffa4cb55
et/NetworkStatsObserversTest.java
et/NetworkStatsServiceTest.java
c2c0db67ab5330b7e3a8be77ca878cd6a5b6d38f 14-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Add ENCRYPTION_STATUS_ACTIVE_PER_USER to..." into nyc-dev am: c070a099f5
am: d0a90344fd

* commit 'd0a90344fdd11b9b639d45678fd1914f1c42719c':
Add ENCRYPTION_STATUS_ACTIVE_PER_USER to...
d4c9e541ec7110d3c842d6f92c3ec6beb0b6d997 26-Feb-2016 Makoto Onuki <omakoto@google.com> Add ENCRYPTION_STATUS_ACTIVE_PER_USER to...

getStorageEncryptionStatus()
Use StorageManager APIs to get the encryption
state instead of from the system properties
directly.

Bug 26547262

Change-Id: Ic27baa9489d43a93873f8bb0428084f8886aed67
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DpmMockContext.java
94ae124147f1bdb98cc13547a3e414a5bf1b8b5c 11-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Test for ShortcutManager.updateShortcuts(), also" into nyc-dev am: 04efe9e5ff
am: 0408672bcb

* commit '0408672bcbc9a23ff2c83962ceb8399aa0dbc087':
Test for ShortcutManager.updateShortcuts(), also
7a6a05f0ccc8c57496d0a1e2b0882ab7de3175e5 11-Mar-2016 Makoto Onuki <omakoto@google.com> Test for ShortcutManager.updateShortcuts(), also

... fix bugs

Bug 27548047

Change-Id: Ia55d35521912dcba2fb1bb9c20588a83d1a2d004
m/ShortcutManagerTest.java
903f462bdad7daf36cfa46ce532b9893e155d507 10-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Refactor ShortcutService" into nyc-dev am: be4f470038
am: 7f16c30f8c

* commit '7f16c30f8cf8a8a2e93ab771fdc785e38d8a917a':
Refactor ShortcutService
41066a61b912f22dd0342a002b4b5e060719cec9 10-Mar-2016 Makoto Onuki <omakoto@google.com> Refactor ShortcutService

Move PackageShortcuts to the top level.

Change-Id: If19a7dd979f8697e54a45c3aa654bad235f6259d
m/ShortcutManagerTest.java
7e4a7fcfae433aca9fb6ac1255aba82865dd6a88 10-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManaegr: load config from settings, also..." into nyc-dev am: 495d124a67
am: 837a5fd72d

* commit '837a5fd72d4ee48b94d3c9f5dc9a409ecfd3caf9':
ShortcutManaegr: load config from settings, also...
495d124a67daa1f070ca0ca0be0c14377675200a 10-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManaegr: load config from settings, also..." into nyc-dev
5b416edcff0088a74c60898f4e7b7173e9d69253 10-Mar-2016 Jeff Sharkey <jsharkey@android.com> Merge "Log when pre-N apps send too much to DropBox." into nyc-dev am: 93720d5729
am: 7051cad205

* commit '7051cad205e3ea3269c51811f5586e165d533af0':
Log when pre-N apps send too much to DropBox.
93720d572971115b4968acc8f64529b5698bfd11 10-Mar-2016 Jeff Sharkey <jsharkey@google.com> Merge "Log when pre-N apps send too much to DropBox." into nyc-dev
b8e8a91f54f9f11a5936611c00d198ed21824854 10-Mar-2016 Jeff Sharkey <jsharkey@android.com> Log when pre-N apps send too much to DropBox.

Once they target N, they'll start getting exceptions, which is
intended to make sure they pay attention to data that would have
otherwise been dropped on the floor.

Bug: 27571535
Change-Id: I49163679c629cd0788327d2c3a654e757ecdcb99
ropBoxTest.java
4362a66dba0b4cfa9fadb6c8af10c590e4ba880d 09-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManaegr: load config from settings, also...

support "cmd override-config" and "cmd reset-config" to help CTS.

Bug 27548047

Change-Id: Id6c9e6f41a2238856dd3470d88d88d0e7e686f26
m/ShortcutManagerTest.java
108853ba12c2ae2071baa0571d3e2c8ab8ac5731 09-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "ShortcutManager: add remaining APIs." into nyc-dev am: 4a07c34ca8
am: 027fd0ae95

* commit '027fd0ae9512b57ec13448d292609ad41ebd0bb6':
ShortcutManager: add remaining APIs.
5504622fb01ab9774b5e73d05f86ee03a8b68ab7 08-Mar-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: add remaining APIs.

- Icons are now persisted. (under /data/system_ce, as PNGs)
- the "load icon" APIs in LauncherApps are supported.
- Implement updateShortcuts()

- Addressed all the comments on the previous CL
- @hide the newly added constructor for PersistableBundle

- Enhance incoming shortcut validation
- A lot of internal clean-up.

Bug 27548047

Change-Id: I8e3c1ccd3e0a997a6d271c84d81170f0c022b60e
m/ShortcutManagerTest.java
3b0196122fda333f986d92d04030fd50f192e58b 09-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Implement LauncherApps.startShortcut()." into nyc-dev am: 76cb56bb21
am: 6e6a3ed250

* commit '6e6a3ed2502e5e6b07403a21e8e954a200fb0146':
Implement LauncherApps.startShortcut().
76cb56bb210a2ffeeda6294b8cde2dd971c495a7 09-Mar-2016 Makoto Onuki <omakoto@google.com> Merge "Implement LauncherApps.startShortcut()." into nyc-dev
43204b8357d781f284037fb8b7b7050ed04a2103 09-Mar-2016 Makoto Onuki <omakoto@google.com> Implement LauncherApps.startShortcut().

Bug 27548047

Change-Id: I357732e22be0959fb573fd6cdaee7c6b439ef7c4
m/ShortcutManagerTest.java
80e6e6332ba19f78322f137b4f06e8dfdd7437d5 09-Mar-2016 Sudheer Shanka <sudheersai@google.com> Merge "Update DPM.getWifiMacAddress to take admin component as argument." into nyc-dev am: 97e89c624e
am: 6f0d578ea9

* commit '6f0d578ea97454e550586f58279bf868f24a2d53':
Update DPM.getWifiMacAddress to take admin component as argument.
97e89c624e19c0a0ebe3d76506a493cfe29c0558 08-Mar-2016 Sudheer Shanka <sudheersai@google.com> Merge "Update DPM.getWifiMacAddress to take admin component as argument." into nyc-dev
af00108ca4e8e3de7c6d155891b74d43c18f5eba 08-Mar-2016 Makoto Onuki <omakoto@google.com> resolve merge conflicts of 1ca3800c44 to master

Change-Id: I4657cdf99900cd555c3109605e8cbdbb0fed79e6
3cb4da16dcf07474acefb709d10b22cdfdefd81b 08-Mar-2016 Sudheer Shanka <sudheersai@google.com> Update DPM.getWifiMacAddress to take admin component as argument.

Bug: 27532280
Change-Id: I3a5e9557c3c6ac43c458c911a5309bdb2655fb66
evicepolicy/DevicePolicyManagerTest.java
6f7362d92573e4ae693bc513dca586d6a4eb087b 04-Mar-2016 Makoto Onuki <omakoto@google.com> Introducing ShortcutManager

What's supported:
- Most APIs are implemented, except for SM.updateShortcuts(),
the icon APIs in LA, and LA.startShortcut().
- Persisting information, except for icons
- Throttling

In addition, now PersistableBundle has a public copy
constructor from a Bundle. (Do we want to @hide it?)

TODOs:
- Add icon support
- Implement missing APIs
- Listen to PACKAGE_* broadcasts and do clean-up
- Support multi-launcher apps (pinned shortcuts per launcher)
- Dev option to reset throttling
- Load throttling config from Settings
- Backup & restore
- Figure out LauncherApps permissions (BIND_APPWIDGETS??)
- Other minor TODOs in the code
- Better javadoc

Note: This requires Idf2f9ae816e1f3d822a6286a4cf738c14e29a45e

Bug 27325877

Change-Id: Ia5aa555a4759df5f79a859338f1dc5e624cd0e35
m/ShortcutInfoTest.java
m/ShortcutManagerTest.java
estutis/TestUtils.java
4c6294208dc11ee18a22d6ad0219b03e599a8d4c 04-Mar-2016 Victor Chang <vichang@google.com> Merge "enforceCanSetDeviceOwnerLocked should enforce userId == USER_SYSTEM for non-split user mode" into nyc-dev am: 0114263a1a
am: 51296a5483

* commit '51296a548312799b5331714b5b581a064f80d737':
enforceCanSetDeviceOwnerLocked should enforce userId == USER_SYSTEM for non-split user mode
0114263a1aff5dea92fdafbec81c1b40093e9aba 04-Mar-2016 Victor Chang <vichang@google.com> Merge "enforceCanSetDeviceOwnerLocked should enforce userId == USER_SYSTEM for non-split user mode" into nyc-dev
e29cd4724ff41f1cd81c1493f02fb0ba2b2f8197 02-Mar-2016 Victor Chang <vichang@google.com> enforceCanSetDeviceOwnerLocked should enforce userId == USER_SYSTEM for non-split user mode

Bug: 27453111
Change-Id: I1acdfecdf4474696e904a6a4df189453be306aa4
evicepolicy/DevicePolicyManagerTest.java
e22fc07fa96e4c3d49c0d14da82d633a8e1eebdb 02-Mar-2016 Lorenzo Colitti <lorenzo@google.com> Merge changes Id78aab9c,I51096b18 into nyc-dev am: 1856df512f
am: 057f24547a

* commit '057f24547afe0e2122863cab96b8149a43d3cf2d':
Speed up ConnectivityServiceTest.
Make it easier to test code that uses WakeupMessage.
bfecba2938bd01299c74bc7d7cf0191c1908776a 20-Feb-2016 Lorenzo Colitti <lorenzo@google.com> Speed up ConnectivityServiceTest.

1. Override WakeupMessage with an implementation that uses
sendEmptyMessageDelayed. This allows us to replace a
6-second sleep with a 150ms wait.
2. Change waitFor()'s polling interval from 100ms to 50ms.

With these changes ConnectivityServiceTest goes from ~9s to ~3s.

Change-Id: Id78aab9cded90a5b17f09d7f437904e179808dd2
onnectivityServiceTest.java
cdbf981889e5765be7bc8069c460f9ffcf1056b0 02-Mar-2016 Lorenzo Colitti <lorenzo@google.com> Merge changes Ic366b532,I0179b45b into nyc-dev am: b7ffb76437
am: 6ad667122c

* commit '6ad667122c35098ab62afd92b5ac26937397825b':
Move PinningNetworkCallback out to a new NetworkPinner class.
Use MessageUtils in ConnectivityManager.
b7ffb764370805aa0734d2f31bc2def34df04d86 02-Mar-2016 Lorenzo Colitti <lorenzo@google.com> Merge changes Ic366b532,I0179b45b into nyc-dev

* changes:
Move PinningNetworkCallback out to a new NetworkPinner class.
Use MessageUtils in ConnectivityManager.
531a34430072b9296aaeb47d9e7d04326a93fee4 29-Feb-2016 Lorenzo Colitti <lorenzo@google.com> Move PinningNetworkCallback out to a new NetworkPinner class.

Also add tests.

Bug: 19159232
Change-Id: Ic366b53259ee5944a8e864876425a6558c0a7216
onnectivityServiceTest.java
5a207e0bd909202e27458b4f00988d923d04760d 26-Feb-2016 Julia Reynolds <juliacr@google.com> Merge "Introduce IMPORTANCE_MIN." into nyc-dev am: abf11299b7
am: cb64b53fd3

* commit 'cb64b53fd37291e0e932af90e42ffe711f9031b9':
Introduce IMPORTANCE_MIN.
f0f629ffe44716b8d900929135142f0ebb9325f4 25-Feb-2016 Julia Reynolds <juliacr@google.com> Introduce IMPORTANCE_MIN.

Allow HUNs for >= IMPORTANCE_HIGH.
Allow full screen intents for IMPORTANCE_MAX.

Bug: 22960980
Bug: 26918284
Change-Id: Id4d2b90ea2e21563dbc716db411060d826e73699
otification/RankingHelperTest.java
137077cdddf22dfd973b40a469c1bbb2c65f65fc 24-Feb-2016 Makoto Onuki <omakoto@google.com> Merge "Support safe mode properly." into nyc-dev am: a4fae1545a
am: 04d8eca54a

* commit '04d8eca54af9d46e793134a9168f658b9d68017f':
Support safe mode properly.
a4fae1545ae38f61385e45e8f635994f447efca5 24-Feb-2016 Makoto Onuki <omakoto@google.com> Merge "Support safe mode properly." into nyc-dev
889c0880661bda16e3759995e03766ddf0350732 17-Feb-2016 Makoto Onuki <omakoto@google.com> Support safe mode properly.

In safe mode, IPM.queryXxx() doesn't work. Use IPM.getReceiverInfo()
directly instead.

Bug 27108276

Change-Id: Ice8f882559b8f0596a19ddb3a16395a4dc538a25
evicepolicy/DpmTestBase.java
fe60596ff1463f2440b0ca917ec5ad750272805d 24-Feb-2016 Dianne Hackborn <hackbod@google.com> Merge "Work towards issue #26390161: Throttle syncs/jobs when system is low on RAM" into nyc-dev am: 11007fa30c
am: f6461b288e

* commit 'f6461b288eec466bd82439f5b5bdfec28483bb68':
Work towards issue #26390161: Throttle syncs/jobs when system is low on RAM
1085ff6ee531931ef7f55cbadbc83616f619b292 24-Feb-2016 Dianne Hackborn <hackbod@google.com> Work towards issue #26390161: Throttle syncs/jobs when system is low on RAM

First, we need to make the job scheduler prioritize jobs for
foreground apps over background apps (so we will degrade well
when we are limiting the number of concurrent jobs).

So now the job scheduler keeps track of the process state of
each uid, and uses that to bump up the priority of jobs
associated with foreground uids. Added constants for priorities
since we have different places specifying priorities.

Also cleaned up a bit of the reporting of "wrapped" jobs from
the sync manager -- there is a new tag argument that can be supplied,
to have the name and tag used in various places be based on that
instead of the useless internal class name.

Change-Id: I8781750ddfac1472a98e1873fc38c014425db3d6
ob/JobStoreTest.java
1d1beb4dcff5839f87c809be7d129c150fbbc94e 23-Feb-2016 Chris Tate <ctate@android.com> Merge "Limit scheduled jobs to 100 per app" into nyc-dev am: 3e30b118f7
am: 21a7ef469f

* commit '21a7ef469fe6cb4f6ed569f75f2ee36676bad9bb':
Limit scheduled jobs to 100 per app
2f36fd6fc94b62b8ccd03cdcea89826d05414f93 19-Feb-2016 Christopher Tate <ctate@google.com> Limit scheduled jobs to 100 per app

Packages that are entitled to schedule jobs on behalf of other uids
are not subject to the limit. Also break the JobStore's monolithic
set of jobs into per-uid slices for efficiency and orthogonality.

Bug 27150350

Change-Id: I8f5f718bf200d55f9977a6fc53b7f617e7652ad9
ob/JobStoreTest.java
87c6da54b2710c7ea953aa8a743e7551ab9cbe43 20-Feb-2016 Ian Pedowitz <ijpedowitz@google.com> resolve merge conflicts of 2de058fcc9 to master

Change-Id: Ib6812ad2fc6402b2885ce81de8f7d892c07971e6
b0001f6fb1383d9824c2733896b0b348e7f77240 16-Feb-2016 Dianne Hackborn <hackbod@google.com> Remove internal locking from JobStatus.

Now all state of JobStatus is implicitly protected by the lock
of whoever is using it -- in this case the global lock for the
JobSchedulerService. This allows us to remove all of the atomic
variables and just replace those with a simple bit field.

The required constraints for a job are now statically defined
once a JobStatus is created, and don't change. (They wouldn't
change before, but now this is absolutely specified to be the
case.) This required tweaking the constructors a bit so that
the earliest and latest run times are computed as part of the
core class initialization.

Also clarified methods on StateController that are called with
the lock held, and took advantage of that in the various
controllers to not now redundantly re-acquire the lock.

Change-Id: I595c5e7d1bff1bd2ff906d612581af82878a25ee
ob/JobStoreTest.java
33d31c5b70c7d056e799e34bb6eccbe6939714ea 16-Feb-2016 Dianne Hackborn <hackbod@google.com> Simplify job scheduler service locking.

Unify all locks to just one lock protecting the entire service.
There is really no need for more complicated locking -- there is
nothing in the code that can take a long time to complete. And
having a single lock will allow various parts of the code to be
much simpler and easier to maintain.

This is just the first step of the change, switching all of the
locking to use one lock. With this done, we can now start
simplifying the code. For example, JobStatus no longer needs
to do any locking (or have atomic variables and such), it can
just rely on its callers holding the global service lock.

Change-Id: I502916ed7f2994b601750c67a59a96b1a4e95c6d
ob/JobStoreTest.java
53faf747f618f71fe3fcbffe6898fcb771317c18 19-Feb-2016 Julia Reynolds <juliacr@google.com> Merge "Remove Notification Topics." into nyc-dev am: 73d96fb4bb
am: f7f055e407

* commit 'f7f055e40709d8de6bad8f4384f4dc59adceb213':
Remove Notification Topics.
73d96fb4bbe1e3796e655314619bf9897d07c929 19-Feb-2016 Julia Reynolds <juliacr@google.com> Merge "Remove Notification Topics." into nyc-dev
710745d320dcf7e2dfabf06aabffc499aec0c9ce 19-Feb-2016 Makoto Onuki <omakoto@google.com> Merge "Clean up on UserManagerService and DPMS" into nyc-dev am: 4ab36372fb
am: e1c87ee38b

* commit 'e1c87ee38b5cbb4e0a151968505ea6a6c244b56f':
Clean up on UserManagerService and DPMS
f5d50fbe1140bad83d20da149ecd8fceede51567 19-Feb-2016 Dianne Hackborn <hackbod@google.com> Merge "Simplify job scheduler service locking."
4ab36372fb7f2f8236d9fa308ec508582fc52607 19-Feb-2016 Makoto Onuki <omakoto@google.com> Merge "Clean up on UserManagerService and DPMS" into nyc-dev
2a3c3da0fc07ef37abc45cfb0166bdf5f7f202b6 18-Feb-2016 Makoto Onuki <omakoto@google.com> Clean up on UserManagerService and DPMS

- Avoid the ART warning about 4.1 compatibility
- Avoid integer overflow in DPMS

Bug 27243525
Bug 27242859

Change-Id: I92af323287e348fbd0eff31e6cf9823be8e41024
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
09bed7a28084564703a0ff4aac855943ecf0986f 18-Feb-2016 Makoto Onuki <omakoto@google.com> Merge "Fix bugs in user restriction migration" into nyc-dev am: 24f62ea634
am: 5cee7cafde

* commit '5cee7cafde47ba3a38d3a61cfeccdf502ec7fca1':
Fix bugs in user restriction migration
c607d1db22c95d2f09ca2ec45320f1ba52ea33ca 18-Feb-2016 Antonio Cansado <acansado@google.com> Merge "Implementation of data usage callbacks." into nyc-dev am: 12d7ea815b
am: 7e098af672

* commit '7e098af67280dbc877790486043998b13e83986e':
Implementation of data usage callbacks.
24f62ea63482e6c5d5ba3357951e13e25221eb2e 18-Feb-2016 Makoto Onuki <omakoto@google.com> Merge "Fix bugs in user restriction migration" into nyc-dev
60949288064460894bdd288f4865cdb180c0e501 18-Feb-2016 Makoto Onuki <omakoto@google.com> Fix bugs in user restriction migration

Originally I didn't know user-0 could have PO, so I excluded this case
from migration. Now we handle it properly.

Also make sure only restrictions that can actually be set by each
owner moves to the owner restriction. (Because of this, we no longer
have to have DISALLOW_WALLPAPER in the exception list, because
owners can't set DISALLOW_WALLPAPER.)

Bug 27225996

Change-Id: I6ad79d90e6c4400abbb1e4feba6ba59e3b650815
evicepolicy/DevicePolicyManagerServiceMigrationTest.java
12d7ea815b772b1013f9f5a583d296701a702a0c 18-Feb-2016 Antonio Cansado <acansado@google.com> Merge "Implementation of data usage callbacks." into nyc-dev
541d6fdf2e3cae7f536cb3c4bbade5d42d886ec4 18-Feb-2016 Makoto Onuki <omakoto@google.com> Merge "Ensure DO/PO are also DA." into nyc-dev am: aafff2f835
am: d11a524ee2

* commit 'd11a524ee2054f3febcdc8310969535edc404a89':
Ensure DO/PO are also DA.
ef37f284364cc45c2ed91bfe04c489d2cedd32d2 12-Feb-2016 Julia Reynolds <juliacr@google.com> Remove Notification Topics.

Bug: 23220370
Change-Id: Ifbcdbab1cf6974c192483091512f75762784a98e
otification/RankingHelperTest.java
cd42acd9515bdce89d4f1401ee2888d684bf1918 17-Feb-2016 Antonio Cansado <acansado@google.com> Implementation of data usage callbacks.

NetworkStatsService will register data usage requests
and keep data usage stats scoped to the request.

There are different types of data usage requests
- scoped to a set of NetworkTemplate; these are restrictred to
device owners and carrier apps and allow the caller to monitor
all activity on the specified interfaces.
- scoped to all uids visible to the user, if the user has
android.Manifest.permission#PACKAGE_USAGE_STATS permission.
The set of uids may change over time, so we keep track of that.
- scoped to a set of uids given by the caller, granted that
the caller has access to those uids.
- scoped to the caller's own data usage. This doesn't require
PACKAGE_USAGE_STATS.

Bug: 25812785
Change-Id: Ie11f35fc1f29d0dbe82f7fc924b169bb55c76708
etworkStatsServiceTest.java
et/NetworkStatsObserversTest.java
et/NetworkStatsServiceTest.java
184db600df42c2b27a2d34deecab57d591434b22 18-Feb-2016 Makoto Onuki <omakoto@google.com> Ensure DO/PO are also DA.

Bug 24503508

Change-Id: Ib957b84d5bee185501636c406d9aaf4985a79d8d
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmTestBase.java
d506b2bad27835e701d4f6a9428124653efae72d 16-Feb-2016 Dianne Hackborn <hackbod@google.com> Simplify job scheduler service locking.

Unify all locks to just one lock protecting the entire service.
There is really no need for more complicated locking -- there is
nothing in the code that can take a long time to complete. And
having a single lock will allow various parts of the code to be
much simpler and easier to maintain.

This is just the first step of the change, switching all of the
locking to use one lock. With this done, we can now start
simplifying the code. For example, JobStatus no longer needs
to do any locking (or have atomic variables and such), it can
just rely on its callers holding the global service lock.

Change-Id: If026b7ef3a46a44f6802232474e629851a232a37
ob/JobStoreTest.java
768e087b5a667f2251d6b8ddb2c438fd37bedc4b 16-Feb-2016 Makoto Onuki <omakoto@google.com> Merge "Don\'t allow deactivating DAs when the user is not unlocked" into nyc-dev am: dafec11e69
am: f56aa71b9f

* commit 'f56aa71b9f477c4e718989ca770cfdc6fc6c5998':
Don't allow deactivating DAs when the user is not unlocked
dafec11e698daf054730cfb04db64f3e31a0c9ff 16-Feb-2016 Makoto Onuki <omakoto@google.com> Merge "Don't allow deactivating DAs when the user is not unlocked" into nyc-dev
132c8298fa63d5d5ba7730fb8d11d967cec060a3 16-Feb-2016 Shreyas Basarge <snb@google.com> Merge "Fixes JobScheduler not persisting flex and sourcePackage" into nyc-dev am: b55fa08c74
am: a8a585e48c

* commit 'a8a585e48c6ab1aad543add047f6a5a1a822cc1b':
Fixes JobScheduler not persisting flex and sourcePackage
b55fa08c74141d2c0e4ef9218214e1ba30bac8b8 16-Feb-2016 Shreyas Basarge <snb@google.com> Merge "Fixes JobScheduler not persisting flex and sourcePackage" into nyc-dev
8e64e2e6a4d2964b6a4147f5cccd03de934c86cd 12-Feb-2016 Shreyas Basarge <snb@google.com> Fixes JobScheduler not persisting flex and sourcePackage

There was a bug with persisteing and restoring flex and
sourcePackage. Fixed it and added tests.

Change-Id: Ie8e4714b4727ecef4254773fd4339b28f4a47c01
ob/JobStoreTest.java
1a5ee776ee51ae6fba30c8f3b33e26eb7f9dedc6 13-Feb-2016 Makoto Onuki <omakoto@google.com> Don't allow deactivating DAs when the user is not unlocked

Bug 27149570

Change-Id: I772d9cbd6edc822c8f7b1988905b702e05e674cd
evicepolicy/DevicePolicyManagerTest.java
d82c274ddd4807f7b3f7bfa65ca2fd0f4cdf76bc 12-Feb-2016 Rubin Xu <rubinxu@google.com> Merge "Fix testApplicationRestrictionsManagingApp unit test" into nyc-dev am: d6c90a8883
am: 8678f7965d

* commit '8678f7965d8d41a2f3d916a8e32ebb5c0c4c7b9a':
Fix testApplicationRestrictionsManagingApp unit test
ba60473a6539d16bef8720d79b5559512303bddf 11-Feb-2016 Dianne Hackborn <hackbod@google.com> Implement transient extras for jobs.

You can now associate an arbitrary Bundle of extras with a job,
as long as the job is not persisted.

Also implement deep-copy of Bundle.

Change-Id: I7890d627492b664d9b1f039e8cb82f8868de7be3
ob/JobStoreTest.java
ed1928a981cbff9a67b5c1786ded8cbdf848056b 11-Feb-2016 Rubin Xu <rubinxu@google.com> Fix testApplicationRestrictionsManagingApp unit test

The API now requires the app restriction manager app to exist
on the current user when it is called.

Change-Id: I809816d4f5d73378c23b18d7b74ebb282b7dc444
evicepolicy/DevicePolicyManagerTest.java
2b4c8f926fdc8a2ccb88668ca85edfd3ecb9913a 09-Feb-2016 Shreyas Basarge <snb@google.com> SyncManager sync blow up fix

Duplicates for periodic syncs would be
created just after boot and when a
periodic sync was delayed. This CL fixes
the behavior.

Bug: 26954967
Change-Id: I2440961629d443a62f96360563d435af9137857b
(cherry picked from commit 1675400a7cd0b56e5adc5606fb4fea77f8d24ea5)
ontent/SyncOperationTest.java
1675400a7cd0b56e5adc5606fb4fea77f8d24ea5 09-Feb-2016 Shreyas Basarge <snb@google.com> SyncManager sync blow up fix

Duplicates for periodic syncs would be
created just after boot and when a
periodic sync was delayed. This CL fixes
the behavior.

Bug: 26954967
Change-Id: I2440961629d443a62f96360563d435af9137857b
ontent/SyncOperationTest.java
354cd3ce2213a1032d9138ea6fa1420f055ab08c 17-Dec-2015 Svet Ganov <svetoslavganov@google.com> Multi packages per APK

This change introduces the ability to have multiple packages per
APK. The feature is currently restricted to privileged apps and
updates to such apps.

In essence the manifest can have multiple child package declarations.
A child package can declare everything an Android package can except
some tags or attributes that are not applicable and instead inherited
from the parent when needed. For example, the target SDK of the parent
applies to all children.

A child package can be updated only through the parent package.
A package with multiple child packages is installed, uninstalled
atomically - no partial installs where some child packages are not
installed.

The remaining work is to ensure broadcasts are also sent for child
packages. This will come in a subsequent change.

Sample app:ag/848432

Design doc: https://docs.google.com/document/d/18nFWtJuZchLxrHf5SBbJW03-Ky9Rh_G0-OVB14b6u78

Change-Id: I6fd021d981bf5786290e0c53502724a14c97358c
m/KeySetManagerServiceTest.java
046cc21b7569e25508bf71fca4fb6d36c893b27b 05-Feb-2016 Amith Yamasani <yamasani@google.com> Merge "Rewrite app standby stats"
a93542f9d341897f3206f775fd5720663b17504f 04-Feb-2016 Amith Yamasani <yamasani@google.com> Rewrite app standby stats

Don't mix up with usage stats. Keep a separate db and history
based on elapsed time and screen on time.

Unit tests for AppIdleHistory class.

Bug: 26989006
Change-Id: If343785b46da1db67f7c1c1263854c2732a232c6
sage/AppIdleHistoryTests.java
5eec76504ff2ac5a05c73951b7fe38cc6a560bb9 05-Feb-2016 Esteban Talavera <etalavera@google.com> Merge "Fix unit tests"
8375fcec625d482af894cfed7b608f10cacb0f5d 04-Feb-2016 Esteban Talavera <etalavera@google.com> Fix unit tests

http://ag/858485 added a new flag and the mockito didn't match
the call any more

Change-Id: I8f99b1b6063488aeced08513b11c79bf0162006e
evicepolicy/DpmTestBase.java
8514a8131f4644877c5d9c34a1588ee3d854c035 03-Feb-2016 Paul Jensen <pauljensen@google.com> Merge "Android packet filtering program interpreter test & program generator" into mm-wireless-dev
am: 44307adcf3

* commit '44307adcf371bacad4de6925a9207bdbfdc6f874':
Android packet filtering program interpreter test & program generator
44307adcf371bacad4de6925a9207bdbfdc6f874 03-Feb-2016 Paul Jensen <pauljensen@google.com> Merge "Android packet filtering program interpreter test & program generator" into mm-wireless-dev
d38fb7662d0e525eee57062ee8c14f661b1aee2d 08-Jan-2016 Paul Jensen <pauljensen@google.com> Android packet filtering program interpreter test & program generator

Change-Id: I17951bd6320b9eb3b6c43f2ae37f62c2025705c1
pfTest.java
pf2Apf.java
90b896533eb6a8867e7951bbbdbbacd9b520199c 28-Jan-2016 Makoto Onuki <omakoto@google.com> DO / PO Shouldn't be removed as active admin...

even if they asked.

Also clear(Device|Profile)Owner should remove them as the active admin
too.

Also add some more unit tests.

Bug 26858840

Change-Id: I7b3ed92e1b4cbe803381ed6e3f64d8de17b2ebb0
evicepolicy/DevicePolicyManagerTest.java
49caead1c2608f57ac6c260396c6bfd058b921ae 02-Feb-2016 Rubin Xu <rubinxu@google.com> Call SecurityLog methods via Injector

This is to make sure the unit test can mock them out.

Bug: 26911599
Change-Id: I07a1a8b43ad5716a4b667bc5266b3b03997268c5
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DpmMockContext.java
3f3657a61b54d495bf2e692289eb92a48fe5a0b2 28-Jan-2016 Makoto Onuki <omakoto@google.com> Fix DPM unit tests

Bug 26911599

Change-Id: I874c9cd4f63c79bc984777ef3b1b654a414c4911
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DpmMockContext.java
a491c07f36350cbb13b0a3070508553ba6c96608 01-Feb-2016 Shreyas Basarge <snb@google.com> Merge "SyncManager on JobScheduler"
8c834c07675052c984728cbf79f7c2e0d8246e43 07-Jan-2016 Shreyas Basarge <snb@google.com> SyncManager on JobScheduler

SyncManager now uses JobScheduler for scheduling
and persistence purposes.

Change-Id: I38c92aedbf4d891ca297644d0b706835aaedfcd6
ontent/SyncOperationTest.java
ontent/SyncStorageEngineTest.java
7b9f2e1d86e5017dbf5530356ec30d090f703a67 28-Jan-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Added SystemApi for getting serial numbers of users"
940e8577a1569140521fb605336997863529f7ad 26-Jan-2016 Fyodor Kupolov <fkupolov@google.com> Added SystemApi for getting serial numbers of users

Also added UserHandle version of queryBroadcastReceiversAsUser.

Bug: 25844894
Change-Id: I78ecbef186e4ced10425ae2899db72c2d91c5792
m/UserManagerTest.java
e496c555b94086020b0ec155f6a87f6645c6cd93 28-Jan-2016 Etan Cohen <etancohen@google.com> Merge "Allow NetworkFactories to match any network specifier on a request" into mm-wireless-dev
am: bd0858ba67

* commit 'bd0858ba679cced35bda55a643707ad69e4caa34':
Allow NetworkFactories to match any network specifier on a request
92d456e9a62d7dadb3e21f481f7453bd82b1aa23 25-Jan-2016 Julia Reynolds <juliacr@google.com> Show app level settings when an app doesn't use topics.

Change-Id: I205062868ac3a44aa24a29bcb82a9374026287a7
otification/RankingHelperTest.java
44a18081546345a0655748717862a89ae6dd7948 26-Jan-2016 Alan Treadway <alantreadway@google.com> Merge "Add explicit and persistent user provisioning state."
6d009037271b487b45716c3a1f72037b89de6d75 25-Jan-2016 Benjamin Franz <bfranz@google.com> Add SmallTest annotation to DevicePolicyManagerTest

Adding this annotation makes sure that the tests get picked up by
continuous integration tests.

Change-Id: Ia9166898803dd0037f6bb20cb6a12333ed347fd3
evicepolicy/DevicePolicyManagerTest.java
afad8783699b1ba6f3c7ee5961d6ddc2bd771dc1 19-Jan-2016 Alan Treadway <alantreadway@google.com> Add explicit and persistent user provisioning state.

Add explicit modelling of provisioning state so that integration
of management provisioning flows with packages such as setup-wizard
are cleaner, and can be more direct. Previously we relied upon
USER_SETUP_COMPLETE secure setting and HOME intents to signal intent,
but this is not very clear and can be fragile.

Bug: 25858670
Change-Id: Idc56a040f710c3aee281db420f21717da3960722
evicepolicy/DevicePolicyManagerTest.java
fe434a15d6bde9299b51dc284b336944e5cf8a1c 25-Jan-2016 Esteban Talavera <etalavera@google.com> Merge "Add additional APIs supported work on the parent DPM instance"
4c052f237a108457fca3d3864c5654ebd4505111 25-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Implement user affiliation

A user/profile is considered affiliated if it is managed by the same
entity as the device. This is determined by having the device owner and
profile owners specify a set of opaque affiliation ids each. If the sets
intersect, they must have come from the same source, which means that the
device owner and profile owner are controlled by the same entity.

BUG=25599229

Change-Id: I393fe0de70272307ed3c811aaba4b48a5109c562
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmTestBase.java
623999185029a2c5baf29efe4ebdcbcdebcca294 11-Jan-2016 Esteban Talavera <etalavera@google.com> Add additional APIs supported work on the parent DPM instance

Bug: 22543972
Change-Id: I05061e34d120c64d5c49ca6b7b4014d7dadb68f4
evicepolicy/DevicePolicyManagerTestable.java
c48e3b602ead581b06669f59aad786bdc05eb6b0 20-Jan-2016 Jeff Davidson <jpd@google.com> Merge "Implement roaming tracking in NetworkStats summary queries."
a6a78076eeb27084ed815ce0492d4ffe08134bec 12-Jan-2016 Jeff Davidson <jpd@google.com> Implement roaming tracking in NetworkStats summary queries.

Whether a network is deemed roaming or not was already being tracked
as part of the NetworkIdentitySet, so the underlying data store
already tracks roaming and native data separately. However, this data
was being aggregated together in NetworkStatsCollection#getSummary,
since the NetworkIdentitySet is converted to an iface name for the
purposes of matching, and the iface name will be identical whether or
not the iface is considered roaming. Now it is separated.

Also fixes a long-standing bug in NetworkIdentitySet where an identity
read from a saved file would always be considered roaming == false,
even if it wasn't at the time it was written.

Bug: 25813438
Change-Id: I11ab5b51182ed8da7af8fde468df065f9fdc3dad
etworkStatsServiceTest.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
m/ActivityManagerTest.java
17971e383f97db0d398b86ae537448605f70894e 15-Jan-2016 Shreyas Basarge <snb@google.com> Merge "Added priority to JobScheduler scheduling"
5db09084c8e4efc6311754243c39962fc8e7a766 07-Jan-2016 Shreyas Basarge <snb@google.com> Added priority to JobScheduler scheduling

Priority can be assigned to jobs. Higher priority
jobs can preempt lower priority ones. Reason for
calling onStopJob (timeout, preempt, etc.) is set
on the JobParameters object.

Reference:
https://docs.google.com/document/d/1fuVO5rBCkODx8wjk6uulFCP1Uzfx7IVsw2EyKKrGqVA

Change-Id: Ic36016514cec076984d44086316d8d00d896b3aa
ob/JobStoreTest.java
ob/MockPriorityJobService.java
ob/PrioritySchedulingTest.java
b6bb986889cebd19a22f89c0631f03d0ab711a77 12-Jan-2016 Udam Saini <udam@google.com> Merge "Makes captive portal server calculation in one place."
4175be2f4e1e27490f38c387525d0c0cba88b47b 09-Jan-2016 Jeff Sharkey <jsharkey@android.com> Triage SearchManagerService for missing apps.

Searchables aren't available until after the user is unlocked. We
could scan for them while locked, but we're aiming for a minimalist
environment, and scanning them while locked would require us to send
a changed broadcast on every boot.

Switch to using new SystemService lifecycle for faster event
delivery. Restore broken global search observer. Verified that
apps on external storage are handled correctly.

Bug: 26471205
Change-Id: Id99ffe2ea6db37a394454cc7dfa4eab10280ff35
earch/SearchablesTest.java
b7c2487c8b5fbd154643b8ddade8d88507cae137 04-Jan-2016 Udam Saini <udam@google.com> Makes captive portal server calculation in one place.

This also creates a hidden api for the captive portal server calculation
so that the Setup Wizard can use this as well.

bug:13246857
Change-Id: I4dfd0916df97cfce13252c7cc15f7bd05ed95f77
onnectivityServiceTest.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
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmTestBase.java
028d6906d5671bcc8239ead2496f9eb10e4a142b 06-Jan-2016 Kenny Guy <kennyguy@google.com> Merge "Add support message for device admins"
06de4e77c20be239384262b1508f0cf53bedb145 22-Dec-2015 Kenny Guy <kennyguy@google.com> Add support message for device admins

Allow admins to set a long and short support
message for settings to display.

Bug: 25659579
Change-Id: Ib645490785642e49c69d8dbc65455eb3398547ee
evicepolicy/DevicePolicyManagerTest.java
51017d0e23ce9855fabcf786a2067ceb19121fbc 15-Dec-2015 Chris Wren <cwren@android.com> implement assistant service connection

Added a guest-mode to ManagedServices.
Like system services, the lifecycle of a guest is not managed.
Unlike system services, guests are not considered privledged.

The Assistant gets all the usual listener events.
Implemented adjustImportance.
Future work: enqueued, clicked, visibility, removed, annotations

Bug: 22455414
Change-Id: Ic41c0bf625b5e98cb577b49098bba23a539bb507
otification/RankingHelperTest.java
f8373b5afc6dd25350bbca7093178807f1cc9ed6 23-Dec-2015 Mahaver Chopra <mahaver@google.com> DPM Test: DA and PO cannot call DPM.reboot()

Bug: 25304994
Change-Id: Ifaccf3625314f4bfcd7f99413abc9067cc3dd2f9
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
bf60f728cc7ed326fb8978afd9f589a685bb87b7 10-Dec-2015 Esteban Talavera <etalavera@google.com> Device or profile owner can let another app manage app restrictions

The device or profile owner can allow another
package to set app restrictions for any app in that user

Similar to the way it can give permission to access
CA certificate related APIs from M.

Bug: 22541936
Change-Id: I0c1b0804ad300dfa4fbdc1c7721c5d8653d77861
evicepolicy/DevicePolicyManagerTest.java
40e2ce37d3ddd9b2c33ba3b68e6c28c67e1edea0 15-Dec-2015 Jeff Davidson <jpd@google.com> Merge "Relax permissions around NetworkStatsManager APIs."
c14fb58da8ca3eb984f0f88fd45979bfa72cf8fc 15-Dec-2015 Jeff Davidson <jpd@google.com> Merge "Fix bit-rotted NetworkStatsServiceTest."
ddb9ef0357e3ee609e188fb9e1e461f95aa601fa 18-Nov-2015 Etan Cohen <etancohen@google.com> Allow NetworkFactories to match any network specifier on a request

Current usage of NetworkSpecifier: network factory will match a request
if the request has either a (1) empty network specifier, or (2) a
network specifier which is identical to that of the network factory.
Note: 'matching' w.r.t. network specifier - all other matching rules
are still in effect.

Change: add rule (3) or the network specifier of the network factory
is the special string (which is defined as "*" and which user-facing
network requests aren't allowed to use).

Rationale: allows on-demand network creation.

Example:
- Can specify a Wi-Fi NetworkRequest with NetworkSpecifier="ssid"
- It will match a Wi-Fi network factory specifying NetworkSpecifier="*"
- That network factory will bring up a Wi-Fi network, connecting to the
specified SSID.
- Once the network is created it will create a NetworkAgent which will
now have a NetworkSpecifier matching that of the request (not the
match-all special string!)

That final step of making sure that the NetworkAgent matches the request
and not the match-all is critical to delivering any subsequent callbacks
correctly. I.e. your network will only get callbacks which match it.

Bug: 26192833
Change-Id: I49e3b492e0bb48a3f6e9a34e3f94f0e1cf89741f
onnectivityServiceTest.java
1efb1335814aea8ee0696144ca0ab24159b86e54 10-Dec-2015 Jeff Davidson <jpd@google.com> Relax permissions around NetworkStatsManager APIs.

Currently, access to network usage history and statistics requires a
signature|privileged permission, an AppOps bit (associated with the
PACKAGE_USAGE_STATS permission), or device/profile ownership. Once
access is granted via one of these mechanisms, it generally applies to
any UID running in the same user as the caller.

This CL expands access as follows:

-Any app can access its own usage history with no extra requirements.
-Carrier-privileged applications can access usage history for the
entire device.
-Device owners can access per-UID breakdowns for usage. Previously
they could access the summary for the whole device, but not the
individual breakdowns.

We simplify the permission model by defining three access levels -
DEFAULT (own app only), USER (all apps in the same user), and DEVICE
(all apps on the device), and propagate these levels throughout.

Finally, this CL fixes an apparent bug in
NetworkStatsSerice#hasAppOpsPermissions - if the AppOp bit was in
MODE_DEFAULT, hasAppOpsPermission would always return false instead of
falling back to the PackageManager permission check.

Bug: 25812859
Bug: 25813856
Change-Id: Ic96e0776e2a4215a400163872acea1ededfaced9
et/NetworkStatsAccessTest.java
et/NetworkStatsCollectionTest.java
b7e3fd80e52cd7a3607f36044d6c3b94bb985b27 14-Dec-2015 Jeff Davidson <jpd@google.com> Fix bit-rotted NetworkStatsServiceTest.

Breakages:

-ag/574873 - Renders testReportXtOverDev obsolete as this is no longer
a supported mode. Test has been removed.
-ag/600223 - Tests were sending a CONNECTIVITY_ACTION bcast to trigger
a call to updateIfaces(), but the listener was removed.
Tests now call forceUpdateIfaces() directly.
-ag/648284 - Calls to get VPN info were not mocked.

Change-Id: I309f2b5d006549104cb1d3cb83e99363dd6dac16
etworkStatsServiceTest.java
72be84fd8c2e3b6760e95a118d50e203c16ec379 11-Dec-2015 Julia Reynolds <juliacr@google.com> Merge "use importance instead of score"
bdf3376616c276ed18a51185351b44fd16eeae29 04-Dec-2015 Chris Wren <cwren@android.com> use importance instead of score

Change-Id: Id3b0a074671943b4fcabb63fe990cbfd1e46bdfd
otification/RankingHelperTest.java
055d8396ef6b99f9dcd639e98cce6029fca1c145 11-Dec-2015 Makoto Onuki <omakoto@google.com> Merge "Allow PO to set DO restrictions if it's on user 0"
4aa47e58c4f8d654981a9d6a7362c8bb8b2a7e30 01-Oct-2015 Christopher Tate <ctate@google.com> DO NOT MERGE 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.

Cherry-picked from 14a7bb0d370fffdf902a4e2345f46754ed2d7684
Bug 20157436

Change-Id: I2eb030a24efdd466a2eee1666c5231201b43684b
etworkStatsServiceTest.java
5485ed46ff337769589c6e06b3469246e60b9e3b 09-Dec-2015 Makoto Onuki <omakoto@google.com> Allow PO to set DO restrictions if it's on user 0

Bug 26091525

Change-Id: Ie6d2cd4ade076d8d2ec47243ff1280b95b7c9044
m/UserRestrictionsUtilsTest.java
e0e413e2b17a0164e15c77f4ab51b3166f9111d2 10-Dec-2015 Dianne Hackborn <hackbod@google.com> Add new target SDK filtering feature to BroadcastOptions.

You can now control the range of target SDKs that receivers
will be need to have in order to receive your broadcast.

Use this for CONNECTIVITY_ACTION to not allow N+ applications
to receive these broadcasts through their manifest.

Also tweak the broadcast debug output code to now include the
disposition of each receiver in the list. This is becoming
important as skipping receivers is becoming a more common
thing to have happen.

Change-Id: I251daf68575c07cbb447536286ab4e68b7015148
roadcastInterceptingContext.java
b3b9258ab6a01af5e0df4b8385b73084cd9ec530 07-Dec-2015 Xiaohui Chen <xiaohuic@google.com> UserManager: get/set user account name

Bug: 25935510
Change-Id: I0b621fb300be74209534e08a11f1d1a7c049cd5a
m/UserManagerServiceTest.java
c0309868832b8aee6e52b14e1c0d47b67553194a 04-Dec-2015 Julia Reynolds <juliacr@google.com> Merge "Topics can now have an Importance."
5d25ee7a006fda7150ba251cff92c27130611f88 20-Nov-2015 Julia Reynolds <juliacr@google.com> Topics can now have an Importance.

Bug: 22451710
Change-Id: I627121da6c4b85492715a8e8a099656dca52b734
otification/RankingHelperTest.java
9d8a1048bb666c68402dce031bebfa07c92a42db 04-Dec-2015 Jeff Sharkey <jsharkey@android.com> Handle non-encryption-aware accounts and sync.

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

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

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

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

Bug: 25945136
Change-Id: I8714121f6236b00821769023c4df7de1c8a99944
ccounts/AccountManagerServiceTest.java
7ef490fab68ee93f92eb5728cc4d3cb691315412 03-Dec-2015 Shreyas Basarge <snb@google.com> Fix for non persisted jobs being persisted

Bug: 25905179
Change-Id: I5e836f9894089aa8acc1bde382674e29402f0a60
ob/JobStoreTest.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
m/UserManagerTest.java
2c1a253f2297bf9682105924aee828a0c5897027 27-Nov-2015 Lorenzo Colitti <lorenzo@google.com> Fix one of the breakages of ConnectivityServiceTest in master.

Change-Id: I31c7a019383fa589beb1572486700e54edfb97e8
onnectivityServiceTest.java
e7927da1b6dc4f96714aa9bc4fbb71b3659f8cea 25-Nov-2015 Makoto Onuki <omakoto@google.com> Don't call DPM from UserManager to avoid lock inversion

- Also make sure DPMS.mOwners is always guarded with DPMS.this.
(and remove synchronization from Owners.)

Bug 25796840

Change-Id: I83f7b78e7b437d9c2a2b1d6e714346cd15f95330
evicepolicy/DevicePolicyManagerServiceTestable.java
3ab6f2e219c167fd35f16b6cf233ae6a39d9de02 05-Nov-2015 Makoto Onuki <omakoto@google.com> DA receiver should be protected with BIND_DEVICE_ADMIN.

- DPM.setActiveAdmin() will not accept DAs without BIND_DEVICE_ADMIN
when it's targeting NYC or above.

- DAs without BIND_DEVICE_ADMIN targeting MNC or below will still be
accepted. (with a logcat warning)

- DAs that are already set on a device without BIND_DEVICE_ADMIN
will still be accepted regardless of the target API level, even when
it's upgraded to a version targeting NYC.

Bug 24168653

Change-Id: I1914c2ec99135d9dd8cbac3f6914f9e43bafacc8
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmTestBase.java
evicepolicy/DummyDeviceAdmins.java
a31ebbc439364a4993e79fd385cf6373408a42fe 24-Nov-2015 Makoto Onuki <omakoto@google.com> Add DO API to get wifi mac address

Bug 25496044

Change-Id: Ib1f0ce4ca10951edcfaa0aa79ae5c2d142a74599
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
c8a5a555f1482d0f45b538eb898d6ee7e26552a6 19-Nov-2015 Makoto Onuki <omakoto@google.com> DPM.isDeviceOwnerApp() and getDeviceOwner() now check calling user

- Previously on MNC, they would return the same result regardless who
the calling user is.

- Now they properly take DO user-id into account. Meaning, they'll
always return false and null respectively, if the calling user doesn't
run device owner.

- Note isDeviceOwnerApp() is a public API and getDeviceOwner() is
a system API. Meaning we're changing the behavior or non-private
APIs.

- Also cleaned up hidden APIs, and gave them explicit suffixes
to avoid confusion. Bundled code should prefer them for clarity.

Now we have:

* APIs that work cross-users: They all require MANAGE_USERS.
boolean isDeviceOwnerAppOnAnyUser(String packageName)
ComponentName getDeviceOwnerComponentOnAnyUser()

int getDeviceOwnerUserId()
boolean isDeviceOwnedByDeviceOwner()

String getDeviceOwnerNameOnAnyUser()

* APIs that work within user. No permissions are required.

boolean isDeviceOwnerAppOnCallingUser(String packageName)
ComponentName getDeviceOwnerComponentOnCallingUser()

Bug 24676413

Change-Id: I751a907c7aaf7b019335d67065d183236effaa80
evicepolicy/DevicePolicyManagerTest.java
ac65e1e1dba1cf0ea237a389220ec818ade07a16 21-Nov-2015 Makoto Onuki <omakoto@google.com> Remove UserManager.setSystemControlledUserRestriction()

Now that we don't have UM.setUserRestriction*s*() that could remove
all existing restrictions, there's almost no point handling
DISALLOW_RECORD_AUDIO differently.

Now DISALLOW_RECORD_AUDIO is handled just like other restrictions,
except we don't persist it.

Bug 24954662

Change-Id: I27875b4a74dd95a3ce6bb774081eeaf718eaec15
evicepolicy/DevicePolicyManagerServiceMigrationTest.java
m/UserRestrictionsUtilsTest.java
09b108e2bb6b585947249eda92c047d0b582e8a0 21-Nov-2015 Fyodor Kupolov <fkupolov@google.com> Merge "Added keep-uninstalled-packages DO policy"
cb6fd80721253ffa9dcab5cf8c2f4e9b9cd17ccc 05-Nov-2015 Fyodor Kupolov <fkupolov@google.com> Added keep-uninstalled-packages DO policy

This policy allows DO to specify a list of apps to cache even without being
installed on any user.

Bug: 23938464
Change-Id: I2eeab7f148409739fc23a5c44e955ad12b63fd04
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DpmMockContext.java
m/UserRestrictionsUtilsTest.java
3f72604be806c0173b5dca0225cadf6e7c872147 15-Oct-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Use HexDump instead of java.lang.IntegralToString

java.lang.IntegralToString is being removed, replaced
all its usage by com.android.internal.util.HexDump.

Bug: 24932279
(cherry-picked from 15fc0548a536750110e159e06a39ba943eccdd81)

Change-Id: Id6ab88337af12d93cd73c41775b9d5baa1e61d96
pdates/CertPinInstallReceiverTest.java
1a2cd74526113b45d9108b6997609122c4311fb1 16-Nov-2015 Makoto Onuki <omakoto@google.com> More work on layered user restrictions.

- Now when DO/PO sets a user restriction, DPMS pushes it to UMS and
then UMS persists it, in order for UserManager.hasUserRestriction()
to never have to talk with DPMS, which would cause lock inversion.

- Also apply user restrictions when a user start.

- This is an updated version of the abandoned CL -- the difference
is, ActivityManager no longer has to call DPMS.

- Also removed an unnecessary write to userlist.xml in UMS.
upgradeIfNecessaryLP().

Bug 23902097
Bug 25388912
Bug 25354031
Bug 25641040

Change-Id: I0948aea06ad7d0f45fe612a431d765faddfe3c58
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
evicepolicy/MockUtils.java
evicepolicy/OwnersTest.java
m/UserRestrictionsUtilsTest.java
bef28feba57be7fd6a4d14a85a8229154338b2ed 30-Oct-2015 Dianne Hackborn <hackbod@google.com> Initial stab at background check.

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

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

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

Change-Id: If53714ca4beed35faf2e89f916ce9eaaabd9290d
ontent/SyncOperationTest.java
ontent/SyncStorageEngineTest.java
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
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
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
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
6d2beef6a819aebed4119ca06cb2369bc56dd214 06-Nov-2015 Makoto Onuki <omakoto@google.com> Merge "Add DPM.getUserRestrictions()"
3a3092fab0ccb631bc70de64f3bbe5c076a1f94b 30-Oct-2015 Makoto Onuki <omakoto@google.com> Add DPM.getUserRestrictions()

This returns per-DO/PO restrictions.

Bug 23902097

Change-Id: I225c1b01444fe2f60e5a6674d327182cc9bb15dc
evicepolicy/DevicePolicyManagerTest.java
803d6757fd23096e437e6fecd51ea6dda918b536 30-Oct-2015 Makoto Onuki <omakoto@google.com> Do not allow DO and PO running on the same user.

Bug 25346603

Change-Id: Ic5fbed82466a538fbf64ef802fc2624dd67313bb
evicepolicy/DevicePolicyManagerTest.java
82402753815ff4633cc572713ae490a17d9129e5 28-Oct-2015 Fyodor Kupolov <fkupolov@google.com> Introduced short-term lock for UMS internal state

Added mUsersLock - short-term lock for internal state, when interaction and
synchronization with PM is not required. Modifications to mUsers and
mRemovingUserIds must be guarded by 3 locks: mInstallLock, mPackagesLock and
mUsersLock. While reads can use mUsersLock.

Testing revealed that the following methods in UMS often cause contention:
- exists
- getUserInfo
- getProfileParent

They all now use a short-term lock mUsersLock for reads.

Bug: 24979571
Change-Id: Ie3a22ea7cbb450c7969800fe2a4a2b2516165e5b
m/UserManagerServiceTest.java
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
etworkStatsServiceTest.java
068c54a5be697c3df4657dcda33cd17c4b547710 13-Oct-2015 Makoto Onuki <omakoto@google.com> Layer user restrictions

- Now DPMS remembers user restrictions set by DO / PO in their ActiveAdmin.

- User restrictions set by DO/PO will no longer be saved by UserManger. Instead,
when needed, UMS will consult DPMS to build "effective" user restrictions.

- UM.getUserRestrictions() will now always return "effective" user restrictions.

- DPMS migrates existing user restrictions per the eng spec.

- Also now UM.setUserRestrictions() will crash. UMS.setUserRestrictions() has
been removed.
This was needed because UM.setUserRestrctions(UM.getUserRestrictions()) will no
longer be a valid use like it used to be.

- Also introduced a fined-grained lock for user restrictions in UM to avoid
deadlock between DPMS and also for better performance.

Bug 23902097

Change-Id: If0e1e49344e2f3e9226532d00777976d1eaa7df3
evicepolicy/DevicePolicyManagerServiceMigrationTest.java
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
evicepolicy/DpmTestBase.java
evicepolicy/DpmTestUtils.java
evicepolicy/OwnersTest.java
m/UserManagerTest.java
7d7a2254bc41d2dfc34fbb8693cb0dad2ccd528a 16-Oct-2015 Matthew Williams <mjwilliams@google.com> DO NOT MERGE Sync extras bundle comparison can throw NPE

BUG: 23591205
Change-Id: Ic6404c0befe70c34b078e0eae6a627826173d82c
(cherry picked from commit 9ad2c8403354a985258c098681067e74b9e2f638)
ontent/SyncManagerTest.java
b3b91ceaefa47b883c77d8ccac35608831c888c5 20-Oct-2015 Matthew Williams <mjwilliams@google.com> Merge "Sync extras bundle comparison can throw NPE"
9ad2c8403354a985258c098681067e74b9e2f638 16-Oct-2015 Matthew Williams <mjwilliams@google.com> Sync extras bundle comparison can throw NPE

BUG: 23591205
Change-Id: Ic6404c0befe70c34b078e0eae6a627826173d82c
ontent/SyncManagerTest.java
1f0ec16b6d5f20ed8b6156eb1b5abf4c73548645 16-Oct-2015 Matthew Williams <mjwilliams@google.com> DO NOT MERGE Sanity check loaded periodics and cap runtime.

BUG: 24900376
We've seen an issue where periodic run times can be massively
inflated after loading from disk.
As a safeguard, cap the period's loaded runtime to be [p, 2p]
from the time of loading.

Change-Id: Ie4464490c8d6702fee8efe9190c3da5dc5f013f6
(cherry picked from commit fa8e5084eed63ab8d92c71fcff656690a30293c3)
ob/JobStoreTest.java
fa8e5084eed63ab8d92c71fcff656690a30293c3 16-Oct-2015 Matthew Williams <mjwilliams@google.com> Sanity check loaded periodics and cap runtime.

BUG: 24900376
We've seen an issue where periodic run times can be massively
inflated after loading from disk.
As a safeguard, cap the period's loaded runtime to be [p, 2p]
from the time of loading.

Change-Id: Ie4464490c8d6702fee8efe9190c3da5dc5f013f6
ob/JobStoreTest.java
a52562ca9a4144cf30e6d5c6ffe856cc8e284464 02-Oct-2015 Makoto Onuki <omakoto@google.com> setDeviceOwner() now requires a full component name.

Bug 20149907

Change-Id: I24e66159d1d966925aa3a494b1e2839b07cdafa2
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
evicepolicy/OwnersTest.java
a4f119790e32fcce56586e7324d508e35cb30a2a 01-Oct-2015 Makoto Onuki <omakoto@google.com> First cut of user restriction layering.

- Start persisting restrictions set by DO/PO.

- Also dump user restrictions on dumpsys

- More changes will follow, including migration.

- Now System settings are mockable.

Bug 23902097
Bug 23902477

Change-Id: I0bda22f484e1a8e259a1feb2df83c5f4a29116da
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
evicepolicy/OwnersTest.java
c3cdf1c614f92759f1505b7b61265e51232b8944 05-Oct-2015 Craig Lafayette <craiglafa@google.com> Merge "Remove device initializer agent"
bb7e5ac58e74667799662cfa0f780ce8eaad053f 02-Oct-2015 Xiaohui Chen <xiaohuic@google.com> Merge "Cleanup USER_OWNER in mount service"
621b3fc7a94a9b1bbbb230f264899299a806237b 02-Oct-2015 Xiaohui Chen <xiaohuic@google.com> Cleanup USER_OWNER in mount service

Also removed a failing unit test and the related code which is
now deprecated.

Bug: 19913735
Bug: 24064753
Change-Id: I9b11130b52caeb0ad890cc6adaaf7fb2fc7b5db6
ountServiceTests.java
e7ee54ee7f4985bc743053d38d21f33c70220f05 21-Sep-2015 Craig Lafayette <craiglafa@google.com> Remove device initializer agent

Bug: 23216982
Change-Id: I867c0b5f4165983d1ed2623a655f6a2a5e3770bb
evicepolicy/OwnersTest.java
d932f7689d799b07a6776bc7c59749f672528239 30-Sep-2015 Makoto Onuki <omakoto@google.com> Refactor DPMS tests to be able to test more different cases.

- DpmMockContext.addUser() allows to create more users. This will set up
UserManager properly and create a data directory.

- Updated DevicePolicyManagerTest so it can now easily emulate calls from
different secondary users.

Change-Id: Ic9d3e8d0d1e7f41e184c82e6dc323c244535b8d8
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DevicePolicyManagerTestable.java
evicepolicy/DpmMockContext.java
evicepolicy/DpmTestBase.java
evicepolicy/DpmTestUtils.java
evicepolicy/OwnersTest.java
72a3a0c7d24f629bca38ee2652491307e4e706da 26-Sep-2015 Makoto Onuki <omakoto@google.com> Fix OwnersTest when run with -e package

It was because UserManager.get() returns a static cached instance but
we should always be using the mock instance that's created for each test.

Bug 24378326

Change-Id: Id4663e7676d2d0130622055a97fbde0884714349
evicepolicy/DpmMockContext.java
b643fb0e67460344ade2e3db92738999f8168496 23-Sep-2015 Makoto Onuki <omakoto@google.com> Use a factory class for dependency injection, add more tests.

- Extracting into a factory allows us to use mocks in other classes.
(Such as Owners.)

- Also removed broken test ApplicationRestrictionsTest. Instead added a new
simplified test to DevicePolicyManagerTest.

- Also stop caching rarely used instances in DPMS.

Bug 24061108
Bug 24275172

Change-Id: Ice9e57204b18e7b5f6b115126dab2209041439c2
evicepolicy/ApplicationRestrictionsTest.java
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
evicepolicy/DpmTestBase.java
evicepolicy/DummyDeviceAdmins.java
f76b06a6b546f430cf85e561858ed12eedc32b81 23-Sep-2015 Makoto Onuki <omakoto@google.com> Test more DPM APIs.

Bug 24061108

Change-Id: Ia9da19f62c0f4edf53ca1f4c213f0368ec1983ba
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DpmMockContext.java
evicepolicy/DpmTestUtils.java
evicepolicy/DummyDeviceAdmin.java
evicepolicy/DummyDeviceAdmins.java
evicepolicy/MockUtils.java
cc4bbeb76af92a8484fe05f37c4ff412b4c47ccc 17-Sep-2015 Makoto Onuki <omakoto@google.com> Make DPM/DPMS unit-testable

- Now all services that DPMS uses are injectable.
- Introduce some wrappers to make static methods and final class mockable.
(e.g. for Binder.getCallingUid())

- In unit tests we replace those with Mockito mocks, except we use a partial
mock for PackageManager, because we use way too many methods of this and
most of them are okay to use directly.

- To install a partial mock to PackageManager, I needed to make
ApplicationPackageManager @hide public non-final.

- For a starter, added tests for DPM.setAmin().

Bug 24061108

Change-Id: I2afd51d8bc0038992d5f9be38c686260be775b75
evicepolicy/DevicePolicyManagerServiceTestable.java
evicepolicy/DevicePolicyManagerTest.java
evicepolicy/DevicePolicyManagerTestable.java
evicepolicy/DpmMockContext.java
evicepolicy/DpmTestBase.java
evicepolicy/DpmTestUtils.java
evicepolicy/DummyDeviceAdmin.java
evicepolicy/MockUtils.java
evicepolicy/OwnersTest.java
f3f02ac931d04e6ba4393e27558cd317cb1e6b44 08-Sep-2015 Svetoslav <svetoslavganov@google.com> Add get_accounts app op

For each runtime permission we have an app op to toggle the
permission for legacy apps as they cannot handle permission
revocations. We were lacking an app op for get_accounts
which prevented the user from controlling access to accounts
regardelss that they change the state of the permission
toggle in the UI. Even worse the permission UI is written
with the assumption that every runtime permission has an
app op and as a result revoking the contacts group (if the
app requests the get_accounts permission) is reset back to
allowed in the UI.

bug:23854618

Change-Id: I12b83dfd22974d130e5b8e7a195421120813e2db
ccounts/AccountManagerServiceTest.java
f57d98564b26953b722ab0e14222f50e6515f36d 09-Sep-2015 Svetoslav Ganov <svetoslavganov@google.com> am 4f7d0bc7: Merge "Add get_accounts app op" into mnc-dev

* commit '4f7d0bc7af5fbb65796d24b130b7e9e63107bc5d':
Add get_accounts app op
51c61ee23a55ccc75e0ddb3582720fc626607e42 09-Sep-2015 Lorenzo Colitti <lorenzo@google.com> am fd183706: am 22262f31: am 0bc35668: am 017223ac: Merge changes from topic \'packet-keepalive-fixes\' into mnc-dr-dev

* commit 'fd18370675f8794807747a18276dd7385e25f06e':
Require the new PACKET_KEEPALIVE_OFFLOAD permission.
Add an error code for generic hardware error.
Fix bugs and crashes in PacketKeepalive API.
Add tests for the PacketKeepalive API.
Add a PACKET_KEEPALIVE_OFFLOAD permission.
Use a CountDownLatch instead of sleep() in NetworkFactory tests.
Get rid of shortSleep() in ConnectivityServiceTest.
Make ConnectivityServiceTest a bit more readable.
ce852ddcecefc6b3e1265462f5c8670bd0e4ace1 08-Sep-2015 Svetoslav <svetoslavganov@google.com> Add get_accounts app op

For each runtime permission we have an app op to toggle the
permission for legacy apps as they cannot handle permission
revocations. We were lacking an app op for get_accounts
which prevented the user from controlling access to accounts
regardelss that they change the state of the permission
toggle in the UI. Even worse the permission UI is written
with the assumption that every runtime permission has an
app op and as a result revoking the contacts group (if the
app requests the get_accounts permission) is reset back to
allowed in the UI.

bug:23854618

Change-Id: I9e3f9bfeb320bed561d718db99ee285915d5701b
ccounts/AccountManagerServiceTest.java
58b684f1cdc52467b71c42cfae18433a19ce7d0b 04-Sep-2015 Makoto Onuki <omakoto@google.com> [split system] Tentatively support running DO on meat user

- setDeviceOwner() now takes a user ID. (We can infer it from Binder, but
we still need it for the dpm command.)

- Change broadcast target UID for DO to the DO user

- Start the DO user on boot complete.
TODO Investigate whether this is actually the good timing.

TODO Prevent the DO user from being killed

Bug 23827706

Change-Id: I227dbd444f1f4e94d98c317489d151554fe79d91
evicepolicy/OwnersTest.java
7914ce5dd4d2e53eba1a3a8a1ed97da96cec129f 08-Sep-2015 Lorenzo Colitti <lorenzo@google.com> Add tests for the PacketKeepalive API.

This currently fails in many different ways, but it tells us what
to fix.

Bug: 22606153
Bug: 23884210
Change-Id: If2e5ee0a8d7b26cad67d3d566ed5b1383e0db096
onnectivityServiceTest.java
ffa390b6f37f20ab5f4ebf5c861c565db200107e 07-Aug-2015 Lorenzo Colitti <lorenzo@google.com> Use a CountDownLatch instead of sleep() in NetworkFactory tests.

This makes testNetworkFactoryRequests 2-3 times faster.

Bug: 22606153
Change-Id: I9657b6929e77f23ec811d0ab57b2ba974f0b6a69
onnectivityServiceTest.java
e58961aa5f86553f0106edbc03d1534b097fa25c 07-Aug-2015 Lorenzo Colitti <lorenzo@google.com> Get rid of shortSleep() in ConnectivityServiceTest.

Instead, use IdleHandler to wait for things to become idle.

Bug: 22606153
Change-Id: Ic6ab93ad4d336b40962f9be1096629a44b63ee2f
onnectivityServiceTest.java
83fa2588f662aae0b612da91fd09d205cf2e8cb0 06-Aug-2015 Lorenzo Colitti <lorenzo@google.com> Make ConnectivityServiceTest a bit more readable.

1. Make TestNetworkCallback a bit smarter and rename it to
SingleUseNetworkCallback. This allows us to get rid of all the
calls to TestNetworkCallback#getConditionVariable.
2. Delete the commented out code that used to test a
ConnectivityService model that has not been used since KK.
3. Remove unused imports, etc.

Bug: 22606153
Change-Id: I81a2d0b970d19e5f4515490d8c2f88d416445fa1
onnectivityServiceTest.java
3403b74429973cd743ff9487b21ad5c9bb8dd461 04-Sep-2015 Makoto Onuki <omakoto@google.com> Merge "Replace all occurrences of HashMap/HashSet with ArrayMap/ArraySet."
e2796c216e82091f8ee54c9c438b2119a069e029 03-Sep-2015 Xiaohui Chen <xiaohuic@google.com> Merge "Cleanup USER_OWNER in a11y manager and tests"
1d52f9f16a27b46ba4d5e02a40c8781e62756ea7 03-Sep-2015 Xiaohui Chen <xiaohuic@google.com> Merge "Cleanup USER_OWNER in a11y service and tests"
2714d448b12797a5050834f952fd1166246e558e 03-Sep-2015 Makoto Onuki <omakoto@google.com> Replace all occurrences of HashMap/HashSet with ArrayMap/ArraySet.

Also fix the command line for OwnersTest in javadoc.

Change-Id: I53c222aa13eee179c5abf7e6ba95c6cbe9a7f47f
evicepolicy/OwnersTest.java
9daa916a4d92d4776cc6577afc5156a281574654 29-Aug-2015 Xiaohui Chen <xiaohuic@google.com> Cleanup USER_OWNER in a11y manager and tests

Bug: 19913735
Change-Id: Icc2b55e685e7f9c212326bf2317ea9a7afce0359
ccessibilityManagerTest.java
a826b8c24c45443271567cae4cde6db04f147a7c 02-Sep-2015 Xiaohui Chen <xiaohuic@google.com> Cleanup USER_OWNER in a11y service and tests

I need to make some changes to get the tests pass. First a11y service
will now disable when no service is specified, I need to re-enable
a11y after services are enabled. Second the old event used in tests
seems to be filtered out by the service, I need to pick a new event.
Also the timeout waiting for mock service to start is extended, I hit
the old timeout quite often with N9.

Bug: 19913735
Change-Id: I8fe1b7b5d93b6a52df0a8940a08761ea5fbf5084
ccessibilityManagerServiceTest.java
ockAccessibilityService.java
c9754cf0dfa66d39ce9ea0d2eeab5f7c442a9686 31-Aug-2015 Makoto Onuki <omakoto@google.com> Add unit tests for file persisting in Onwers.

Bug 23432442

Change-Id: If10ed5a46084695b2aca1286713b8baea8c2a418
evicepolicy/DpmMockContext.java
evicepolicy/DpmTestBase.java
evicepolicy/OwnersTest.java
99aeac27ebc5ad54c0095122251cc0258713c263 31-Aug-2015 Makoto Onuki <omakoto@google.com> Rename DeviceOwner to Owners

Bug 23432442

Change-Id: Ic59c880d45126fbcf50b1bd31e37b2b64e2f3a6d
evicepolicy/DeviceOwnerTest.java
evicepolicy/OwnersTest.java
39e784dd46fe4c7257bf63d0a60167abb2b28f79 22-Aug-2015 Makoto Onuki <omakoto@google.com> Split device owner config files

DPMS.mDeviceOwner is now always non-null, so no null checks are needed.

Bug 22802261
Bug 23432442

Change-Id: Ia8e5f114ecfc0add44b0d1be7d043ef6e37019ef
evicepolicy/DeviceOwnerTest.java
72d9c026561bb681392d1a56d98faf1667a0cc48 21-Aug-2015 Xiaohui Chen <xiaohuic@google.com> Update UserManagerTest

This makes it work in split system user mode.

Bug: 19913735
Change-Id: Ia1bd7043aba9fb34333e0edcc7375d287570c80a
m/UserManagerTest.java
e0938bed96a91236db9f389adbf00c5e786f8679 19-Aug-2015 Lorenzo Colitti <lorenzo@google.com> am a5bfd73a: am ab5e962e: am d7121f56: am 0257c82f: am 11e84bde: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into mnc-dev

* commit 'a5bfd73ab683d3310ee3ce31d7ad3edb656aa858':
Don't mark NetworkRequests restricted when they don't have restricted caps
594f208d661bc29dafef91e948d36cac652d59db 18-Aug-2015 Xiaohui Chen <xiaohuic@google.com> Clean up USER_OWNER reference in pm/Settings

Bug: 19913735
Change-Id: I538ed443b945e9cbb731520450bf5ef39882ae37
m/PackageManagerSettingsTests.java
aae613d96134245af7c55976731a49fa59e77470 19-Aug-2015 Paul Jensen <pauljensen@google.com> Don't mark NetworkRequests restricted when they don't have restricted caps

Requests without NET_CAPABILITIES_INTERNET and just the default network
capabilities should not be marked restricted. Without this fix apps
can hit permissions exceptions if they inadvertently make requests
without NET_CAPABILITIES_INTERNET.

Bug:23164917
Change-Id: I4c7136821315bcb05dfc42ffbc505a5d4f6109e6
onnectivityServiceTest.java
9180e2ea5916d43caf998d0fa7bf7ac70c575c4e 05-Aug-2015 Paul Jensen <pauljensen@google.com> am abd27102: am 41779e46: am 95297732: am 86e7d135: resolved conflicts for merge of dbc4edcc to mnc-dr-dev

* commit 'abd27102f4e232be448bc6012e0bd833637ab3fa':
Fix NOT_RESTRICTED network capability and enforce it.
dbc4edccfced5cb739bae75e8cd15cecc39cf16e 05-Aug-2015 Paul Jensen <pauljensen@google.com> Merge "Fix NOT_RESTRICTED network capability and enforce it." into mnc-dev
487ffe7d3d84bf65212158f7098e8a84b5b55e09 24-Jul-2015 Paul Jensen <pauljensen@google.com> Fix NOT_RESTRICTED network capability and enforce it.

With this change:
1. NOT_RESTRICTED should be removed from NetworkRequests that bring up
special restricted carrier networks (e.g. IMS, FOTA).
2. NetworkRequests without NOT_RESTRICTED require CONNECTIVITY_INTERNAL
permission to register
3. Binding sockets to networks without NOT_RESTRICTED requires
CONNECTIVITY_INTERNAL permission

Bug:21637535
Change-Id: I5991d39facaa6b690e969fe15dcbeec52e918321
onnectivityServiceTest.java
00c8a9d60a6181d826475196c7a91d319e9531ec 31-Jul-2015 Lorenzo Colitti <lorenzo@google.com> am 5bbbf8ed: am 3b03916d: am c7a86e90: am c70348c1: am 496a9d26: Merge "Stop supporting legacy ConnectivityManager routing methods in M." into mnc-dev

* commit '5bbbf8edfd74389f9b38d3497d6d86afb543b8f2':
Stop supporting legacy ConnectivityManager routing methods in M.
ffc42b0b7be29ee4118e0515d5ab024927bcb8ca 29-Jul-2015 Lorenzo Colitti <lorenzo@google.com> Stop supporting legacy ConnectivityManager routing methods in M.

The methods startUsingNetworkFeature, stopUsingNetworkFeature and
requestRouteToHost were @removed in all the M preview builds, but
internal and external developers have noted that this imposes
additional burden for applications that need to work across
multiple platform versions because it causes compile-time errors.

We switched from @removed back to @deprecated to avoid these
problems. In order to effectively deprecate these methods, which
are error-prone and insecure, make them throw
UnsupportedOperationException if the app's target SDK is M or
above.

Because there are still one or two places in system code that use
these APIs, exempt Process.SYSTEM_UID and the OMA-DM client from
the check for now.

Bug: 22728205
Change-Id: I790bd32f3aa8067cbb625962a209bb9232f4b58c
onnectivityServiceTest.java
722113aa5f3c75d6c49ab48a65ad0276a9c9b3b1 30-Jul-2015 Paul Jensen <pauljensen@google.com> am 917b275d: am 06287d1c: am 9a2314b0: am 682fd6ae: am a991c66c: Merge "Fix missing onLost NetworkCallbacks when network loses capability" into mnc-dev

* commit '917b275d6b54b08edb6326512d7e48a02163e730':
Fix missing onLost NetworkCallbacks when network loses capability
cf4c2c637268b1a2979e20a8b5644916777a02a4 01-Jul-2015 Paul Jensen <pauljensen@google.com> Fix missing onLost NetworkCallbacks when network loses capability

If a network no longer satisfies a NetworkRequest, send the onLost
NetworkCallback. If it was a real request (not listen) then update
the NetworkFactories.

To test this change I created a little infrastructure to fake
different Internet connectivity probe results during tests. This
allowed me to rewrite some of ConnectivityServiceTest's logic for
validating networks. This brought to light a couple issues that
I had to address to keep tests passing:
1. testUnlingeringDoesNotValidate was relying on a bad side-effect
of my old method of ConnectivityServiceTest's logic for
validating networks, so I rewrote the test.
2. ConnectivityService was not sending out NetworkCallbacks for
WiFi when Cellular was validated. I'm including a fix for this
in this CL also.

Bug:22220234
Change-Id: I29314f38189817f8b2561a213c4f9e8522696663
onnectivityServiceTest.java
b5143ecfeebfcf1424e599882e97c46881bb8c48 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am 1fa2a088: am 1281575c: am 41fac5e8: am 189f3136: am 98724126: Merge "Added sendBroadcastMultiplePermissions method" into mnc-dev

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

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

Bug: 21852542
Change-Id: I27c9130e8f004b428452501ebc8a36aabde1f343
roadcastInterceptingContext.java
9ac5983c7b43676f748816381904d4c62a168a3e 15-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am 7aeb1a5c: am cf4617cf: am 1aeceef4: am fc4acfd9: am 4a817924: Merge "Revert "Allow array of required permissions in sendBroadcast"" into mnc-dev

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

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

This reverts commit b4e7283c9afd9fb15ebd63f6ce9b75c9c1af658b.

Change-Id: Ie8390964bda5bdfa869cee8f46584043d8e7c664
roadcastInterceptingContext.java
b4e7283c9afd9fb15ebd63f6ce9b75c9c1af658b 14-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Allow array of required permissions in sendBroadcast

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

Bug: 21852542
Change-Id: I3b8ff258fa9f3249c344bb8093b820b24eef00c0
roadcastInterceptingContext.java
365504aca42c948a45b71f8cd8a4475eecabf63e 10-Jul-2015 Paul Jensen <pauljensen@google.com> am c4417cf9: am f50ac2e7: am cfedbc43: am 7f9e3274: am bbce221e: Merge "Fallback to Cellular if WiFi fails to validate" into mnc-dev

* commit 'c4417cf98a98211072b36cb246d0e30aa650e2f2':
Fallback to Cellular if WiFi fails to validate
84bfd14cce67dbd4d5b9d7d2b242f2e88c6cfb41 10-Jul-2015 Paul Jensen <pauljensen@google.com> am f1576d8d: am 54b98c71: am 99ef3aef: am b54ec1bd: am d8cdba0d: Merge "Prepare some ConnectivityService logic for fallback to Cellular change" into mnc-dev

* commit 'f1576d8d07e844331685c35d976125f51a6d1a4d':
Prepare some ConnectivityService logic for fallback to Cellular change
e098854c41a72b22f4174bc623e8e93cde8d7331 25-Jun-2015 Paul Jensen <pauljensen@google.com> Fallback to Cellular if WiFi fails to validate

Previously, once a network validated, for the purposes of comparing networks
to select the default network, we always considered it validated.
With this change if a network later fails to validate, we'll take this latest
validation result into account. This means if WiFi and cellular are up
(e.g. if we recently switched from cellular->WiFi, and cellular is now
lingering) and both are validated, but for some reason WiFi fails a validation,
cellular will become the default network connection.

Bug:20896761
Change-Id: I858aa10c1aaec5cd9032067f960963409107bdb1
onnectivityServiceTest.java
85cf78edc92b85ec90e91de42b14b84e202260f3 25-Jun-2015 Paul Jensen <pauljensen@google.com> Prepare some ConnectivityService logic for fallback to Cellular change

Reduce the duplication of some logic so when falling back to Cellular
when WiFi fails to validate is enabled, there's less chance for bugs
and failures:
1. De-duplicate several Network vs NetworkRequest matching functions
2. Remove the very tricky nascent logic by adding a simple "lingering" bit.

Bug:20896761
Change-Id: I21da9e827eec9cfd6835fcaa650192b9186ed053
onnectivityServiceTest.java
45895c802bb4ad4a947409a1ac86ab0a645fc6f1 23-Jun-2015 Paul Jensen <pauljensen@google.com> am 0a99ca6e: am daf6b73b: am 9065b810: Merge "Disallow requesting networks with mutable NetworkCapabilities." into mnc-dev

* commit '0a99ca6e3c15983e91273fbc1c109f84f25ea982':
Disallow requesting networks with mutable NetworkCapabilities.
bb2e0e98160f099261876794518d4db62e309aec 16-Jun-2015 Paul Jensen <pauljensen@google.com> Disallow requesting networks with mutable NetworkCapabilities.

It's not clear what it means to request a network with a mutable
NetworkCapability like NET_CAPABILITY_VALIDATED or
NET_CAPABILITY_CAPTIVE_PORTAL. Presently requesting such a network
would fail in a number of different ways:
1. The NetworkFactories would fail to match the request against their
filter which doesn't include stateful NetworkCapabilities.
2. If the NetworkFactories did match, they'd bring up networks to try
and satisfy the requests, but the networks would not have any
mutable NetworkCapabilities initially so they'd be reaped.
Because of these problems it's safest to simply disallow these
requests.

Bug: 21343774
Change-Id: I56303242b81d39b370b8d5d1e32059bfcfc25949
onnectivityServiceTest.java
764f9294df945519fc412efd4c5bc25c8d7b9208 20-Jun-2015 Paul Jensen <pauljensen@google.com> am f58e1dd3: am 4a451de0: am 8e21d29f: Merge "Don\'t send spurious onAvailable NetworkCallbacks when rematching" into mnc-dev

* commit 'f58e1dd34c5bca555673b08c0f3490c0328ba07a':
Don't send spurious onAvailable NetworkCallbacks when rematching
8e21d29f7e8691c5798ef613c2ccc4112c649421 20-Jun-2015 Paul Jensen <pauljensen@google.com> Merge "Don't send spurious onAvailable NetworkCallbacks when rematching" into mnc-dev
3d911469a190437fe936103e861bfa171841fbd6 12-Jun-2015 Paul Jensen <pauljensen@google.com> Don't send spurious onAvailable NetworkCallbacks when rematching

Bug:21762680
Change-Id: Ia701045dffc666fe75fba0e1771872147e37179a
onnectivityServiceTest.java
8056138a71ce870cca708d0a7eb19d0500140064 17-Jun-2015 Chris Wren <cwren@android.com> am 082314d4: am aeb1205a: am 3d2b6212: Merge "high-frequency notification stats." into mnc-dev

* commit '082314d42ea9ba917fac81a45ea87046523b5856':
high-frequency notification stats.
3d2b621204bf74eb0adf548ae1c8850a05aea01a 17-Jun-2015 Chris Wren <cwren@android.com> Merge "high-frequency notification stats." into mnc-dev
5eab2b72afe5b20dc66c237b1cceedfc09de2d52 16-Jun-2015 Chris Wren <cwren@android.com> high-frequency notification stats.

Aggregate and then periodically report stats that are high-frequency
because they are driven by app behavior, not user behavior.

Reuse the NotificationUsageStats facility.
Remove redundant stats.
Lessen memory foot print.
Enable in-memeory aggregates with small, bounded memory footprint.

Bug: 20258744
Change-Id: I87e391419c53917fa13c68a56f8cdb40a7c8e548
otification/RankingHelperTest.java
13ae6679e1d68263f9196de1bcf7cf16c0f6599f 17-Jun-2015 dcashman <dcashman@google.com> am daccbc0a: am 1208e343: am 2f902959: Merge "Make keysetmgrservice gurantees explicit." into mnc-dev

* commit 'daccbc0a3c34808d5818f2e754b60731c803a14c':
Make keysetmgrservice gurantees explicit.
87f794f0bf8b53d6c983968f398c4bde4cb6a014 03-Jun-2015 dcashman <dcashman@google.com> Make keysetmgrservice gurantees explicit.

Add exceptions/checks for keysetmgrservice interractions which *should* never
happen, but would result in NPE or invalid metadata. Also handle mismatches
between package and keyset metadata in packages.xml.

Bug: 20128916
Change-Id: Ia0f63f78d232d9d8d9fbe4cd8e6cc3406e5192a7
m/KeySetManagerServiceTest.java
a4bb8ee39bce6bad2f79d5de1eb913eca8f0a660 15-Jun-2015 Paul Jensen <pauljensen@google.com> am b379fdd0: am 49ab026a: am 8a6025fd: Merge "Remove most sleep() calls from ConnectivityServiceTest" into mnc-dev

* commit 'b379fdd0e9fa560e0abfe771acf920bb6aca60ad':
Remove most sleep() calls from ConnectivityServiceTest
0a2823e539abeb037d3acb01b5d5eed7c85f4ed7 12-Jun-2015 Paul Jensen <pauljensen@google.com> Remove most sleep() calls from ConnectivityServiceTest

Change-Id: I90d2f6811ed1cb84614101200ac377e920bd864a
onnectivityServiceTest.java
de4c947aef00c4d8e213216c8a1741f029945280 11-Jun-2015 Robert Greenwalt <rgreenwalt@google.com> am c2a3f75f: am 1ec7d05e: am 3cbad5c1: Merge "Remove network requests properly." into mnc-dev

* commit 'c2a3f75fb60a4a720f07791cfe0730f42cd8eb80':
Remove network requests properly.
3cbad5c17f8f8312f5e87e528f6094b60fddc440 11-Jun-2015 Robert Greenwalt <rgreenwalt@google.com> Merge "Remove network requests properly." into mnc-dev
348e98dba046a33c4ba6069ef7a6ac18c2040fe2 06-Jun-2015 Robert Greenwalt <rgreenwalt@google.com> Remove network requests properly.

We used to only remove requests that we'd acted on but that's
just wrong.

Also adds test case which exposed the problem but passes with the fix.

bug:20731384
Change-Id: I581a005560cc71167b857abf2452769399a9e1b7
onnectivityServiceTest.java
de2c37fdce31c13e16177ecc5d87b0cb622d59e3 10-Jun-2015 Paul Jensen <pauljensen@google.com> am c05c31a4: am 0fac11a8: am c1e623bb: Merge "Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs" into mnc-dev

* commit 'c05c31a4c684f15bacd1908737bf8148d0e6adb3':
Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs
67b0b0756b47c0ef0c50ce42f140d36c200f7984 10-Jun-2015 Paul Jensen <pauljensen@google.com> Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs

Overlapping the NetIDs can cause the ConnectivityService instance under test
to inadvertently use real networks, for example when NetworkMonitor attempts
to validate a network. This fixes test hangs when run on devices with
active internet connections.

Change-Id: I5e1898953f0117b9f75beccac4a52ae2db173567
onnectivityServiceTest.java
0935f3ce512a62f943d2cc4daa65145ad6937c34 28-May-2015 Tim Kilbourn <tkilbourn@google.com> Refactor DropBoxManagerService as a SystemService.

Move the binder stub inside the service and inherit from SystemService
to take advantage of SystemServiceManager.

Change-Id: Ic6fff50ccfcf6c9626ffca8d61f627c055608953
ropBoxTest.java
d7b6ca91e9ecac15949a4484d560cfab5833a431 13-May-2015 Paul Jensen <pauljensen@google.com> Revive ConnectivityServiceTest and add some tests.

Change-Id: I44740a7b21cff18ac2a67d09c4d0e597add19ee0
onnectivityServiceTest.java
e7b021735ec53966e773966ff5e90fada421a3e2 27-Apr-2015 dcashman <dcashman@google.com> Fix PackageManagerSettingsTests and add KeySet info.

Add unit tests for the keyset portion of packages.xml. Also fix previously
broken test by adding UserManagerService reference.

Bug: 19530911
Bug: 19530120
Change-Id: I251fc3e9dc983f1d63f9e84905d3ed0e64843def
m/KeySetManagerServiceTest.java
m/KeySetUtils.java
m/PackageManagerSettingsTests.java
67633a17face3de63025d07f5c0fcf1f25e95f1a 27-Feb-2015 dcashman <dcashman@google.com> Add KeySetManagerService unit tests.

Bug: 19530120
Change-Id: Ie5601f7cafd4b853c6436941cfed48622549d928
m/KeySetManagerServiceTest.java
m/KeySetStrings.java
f851d6dd2a15b74f63c85403afad0ed747f7311c 20-Apr-2015 Erik Kline <ek@google.com> CONNECTIVITY_ACTION is the new _IMMEDIATE

Bug: 20013379
Change-Id: I3e904dc0a0ddb30c7bb8cdb24d0762052ddc59eb
onnectivityServiceTest.java
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
8fa5665f0e757cec0063fb4cf1354f1596f93a91 31-Mar-2015 Andres Morales <anmorales@google.com> Wire up GateKeeper to LockSettingsService

Adds:
- Communication to GKService
- password upgrade flow
- enroll takes previous credential

Change-Id: I0161b64642be3d0e34ff4a9e6e3ca8569f2d7c0a
ockSettingsStorageTests.java
385de624aa990266ffbaf70711ac8a330569429e 11-Apr-2015 Fyodor Kupolov <fkupolov@google.com> Use UserHandle instead of int for public APIs

Bug: 20049349
Change-Id: If5671fb47aa9a3cffebff16787daeae9ca7361e8
m/UserManagerTest.java
2e29aa5ea7fd361e66751578037ce253009c80e4 11-Apr-2015 Fyodor Kupolov <fkupolov@google.com> Merge "Added getUserCreationTime to query user/profile creation time"
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
etworkStatsServiceTest.java
ff7233e2e3df4965b9ecadabfd78bb991fd1e102 08-Apr-2015 Fyodor Kupolov <fkupolov@google.com> Added getUserCreationTime to query user/profile creation time

Added public api to query creation time of the user or of a managed profile
associated with the calling user.

Bug: 20049349
Change-Id: I7f9263fe434233e6f7d4f165c974cab64ca7107c
m/UserManagerTest.java
262f9952e6e78e00a6d42bab97d73dccfb9607f4 24-Mar-2015 Fyodor Kupolov <fkupolov@google.com> Support for nested bundles in setApplicationRestrictions

Added new restriction types - bundle and bundle-array.

Modified RestrictionsManager.getManifestRestrictions to support new
hierarchical restrictions.
Added RestrictionsManager.convertRestrictionsToBundle, which enables
programmatic conversion from a list of RestrictionEntries to a Bundle.

Modified read/write methods for application restrictions in UserManagerService.
Added unit tests.

Bug: 19540606
Change-Id: I32b264e04d5d177ea5b4c39a8ace5ee0ce907970
m/UserManagerServiceTest.java
fc2d615a7b71634615225e8f14558ede5856bbd1 29-Mar-2015 Svet Ganov <svetoslavganov@google.com> Fix build

Change-Id: Ib3fc843ad02ea3a83f03cf1d6b063d4031da51b1
m/PackageManagerSettingsTests.java
12a692a5e8244cad6ae634cc0821e4e3590cfef6 29-Mar-2015 Svet Ganov <svetoslavganov@google.com> Fix runtime permissinos toggling and relax XML parsing.

1. Fixed the case where runtime permissons can be toggled by a
developer via a system property.

2. Relaxed the runtime permission XML parsing to be more fault
toelrant and consistent wiht the reset of the package manager
parse code.

3. Fixed a deadlock due to calling in to the activity manager
with the package manager lock held to kill an app.

Change-Id: I11dfb57ad4d8119baea79227dc2a3fe5e2208515
m/PackageManagerSettingsTests.java
c6d1c345f41cf817bf2c07c97b97107d94296064 26-Feb-2015 Svetoslav <svetoslavganov@google.com> Runtime permissions: per user permission tracking.

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

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

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

Change-Id: Icbf2fc2ced15c42ca206c335996206bd1a4a4be5
m/PackageManagerSettingsTests.java
db64454b3354e26c96fdb83a4443cce12e352640 13-Mar-2015 Andreas Gampe <agampe@google.com> resolved conflicts for merge of b6b9fe21 to master

Change-Id: If4f62aa1fd8bb774288a677e7008e86a7e3ea6d9
7fad4eb4b52bc6c7ddad47f70e0c310093fbde3b 21-Nov-2014 Paul Jensen <pauljensen@google.com> Remove dead code, mostly DataStateTracker.

Change-Id: I1433937bffdb29bd42fb1adbfcf0a50ceffac7dd
onnectivityServiceTest.java
8add57224ffcf73705e507f1b73954e5de15eb88 23-Dec-2014 Esteban Talavera <etalavera@google.com> Remove deprecated version of setProfileOwner that takes packageName

The ComponentName equivalent should be used instead.

Bug: 17654371
Change-Id: I7001e86ab1709b824944148a3c44af5243dacb83
evicepolicy/ApplicationRestrictionsTest.java
evicepolicy/DeviceOwnerTest.java
3256601f5e4d94713f59e97b9d4912875c1bdcaf 03-Dec-2014 Jeff Sharkey <jsharkey@android.com> Offer to "merge" subscribers for data usage.

There are some cases where multiple subscriber identities (IMSI)
should be treated as "merged together" from a data usage
perspective. This is done by extending the template used for
matching purposes to support multiple subscribers.

Then, when we query historical usage or set network policies, we
normalize the matching template to merge to any other identities
that should be included. When normalizing, the "lowest" identity
is always used for equality and storage purposes, which allows
identities to come and go over time.

This change also fixes data usage recording for multi-SIM devices
by passing along the concrete subscriber identity for each network
interface. Also correctly create default policies for multi-SIM
devices. This change also drops setPolicyDataEnable() until it can
be wired up to the right underlying NetworkAgent. (This means we
still bring up the network, and then rely on iptables rules to block
traffic when over the limit, instead of proactively disabling the
connection.)

Bug: 18012787
Change-Id: If6acf32009fdfea2b836f5aff8e2f3e5e0248b4a
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
21b5ee3f0e39be4a79bcfb2b79b0529f75f5cb58 13-Nov-2014 Sreeram Ramachandran <sreeram@google.com> Eliminate race conditions in UID-based network filtering.

The previous code retrieved information from the legacy tracker multiple
times for each user query, leading to race conditions where the info
could've changed between the calls.

Refactors the handling of legacy data types in ConnectivityService and
unifies call paths so that APIs that deal with legacy data types
(NetworkInfo and int/networkType) and newer types (such as Network) go
through common code paths, using NetworkState to hold all the necessary
data pieces. This enables follow-on bug fixes to getActiveNetworkInfo().

The changes are limited to public "query" APIs (those that retrieve some
network information or the other). More details about the specific
changes and their rationale can be found in the code review thread.

Bug: 17460017
Change-Id: I656ee7eddf2b8cace5627036452bb5748043406c
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
e542499a304f067372d85722e11a74b4e56b0bd7 07-Nov-2014 Adrian Roos <roosa@google.com> Add LockSettingsStorage tests

Bug: 18163444
Change-Id: I563276e6d445d43d05bf0d3c633440a8e0109b69
ockSettingsStorageTests.java
d634d39c605553e669a16fd8fd406aa4695f54af 27-Oct-2014 Jeff Sharkey <jsharkey@android.com> Merge "Follow API removal." into lmp-mr1-dev
cff1d673394f8ef8c92bb69fea18cef4f7d07959 27-Oct-2014 Jeff Sharkey <jsharkey@android.com> Follow API removal.

Bug: 18118003
Change-Id: Iad73ce748e05ba0660246e8dbb041415c187f792
etworkStatsServiceTest.java
036ebd782ca60c87360df354acf85854d428de12 27-Oct-2014 Jeff Sharkey <jsharkey@android.com> Follow ArraySet refactoring.

Bug: 18115729
Change-Id: I2c32965b621b5bb57ff3bde02b00b31b59a5cd6d
m/PackageManagerSettingsTests.java
48a30db75dd0eedf8e065c89825b2af86a381b62 23-Sep-2014 Matthew Williams <mjwilliams@google.com> Fix lock ordering in JobScheduler

BUG: 17625667
Two part clean-up.
1) Don't try to lock in onControllerStateChanged. Do it in the handleMessage
instead where the rest of the locking is. This is sufficient to fix this bug.
2) The other side of the deadlock came b/c we lock when cancelling and calling
stopTrackingJob. Controllers handle their own locking so this isn't
necessary. B/c of a potential race from the controller side, added an explicit
check for the JSS to only run an expired job if it still exists.

Change-Id: Iaeebbc19437eb5b73e3ced3168f1fc13e564a4be
ob/JobStoreTest.java
0e8d7d63ba439cc0604af7055679dae3d30fdc48 03-Sep-2014 Amith Yamasani <yamasani@google.com> Add some @SystemApi tags for internal user-related APIs

Also added an internal isManagedProfile()

Bug: 17371392
Change-Id: Ibcc26771d954505cbd530192bf4a8a25a8d4cae0
m/UserManagerTest.java
d1c06753d045ad10e00e7aba53ee2adba0712ccc 22-Aug-2014 Matthew Williams <mjwilliams@google.com> Implement API review feedback for JobScheduler

BUG: 17005336

Took the opportunity to clean up some back-off logic

Change-Id: Ibc8ae34d1d44dd064ba071e4cbad17872f7e38cf
ob/JobStoreTest.java
235510e67210f90de30c2d5582a2077ccc589619 13-Aug-2014 Jose Lima <joselima@google.com> Made AlarmClockInfo a nested class in AlarmManager

Bug: 16959028
Change-Id: I150eaaff765d1e214c3621c1bf50162ec0dac8ec
etworkStatsServiceTest.java
95ab7849444125387dc88088bb5197ee463d8c17 12-Aug-2014 Amith Yamasani <yamasani@google.com> Decouple user limit from guest creation

Allow Guest to be created even if there are N users.
Allow N users to be created even if there are N-1 users
and a Guest.
Limit number of guests and managed profiles that can
be added.

Added unit tests.

Bug: 15934700
Change-Id: I1a8f0fa38a91d71ef7b2980e05c974244dfc337a
m/UserManagerTest.java
6831f1d80f9a5ad2400bd186fb6179e0e511be05 27-Jul-2014 Robert Greenwalt <rgreenwalt@google.com> Remove dead code 2.

Removing ConnectivityService.NetworkFactory. This requires disabling
the ConnectivityServiceTest, but that's been broken since we stopped
using NetworkStateTrackers anyway.

Change-Id: I9b86bd37eb9d018c40f60dca5b00d62c36d4e3ad
onnectivityServiceTest.java
01ac45b6ff2334925c8d24b5278b44e5e30f5622 23-Jul-2014 Matthew Williams <mjwilliams@google.com> Fix JobScheduler race condition

The loading of jobs from disk is now done sychronously.

Bug: 16372824
Change-Id: Ica0592d6de51e89662c9e49ed1eb59209b64356c
ob/JobStoreTest.java
ask/TaskStoreTest.java
1031c974855ff4117a6d7866e664295786840319 23-Jul-2014 Chris Wren <cwren@android.com> Honor the sort and group keys for notification ranking.

Sort notifications naturally, then move group childen to be next their proxy.
The group proxy is the summary, or if no summary exists, the lowest-ranked
member of the group is chosen as the proxy.

Notifications with a sortKey but no group and placed into a synthetic
group that consists of all notifications from that package and user in
the same priority bucket that also have sortKeys.

Expose a new API for listeners to get the group key for the notificaiton.

Bug: 15190903
Change-Id: I324ba0c394affdabb3588ca2ebafa7cf0acad2af
otification/RankingHelperTest.java
cf7ed583080b6c958f5a02817110505bae2a17df 23-Jul-2014 Chris Wren <cwren@android.com> Revert "Honor the sort and group keys for notification ranking."

This reverts commit df09d4c348f9f2aea10391b27d157d8b71a9e189.

Change-Id: Idbc9ed5c5c83cd0cad5a71872bcc203321a11e9e
otification/RankingHelperTest.java
4a24fd3c7bab53e4e9c127214e7168db0af8800a 17-Jul-2014 Chris Wren <cwren@android.com> Honor the sort and group keys for notification ranking.

Sort notifications naturally, then move group childen to be next their proxy.
The group proxy is the summary, or if no summary exists, the lowest-ranked
member of the group is chosen as the proxy.

Notifications with a sortKey but no group and placed into a synthetic
group that consists of all notifications from that package and user in
the same priority bucket that also have sortKeys.

Bug: 15190903
Change-Id: I377ed65b9592079446da4a4189f5ab49d28630ec
otification/RankingHelperTest.java
03666c705ddabe0e7c5869ab69c2ca8b964164e9 20-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Cleanup: Delete dead code.

Bug: 15413389
Change-Id: I315468832ef18ffc84174e54774ab63b86d284dc
onnectivityServiceTest.java
900c67fc51fc2672458dd1c9641250f2ecc01a31 09-Jul-2014 Matthew Williams <mjwilliams@google.com> Add job persistance as a setter in the API

Bug: 15936795
Change-Id: I11e5a722bab5838dc151670256ed09dfaa7fdaa7
ask/TaskStoreTest.java
c42a1e1071937ae48b7aa5d6291a32c29078b74b 07-Jul-2014 Adrian Roos <roosa@google.com> Add AlarmClock API to AlarmManager

Adds a new kind of alarm that represents an alarm clock and
a way to query the next scheduled alarm clock.

Deprecates Settings.System.NEXT_ALARM_FORMATTED.

Bug: 14589952
Change-Id: I297eeeff36d07adcda010afac183d0f5ee37dc99
etworkStatsServiceTest.java
43c4f41adb330522c6784177bf8e9a1239c6a15f 11-Jun-2014 Matthew Williams <mjwilliams@google.com> am 8e8c1401: Fix build.

* commit '8e8c140114cb3a4f1cf448c4492c13769738ca12':
Fix build.
0188bee2c526270c178a0b1f918b2a09999de25f 11-Jun-2014 Christopher Tate <ctate@google.com> am d8f71d34: Merge "Out with the old; in with the new" into lmp-preview-dev

* commit 'd8f71d34c3c7fb161a1586de8edb52161c32d672':
Out with the old; in with the new
46919f358390ad40e19259d12ef04b6898b9e4a4 11-Jun-2014 Matthew Williams <mjwilliams@google.com> Fix build.

Two tests were breaking the build.

Change-Id: If424a552d3fedb912fa94870b88c60dc3750b69a
ask/TaskStoreTest.java
ask/controllers/BatteryControllerTest.java
7060b04f6d92351b67222e636ab378a0273bf3e7 10-Jun-2014 Christopher Tate <ctate@google.com> Out with the old; in with the new

Switch to the official "JobScheduler" etc naming.

Bug 14997851

Change-Id: I73a61aaa9af0740c114d08188bd97c52f3ac86b7
ask/TaskStoreTest.java
ask/controllers/BatteryControllerTest.java
f53c295ae3ccabf1cf5a31c03f64233526e683eb 10-Jun-2014 Matthew Williams <mjwilliams@google.com> am 3b471117: Merge "Add OnNetworkActive to TaskManager and simplify locking." into lmp-preview-dev

* commit '3b4711176e77640d697e94137e65fa93c8363f5c':
Add OnNetworkActive to TaskManager and simplify locking.
effacfa75bd9c2ebc889a7bc4f002c07f82f4c31 06-Jun-2014 Matthew Williams <mjwilliams@google.com> Add OnNetworkActive to TaskManager and simplify locking.

Bug: 14993295
Hooks up a ConnectivityManager.NetworkActiveListener.
    
Previously was using 3 locks where 1 would suffice,
negligible to no performance issues b/c most of the previous locks
were nested.

Added OnNetworkActiveListener so that the ConnectivityController can kick of
tasks when it knows that the network is active.

Fixed some bugs that stopped timecontroller from executing tasks.

Requesting a retry will not add a deadline to that task. However backed-off
tasks are run as soon as they are ready, subject to their constraints.

Added receiver to listen for package removal and user removal, which will
delete any outstanding jobs for that uid.

Change-Id: I4c4523af558b927f19b8a215878fcc7198abb93f
ask/controllers/BatteryControllerTest.java
38b200fe6c1aba63b57b315f4274d337545f0c89 05-Jun-2014 Matthew Williams <mjwilliams@google.com> am 1a2f47d4: Merge "Add persistence of tasks for TaskManager & BatteryController" into lmp-preview-dev

* commit '1a2f47d4cdc0ea40dff1b88f7976d64c19d687b1':
Add persistence of tasks for TaskManager & BatteryController
3d86fd2bb9db6067c49634bc4c6cdb4d5235ad36 17-May-2014 Matthew Williams <mjwilliams@google.com> Add persistence of tasks for TaskManager & BatteryController

Tasks are persisted only if the client has the RECEIVE_BOOT_COMPLETED
permission. This applies to both periodic and one-off tasks.
Write out task as xml, using PersistableBundle for the extras data.
Todo: Add persistable bundle to xml when ag/468207 is merged.

Also added BatteryController logic.

Change-Id: I23eeeb8b3bc6ba155e7fa4ec25857a68ee8b1567
ask/TaskStoreTest.java
ask/controllers/BatteryControllerTest.java
5b5aa4072fb58aea47f523c724878c579adae294 02-Jun-2014 Amith Yamasani <yamasani@google.com> Handle saving and restoring ints in application restrictions

Unit tests for restrictions types and proper escaping.

Change-Id: Iac35521faf5798398a89fecbad82fcdd256a4146
evicepolicy/ApplicationRestrictionsTest.java
92af372fc60f59c628a7169d4a506e9c834c097a 27-May-2014 Chris Wren <cwren@android.com> add tests for ValidateNotificationPeople.getExtraPeople()

Change-Id: Ieb8acce58574c25cccce674b4494f75d96b57125
otification/ValidateNotificationPeopleTest.java
4ddebf7f5b85d082c56f6a8aad11bd0c5ca68fde 16-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Fix build.

Change-Id: I5dab09d2d8a9cff56fa17bb4e8c14b365449399b
onnectivityServiceTest.java
a7b9796345335e4906d98432a1d194fa242cd23e 15-Apr-2014 Paul Jensen <pauljensen@google.com> Get ConnectivityServiceTest building again after 8f80cc8.

Change-Id: I4520011ba2076d8fac1ca234cb9a79c774992671
onnectivityServiceTest.java
629f76682729a63c0e3d29f836c3c69c6fdb4c77 11-Apr-2014 Narayan Kamath <narayan@google.com> am 80edaa67: am 24c089a8: Fix build.

* commit '80edaa676bd59409f8a82e12c035bee96e653004':
Fix build.
24c089a8b5871b331441d0858aa164364b7737cb 11-Apr-2014 Narayan Kamath <narayan@google.com> Fix build.

isScreenOn was changed to isInteractive.

Change-Id: I381d0b0ca745b61e64ac6309c2a6307696f52be0
etworkPolicyManagerServiceTest.java
c798e4f5497c39a3c6c14b120cffdee1122a9212 25-Mar-2014 Matthew Williams <mjwilliams@google.com> am 4701b51a: am bb87ac7f: DO NOT MERGE: Downgrade expedited to normal on reschedule.

* commit '4701b51af216ce2b6fa9fa508ebba47bf13063c7':
DO NOT MERGE: Downgrade expedited to normal on reschedule.
bb87ac7f9733ca9b490cb34e8a675dba083a57b7 24-Mar-2014 Matthew Williams <mjwilliams@google.com> DO NOT MERGE: Downgrade expedited to normal on reschedule.

bug: 12033540
Expedited was previously tracked by a redundant internal variable, ostensibly
as an optimisation. This variable could differ from the value in the bundle
depending on how the operation is initialised, which led to confusion. Now an
expedited sync will only be treated as such on its first execution.

Change-Id: Ibfc4e9e49b86c82f2364a6ef55f887705a053eb6
ontent/SyncOperationTest.java
cde7086b900fd192a8e389f62ab5007d351d86b8 21-Mar-2014 Matthew Williams <mjwilliams@google.com> Merge "Downgrade expedited to normal on reschedule."
a3f828ba3079408543091a4ccd6c11896ec4e0c7 19-Mar-2014 Ashish Sharma <ashishsharma@google.com> Update the tests to deal with the new timestamps in idletimer module.

Change-Id: I1a8368d84ef806f1501b0a1f5e817388a1d10518
etworkManagementServiceTest.java
8a985d24ce9a38f40ed88fecbdcd0e75e3a68f44 25-Feb-2014 John Spurlock <jspurlock@google.com> Tabs -> spaces in frameworks/base.

Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
ccounts/AccountManagerServiceTest.java
d63b4314b85e982a1d70d4064af59851f476dd36 13-Feb-2014 David Christie <dnchrist@google.com> Merge "Log history of location requests in LocationManager. -Assists with debugging power issues. Bug: 12824233"
6428046767ee4195617fb41b5639eefa2ca7a939 09-Jan-2014 Matthew Williams <mjwilliams@google.com> Downgrade expedited to normal on reschedule.

bug: 12033540
Expedited was previously tracked by a redundant internal variable, ostensibly
as an optimisation. This variable could differ from the value in the bundle
depending on how the operation is initialised, which led to confusion. Now an
expedited sync will only be treated as such on its first execution.

Change-Id: I9979102317aecbe8bc53a36381d4b2782ac131be

Conflicts:
services/core/java/com/android/server/content/SyncOperation.java
services/core/java/com/android/server/content/SyncQueue.java
ontent/SyncOperationTest.java
ontent/SyncStorageEngineTest.java
776c555d954d9494069f786785877c08add27327 09-Jan-2014 Adam Connors <adamconnors@google.com> Extend DeviceOwner concept to accommodate ProfileOwners

ProfileOwners, like DeviceOwners, are Device Admins that have
additional priviledges. ProfileOwners however are scoped per
user.

Change-Id: I1e22c85878e0672121e6ebbe97fca38591f992b2
evicepolicy/DeviceOwnerTest.java
2ff96af24de2c22a21de9b56ea8543dccdbdcb9d 31-Jan-2014 David Christie <dnchrist@google.com> Log history of location requests in LocationManager.
-Assists with debugging power issues.
Bug: 12824233

Change-Id: Iaaef0dbe00154c7668034a166587671b75d1f3c7
ocation/LocationRequestStatisticsTest.java
4598ea4e5e6b2accce5165a76f5e2d04ce46c74c 09-Dec-2013 Lorenzo Colitti <lorenzo@google.com> am 263c4788: am 30253d7a: am 2daa0c93: Merge "Add address flags and scope to LinkAddress."

* commit '263c4788dcf45f104f8668fd6621d1a7c39689b9':
Add address flags and scope to LinkAddress.
64483947fdb03bf838e317ac0a4af5e0f53a5bbf 15-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Add address flags and scope to LinkAddress.

This is necessary so that the framework can know whether an IPv6
address is likely to be usable (i.e., if it's global scope and
preferred). Also, it will simplify the address notification
methods in INetworkManagementEventObserver, which currently take
the address, the flags, and the scope as separate arguments.

1. Add flags and scope to the class and update the unit test.
Use the IFA_F_* and RT_SCOPE_* constants defined by libcore.
Since most callers don't know about flags and scope, provide
constructors that default the flags to zero and determine the
scope from the address. Addresses notified by the kernel will
have these properly set. Make multicast addresses invalid.
Update the class documentation.
2. Provide an isSameAddressAs() method that compares only the
address and prefix information between two LinkAddress
objects. This is necessary because an interface can't have
two addresses with the same address/prefix but different
flags.
3. Update LinkProperties's addLinkAddress and removeLinkAddress
to identify existing addresses to add/remove using
isSameAddressAs instead of implicit equals(). Specifically:
- If addLinkAddress is called with an address that is already
present, the existing address's flags and scope are updated.
This allows, for example, an address on an interface to go
from preferred to deprecated when it expires, without it
having to be removed and re-added.
- If removeLinkAddress is called with an address that is
present but with different flags, it deletes that address
instead of failing to find a match.
4. Update the INetworkManagementEventObserver address
notification methods to take just a LinkAddress instead of
LinkAddress, flags, and scope. While I'm at it, change the
order of the arguments for consistency with the other
functions in the interface.

Change-Id: Id8fe0f09a7e8f6bee1ea3b52102178b689a9336e
etworkManagementServiceTest.java
317d15c15531b353aa3e8cb1a3ba03d98b71efb6 02-Dec-2013 Lorenzo Colitti <lorenzo@google.com> am 4806fdfb: am f226bc60: Merge "Use LinkAddress in address notifications."

* commit '4806fdfbd0fecf91584396fc0f620c97a05ab837':
Use LinkAddress in address notifications.
5ad421a3d00c92c155d57af9d1a05d81cc2fa88f 17-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Use LinkAddress in address notifications.

Currently address{Updated,Removed} pass in the address as a
string such as "fe80::1/64". Use LinkAddresses instead, since
that's what it is.

This makes the code more robust in the unlikely case that netd
passes in an invalid string. In the future we can move flags and
scope into the LinkAddress itself and simplify the code further.

Bug: 9180552
Change-Id: I66599f9529cf421caa7676fdd0141bb110b8589e
etworkManagementServiceTest.java
5ae4a531cc31be2868f65c40e8636658f1ae2f06 31-Oct-2013 Lorenzo Colitti <lorenzo@google.com> Pass DNS server info notifications to observers.

These are sent if the device receives IPv6 Router Advertisements
with DNS server configuration options. Currently, nothing listens
to them; in a future change we will use them as IPv6 DNS servers.

[Cherry-pick of 416740ad4d9132005a71dc0883334e852235a18a]

Bug: 9180552
Change-Id: I05000c0cd3867a68ab390102e8470b6912a9d3aa
etworkManagementServiceTest.java
a9626c1c956f51e7b4cb783d70b75abc3b180a00 04-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Minor cleanups to NetdCallbackReceiver.onEvent.

- Clean up identical error messages.
- Fix the array length check for InterfaceAddressChange.

[Cherry-pick of 59be800e7fe81842aa8c77b91319f58ab165983d]

Bug: 9180552
Change-Id: Id871f481445b530c3ad749725f1548df0e3a1228
etworkManagementServiceTest.java
416740ad4d9132005a71dc0883334e852235a18a 31-Oct-2013 Lorenzo Colitti <lorenzo@google.com> Pass DNS server info notifications to observers.

These are sent if the device receives IPv6 Router Advertisements
with DNS server configuration options. Currently, nothing listens
to them; in a future change we will use them as IPv6 DNS servers.

Bug: 9180552
Change-Id: I05000c0cd3867a68ab390102e8470b6912a9d3aa
etworkManagementServiceTest.java
59be800e7fe81842aa8c77b91319f58ab165983d 04-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Minor cleanups to NetdCallbackReceiver.onEvent.

- Clean up identical error messages.
- Fix the array length check for InterfaceAddressChange.

Bug: 9180552
Change-Id: Id871f481445b530c3ad749725f1548df0e3a1228
etworkManagementServiceTest.java
d08d6686c5e16cedc23cd9bc836a28d629b8622c 14-Oct-2013 Matthew Williams <mjwilliams@google.com> resolved conflicts for merge of 94b51810 to master

Change-Id: Ida818f066b66c356a84c80e5eab0a4e2cf4ebd49
94b518101c2b2587cb60664dde8931b11f154ec0 11-Oct-2013 Matthew Williams <mjwilliams@google.com> am e0a2bdaf: am 32551ae5: Merge "Fix infinite boot-loop bug in SM." into klp-dev

* commit 'e0a2bdaf61a7a72e92d614f81f86e7fd441b38e4':
Fix infinite boot-loop bug in SM.
632515b9d0960749ddb1636677d7f12f196d73f7 11-Oct-2013 Matthew Williams <mjwilliams@google.com> Fix infinite boot-loop bug in SM.

Bug:11064918
If the ContentResolver sync API is used with the empty ("")
string as a provider, the ContentService will throw an RTE.
This cl addresses all the entry points of the API that could
allow this, as well as adds an ifEmpty check at the point of
failure.
Also removed RTE throws from public functions(no point in
crashing the phone).

Change-Id: I57427d12a6cafb3e6d7a32ca0c10b05315b20580
ontent/SyncStorageEngineTest.java
87e385effb106d1764abaf1c7d77ff3751b922dc 04-Oct-2013 Alex Klyubin <klyubin@google.com> am aa947f15: am a9bce468: am 84742149: Merge "Make EntropyMixer mix in output of Hardware RNG into Linux RNG."

* commit 'aa947f15314a4239de91a1cd0bea085e3399d43e':
Make EntropyMixer mix in output of Hardware RNG into Linux RNG.
aa947f15314a4239de91a1cd0bea085e3399d43e 04-Oct-2013 Alex Klyubin <klyubin@google.com> am a9bce468: am 84742149: Merge "Make EntropyMixer mix in output of Hardware RNG into Linux RNG."

* commit 'a9bce46876d6f1f82727ab6922748fcc6b43c767':
Make EntropyMixer mix in output of Hardware RNG into Linux RNG.
6ab3d20d3c2de01a342450d83103e9f5e89e670e 03-Oct-2013 Alex Klyubin <klyubin@google.com> Make EntropyMixer mix in output of Hardware RNG into Linux RNG.

On devices with Hardware RNG (HW RNG), this makes EntropyMixer
periodically (every three hours) read 512 bytes from HW RNG and mix
them into the Linux RNG.

This is done without increasing Linux RNG's entropy estimates to
avoid having to trust the quality of the HW RNG. This approach cannot
reduce the quality of the Linux RNG output, but may increase it.

Change-Id: Ifde851004301ffd41b2189151a64a0c5989c630f
ntropyMixerTest.java
06485a7c6e3bbea1f427f345ac3a18b2346750e0 26-Jul-2013 Matthew Williams <mjwilliams@google.com> Pending op fix didn't merge properly from KLP-dev.

Manually merge in Cl c/342668. Add another test to ensure that it
WAI.

Change-Id: Iae603328d525cc71e4e31ad30a13384efc50f823
ontent/SyncStorageEngineTest.java
86f4b37d196bb9a72a22f706f89f3066ab2bf287 16-Sep-2013 Matthew Williams <mjwilliams@google.com> Merge "Refactor SyncManager rename authority->target"
8ef2204c8f5f9744a2ff7abdbbf2d26a5ea02837 26-Jul-2013 Matthew Williams <mjwilliams@google.com> Refactor SyncManager rename authority->target

fix bug that was stopping any sync service sync from
from taking place.
Change-Id: Ib3f46d43be630d4196fbf0ca32da03b6e7a6a5b9
ontent/SyncStorageEngineTest.java
123eeea6d62a80fb9660ad623fd378d2f2f0c904 12-Sep-2013 Jeff Sharkey <jsharkey@android.com> am e2d76fa8: am cecccecc: Merge changes Ib1274847,I2eb2a1bf into klp-dev

* commit 'e2d76fa8c6d0f5c3d1a73a3ec9756c4bc545806d':
Fix SDK build.
Request all tethering interfaces, fix corruption.
e4984bea95a07dea0ef0259fefa1e52f0bbb1533 11-Sep-2013 Jeff Sharkey <jsharkey@android.com> Request all tethering interfaces, fix corruption.

netd now tracks statistics for tethered interfaces across tethering
sessions, so switch to asking for all tethering stats. (Currently
we're double-counting all tethering data, ever since it started
tracking across sessions.)

Also catch OOME to handle corrupt stats files, which we then dump to
DropBox and then start over.

Bug: 5868832, 9796109
Change-Id: I2eb2a1bf01b993dd198597d770fe0e022466c6b9
etworkStatsServiceTest.java
56dbf8f23677d28615e61ef2fbb0e738cca02528 26-Jul-2013 Matthew Williams <mjwilliams@google.com> Fix broken javadocs

Change-Id: Ibf7f2ed92919efd36fffa963447b1a443c0bb9db
ontent/SyncStorageEngineTest.java
7421a01f18f34d554ca7a9fd987c4f96da2bdf2f 20-Aug-2013 Lorenzo Colitti <lorenzo@google.com> Add a simple test for NetworkManagementService.

For now, this only tests network observers. It works by starting
NetworkManagementService with a fake netd socket, feeding it
inputs, and seeing if the appropriate observer methods are
called.

Bug: 10232006
Change-Id: I827681575642a4ee13ae48b81272521544b676bd
etworkManagementServiceTest.java
ba35271e91648c9cde2bb606aaf2001282231b07 14-Aug-2013 Matthew Williams <mjwilliams@google.com> Use pending.xml to persist sync ops.

Support pending ops by producing badly formed xml.
fixed bug that stopped alarm manager from updating if the
next alarm time is in the past.
Use new AlarmManager API for old AM behaviour - to set
exact alarms.

Change-Id: I57090f9c7155996298be7ec968a88f17ac1938a7
ontent/SyncStorageEngineTest.java
ba530545f70e7aadad774987681091f9abbecb79 06-Aug-2013 David Christie <dnchrist@google.com> Revert "Fix broken unit test"

This reverts commit 0ca981fe42c43a4b7c345f4a0a2b3b2a519be5da.

Change-Id: I67f5e7227a8a874158c4f0954e62a77a317f1edd
etworkStatsServiceTest.java
0ca981fe42c43a4b7c345f4a0a2b3b2a519be5da 02-Aug-2013 David Christie <dnchrist@google.com> Fix broken unit test

Change-Id: I4aa0035233749f6d585c151329436439ae9b2921
etworkStatsServiceTest.java
df2cab2fc46c3f2c56f85dee1a19d0fa48cfd444 02-Aug-2013 David Christie <dnchrist@google.com> Fix build breakage

Change-Id: Ia684fb55db301fdadaa3aae93f82b2cdcfc200af
etworkStatsServiceTest.java
ebe51fc0d860077245c44bfb00130be62da001e1 26-Jul-2013 David Christie <dnchrist@google.com> Add WorkSource capability to AlarmManager.

Change-Id: I663ea3078d405f0fa667a04bdaa376ae6652e994
etworkStatsServiceTest.java
fa77418134c6f1f80af225a78819f069e9c974fb 19-Jun-2013 Matthew Williams <mjwilliams@google.com> AnonymousSyncService & SyncRequest.

Changes to the way bundles are parcelled broke SM,
this update writes out the bundle as xml. This circumvents
the need for parcel, and makes it easier to debug whats
happening.
Change-Id: I6cd5d3a2eb80bfa5b3ae0c7f2d2ff91a65daaa34
ontent/SyncOperationTest.java
ontent/SyncStorageEngineTest.java
bc668ac4b7c54278ed20d8329eb80e0b54892dc7 21-Jul-2013 Guang Zhu <guangzhu@google.com> fix build

Change-Id: Ie4bd7c3fe9320d22b7da2962e5e5a4abca510bd2
etworkStatsServiceTest.java
3e07a89b2c7fd8ac67a83b08b583682840f8fa5c 19-Jul-2013 Christopher Tate <ctate@google.com> Fix build & preserve DHCP scheduling as-is

Change-Id: I4063b18532c476280f343658bf3641495e526ed4
etworkStatsServiceTest.java
a8c7e3f86ab205a557c7b8cc1e8c6a61cec06f41 16-Jul-2013 Svetoslav <svetoslavganov@google.com> Fix the build - missed a renaming

Change-Id: I0e85723647c0e5a6f6374e119f0fbd43db477ee0
ountryDetectorServiceTest.java
56cd646abeae51e806791f82ab0995fe047b1fe4 08-Jun-2013 Jeff Sharkey <jsharkey@android.com> Avoid logging sensitive data.

When building commands to send across NativeDaemonConnector, scrub
sensitive arguments to prevent them from being logged.

Bug: 8609800
Change-Id: I84b16791749264a010f7e59f9918f68d71bac6b9
ativeDaemonConnectorTest.java
31c0959b1a04f4e17d7528a6e4a9296701e3ade7 31-Mar-2013 Amith Yamasani <yamasani@google.com> Fix test

Change-Id: I329ceff03d3707e10c2e4eabfb8e6ea61082ae6d
ccounts/AccountManagerServiceTest.java
9d034debdd7226ea33530143710fcb962144be22 29-Mar-2013 Geremy Condra <gcondra@google.com> am 24948d3c: am 946a5c91: Merge "Save off the seinfo value with packages.list."

* commit '24948d3ca7ff7fa70ee85e9aa7530239d7b482b2':
Save off the seinfo value with packages.list.
7039738f813f8e38e4857d439b7e46f3c877794d 28-Mar-2013 Dianne Hackborn <hackbod@google.com> Fix build.

Change-Id: I38a25dc63107fc907a520169e1b58f00e51dbb9d
m/PackageManagerSettingsTests.java
05191053545065c9c71afae173d3ab42a2d947fa 26-Mar-2013 Amith Yamasani <yamasani@google.com> Match tests to new API.

Change-Id: I9a537a437c721ae64d9307b889b9de5d5429670f
m/UserManagerTest.java
4a4537331be12e7ac11066931c845ec9d8064571 26-Mar-2013 Robert Craig <rpcraig@tycho.ncsc.mil> Save off the seinfo value with packages.list.

Patch adds the seinfo label per package to the file.
This is of particular interest to the run-as program
which uses the seinfo tag to correctly label the
app security context before running the shell.

Change-Id: I9d7ea47c920b1bc09a19008345ed7fd0aa426e87
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
m/PackageManagerSettingsTests.java
e16713597661c326d2bb6586a8b13e27520c4227 08-Mar-2013 Lorenzo Colitti <lorenzo@google.com> Always specify an interface for host routes.

Change-Id: I05b4d87e7d7e8237c6f4a70f1fedae00f416f581
onnectivityServiceTest.java
79619ddbfe7367e11dd17d848b179877350b7b8e 04-Mar-2013 Nick Kralevich <nnk@google.com> EntropyMixer: Write entropy at shutdown / reboot / power

Write out entropy if we're shutting down or rebooting,
or if someone plugs in the power.

Bug: 8312061
Change-Id: Id9a48064a7bdfe6c05a9227ea95a1bdbd0e9b8ae
ntropyMixerTest.java
6794458f8626c3be27eac3db3a5c89d94f132675 22-Feb-2013 Maggie Benthall <mbenthall@google.com> Add location sharing toggle user restriction.

And add support for respecting it.

Change-Id: Ia5cf9134c5f5741c3f55afadbe54f862da7bfe5b
m/UserManagerTest.java
3671b1e910e4d297bebcd3ceaa2682bfb4b1f4a1 01-Feb-2013 Jeff Sharkey <jsharkey@android.com> Migrate to using Mockito directly.

Change-Id: I1fcc5d1a780f5831bd6685f0735d4c0c6d245735
roadcastInterceptingContext.java
onnectivityServiceTest.java
20949a76fee62e89d7dc22858a74469efa14f61d 12-Feb-2013 Amith Yamasani <yamasani@google.com> Fix UserManager test

Change-Id: I927ffdda3dd5f69dc136e65c8069f2e480badfe9
m/UserManagerTest.java
e4cf73437a18c1444055f88a1fcc0d146ec23ac5 17-Dec-2012 Amith Yamasani <yamasani@google.com> Starting point for User Restrictions API

Restrictions saved as key/value pairs, mostly booleans right now
but might be expanded to other types later.

Save and restore restrictions in the user manager service.
Enforce some of the restrictions at the framework level. Some
are enforced (also) at the app level, such as in Settings.

Change-Id: Id11ffe129cb6a177e094edf79635727388c26f40
m/UserManagerTest.java
f265ea9d8307282ff1da3915978625a94fc2859e 01-Feb-2013 Dianne Hackborn <hackbod@google.com> App ops: vibration, neighboring cells, dialing, etc.

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

Add operation for retrieving neighboring cell information.

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

Change-Id: I3f8015634fdb296558f07fe654fb8d53e5c94d07
etworkPolicyManagerServiceTest.java
d4d9364019ed071509213b9ce772f4a5904d2847 30-Jan-2013 Dianne Hackborn <hackbod@google.com> Maybe fix build.

Change-Id: Ibad8edb15e7cc332d6c29958a386d32a96f4e755
m/PackageManagerSettingsTests.java
56dc0e02fc0e519a86c5efefe0143001d2563d43 23-Jan-2013 Jeff Sharkey <jsharkey@android.com> Merge "Tests to assert correct January behavior."
1539905b4621f94b0a1a215407a71034da806247 15-Jan-2013 Jeff Sharkey <jsharkey@android.com> Tests to assert correct January behavior.

Change-Id: I162102b6f1b892b79e2f5b96cb0184abb85d00bc
etworkPolicyManagerServiceTest.java
ca6486e7f579fa885b6213513f26ce2ca49f873b 15-Jan-2013 Sasha Levitskiy <sanek@google.com> Removed Throttle Manager as obsolete

Change-Id: I63e8514f34c880d0badaab33a347f54a80c84da6
hrottleServiceTest.java
03cb98aecfeef0b0894f69987f8b4a15c02501f3 11-Dec-2012 Amith Yamasani <yamasani@google.com> Move Observer test to servicetests

Change-Id: Ib3493af4eb3185db79004a3cad5473161ed51f71
ontent/ObserverNodeTest.java
e03c17f1cb50a7869ef33406a2be275fdb040ea1 11-Dec-2012 Amith Yamasani <yamasani@google.com> Merge "Move one more test."
814a8d35ae11b70027e0e476ca1c0bb589106b4d 11-Dec-2012 Amith Yamasani <yamasani@google.com> Move one more test.

Change-Id: Iea0e0b5727746f2332db2ab1c1b216326eb50f13
earch/SearchablesTest.java
8ff9a156c04c24458d94c716a64a5b7327f0e987 11-Dec-2012 Amith Yamasani <yamasani@google.com> Fix build. Forgot to move this test.

Change-Id: I06aab8ec6e2dac86b65bbeed3587444260fec2e8
ontent/SyncStorageEngineTest.java
7a96c39c510923ef73bbb06ab20109f0168b8eb1 15-Nov-2012 Jeff Sharkey <jsharkey@android.com> Move lingering services to services.jar.

This helps reduce the pressure on framework.jar, and makes it clear
that it should only be used by the system_server.

Bug: 7333397
Change-Id: I0858904239535380fbf30562b793e277d8c3f054
ccounts/AccountManagerServiceTest.java
ontent/SyncOperationTest.java
b2e18e91ec1f9c521b69e44761db2805e3a61ba3 29-Nov-2012 Dianne Hackborn <hackbod@google.com> am b443ddbb: am 2c41c4a2: Fix build.

* commit 'b443ddbbc7f1c7ed2d30310f80323cd4a5bf3e8d':
Fix build.
b443ddbbc7f1c7ed2d30310f80323cd4a5bf3e8d 29-Nov-2012 Dianne Hackborn <hackbod@google.com> am 2c41c4a2: Fix build.

* commit '2c41c4a2766dcce506fc0e9e361fc8198553293c':
Fix build.
2c41c4a2766dcce506fc0e9e361fc8198553293c 29-Nov-2012 Dianne Hackborn <hackbod@google.com> Fix build.

Change-Id: Icc1f2913b4e889609066b0ff1dddcd9be0230897
m/PackageManagerSettingsTests.java
58ed5d748c0b9b64845975ef5844ad313de7c3f6 07-Nov-2012 Kenny Root <kroot@google.com> am 768d9e1a: Merge "Correct executable bit for source files"

* commit '768d9e1a72ceee7d4a5f608776b87b62d6ce4a04':
Correct executable bit for source files
3a084af2e90849aaa8beb3a610189e3399c63ea0 07-Nov-2012 Kenny Root <kroot@google.com> Correct executable bit for source files

Many media files and source code files were marked as executable in Git.
Remove those.

Also a shell script and python script were not marked as executable.

Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
ocation/LocationBasedCountryDetectorTest.java
283d1409ddadd35cd41b5496659d3a24dc365fb0 21-Oct-2012 Amith Yamasani <yamasani@google.com> am f624d72c: am 8074e98b: Merge "Fix crashes when quickly adding and removing users" into jb-mr1-dev

* commit 'f624d72cb0fe40fd5748d4f0d1a93bf267aa3ed8':
Fix crashes when quickly adding and removing users
f624d72cb0fe40fd5748d4f0d1a93bf267aa3ed8 21-Oct-2012 Amith Yamasani <yamasani@google.com> am 8074e98b: Merge "Fix crashes when quickly adding and removing users" into jb-mr1-dev

* commit '8074e98b20ac04fdc032a1ed00dd6763b7e04147':
Fix crashes when quickly adding and removing users
db6a14cc85cede0769735fdac4da70766989a3ce 18-Oct-2012 Amith Yamasani <yamasani@google.com> Fix crashes when quickly adding and removing users

Make USER_REMOVED an ordered broadcast and send it before the user's
state is completely removed from the system. This gives services the
opportunity to clean up their state, while still having access to the
user's directory and UserInfo object (such as serial number).

Tell SyncManager to skip over dying/partially created users.

Improve UserManager tests, waiting for users to be removed fully.

Bug: 7382252

Change-Id: I93cfb39c9efe6f15087bf83c569a2d154ef27168
m/UserManagerTest.java
ae1af49a914cdbbd64ee069ad3f9913c7c6632f0 28-Sep-2012 Jeff Sharkey <jsharkey@android.com> am 3a8af8ef: Merge "Migrate more Secure settings to Global." into jb-mr1-dev

* commit '3a8af8efff93ca8ee80fc8c7841e7bee9a8b7786':
Migrate more Secure settings to Global.
625239a05401bbf18b04d9874cea3f82da7c29a1 27-Sep-2012 Jeff Sharkey <jsharkey@android.com> Migrate more Secure settings to Global.

Migrate networking, storage, battery, DropBox, and PackageManager
related Secure settings to Global table.

Bug: 7232014, 7231331, 7231198
Change-Id: I772c2a9586a2f708c9db95622477f235064b8f4d
ropBoxTest.java
031c410adc368a6242a834e23741afa09db69fa0 27-Sep-2012 Jeff Sharkey <jsharkey@android.com> am 68b7a6d1: Merge "First step towards cleaning up Global settings." into jb-mr1-dev

* commit '68b7a6d14b68b38324ffd275c7227805c7d99b2d':
First step towards cleaning up Global settings.
bdfce2ec05a3e9ca6acd6711de6133e06f2446e6 27-Sep-2012 Jeff Sharkey <jsharkey@android.com> First step towards cleaning up Global settings.

Remove all @Deprecated @hide settings, and clean up any stragglers.

Bug: 7232125
Change-Id: Ibf67093c728d4a28565129b923edb1701d3b2789
hrottleServiceTest.java
558f6d654f45ffc77db94fc660152704d4a6783f 26-Sep-2012 Jeff Sharkey <jsharkey@android.com> am 6e065a72: Merge "Handle multi-user mountObb() requests." into jb-mr1-dev

* commit '6e065a729dbf08f99209a7710da80442a394ec0d':
Handle multi-user mountObb() requests.
4fbbda4cecb078bd3867f416b02cc75f5455284f 25-Sep-2012 Jeff Sharkey <jsharkey@android.com> Handle multi-user mountObb() requests.

Since emulated external storage paths differ based on execution
context, carefully fix up paths for various use-cases:

1. When sending paths to DefaultContainerService, always scope
OBB paths as belonging to USER_OWNER.
2. When sending paths to vold, always build emulated storage paths
visible to root.
3. Always use the original untouched path when talking with apps.

Mount OBB containers using shared app GID, so that an app can read
the mount point across users.

Handle legacy paths like "/sdcard" by resolving the canonical path
before sending to MountService. Move tests to servicestests, and
add tests for new path generation logic.

Bug: 7212801
Change-Id: I078c52879cd08d9c8a52cc8c83ac7ced1e8035e7
ountServiceTests.java
31a2b8c7bfe0401a3b8c6250cf3ea43693362f92 22-Sep-2012 Svetoslav Ganov <svetoslavganov@google.com> am 0a5c5567: Merge "Multi-user support for the accessibility layer." into jb-mr1-dev

* commit '0a5c5567f2d7e203d95c80a8d3353d0acd98b5f9':
Multi-user support for the accessibility layer.
58d37b55bd228032355360ea3303e46a804e0516 18-Sep-2012 Svetoslav Ganov <svetoslavganov@google.com> Multi-user support for the accessibility layer.

1. This change converts the accessibility manager service to
maintain a state per user. When the user changes the services
for the user that is going away are disconnected, the local
accessibility managers in the processes for this user are
disabled, the state is swapped with the new user's one, and
the new user state is refreshed.

This change updates all calls into the system to use their
user specific versions when applicable. For example, regisetring
content observers, package monitors, calls into other system
services, etc.

There are some components that are shared across users such
as UI created by the system process and the SystemUI package.
Such components are managed as a global state shared across
all users and are updated accordingly on a user switch. Since
the SystemUI is running in a normal app process this change
adds hidden APIs on the local window manager to allow the
SystemUI to notify the accessibility layer that it will run
accross users.

Calls to AccessibiltyManager's isEnabled(), isTouchExplorationEnabled()
and sendAccessibilityEvent return false or a are a nop for a
background user sice he should not send accessibility events,
and should not perform touch exploration.

Update the internal accessibility tests due to changes in the
AccessibilityManager.

This change also fixes several issues that were encountered
such as calling out the accessibility manager service with a
lock held.

Removed some incorrect debugging code from the TouchExplorer
that was leading to a system crash.

bug:6967373

Change-Id: I2cf32ffdee1d827a8197ae4ce717dc0ff798b259
ccessibilityManagerServiceTest.java
ccessibilityManagerTest.java
d44daaba447e42c0b75d4cf5d33cf0b6ea3076b5 18-Sep-2012 Andy Stadler <stadler@google.com> Move files to make eclipse-java happy

No changes to text at all, just moving the java files to match their
declared packages.

There was no original bug# but this cleans up the code submitted in
the original Change-Id: I42307f58074157b33b6e01216aab10022340d449

Change-Id: I233fa7f21167a42565aadb7ad109600b1a1a5721
pdatable/CertPinInstallReceiverTest.java
pdates/CertPinInstallReceiverTest.java
8e53462d943231bcc993e94b57b32b8700b3e73f 16-Sep-2012 Jeff Sharkey <jsharkey@android.com> am d0c6ccba: Move NetworkPolicy from apps to UID.

* commit 'd0c6ccbafdebc73d03cf3cd47f02f9f6c78a69ff':
Move NetworkPolicy from apps to UID.
d0c6ccbafdebc73d03cf3cd47f02f9f6c78a69ff 15-Sep-2012 Jeff Sharkey <jsharkey@android.com> Move NetworkPolicy from apps to UID.

For multi-user devices, switch to storing policy per-user instead of
per-app. Also watch for user added/removed broadcasts to clean up
policies and apply global restrictions.

Bug: 7121279
Change-Id: Ia7326bd0ebe0586fa4ec6d3a62f6313dc8814007
etworkPolicyManagerServiceTest.java
b631084613e12e1c6a0ae2ad9446e1284b650ccb 24-Aug-2012 Geremy Condra <gcondra@google.com> DO NOT MERGE Add components for the Android Config Updater to system server.

This adds the necessary bits to verify and install configuration
updates using system server. It also includes the cert pinning
updater as the first user.

Change-Id: I42307f58074157b33b6e01216aab10022340d449
pdatable/CertPinInstallReceiverTest.java
4120375d46091df8527bb701882e056fbb0e6b06 31-Aug-2012 Dianne Hackborn <hackbod@google.com> Remove Binder.getOrigCallingUid().

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

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

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

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

That's for another change, however.

Change-Id: I468e14dce8def0e13e0870571e7c31ed32b6310c
etworkPolicyManagerServiceTest.java
2a00329c6d55c6cd9166e01963d7410e95d80d21 15-Aug-2012 Amith Yamasani <yamasani@google.com> UserHandle to UserSerialNo mapping

Use AtomicFile for usermanager files.

Added a MANAGE_USERS permission that apps (signature permission) can use
to create/query/modify/remove users.

Change-Id: I5cf232232d0539e7508df8ec9b216e29c2351cd9
m/UserManagerTest.java
f02b60aa4f367516f40cf3d60fffae0c6fe3e1b8 16-Aug-2012 Dianne Hackborn <hackbod@google.com> Rename UserId to UserHandle.

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

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
etworkPolicyManagerServiceTest.java
258848d2ae04f447ff1c18023fa76b139fcc0862 11-Aug-2012 Amith Yamasani <yamasani@google.com> User Manager service to manage users and query user details

Moved a bunch of methods from PackageManager to UserManager.

Fix launching of activities from recents to correct user.

Guest creation APIs

Change-Id: I0733405e6eb2829675665e225c759d6baa2b708f
etworkPolicyManagerServiceTest.java
m/PackageManagerSettingsTests.java
m/UserManagerTest.java
fb878b66b9456f8fee2bcb1076263852d207949d 27-Jul-2012 Jeff Sharkey <jsharkey@android.com> Isolate NetworkStateTracker creation, test.

Change ConnectivityService to use a factory when creating
NetworkStateTrackers, which gives us a good place to inject mocks
for testing. Add initial tests to verify that network routes are
added and removed as networks changed.

Change-Id: I11cbc61a84c2ed4afa2670036295b1494eab26e1
onnectivityServiceTest.java
b8151ecd6ef4faa5c16d0a4c3abb45ec84d1f97a 19-Apr-2012 Amith Yamasani <yamasani@google.com> Add an icon to the user information.

Store the icon in the user folder under /data/system,
similar to how the wallpaper is stored.

Change-Id: Id8ccb55b9e2ba7b4c557505a7f69f04eca1518cf
etworkPolicyManagerServiceTest.java
70c70530bd6793869736ec894498e4ebf5dc9b20 16-May-2012 Jeff Sharkey <jsharkey@android.com> Transition from DEV network stats to XT.

When XT stats are available, transition to prefer them over DEV,
since they aren't subject to hardware driver bugs. Only switches at
the first atomic XT bucket, and adds a Settings.Secure flag to force
back to DEV if needed. Includes tests to cover transition.

Fix tests where device overlay would change which network types
reflected data usage. Test both history and summary APIs. Fixed
collection timestamps to reflect full buckets.

Bug: 6504744
Change-Id: Idd7f3b2fdb064c36547c85c51c214fd938c59b7e
etworkStatsServiceTest.java
et/NetworkStatsCollectionTest.java
3d33c268cc7f08ec3d2ec1aa535fa86dec458b2e 07-May-2012 Geremy Condra <gcondra@google.com> Adds support for the CertBlacklister.

The CertBlacklister is a mechanism for allowing is to use gservices
to blacklist certs by serial number or public key.

Change-Id: Ie4b0c966a8a43c9823fb550c0b1691204f133ae7
ertBlacklisterTest.java
0cf6de0c930c9082b7bffdb9824e4a7c7832b6df 05-May-2012 Jeff Sharkey <jsharkey@android.com> Fix network stats and policy tests.

Bug: 6299195
Change-Id: I1941b5f7329940cc7469bd3fda17c3dc3a656250
etworkPolicyManagerServiceTest.java
et/NetworkStatsCollectionTest.java
ac3fcb1590e1da21324c13ce237ec48f2bf488bf 03-May-2012 Jeff Sharkey <jsharkey@android.com> Reduce persist threshold for lower warning/limit.

Default is 2MB persist threshold, but even that can be substantial
for devices on 100MB/month plans. This change gradually reduces the
persist threshold up to 8x lower (256kb outstanding) based on lowest
active policy.

Bug: 5382676
Change-Id: Ief4e8cdb169bfb151a3d1b45722a8eaa01926508
etworkStatsServiceTest.java
e8914c36276710de50b347c1e6aecfa45d6a56cd 02-May-2012 Jeff Sharkey <jsharkey@android.com> Begin collecting xtables iface counters.

Add method to parse new iface_stat_fmt proc stats, or return null
when kernel support is unavailable. Add test and remove older, unused
parsing code. Create new "xt" recorder to persist the new xtables
counters when available.

Add SSID support to NetworkIdentity to fix policy tests.

Bug: 6422414
Change-Id: I77f70e9acb79a559ab626f3af5c4f3599801ed43
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
hrottleServiceTest.java
bfdd680ab44da173a4a39fcd6feccdebb9d1f855 09-Apr-2012 Jeff Sharkey <jsharkey@android.com> Migrate to @Override to remove warnings.

Bug: 6303344
Change-Id: I0d33b2ed448467379d576ccd71fb5ae20c878852
etworkPolicyManagerServiceTest.java
b52e3e55098c4a6e3dbfe19885895411cfb38911 06-Apr-2012 Jeff Sharkey <jsharkey@android.com> INetworkStatsSession with lifecycle for caching.

Users outside system_server now explicitly communicate their
lifecycle, which keeps a strong-reference chain to any fully loaded
NetworkStatsCollection histories.

Bug: 6236498
Change-Id: I8e22739b6e89a626b676967a736d7117fd000778
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
8fc27e8b87bd1def854a03d84009143b315d4176 05-Apr-2012 Jeff Sharkey <jsharkey@android.com> Support metered Wi-Fi NetworkPolicy.

Add networkId field to NetworkIdentity to identify Wi-Fi networks by
SSID. Add support for policies without usage cycles.

Only apply mobile policies when SIM state is ready, which is cleaner
than just checking for airplane mode. Also avoids creating no-op
default policies when subscriberId is null.

Bug: 3001465, 3291052
Change-Id: I1f8aaa49a5db306df022c402ea7f3f5d4bc0cfc7
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
et/NetworkStatsCollectionTest.java
135936072b24b090fb63940aea41b408d855a4f3 23-Mar-2012 Amith Yamasani <yamasani@google.com> User management and switching

Broadcast intents that get sent out when users are added/removed/switched.

More work on generating user-specific information in package manager queries.
APIs to update user name and query a user by id.
Removed Package.mSetStopped and mSetEnabled, since they're not user specific.

User removal:
- Cleanup ActivityManager, PackageManager, WallpaperManager, AppWidgetService
and AccountManager.
- Shutdown processes belonging to the user.

Don't show vibrate option in long-press power if there's no vibrator.

Lock the screen when switching users, to force unlocking.

Change-Id: Ib23a721cb75285eef5fd6ba8c7272462764038fa
m/UserManagerTest.java
6143f31537991d2cd0f27e4d8f48f109fb10bc52 22-Mar-2012 Jeff Sharkey <jsharkey@android.com> Merge "NetworkPolicy multi-user tests."
cae04a29da1334aa160ac44f7430411c23cebd1b 22-Mar-2012 Jeff Sharkey <jsharkey@android.com> NetworkPolicy multi-user tests.

Bug: 6214004
Change-Id: If13023a689dadfefe1475e0ef2f192922f2e7753
etworkPolicyManagerServiceTest.java
ad812a23df775062f0185076557e7f3fdfa57943 22-Mar-2012 Amith Yamasani <yamasani@google.com> Merge "Package restrictions per user"
4b63d69759ecbb6837b3ee227f336905c9d9bae5 22-Mar-2012 Jeff Sharkey <jsharkey@android.com> Fix test breakage.

Change-Id: I2c5fc8c3bf7795ccdd474caa3f858e9a56f026ed
etworkPolicyManagerServiceTest.java
483f3b06ea84440a082e21b68ec2c2e54046f5a6 14-Mar-2012 Amith Yamasani <yamasani@google.com> Package restrictions per user

Packages can be enabled/disabled per user.
This requires maintaining stopped/launched states and
enabled / disabled components and packages per user.

Refactored pm.Settings and PackageSettingsBase to keep
track of states per user.

Migrated the stopped-packages.xml to users/<u>/package-restrictions.xml

Changed intent resolution to handle individual user restrictions.
Bunch of IPackageManager calls now have a userId argument.
Make AppWidgetService handle removals of packages.

Added some tests for pm.Settings and PackageManager.

Change-Id: Ia83b529e1df88dbcb3bd55ebfc952a6e9b20e861
m/PackageManagerSettingsTests.java
9bf3150cfae03421c9dd237b46657714859d871c 10-Mar-2012 Jeff Sharkey <jsharkey@android.com> Save timezone when setting data cycle reset date.

Instead of cycle reset at midnight UTC, use midnight of timezone
active when user last set cycle reset date. Tests to verify, and
also to test leap year behavior.

Bug: 5938567
Change-Id: Ie06f7f0fa242d23110f9586a3f4f7037af87b31b
etworkPolicyManagerServiceTest.java
241dde2306202e7655fdf41d5381f2874e47e108 03-Feb-2012 Jeff Sharkey <jsharkey@android.com> Unify shorthand for byte-based units.

Change-Id: If990859dee3f0973e1d4c48f05312c84071b3328
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
0e2e5f8b564bebd5798c9fa387fbff96429ab5d2 03-Feb-2012 Jeff Sharkey <jsharkey@android.com> Support snoozing of data warning notification.

Introduce second snooze timestamp to support dismissal of data usage
warning notification. Also explicitly set notification "when" to
avoid fighting with other notifications, such as ongoing downloads.

Bug: 5443756, 5262414
Change-Id: I03342c25b0410b1b2db84de9a40884f04cb1d8ae
etworkPolicyManagerServiceTest.java
63abc37356728c0575d6a62a203102ae6d97953b 12-Jan-2012 Jeff Sharkey <jsharkey@android.com> Move network stats to FileRotator pattern.

Split existing network stats into two separate classes: a recorder
which generates historical data based on periodic counter snapshots,
and a collection of historical data with persistance logic.

Recorder keeps a pending history in memory until outstanding data
crosses a specific threshold. Persisting is handled through a given
FileRotator. This pattern significantly reduces disk churn and
memory overhead. Separate UID data from UID tag data, enabling a
shorter rotation cycle. Migrate existing stats into new structure.

Remove "xt" stats until iptables hooks are ready. Avoid consuming
Entry values when recording into NetworkStatsHistory. Assign
operation counts to default route interface.

Introduce "Rewriter" interface in FileRotator with methods to enable
rewriteAll(). Introduce IndentingPrintWriter to handle indenting in
dump() methods.

Bug: 5386531
Change-Id: Ibe086230a17999a197206ca62d45f266225fdff1
etworkStatsServiceTest.java
et/NetworkStatsCollectionTest.java
f60d0afd1ef08a24121d015bb016df05265b6d07 01-Dec-2011 Jeff Sharkey <jsharkey@android.com> Restrict app data on metered networks.

This separates the definition of "metered network" and "network with
limit." For now, all mobile networks are considered metered.

Bug: 5571454
Change-Id: I394cd385bd33add75e53bfc9cf2fefd06a00208a
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
f9165b7e43885a3bf8c2b14788d0600642493d58 10-Dec-2011 Makoto Onuki <omakoto@google.com> MCC detection fixes for CountryDetector

- Don't get and cache phone tpe at the initialization time. At this point
TelephonyManager is probably not ready yet.

- Refresh MCC whenever we get the service state changed callback, even when
the state hasn't actually changed, in order to make sure we get refresh
country properly when MCC changes.

- Also remove the initialization of mPhoneStateListener, which prevented us from
registering phone state listener properly.

- Also fix tests which were already failing.

Bug 5670680

Change-Id: Id45abeba1b1e843053ac2c946861b439ca568de4
ocation/LocationBasedCountryDetectorTest.java
31c6e4817f6c967fc4f61c4f1d9f25743958f7de 19-Nov-2011 Jeff Sharkey <jsharkey@android.com> Move NativeDaemonConnector to varargs.

Perform uniform argument escaping inside NativeDaemonConnector, using
varargs to separate boundaries. Also move to parsed NativeDaemonEvent
instances instead of raw Strings.

Bug: 5472606
Change-Id: I1270733e2b2eeb2f6b810240df82ab24d38ebf40
ativeDaemonConnectorTest.java
8549aeea0af63810bd5a661a23079d6554e4717b 18-Nov-2011 Nick Kralevich <nnk@google.com> Merge "Rename EntropyService to EntropyMixer"
6967cbc959b079fa7e4411360e40e2a0ed65da29 17-Nov-2011 Nick Kralevich <nnk@google.com> Rename EntropyService to EntropyMixer

EntropyService implies that this program provides entropy to other
programs, and is misleading. The EntropyMixer class is designed purely
to stir the existing entropy pool with some possibily random-ish data,
and carryover entropy across device reboots.

Change-Id: I086cd339a3b652d32371521e61e1b1f555ce2280
ntropyMixerTest.java
ntropyServiceTest.java
c506ff615080082515b1f634ad49b19fd2111669 17-Nov-2011 Jeff Sharkey <jsharkey@android.com> Only write network stats when already loaded.

Bug: 5584564
Change-Id: Ife2a68804bf3691e9bccdc167807204bce8a85b2
etworkPolicyManagerServiceTest.java
7ee8658453fe4efe04781bea9a14368e1d5ff41f 15-Nov-2011 Jeff Sharkey <jsharkey@android.com> Conservatively trim data usage stats.

Instead of trusting NTP time alone, use the most-conservative of
system clock and NTP.

Bug: 5584564
Change-Id: I5dd87fc009959b1cf0a7d660e385a0b1a8be238b
etworkPolicyManagerServiceTest.java
163e6443f27884a9bfcb9a48ef606dc635852c23 01-Nov-2011 Jeff Sharkey <jsharkey@android.com> Correct proc file reader, optimizations.

Moved away from BufferedReader, which only reads the first 8KB of
some proc files because it aggresively fills its buffer. Optimized
proc parsing, now double the speed. Tests to cover.

Log when NetworkStats counters roll backwards when subtracting, and
optimizations around findIndex(). When system removes UID, also
remove from last stats snapshot to avoid xt counters from rolling
backwards.

Bug: 5472949, 5458380
Change-Id: I07c08fe5233156fac2b84450f6291868bf9bfaf2
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
1059c3c30ad96a15695c1a92ae8896e078a6309f 05-Oct-2011 Jeff Sharkey <jsharkey@android.com> Move battery stats to xt_qtaguid for data stats.

Replace TrafficStats calls by reading values from xt_qtaguid kernel
module. To keep BatteryStatsImpl changes lightweight, cache recently
parsed stats. Tracks mobile ifaces from ConnectivityService.

Refactor xt_qtaguid parsing into factory outside of NMS. Add stats
grouping based on UID, and total based on limiting filters like iface
prefix and UID.

Bug: 4902271
Change-Id: I533f116c434b77f93355bf95b839e7478528505b
etworkManagementServiceTest.java
ae2c1810839430c84e4a1172580d9c4b18f568ca 04-Oct-2011 Jeff Sharkey <jsharkey@android.com> Read iface stats from single proc file.

When available, use single "iface_stat_all" file instead of reading
values from dozens of files scattered across proc. Tests to verify.

Bug: 5397840
Change-Id: I0247be518436c1f79b32c4b72216739f49a9e8cc
etworkManagementServiceTest.java
905b5891d2aa802f447ac2ce5d77b6c5ba06277a 01-Oct-2011 Jeff Sharkey <jsharkey@android.com> Track xtables summary, move tether stats, time.

Begin tracking xtables summary of data usage to compare with values
reported from /proc/net/dev. Roll tethering directly into UID stats
to trigger UID stats persisting when crossing threshold.

Include xtables summary and authoritative time in samples.

Bug: 5373561, 5397882, 5381980
Change-Id: Ib7945522caadfbe0864fdf391582dc820f4f371e
etworkStatsServiceTest.java
8a663c89a3b5bda4e749a58d0434b130260eabb2 26-Sep-2011 Kenny Root <kroot@google.com> Merge "Allow non-required package verifiers"
05ca4c90644921df9193d92b2abdc81ef77e4a62 15-Sep-2011 Kenny Root <kroot@google.com> Allow non-required package verifiers

* Verifiers can be specified in the AndroidManifest.xml

* Those verifiers can respond to the new Intent action

* PackageManager API for those verifiers: verifyPendingInstall

Change-Id: I4892bce2e6984871e6e93c60a1ca0dae145f5df5
m/PackageVerificationStateTest.java
367d15ab1a33b6159447fa8542d4fa8ff148371c 22-Sep-2011 Jeff Sharkey <jsharkey@android.com> Watch network subtype, tethering teardown, empty.

Watch for changes to telephony network subtype, and update iface
mapping to persist stats under correct type. Update network stats
before removing tethering NAT rules.

Skip recording that would create empty historical buckets. Query UID
stats before iface stats to always skew positive when counters are
actively rolling forward.

Bug: 5360042, 5359860, 5335674, 5334448
Change-Id: I8aa37b568e8ffb70647218aa1aff5195d3e44d5a
etworkStatsServiceTest.java
34c73acf88c8190b8cd51d8b8f2b9c22aa7f7941 18-Sep-2011 Jeff Sharkey <jsharkey@android.com> Sample atomic network stats buckets, full poll.

When sampling network stats, always use atomic buckets instead of
interpolating. Always poll iface and UID together so we distribute
into buckets equally. Move stale bucket trimming to just before
writing stats.

Bug: 5321340
Change-Id: I78a2226778a79c875f3668336e39ea24a7b4d5c4
etworkStatsServiceTest.java
98a4f7e7e12effb78b3d1035e5a670ccbbf5bca1 03-Sep-2011 JP Abgrall <jpa@google.com> NetworkManagement SocketTagger: Migrate QTagUid support to JNI.

* Instead of javaland trying to write commands to
/proc/net/xt_qtaguid/ctrl
use the libcutils/qtaguid.c support via JNI.
* Get rid of tagToKernel() handled by qtaguid library.

Requires libcutils changes from c/132538/

Change-Id: I9de5b3fa4a596c56835024c6d376769a0eea7db1
etworkManagementServiceTest.java
991d1b1b3f303ad247a959881b1d5b57766f678b 15-Sep-2011 Jeff Sharkey <jsharkey@android.com> Network stats flag to force complete poll.

Devices currently delay collecting UID stats during common operations
like global alerts to reduce parsing load. Here we introduce a flag
to always collect UID and iface stats together to aid debugging.

Bug: 5321340
Change-Id: Ia8e1daf1a6f9d5f5cf1f64a04b6b6766ee965ab6
etworkStatsServiceTest.java
b3d5957604f8fcaafe72bd76052bc76b682bf443 08-Sep-2011 Jeff Sharkey <jsharkey@android.com> Poll UID stats during iface changes, enforce idx.

When ifaces change, poll UID stats without persisting, since they
depend on knowing active iface to store correctly. Log dropped UID
stats when iface is unknown. Switch to using flags when calling
performPoll().

Enforce that "idx" values are consistent from xt_qtaguid. Transition
to using Log.wtf() for important checks, mostly around file I/O,
kernel stats parsing, and kernel module control. Increase stats
persist threshold to 2MB to reduce churn.

Bug: 5269476, 5270106
Change-Id: I721215bfb65127f95775c71cf135e907cd567e92
etworkStatsServiceTest.java
0fea823673e9cab24bd16a1c80a9bd689fc7a6f9 01-Sep-2011 Jeff Sharkey <jsharkey@android.com> Selectively add stats based on iface active state.

Only combine /proc/net/dev and xt_qtaguid stats when iface is marked
as active. When inactive, only return xt_qtaguid stats. When iface
is unknown to xt_qtaguid, always pass through /proc/net/dev stats.

Bug: 5242730
Change-Id: I469fc6abe45309f794afebca814cbb39e4f13af5
etworkManagementServiceTest.java
961e30458319cfd50e1892ba7dd14a1d0ebe4cc7 30-Aug-2011 Jeff Sharkey <jsharkey@android.com> Introduce immediate CONNECTIVITY_ACTION variant.

New broadcast that is dispatched immediately after connectivity
changes have been handled by ConnectivityService, bypassing any
applicable CONNECTIVITY_CHANGE_DELAY.

Also protect CONNECTIVITY_CHANGE broadcasts, since they should only
be sent by system.

Bug: 5198167
Change-Id: I75f1fb44b21da1879f0ab960bcaa481126d70fde
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
47eb102b40cd1324d89816a7fb0fecd14fd7a408 26-Aug-2011 Jeff Sharkey <jsharkey@android.com> Always splice historical data stats, debug info.

When reading network counters, always splice in xt_qtaguid values
to avoid counting backwards. Test to verify.

Remove verbose logging around global alerts, and add dumpsys debug
info for NMS and MDST. Also fix subtle bug around stats persisting
and dumping.

Bug: 5212893, 5211028
Change-Id: I783e5286637a67ee2dd2b09878198711a926d0cb
etworkManagementServiceTest.java
8e9992ae5053a3ac52d28a5a892aed0a0798c7ab 24-Aug-2011 Jeff Sharkey <jsharkey@android.com> Register for kernel global data usage alerts.

Instead of polling every 15 minutes, register for alerts that trigger
when system-wide traffic passes a threshold. Still mixed with polling
to persist UID stats, but relaxed to 30 minutes. Currently watches
for every 512kB.

Make persistence decision separately for network versus UID, and use
total delta bytes when making decision. Use light bootstrap during
systemReady() instead of heavy poll, which had been force-loading all
UID data unnecessarily.

Bug: 5023631
Change-Id: I04b723d6c4bf872fb1028071122dba66a8e1b576
etworkStatsServiceTest.java
8e28b7d78232f6cf08739ca0d129cc7f9e650801 19-Aug-2011 Jeff Sharkey <jsharkey@android.com> Proactively disable data when over policy limit.

Add policy controls to NetworkStateTracker which are combined with
other user preference and internal flags to decide if data connection
should be established. Better locking around enabled flags.

When data network would be over limit, proactively disable data on
that network. Enable when policy is snoozed or when cycle resets.

Track and dismiss notifications from now-stale policies.

Bug: 4587023, 5178147
Change-Id: Ibfcc9f73cda7c369209af701b46eddd3d1943f2d
etworkPolicyManagerServiceTest.java
b5d55e302d2253e4bfb233ea705caf258cdc4cb9 11-Aug-2011 Jeff Sharkey <jsharkey@android.com> Foreground/background network stats using sets.

Teach NetworkStats about "counter sets" coming from kernel, and use
them to track usage in foreground/background. Add AID_NET_BW_ACCT to
system_server so it can control counter sets.

Move to composite key of NetworkIdentitySet, UID, set, and tag when
recording historical usage. Persisting still clusters by identity,
since that is heaviest object.

Request async stats poll during systemReady() to bootstrap later
delta calculations. Reset kernel counters when UID removed. Update
various tests.

Bug: 5105592, 5146067
Change-Id: Idabec9e3ffcaf212879821515602ecde0a03de8c
roadcastInterceptingContext.java
etworkManagementServiceTest.java
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
hrottleServiceTest.java
af82ea2abf53b6825fbbce23434419527d8e8b5c 05-Aug-2011 Jeff Sharkey <jsharkey@android.com> Data cycle ends on last second of month.

When data cycle resets on a day invalid in given month, snap the
cycle to last second of month. Previous behavior was to bump fully
into next month, but that causes cycle loops.

Includes tests to verify.

Bug: 4623124
Change-Id: I2f233091f6f1df33a2814284519cbc04532874e9
etworkPolicyManagerServiceTest.java
63d27a9233fed934340231f438493746084a681d 04-Aug-2011 Jeff Sharkey <jsharkey@android.com> Network stats with varint, omit parcel fields.

Persist NetworkStatsHistory using variable-length encoding; since
most buckets have small numbers, we can encode them tighter. Initial
test showed 44% space savings. Also persist packet and operation
counters.

Let NetworkStatsHistory consumers request which fields they actually
need to reduce parcel overhead.

Tests for verify varint and history field requests, also verify end-
to-end by persisting history into byte[] and restoring. Expose
bandwidth control enabled state. Extend random generation to create
packet and operation counts. Moved operation counts to long.

Fix bug that miscalculated bytes since last persist, which would
cause partial stats loss when battery pulled.

Bug: 4581977, 5023706, 5023635, 5096903
Change-Id: If61e89f681ffa11fe5711471fd9f7c238d3d37b0
etworkStatsServiceTest.java
a63ba59260cd1bb3f5c16e395ace45a61f1d4461 20-Jul-2011 Jeff Sharkey <jsharkey@android.com> Add operation counts to network statistics.

Provide API to increment "operation counts" for a UID and tag, used
to eventually derive bytes/operation stats. Internally is stored at
network layer, but should belong at data layer. Switch profiling
to use data layer stats, which are emulated by summarizing network
layer details.

Read packet counts from new /proc/ columns and collect them into
NetworkStatsHistory. Prevent double-counting by ignoring values from
first snapshot. Watch for duplicate /proc/ entries. Update tests
to verify packet and operation counters.

Bug: 5052136, 5097392
Change-Id: I1832f65a2b8a9188f8088f253474a667c21a2f09
etworkManagementServiceTest.java
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
hrottleServiceTest.java
41ff7ec82422a5b6d00892afdb3232bc0e53d851 26-Jul-2011 Jeff Sharkey <jsharkey@android.com> Revise data limit notifs, watch kernel alerts.

Teach NetworkPolicy limits to "snooze" when requested by user, and
notify with both dialog and notification. Register for network alerts
through NMS to trigger updates immediately instead of waiting for
next stats update.

Enforce that all NetworkPolicy are unique on a template basis, and
move SCREEN_ON/OFF broadcasts to background thread. Launch SystemUI
and Settings directly instead of using actions, and include full
NetworkTemplate in extras.

Tests to verify notification and snooze behavior.

Bug: 5057979, 5023579, 4723336, 5045721
Change-Id: I03724beff94a7c0547cb5220431ba8d4cd44d077
etworkPolicyManagerServiceTest.java
00aabf7d187bc05408199bd687a538b2e68bdc17 21-Jul-2011 Svetoslav Ganov <svetoslavganov@google.com> Touch exploration state set to clients asynchronously and depended on talking service being enabled.

1. Upon registration of an accessibility client the latter received only
the accessiiblity state and waiting for the touch exploration state
to be sent by the system in async manner. This led the very first
check of touch exploration state is checked a wrong value to be reported.
Now a state of the accessibility layer is returned to the client
upon registration.

2. Removing the dependency on talking accessibility service to be enabled
for getting into touch exploration mode. What if the user wants to use
an accessibility service that shows a dialog with the text of the touched
view?

bug:5051546

Change-Id: Ib377babb3f560929ee73bd3d8b0d277341ba23f7
ccessibilityManagerServiceTest.java
ccessibilityManagerTest.java
35bfedeaba724aeadc6f6c890269cb6bf7ef42f5 15-Jul-2011 Svetoslav Ganov <svetoslavganov@google.com> Touch exploration separate setting and API to poll the latter state.

1. Seperated touch exploration to be a seperate setting rather being
magically enabled by the system of accessiiblity is on the there
is at leas one accessibility service that speaks enabled. Now
there is a setting for requesting touch exploration but still the
system will enabled it only if that makes sense i.e. accessibility
is on and one accessibility service that speaks is enabled.

2. Added public API for checking of touch exploration is enabled.

3. Added description attribute in accessibility service declaration
which will be shown to the user before enabling the service.

4. Added API for quick cloning of AccessibilityNodeInfo.

5. Added clone functionality to SparseArray, SparseIntArray, and
SparseBooleanArray.

bug:5034010
bug:5033928

Change-Id: Ia442edbe55c20309244061cd9d24e0545c01b54f
ccessibilityManagerServiceTest.java
4e814c348ce205fcc1a273427f95ef1d100ed60c 15-Jul-2011 Jeff Sharkey <jsharkey@android.com> Hide NetworkTemplate details, buffered stats I/O.

Move template matching to builder methods instead of exposing the
internal constants. Also rule to match Ethernet usage. Buffer
reading and writing of network stats, making operations 5x faster.

Change-Id: Iedb2d0ab3b26a976811c050f84a164e909eb74b6
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
434962e44ea93b1c4d216c55f636a435bf54aa54 13-Jul-2011 Jeff Sharkey <jsharkey@android.com> Include full network history around current time.

When requesting historical values with time ranges, always include
full values for buckets that span current time. (It doesn't make
sense to interpolate partial data.) Move getTotalData() to return
full Entry objects to prepare for packet counts.

Bug: 4691901
Change-Id: I717bd721be9f1d4a47c4121e46e07a56cb15bbf1
etworkStatsServiceTest.java
d37948f6ed1667d077e0e3a38808f42f981ddcc2 12-Jul-2011 Jeff Sharkey <jsharkey@android.com> Hide NetworkStatsHistory internals.

Instead of exposing internal storage details, offer getValues()
accessor which populates values into a recycled structure.

Change-Id: I5228d7099a8f61b2018a435a813435a67dae49b4
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
hrottleServiceTest.java
fd8be3e5e7420f3cca591daeec8a44487f5f65aa 11-Jul-2011 Jeff Sharkey <jsharkey@android.com> Return stats from inactive ifaces, packet counts.

When an iface goes inactive, xt_qtaguid maintains historical counters
instead of discarding. Now reading and returning those values in
NetworkManagementService summary calls. Tests to verify stats are
returned.

Modify NetworkStats to include rxPackets and txPackets values, and
move to Entry to eventually hide internal storage details.

Bug: 4984539
Change-Id: I1ba0bb5580c62e946d9dff2cc2a6f64aff403efc
etworkManagementServiceTest.java
350083e36b9db6062e165954403ef921ff3dfdad 29-Jun-2011 Jeff Sharkey <jsharkey@android.com> Migrate bandwidth control to NMS, omit history.

Both stats and policy make NMS calls that depend on bandwidth control
being enabled, so move enable/disable into NMS and drop calls when
disabled. This avoids throwing heavy ISE exceptions when disabled.

Only include recent data when writing NetworkStatsHistory as part of
dumpsys call. Introduce manual poll event for Settings UI.

Bug: 4982115, 4770435, 4515856
Change-Id: I257820b057af2f0f99c736fb4f61e55b9fdc3e66
etworkStatsServiceTest.java
b3f19ca36c8c1301893c621d8f2150e06210722c 30-Jun-2011 Jeff Sharkey <jsharkey@android.com> Enforce background data flag, rules through netd.

Connect up netd penalty box through NMS, and enforce the existing
background data flag by putting all UIDs in penalty box. Allow
platform applications to have policy applied. Only dispatch unique
rules to netd, avoiding any repeats.

Bug: 4598463, 4965677
Change-Id: Ibf9beff998ba7a1ea92f5e2f7eeba7b483d4b918
etworkPolicyManagerServiceTest.java
afb60c36b7879c4ed195fb19cc4334175be28c92 29-Jun-2011 Jeff Sharkey <jsharkey@android.com> Merge "Push interface quota rules from NetworkPolicyManager to kernel."
50fd36d7c38c40b087c8f3e3172478abe0c051d9 16-Jun-2011 Ashish Sharma <ashishsharma@google.com> Push interface quota rules from NetworkPolicyManager to kernel.

Change-Id: Id2b758f561820b44839f69bf5fbd676cae771fe3
etworkPolicyManagerServiceTest.java
8568db534118fc14cc28100306d51626464ff319 29-Jun-2011 Jesse Wilson <jessewilson@google.com> Move socket tagging from libcore.

Change-Id: I7515896936c5bbd212c88e2801b831914219a925
etworkManagementServiceTest.java
4414cea13908b8230640f84ef39603d68ff9c377 25-Jun-2011 Jeff Sharkey <jsharkey@android.com> Better network stats parsing, integer tags, async.

Change NMS parsing to handle extended /proc/ stats formats by pairing
values with header keys. Move TrafficStats to integer tags to match
kernel internals, and offer well-known tags for system services.

Async policy event dispatch from NPMS, and update tests to block for
event dispatch. Narrow app policy to exclude apps signed with system
key, which are usually critical.

Bug: 4948913, 4903489, 4585280

Change-Id: Idb357227ccaa617906411f309371cea18d7bc519
etworkManagementServiceTest.java
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
d03fd3f004e3ba8aaa1692ee0e92e8ae171d2a04 20-Jun-2011 Jeff Sharkey <jsharkey@android.com> Persist "tagged" network stats along with UIDs.

Now stores tags other than TAG_NONE (0x0), which are useful for app
debugging. Combine UID and tag together into single long key, and
expose tag data through AIDL when requested. Change NMS to track
TAG_NONE as total UID traffic, matching the kernel definition.

Added TAG_MAX_HISTORY to control how long tag-granularity statistics
are stored; overall UID usage is still kept for UID_MAX_HISTORY. Fix
bug to trim NetworkStatsHistory outside normal polling loops to catch
non-active networks and UIDs.

Test to verify UID and tag packing, and to verify that UID traffic on
two networks are combined to match MOBILE_ALL template.

Change-Id: If0e039416d9e7f63b1a39e04cddfb1133b5a78ee
etworkStatsServiceTest.java
b09540f33a6cabe50edec0ef32d0b1d0b0d96fff 19-Jun-2011 Jeff Sharkey <jsharkey@android.com> Handle removed UIDs in network stats and policy.

When UID_REMOVED, clean up any existing UID network policy so it
doesn't linger for future apps. Also move any NetworkStatsHistory
to special UID_REMOVED tracking bucket.

Tests for new removal code. Also test detailed UID stats, including
network changes to verify template matching logic.

Bug: 4584212
Change-Id: I9faadf6b6f3830eb45d86c7f1980a27cdbcdb11e
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
1b5a2a96f793211bfbd39aa29cc41031dfa23950 19-Jun-2011 Jeff Sharkey <jsharkey@android.com> Read "qtaguid" network stats, refactor templates.

Teach NMS to read qtaguid stats from kernel, but fall back to older
stats when kernel doesn't support. Add "tags" to NetworkStats entries
to support qtaguid. To work around double-reporting bug, subtract
tagged stats from TAG_NONE entry.

Flesh out stronger NetworkTemplate. All NetworkStatsService requests
now require a template, and moved matching logic into template.

Record UID stats keyed on complete NetworkIdentitySet definition,
similar to how interface stats are stored. Since previous UID stats
didn't have iface breakdown, discard during file format upgrade.

Change-Id: I0447b5e7d205d73d28e71c889c568e536e91b8e4
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
hrottleServiceTest.java
fdfef57f498e3021a34342538aef9f1c7ccbae78 17-Jun-2011 Jeff Sharkey <jsharkey@android.com> Notify policy listeners about metered ifaces.

Currently, kernel definition of metered networks is applied at the
interface level. This change maintain list of those metered ifaces
and notifies policy listeners, like ConnectivityService. (This gives
us a consistent picture of when a network would be blocked.)

Bug: 4601393
Change-Id: I277d5ca96ab967a1c1c3f1da8f9587557cd6d74c
etworkPolicyManagerServiceTest.java
2ef2aeb18d9d1ca7e25ad705c4da559f3682805a 15-Jun-2011 Jeff Sharkey <jsharkey@android.com> Fix NetworkPolicy tests after notifications.

Change-Id: I569e9ceba6d89459b347ed151fd9bda2909dc892
etworkPolicyManagerServiceTest.java
af11d4859582a9736aa204562f0beac5a7d60934 13-Jun-2011 Jeff Sharkey <jsharkey@android.com> Fix test-related build breakage.

Change-Id: I48a3dbbdc49d742d6ad19cff34ee8da4b3949bb8
etworkPolicyManagerServiceTest.java
4a97122ebf4d92a3f94402041729d77905e6c0c0 12-Jun-2011 Jeff Sharkey <jsharkey@android.com> Growable NetworkStats object instead of builder.

NetworkStats now grows in place with arraycopy() instead of callers
needing to know record count a priori. Better growth calculation for
both NetworkStats and NetworkStatsHistory; 50% each time. Better
estimates of buckets needed in calling services.

Change-Id: I3adbffa0b7407612cc6349d9135a8b4eb63cd440
etworkPolicyManagerServiceTest.java
etworkStatsServiceTest.java
hrottleServiceTest.java
39ebc2195ed16b9e955dd57f5c95212bb7b934b6 12-Jun-2011 Jeff Sharkey <jsharkey@android.com> Persist UID stats, lazy loading, resize buckets.

Persisting detailed UID stats in separate "netstats_detail.bin" file
to enable different schedules for summary and detail polling. Only
load detailed UID history on demand, since it's not needed during
boot. Add test to verify UID stats are persisted across simulated
reboot.

Move external settings into well-named interface, which is still
backed by Settings.Secure. During periodic poll events, resize any
history to match current bucket duration setting. Test to verify.

Change-Id: I6366f3583a591f8ba859b0e5987daf8cafa4e95a
etworkStatsServiceTest.java
cd2ca4038a027315832c38c68be5076000bc4b53 11-Jun-2011 Jeff Sharkey <jsharkey@android.com> Move data cycle methods to framework object.

Moved so they can be used by both system service and Settings UI, since
they both work with data usage cycles. Still covered by tests.

Change-Id: I01c0c4db6da9457dd867c9167d31a5f9f8e5f5d9
etworkPolicyManagerServiceTest.java
21c9c45e5caf62b935354b74392fb40c4bf18529 07-Jun-2011 Jeff Sharkey <jsharkey@android.com> Interface-level network policy, persist policies.

Define NetworkPolicy as cycle-reset day and warning/limit values, and
set/get through NetworkPolicyManager. Watch ConnectivityManager for
network connection events, and apply quota rules based on matching
interfaces. Policy service matches based on strong identity to support
IMSI-specific policy values.

Calculates remaining quota based on current stats recorded since the
last reset cycle day. Tests to verify edge cases around February.

Persist network and UID policies in XML, and restore on boot.

Change-Id: Id40ba7d6eed6094fbd5e18e6331286c606880d80
etworkPolicyManagerServiceTest.java
3f3913550c10792edb8aecf66cc83c3db5c8b311 06-Jun-2011 Jeff Sharkey <jsharkey@android.com> Persist network stats using AtomicFile.

Implements read/write of network stats using AtomicFile, along with
magic number and versioning. Stores in "/data/system/netstats.bin"
for now. Tests to verify that stats are persisted across a simulated
reboot, and to verify that TEMPLATE_WIFI is working.

Fixed bug where kernel counters rolling backwards would cause negative
stats to be recorded; now we clamp deltas at 0.

Change-Id: I53bce26fc8fd3f4ab1e34ce135d302edfa34db34
etworkStatsServiceTest.java
75279904202357565cf5a1cb11148d01f42b4569 25-May-2011 Jeff Sharkey <jsharkey@android.com> Collect historical network stats.

Periodically records delta network traffic into historical buckets to
support other services, such NetworkPolicyManager and Settings UI.

Introduces NetworkStatsHistory structure which contains sparse, uniform
buckets of data usage defined by timestamps. Service periodically
polls NetworkStats and records changes into buckets. It only persists
to disk when substantial changes have occured. Current parameters
create 4 buckets each day, and persist for 90 days, resulting in about
8kB of data per network.

Only records stats for "well known" network interfaces that have been
claimed by Telephony or Wi-Fi subsystems. Historical stats are also
keyed off identity (such as IMSI) to support SIM swapping.

Change-Id: Ia27d1289556a2bf9545fbc4f3b789425a01be53a
etworkPolicyManagerServiceTest.java
9599cc5f21152860af9d18015b1398b50743da76 22-May-2011 Jeff Sharkey <jsharkey@android.com> Tests for NetworkPolicyManager rule generation.

Verifies that policy changes trigger rule updates that respect current
foregroundActivities status. Also verifies logic that promotes a UID
based on its most-foreground PID. Verifies that policy changes result
in immediate rule changes.

Also verifies that BACKGROUND_DATA_SETTING_CHANGED broadcasts are sent
by policy changes.

Change-Id: I4fd0dad9e1dbccee2c5968244bb1814e6cb2c6e1
roadcastInterceptingContext.java
etworkPolicyManagerServiceTest.java
hrottleServiceTest.java
cc4053e031371456fe54d51bbad1db721db4ae38 23-May-2011 Svetoslav Ganov <svetoslavganov@google.com> Accessibility serviceconfiguration via meta-data

Note: This is a part of two CL change and contains the
system changes without updates to the settings.

1. Added a mechanism for configuring an accessibility service via
XML file specified in a meta-data tag (similar to IMEs).

2. Added property for specifying a settings activity for an
accessibility service.

3. Refactored the APIs in AccessibilityManager to return
lists of AccessiblityServiceInfo instead ServiceInfo
since the former describes an AccessibilityService in
particular (similar to IMEs).

Change-Id: Ie8781bb7e0cdb329e583b6702a612a507367ad7b
ccessibilityManagerServiceTest.java
ccessibilityManagerTest.java
eedcb9525ba5befee2ba6ebb7a9ee3f13395c2a3 17-May-2011 Jeff Sharkey <jsharkey@android.com> APIs to profile network usage for current UID.

Added startDataProfiling() and stopDataProfiling() to TrafficStats,
which can be used by apps to measure network usage delta between two
points in time. Currently takes two NetworkStats snapshots and returns
delta, which will eventually include tag-level granularity. Added
tests for NetworkStats delta subtraction.

Added NMS.getNetworkStatsUidDetail() that returns stats for specific
UID. Always gives stats access for the calling UID, otherwise enforces
that caller has permission. Fix readSingleLongFromFile(), since
/proc/ files don't have well-defined lengths.

Change-Id: Ic5b6414d8effbd66846e275b00d4b8a82c74589d
hrottleServiceTest.java
9a13f36cddaad01350bdb5f000167811a1d753c9 27-Apr-2011 Jeff Sharkey <jsharkey@android.com> Return NetworkStats bundle from NM service.

Introduce NetworkStats which is a collection of network statistics,
which should match the structure communicated by kernel module through
netd. Will introduce tags and fg/bg stats later. Kept entirely in a
flat data structure to optimize parcel speed.

Initial pass at returning NetworkStats from NetworkManagementService,
both summary and details. Will eventually pull data from kernel module
over netd connection.

Change-Id: I92d9f61678ec8c22e2ce26775fb035a0cf32413f
hrottleServiceTest.java
a550bdc84af70babb48091197bfb1b93d3671664 27-Apr-2011 Daisuke Miyakawa <dmiyakawa@google.com> Use passive provider for location based country detection

Bug: 4345419
Change-Id: Ia3e071b97c6971538ea994fdee6029db928201d6
ocation/LocationBasedCountryDetectorTest.java
b7342acebcb7e5dc7da0cda77fbddf50e7dfdd7c 26-Apr-2011 Jeff Sharkey <jsharkey@android.com> Tests for ThrottleService, NTP into TrustedTime.

Wrote initial suite of tests for ThrottleService, checking a variety
of edge cases. Checks going over limits, updating policies, and reset
after cycle elapses.

Moved NTP code in ThrottleService into new TrustedTime interface,
which makes it easier to understand, and allows tests to provide custom
clocks.

Change-Id: I0d62b8b3a169516a2ab2d33025f6fe30dc792be8
hrottleServiceTest.java
0b285499db739ba50f2f839d633e763c70e67f96 15-Apr-2011 Amith Yamasani <yamasani@google.com> Plumbing in PackageManager and installd for multi-user support.

- Create /data/user directory and symlink /data/user/0 -> /data/data for
backward compatibility
- Create data directories for all packages for new user

- Remove data directories when removing a user

- Create data directories for all users when a package is created

- Clear / Remove data for multiple users

- Fixed a bug in verifying the location of a system app

- pm commands for createUser and removeUser (will be disabled later)

- symlink duplicate lib directories to the original lib directory

Change-Id: Id9fdfcf0e62406a8896aa811314dfc08d5f6ed95
m/UserDetailsTest.java
m/UserManagerTest.java
4b2e934928a2eb65927bd39197198c28c49efb94 31-Mar-2011 Amith Yamasani <yamasani@google.com> Package manager changes to store and update user information.

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

Some unit tests for modifying the XML files.

Change-Id: If2ce2420723111bd426f6762def3c2afc19a0ae5
m/UserDetailsTest.java
383742c16d3dcbfcf748a89f0cb88ac8d2b31bb5 09-Dec-2010 Svetoslav Ganov <svetoslavganov@google.com> 3205857 java.lang.ExceptionInInitializerError at java.lang.Class.newInstanceImpl(Native Method)

Change-Id: I72ab33da2f5cc0bbaa89f3b996ff4ac48deadf73
ccessibilityManagerServiceTest.java
a58a8751b4c2ce457f0082a0baaee61312d56195 13-Jul-2010 Bai Tao <michaelbai@google.com> Add new system service CountryDetector

a. The CountryDetector detects the country the user is in
in order of mobile network, location, sim card or locale.
It will be used by contact and contact provider.

b. All added APIs are hidden at this stage.

Change-Id: I4ba278571ffb6ab6ded0996d4f440a18534f8ed4
ountryDetectorServiceTest.java
ocation/ComprehensiveCountryDetectorTest.java
ocation/LocationBasedCountryDetectorTest.java
3300b6f41e18b26a462824effa6be65a4b158346 22-Jul-2010 Dan Egnor <egnor@google.com> am 7da38863: am 3685db7f: am e8605af5: Merge "Avoid leaking file descriptors when returning drop box events." into froyo

Merge commit '7da38863d4382746090bf50413b1774ab04f6bc1'

* commit '7da38863d4382746090bf50413b1774ab04f6bc1':
Avoid leaking file descriptors when returning drop box events.
6e6d60d4c85ce440d9ef5e5f36e708ed0ced65c6 21-Jul-2010 Dan Egnor <egnor@google.com> Avoid leaking file descriptors when returning drop box events.

We can't use Parcel.writeValue() to write the ParcelFileDescriptor, otherwise
it leaks when returning the value to the caller (the flag gets lost). Change
the way DropBoxManager.Entry gets serialized so that it uses a bit of its own
flags value to track whether the data is a byte[] or a ParcelFileDescriptor.

Modify the dropbox unit test to add extensive checking of Entry serialization
and deserialization under various circumstances, and to include a regression
test to ensure that FD leaking doesn't happen.

Bug: 2847738
Change-Id: I4ccd17dd03ffab234340cd359e6f3510fdf81193
ropBoxTest.java
5637745e59e1c0c22ec2e0adb1f48f8f4edcb7be 07-Jun-2010 Svetoslav Ganov <svetoslavganov@google.com> 2744878 com.android.server.AccessibilityManagerServiceTest:testInterrupt is failing

Change-Id: I73d056c7dcf8edddae2ef9cb28ec7d2b3203bb9b
ccessibilityManagerServiceTest.java
ockAccessibilityService.java
0b29a587142b19ed25dd6489cfa037d06145afd1 17-Apr-2010 Svetoslav Ganov <svetoslavganov@google.com> 2604226 Add test cases for the internal accessibility infrastructure.

Change-Id: Iaeb2c11b6c2167632086b50d9c79e6459cc072b8
ccessibilityManagerServiceTest.java
ccessibilityManagerTest.java
ockAccessibilityService.java
3a8b0c18a49c017ecfde8ebf4eb4bb5181ac6fef 25-Mar-2010 Dan Egnor <egnor@google.com> Limit DropBox storage to 1000 files (by default).

Also does trimming asynchronously (not directly in the broadcast receiver).

Bug: 2541253
Change-Id: I7daf8bc618e2dce68a98571f5f7fbce4df1d6a76
ropBoxTest.java
93a68398b661c02d6c417a2a04e64a6750a9a119 20-Mar-2010 Nick Kralevich <nnk@google.com> Unittests for EntropyService. Make EntropyService more testable.

I've been meaning to write these tests for a long time...

Use "runtest frameworks-services" to run these tests.

Change-Id: I3a3cb7eda547f4a790f38be884b4a583426c7326
ntropyServiceTest.java
1a44d5dcabc18cd5ef111f732ccff91683a1a093 13-Jan-2010 Neal Nguyen <tommyn@google.com> Phase 2 of test cleanup: moving test files from AndroidTests closer to their sources.

Most of these are file moves; a couple notable exceptions are the changes due to the move, and fixing up test code:
- database/DatabaseCursorTest.java
- database/DatabaseStatementTest.java
- net/UriTest.java
ropBoxTest.java