Commit Graph

6546 Commits

Author SHA1 Message Date
Lorenzo Colitti
0e9f4ada31 [automerger skipped] Merge "Add support for TAP interfaces in TestNetworkManager." into qt-dev
am: 5c7c6a4b7d -s ours
am skip reason: change_id I88bfd7f37c0ba0228f8288fe92212618ce134e4f with SHA1 93fac2892e is in history

Change-Id: If600c79a42b040f8323800cc2b6a145d5efb2c39
2019-04-11 17:27:40 -07:00
Rubin Xu
131a0722cc Merge "Block incoming non-VPN packets to apps under fully-routed VPN" am: fd20f8da0a
am: 8951473446

Change-Id: I5af81bc80dadd086261ba4b1eb706cc873bb7cfa
2019-04-11 11:45:43 -07:00
Lorenzo Colitti
124a130abe Merge "Add support for TAP interfaces in TestNetworkManager." am: 144e714d79
am: 878d818c63

Change-Id: I29daac925c4b64bda111ba187b1759b6ce8a5f23
2019-04-11 11:32:46 -07:00
Benedict Wong
8cb5bb604b Merge changes I98573a5c,Ic7394f24 am: 0855a3c457
am: 9567abb46b

Change-Id: I279765199a80b0639dde31302778a95c0f9fd705
2019-04-11 10:05:20 -07:00
Rubin Xu
8951473446 Merge "Block incoming non-VPN packets to apps under fully-routed VPN"
am: fd20f8da0a

Change-Id: I321a96599e51b70817b2514455c43972cd1fbca8
2019-04-11 09:56:11 -07:00
Rubin Xu
fd20f8da0a Merge "Block incoming non-VPN packets to apps under fully-routed VPN" 2019-04-11 16:46:16 +00:00
Lorenzo Colitti
28a9894888 Add support for TAP interfaces in TestNetworkManager.
Bug: 72950854
Test: builds, boots
Change-Id: I88bfd7f37c0ba0228f8288fe92212618ce134e4f
Merged-In: I88bfd7f37c0ba0228f8288fe92212618ce134e4f
(cherry picked from commit ba2eb5e0621c4f2a2c86a641998b4ae1953ae4b8)
2019-04-11 12:04:23 +00:00
Lorenzo Colitti
878d818c63 Merge "Add support for TAP interfaces in TestNetworkManager."
am: 144e714d79

Change-Id: I834ba4b939f67ff3e1c84a39844085dccc1d8d8e
2019-04-11 04:59:16 -07:00
Lorenzo Colitti
144e714d79 Merge "Add support for TAP interfaces in TestNetworkManager." 2019-04-11 11:45:40 +00:00
Junyu Lai
5bd1ffb3f2 [automerger skipped] Merge "Fix onBlockedStatusChanged does not work on multiple networks" into qt-dev
am: b4379e15a9 -s ours
am skip reason: change_id Ifd18d1c6ad708c1dbc793f03d8241f572af50317 with SHA1 7509e6e053 is in history

Change-Id: I1a1cac47a948636d6dae934edb3fbf42327f5314
2019-04-11 01:48:50 -07:00
Junyu Lai
b4379e15a9 Merge "Fix onBlockedStatusChanged does not work on multiple networks" into qt-dev 2019-04-11 06:58:48 +00:00
Remi NGUYEN VAN
d728605afe [automerger skipped] Merge "Expose captive portal urls for configuration" into qt-dev
am: c100196133 -s ours
am skip reason: change_id I54050b28bbfb93e0b7e509dbe0e987a0b902b7d9 with SHA1 a6dad121c5 is in history

Change-Id: I15a4acf4355e05833ed15bde3deb0db966f2a75a
2019-04-10 23:31:51 -07:00
Remi NGUYEN VAN
c100196133 Merge "Expose captive portal urls for configuration" into qt-dev 2019-04-11 03:44:08 +00:00
Benedict Wong
4b57b079d6 [automerger skipped] Merge "Fix remove-before-add for IpSecService RefcountedResource" into qt-dev
am: 610eed67b6 -s ours
am skip reason: change_id I6db75853da9f29e1573512e26351623f22770c5d with SHA1 2d9864ab3c is in history

Change-Id: I3e0bd244d8a2ddf86cf4dab99d4a563ea1e2b01e
2019-04-10 11:14:47 -07:00
Benedict Wong
9567abb46b Merge changes I98573a5c,Ic7394f24
am: 0855a3c457

Change-Id: I2ffeb6ef1a19f7b2982c3631fe2c040024fb53cb
2019-04-10 11:00:10 -07:00
Benedict Wong
0855a3c457 Merge changes I98573a5c,Ic7394f24
* changes:
  Enable checks for MANAGE_TEST_NETWORKS in TestNetworkService
  Cleanup of Test Network service
2019-04-10 17:06:17 +00:00
Rubin Xu
4773027064 Block incoming non-VPN packets to apps under fully-routed VPN
When a fully-routed VPN is running, we want to prevent normal apps
under the VPN from receiving packets originating from any local non-VPN
interfaces. This is achieved by using eBPF to create a per-UID input
interface whitelist and populate the whitelist such that all
non-bypassable apps under a VPN can only receive packets from the VPN's
TUN interface (and loopback implicitly)

This is the framework part of the change that build the whitelist.
The whitelist needs to be updated in the following cases:
* When a VPN is connected and disconnected
    This will cover the change to allowBypass bit, since that can't be
    changed without reconnecting.
* When a VPN's NetworkCapabilites is changed (whitelist/blacklist app changes)
* When a new app is installed
* When an existing app is removed
* When a VPN becomes fully-routed or is no longer fully-routed

New user/profile creation will automatically result in a whitelist app change
transition so it doesn't need to be handled specially here.

Due to the limitation of the kernel IPSec interacting with eBPF (sk_buf->ifindex
does not point to the virtual tunnel interface for kernel IPSec), the whitelist
will only apply to app VPNs but not legacy VPN connections, to prevent breaking
connectivity with kernel IPSec entirely.

Test: atest PermissionMonitorTest
Test: atest android.net.RouteInfoTest
Test: atest com.android.server.ConnectivityServiceTest
Test: atest HostsideVpnTests
Bug: 114231106
Change-Id: I143b03d60e46cb1b04732b4a4034f5847b4d1b1a
2019-04-10 17:05:54 +01:00
Remi NGUYEN VAN
747c63e385 Merge "Fix comment on StaticIpConfiguration#getDomains" am: 4aca98b5f5
am: 26174b9b95

Change-Id: I6a2ff0368193aaa988585613d99662a01cf4fa26
2019-04-10 00:07:05 -07:00
Chenbo Feng
93967660a1 Merge "Add smoke test for jni library" am: 98ad72632c
am: 22f45a249d

Change-Id: Iba607c906917017f79f141f4e0599a2330cc0f14
2019-04-10 00:01:28 -07:00
Remi NGUYEN VAN
26174b9b95 Merge "Fix comment on StaticIpConfiguration#getDomains"
am: 4aca98b5f5

Change-Id: Ia664b08eabe344470a5c08e5510f1a8f7132ac73
2019-04-09 23:54:09 -07:00
Chenbo Feng
22f45a249d Merge "Add smoke test for jni library"
am: 98ad72632c

Change-Id: Iedb44739539f63090b067c1a25d4e83c333caddb
2019-04-09 23:50:10 -07:00
Treehugger Robot
4aca98b5f5 Merge "Fix comment on StaticIpConfiguration#getDomains" 2019-04-10 06:30:55 +00:00
Treehugger Robot
98ad72632c Merge "Add smoke test for jni library" 2019-04-10 06:30:26 +00:00
Lorenzo Colitti
93fac2892e Add support for TAP interfaces in TestNetworkManager.
Test: builds, boots
Change-Id: I88bfd7f37c0ba0228f8288fe92212618ce134e4f
2019-04-10 13:29:41 +09:00
Benedict Wong
ff9d0bab2c Enable checks for MANAGE_TEST_NETWORKS in TestNetworkService
This commit re-enables enforcement of the MANAGE_TEST_NETWORK
permission, which is only granted to the shell. CTS tests using this
permission should use UiAutomation.adoptShellPermissionIdentity() to
gain access.

Bug: 72950854
Test: IPsec CTS tests using this passing
Change-Id: I98573a5c68e45abbbaddef01f6ac74a6a18e26f9
2019-04-09 21:23:50 -07:00
Junyu Lai
cc6836e908 Fix onBlockedStatusChanged does not work on multiple networks
There is a logic error in maybeNotifyNetworkBlockedForNewUidRules
that caused function to return if there is no status change in
the first network. This would cause CTS failed in devices which
has volte-enabled SIM inserted.

Bug: 129409153
Fix: 117969394
Test: 1. atest com.android.cts.net.HostsideNetworkCallbackTests \
         --generate-new-metrics 20
      2. atest FrameworksNetTests

Change-Id: I11168fd07a7c29e0605f2e874e9d9f41b5ad88b6
Merged-In: Ifd18d1c6ad708c1dbc793f03d8241f572af50317
(cherry picked from commit 794f01c7266275fa4b22a5ce37fe992535d04463)
2019-04-10 03:23:58 +00:00
Remi NGUYEN VAN
e2fd1e9c6d Expose captive portal urls for configuration
Carriers in Mainland China need to customize certain captive portal
urls. The main issue is that google servers are not accessible in
Mainland China.

Added the following captive portal resources to be targeted for overlay.
- config_captive_portal_http_url
- config_captive_portal_https_url
- config_captive_portal_fallback_urls (string-array)
- config_captive_portal_fallback_probe_specs (string-array)

These values can be customized for e g diffent countries

Bug: 111819230
Test: atest FrameworksNetTests NetworkStackTests
Test: Add a product RRO that targets a specific country code,
insert a SIM card that matches that country code and check the log
what URL is used.

Merged-In: I54050b28bbfb93e0b7e509dbe0e987a0b902b7d9
Merged-In: I1f734c5f864bb2f2bc8ba1a66fe33d3480554f69
(cherry picked from commit 2977a40b1e8db190e5974a638b2619b3d253d38b)

Change-Id: I278f2888851d38edb59157f8623541fbe94549b6
2019-04-10 02:03:27 +00:00
Benedict Wong
8856354a8a Cleanup of Test Network service
This follow-up change performs some cleanup changes without affecting
functionality

Bug: 72950854
Test: Compiles, CTS tests using this pass
Change-Id: Ic7394f24f11d713c9374b438182e29d2a02ea236
2019-04-09 16:34:35 -07:00
Chenbo Feng
ba01e6c570 Add smoke test for jni library
Since the Framework net test require jni library
libnetworkstatsfactorytestjni, but the test fails to load that library
unless *all* the dependencies of that library are explicitly listed in
jni_libs, whenever any of the dependencies changes the framework net
test will start failing and it might not be catched since the change
might not related to frameworks/base. And this smoke test is aimed to
spot those native library changes and it should be stable enough to put
in global presubmit.

Bug: 124764595
Test: FrameworksNetSmokeTests
Change-Id: Id24e7f0558b5643e4ad7393e85f1f0a2bd875615
2019-04-09 14:45:35 -07:00
Benedict Wong
608168402b Fix remove-before-add for IpSecService RefcountedResource
This patch fixes a bug where if a binder dies before the linkToDeath
call, the cleanup will be performed before the entry is added to the
array. While it is safe in that quotas and tracking performs as per
normal, the RefcountedRecord may not be cleaned up.

Rethrowing this exception is safe, since the only paths that would hit
this are all on binder threads coming from applications. Further, it
seems there is only one real way of this getting hit - if the app that
called the creation died during the binder call.

Bug: 126802451
Test: Compiled, CTS tests passing
Change-Id: Ib955acaa5e498c0e977cb5f2e48cffbc9fea8c7c
Merged-In: I6db75853da9f29e1573512e26351623f22770c5d
Merged-In: I416c2e43961ec0e1cc6b2fbcef970fbce858603b
Merged-In: Ib955acaa5e498c0e977cb5f2e48cffbc9fea8c7c
(cherry picked from commit 6c089d90bfa728e9842de0f5947f0c557c62dea0)
2019-04-09 21:37:26 +00:00
Benedict Wong
b64f22c9b4 Merge "Fix remove-before-add for IpSecService RefcountedResource" am: 342d6de289
am: 15b70fe885

Change-Id: I416c2e43961ec0e1cc6b2fbcef970fbce858603b
2019-04-09 10:56:30 -07:00
Benedict Wong
15b70fe885 Merge "Fix remove-before-add for IpSecService RefcountedResource"
am: 342d6de289

Change-Id: Ief286a54a93efd731deeff9fc32815663ab7695d
2019-04-09 10:39:16 -07:00
Benedict Wong
342d6de289 Merge "Fix remove-before-add for IpSecService RefcountedResource" 2019-04-09 17:22:56 +00:00
Chalard Jean
2a310fd768 [automerger skipped] Merge "Address leftover comments on aosp/894233" into qt-dev
am: fa6c7828b5 -s ours
am skip reason: change_id Idf24f42a86bbfcc89e3ea8cf50d1b705d72ac613 with SHA1 ce140af98c is in history

Change-Id: I6e9043be4c28b73856b72f80971e2b66f8b8926b
2019-04-09 06:54:57 -07:00
Junyu Lai
bbc12176d2 Merge "Fix onBlockedStatusChanged does not work on multiple networks" am: eb70ae41c6
am: db161dda22

Change-Id: I4e414fd34b463219e6374de15622918af7d7fa49
2019-04-09 06:50:52 -07:00
TreeHugger Robot
fa6c7828b5 Merge "Address leftover comments on aosp/894233" into qt-dev 2019-04-09 13:39:29 +00:00
Junyu Lai
db161dda22 Merge "Fix onBlockedStatusChanged does not work on multiple networks"
am: eb70ae41c6

Change-Id: Ia8edf1e9d0f49da5be2bac1889cd0001010a869b
2019-04-09 05:43:18 -07:00
Chalard Jean
fd95136ad9 Address leftover comments on aosp/894233
Cherry-pick from commit 415f523f7ce4c7e33fa70ea003f265e5b53faa20,
with small conflict resolution.

Bug: 129510344
Test: m, boots, wifi connects, resolves DNS
Change-Id: Idf24f42a86bbfcc89e3ea8cf50d1b705d72ac613
Merged-In: Idf24f42a86bbfcc89e3ea8cf50d1b705d72ac613
Merged-In: Ia08104f839ef37139a8761e2e625bb10c94c275f
2019-04-09 12:16:52 +00:00
Junyu Lai
eb70ae41c6 Merge "Fix onBlockedStatusChanged does not work on multiple networks" 2019-04-09 12:13:26 +00:00
Lorenzo Colitti
684a1fedc0 [automerger skipped] Merge "Fix ConnectivityServiceTest fail." into qt-dev
am: 0483f072fa -s ours
am skip reason: change_id I7f185e731db91c30a9b0f14aefbdbb067942190e with SHA1 c999faee0e is in history

Change-Id: I6eddfc7bae967c76c63521b7fbcabd78a913bfd4
2019-04-09 03:44:42 -07:00
Lorenzo Colitti
0483f072fa Merge "Fix ConnectivityServiceTest fail." into qt-dev 2019-04-09 10:25:10 +00:00
Lorenzo Colitti
55a77067a8 [automerger skipped] Merge "Fix flaky UdpEncapsulationSocket test" into qt-dev
am: 6e8628f043 -s ours
am skip reason: change_id Idf040a67e53d9b9ec6e6c647ce24f8ada501d355 with SHA1 97a2e106c5 is in history

Change-Id: Ic9b6b8c2ca4aabd3ed18291a94992a2b67286064
2019-04-09 02:31:35 -07:00
TreeHugger Robot
6e8628f043 Merge "Fix flaky UdpEncapsulationSocket test" into qt-dev 2019-04-09 09:15:02 +00:00
Lorenzo Colitti
0eb34c5415 [automerger skipped] Merge "Extend support for requestRouteToHostAddress for backward compatibility" into qt-dev
am: 8d994400b5 -s ours
am skip reason: change_id Ifa60d8f2d60aba4c4e2894dc612c224d45e3992d with SHA1 3b5a296b8f is in history

Change-Id: I7cd14e336c2ab60e92c247e42d9acddf08316edf
2019-04-09 02:13:26 -07:00
paulhu
b375738a52 Fix ConnectivityServiceTest fail.
NetdService#getInstance() will get null object in
WrappedConnectivityService constructor. Then pass this null
INetd object to PermissionMonitor will case NPE in
PermissionMonitor#sendPackagePermissionsToNetd()

Bug: 128024100
Test: atest FrameworksNetTests
Change-Id: Ia1c80f9600a19c4aaf3f3c1b497b355d96c49c8e
Merged-In: I7f185e731db91c30a9b0f14aefbdbb067942190e
Merged-In: Ic77ef73841266da487401ffd657ef63562b6fc1e
(cherry picked from commit 7d215078521ea03bbd692364e882d02ad065ced0)
2019-04-09 08:57:08 +00:00
Android Build Merger (Role)
21273659ca Merge "Merge "Address leftover comments on aosp/894233" am: 3753f67bcd am: c4b0483288" into qt-dev-plus-aosp 2019-04-09 06:53:01 +00:00
Chalard Jean
7559529419 Merge "Address leftover comments on aosp/894233" am: 3753f67bcd
am: c4b0483288

Change-Id: Ia08104f839ef37139a8761e2e625bb10c94c275f
2019-04-08 23:52:35 -07:00
Android Build Merger (Role)
c5d65b570e Merge "Merge "Add common tests for FrameworksBaseTests and CTS" into qt-dev am: 29b6be1471" into qt-dev-plus-aosp 2019-04-09 06:50:19 +00:00
Remi NGUYEN VAN
9e1da6068e Merge "Add common tests for FrameworksBaseTests and CTS" into qt-dev
am: 29b6be1471

Change-Id: If7d54cb1cf7f4f271c16cfbdc7629934800fddfc
2019-04-08 23:49:20 -07:00
Anil Admal
7a9206fcdc Extend support for requestRouteToHostAddress for backward compatibility
The gnss@2.0 HAL and the framework GNSS Location Provider code is
updated in Q to not call the deprecated requestRouteToHost() method.
However, devices upgrading to Q which are still using gnss@1.1 or
earlier HAL must continued to be supported.

Fixes: 121222025
Test: Tested with gnss@1.1 HAL and first API level P.  The
      ConnectivityService log message "This method exists only for
      app backwards compatibility and must not be called by system
      services" is not present for devices with first API level P.

Change-Id: I10199776ea413dc256dbf0771e6cb3eedb334495
Merged-In: Ifa60d8f2d60aba4c4e2894dc612c224d45e3992d
Merged-In: Ifa4ec98d5c942522dfd569664f169fa841d495ed
(cherry picked from commit 2eea7ac272431b6e02a0a281207b981b01daf393)
2019-04-09 06:45:57 +00:00