1532 Commits

Author SHA1 Message Date
Lorenzo Colitti
3c295b59f5 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
2016-12-08 17:13:35 +09:00
Lorenzo Colitti
b8df76e413 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
2016-12-08 17:13:34 +09:00
Hugo Benichi
5d540d1410 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
2016-12-08 17:13:34 +09:00
Calvin On
1f64f3fd14 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
2016-12-08 17:13:33 +09:00
Hugo Benichi
0668a61d82 DO NOT MERGE: Add fuzzing tests to ApfFilter RA processing
Test: added new unit tests

(cherry picked from commit 8acea76a2b7555b3bd5ca1170cca9d09e979fafc)

Change-Id: I847d7e4895766042043c0bba1c9b9a698a705d87
2016-12-08 17:13:31 +09:00
Erik Kline
3841a48d0a DO NOT MERGE: Support timeouts for requestNetwork() invocations.
(cherry-pick of 06c3ef1367e850746eef0a5462bdce8674d74c30)
(cherry picked from commit 57faba9ec73fbb311d5ca1df3278aee9728589d5)

Bug: 21414325
Change-Id: I1a58823a372154589f972b98c4c428eab0e0523e
2016-12-08 17:13:01 +09:00
TreeHugger Robot
6cd5d2f838 Merge "Adding orientation preserving resizing" 2016-12-08 06:05:28 +00:00
skuhne@google.com
322347ba58 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
2016-12-07 20:01:19 -08:00
Amin Shaikh
5456cdbc27 Merge "Support multiple caches in NetworkScoreService." am: 78f3f0049e am: a7c0b73971
am: b45a4a5d1b

Change-Id: If0080f344e53c4cddf4605879614a664c80b62ee
2016-12-08 02:28:57 +00:00
Amin Shaikh
b45a4a5d1b Merge "Support multiple caches in NetworkScoreService." am: 78f3f0049e
am: a7c0b73971

Change-Id: Idf846f55436c44930f5db2a07b7362412274f46e
2016-12-08 02:24:59 +00:00
Amin Shaikh
972e236e84 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
2016-12-07 15:52:33 -08:00
Wale Ogunwale
805d9ecc47 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
2016-12-07 12:22:08 -08:00
Julia Reynolds
22f02b3e4a Accept adjustments from notification assistant.
Test: runtest systemui-notification & cts in same topic.
Change-Id: Icff1f89eac32b82d583eca24b0a15f67795912a1
2016-12-07 12:51:16 -05:00
Fyodor Kupolov
e35aff17e9 Merge "2-phase initialization of NetworkPolicyManagerService" 2016-12-06 21:57:55 +00:00
TreeHugger Robot
877ab7f9fd Merge "Revert "Revert "WindowList be gone!""" 2016-12-06 19:27:53 +00:00
Wale Ogunwale
6213caa42d Revert "Revert "WindowList be gone!""
This reverts commit ffa5a9de0c127cb77ddec625fea101ddddb7ad32.

Bug: 33098800
Bug: 33098294
Test: Existing tests pass.
Change-Id: I5803a010c5a224dd1cf452a4a7beb3a4c0a043f4
2016-12-06 09:38:50 -08:00
Narayan Kamath
579e2faf38 Merge "PackageParser: Add support for caching parse results on the file system." 2016-12-06 15:24:07 +00:00
Narayan Kamath
988149c925 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
2016-12-06 11:35:18 +00:00
Michal Karpinski
b97196b1de 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
2016-12-06 10:16:37 +00:00
Mahaver Chopra
abf86385f8 Merge "Return error code from isProvisioningAllowed" 2016-12-06 09:45:05 +00:00
TreeHugger Robot
598e9a7f41 Merge "Prevent orphaning of windows when token is removed" 2016-12-06 04:52:35 +00:00
Fyodor Kupolov
311b9fac00 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
2016-12-05 17:02:27 -08:00
Wale Ogunwale
3d0bfd9530 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
2016-12-05 16:50:03 -08:00
TreeHugger Robot
96bc5dece7 Merge "Fixed Mockito expectation." 2016-12-05 23:23:52 +00:00
Christine Franks
5e998e63ce TwilightService: Ignore (0,0) coordinate location updates am: cc2801296d
am: bc0bd475da

Change-Id: I10691fe0ee6b1d788611db17a84a960fa40d3901
2016-12-05 22:47:58 +00:00
Christine Franks
bc0bd475da TwilightService: Ignore (0,0) coordinate location updates
am: cc2801296d

Change-Id: Ic74955ff78956953288de96d261dc1eab8fc6137
2016-12-05 22:42:45 +00:00
Felipe Leme
b8d572eb86 Fixed Mockito expectation.
Bug: 33349775

Test: most tests from NetworkPolicyManagerServiceTest passes (there are still
      3 failures, but they're unrelated).

Change-Id: I291a2d8404ba540d9922e5de62f5224d2d9b9314
2016-12-05 13:44:36 -08:00
Phil Weaver
cf1f77b574 Merge "Support continuing dispatched a11y gestures." 2016-12-05 20:01:18 +00:00
Christine Franks
cc2801296d 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
2016-12-05 11:19:42 -08:00
Mahaver Chopra
849fd6f58e 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
2016-12-05 17:48:42 +00:00
TreeHugger Robot
6b4061f895 Merge "Have forAllWindows return IME windows in order with IME target" 2016-12-03 02:49:12 +00:00
Phil Weaver
2f165944ce 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
2016-12-02 15:52:38 -08:00
Wale Ogunwale
3c1170d849 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
2016-12-02 14:44:52 -08:00
TreeHugger Robot
0730df7369 Merge "Allow some app windows to display above the IME." 2016-12-02 19:55:52 +00:00
Fyodor Kupolov
cf81eac793 Merge "Test permission grants for all privapps" 2016-12-02 19:02:29 +00:00
Michal Karpinski
70444d3ad5 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
2016-12-02 17:21:28 +00:00
Makoto Onuki
5436546589 Merge "ShortcutManager: Floating shortcuts shouldn't have target activities." 2016-12-02 16:34:59 +00:00
Wale Ogunwale
ca9e061256 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
2016-12-02 07:45:59 -08:00
Michal Karpinski
3db0a14ab0 Merge "DO NOT MERGE Rename the DnsEventListenerService to NetdEventListenerService" into nyc-mr2-dev 2016-12-02 09:26:31 +00:00
Fyodor Kupolov
a97c9066a2 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
2016-12-01 16:11:24 -08:00
Makoto Onuki
106ff7a0a1 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
2016-12-01 23:09:52 +00:00
Makoto Onuki
b36c45fe30 Fix issue with apps restored to lower versions. am: fac592f64c
am: affadd52af

Change-Id: I159f53023179cb67b7225969f4c7220ddd0c03dc
2016-12-01 21:02:35 +00:00
Makoto Onuki
affadd52af Fix issue with apps restored to lower versions.
am: fac592f64c

Change-Id: I01601d1638a1ad23dcf2c57df75b81819ee3dce7
2016-12-01 20:57:03 +00:00
Geoffrey Pitsch
aac3cba531 Merge "Listener in createNotificationChannel" 2016-12-01 19:46:09 +00:00
Geoffrey Pitsch
e75a66e87a Listener in createNotificationChannel
Necessary for when this will eventually trigger an Activity.
New unit test file for NotificationServiceManager.

Test: runtest systemui-notification (cts tests in separate CL)
Change-Id: I8f3e8e34ddcebb1acb9ddd84bffc68affb4b6e89
2016-12-01 10:59:47 -05:00
TreeHugger Robot
325fa50d8d Merge "Allow setting managing organization for the device" 2016-11-30 19:25:33 +00:00
Fyodor Kupolov
fd4f73c76c Merge "Support disabled/log/enforce in ro.control_privapp_permissions" 2016-11-30 18:50:11 +00:00
Bartosz Fabianowski
365a3db470 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
2016-11-30 18:28:10 +01:00
Julia Reynolds
c2b7fba6aa Merge "Blocked packages can't create channels." 2016-11-30 15:09:35 +00:00
Julia Reynolds
a275351745 Merge "Allow apps to set vibrations pattern for channels" 2016-11-30 15:08:13 +00:00