• 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