Commit Graph

6554 Commits

Author SHA1 Message Date
Luke Huang
b2acaecb20 Merge "API council feedbacks for DnsResolver" am: 65dc1155ff
am: dca57c2e44

Change-Id: Id731f73f25f437df94f936e9a3ec227b797b6031
2019-04-12 05:31:10 -07:00
Benedict Wong
913829e75a [automerger skipped] Merge changes I98573a5c,Ic7394f24 into qt-dev
am: 3b5424047c -s ours
am skip reason: change_id I98573a5c68e45abbbaddef01f6ac74a6a18e26f9 with SHA1 0fed3d2c01 is in history

Change-Id: I80f0924a1a1f83962c6dee7fd937a341075327e4
2019-04-11 18:19:05 -07:00
TreeHugger Robot
3b5424047c Merge changes I98573a5c,Ic7394f24 into qt-dev
* changes:
  Enable checks for MANAGE_TEST_NETWORKS in TestNetworkService
  Cleanup of Test Network service
2019-04-12 00:54:45 +00:00
Luke Huang
dca57c2e44 Merge "API council feedbacks for DnsResolver"
am: 65dc1155ff

Change-Id: I5737cf293264bf9d492e7bd56b62bee4d49002eb
2019-04-11 17:54:41 -07:00
Luke Huang
65dc1155ff Merge "API council feedbacks for DnsResolver" 2019-04-12 00:45:18 +00:00
Lorenzo Colitti
2c005f2cd2 [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 4f370cefa2 is in history

Change-Id: If600c79a42b040f8323800cc2b6a145d5efb2c39
2019-04-11 17:27:40 -07:00
Benedict Wong
86bf1b0a6c 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
Merged-In: I98573a5c68e45abbbaddef01f6ac74a6a18e26f9
(cherry picked from commit 0fed3d2c01)
2019-04-11 20:04:19 +00:00
Benedict Wong
dee1ea74c1 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
Merged-In: Ic7394f24f11d713c9374b438182e29d2a02ea236
(cherry picked from commit 5f6bc9d438)
2019-04-11 20:04:06 +00:00
Rubin Xu
c81642f1a1 Merge "Block incoming non-VPN packets to apps under fully-routed VPN" am: 02040de8b1
am: 594df97559

Change-Id: I5af81bc80dadd086261ba4b1eb706cc873bb7cfa
2019-04-11 11:45:43 -07:00
Lorenzo Colitti
1941874a02 Merge "Add support for TAP interfaces in TestNetworkManager." am: 5ceee7e861
am: 7f5140a668

Change-Id: I29daac925c4b64bda111ba187b1759b6ce8a5f23
2019-04-11 11:32:46 -07:00
Benedict Wong
972562ea00 Merge changes I98573a5c,Ic7394f24 am: ca3c2504b5
am: d4b112fee1

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

Change-Id: I321a96599e51b70817b2514455c43972cd1fbca8
2019-04-11 09:56:11 -07:00
Rubin Xu
02040de8b1 Merge "Block incoming non-VPN packets to apps under fully-routed VPN" 2019-04-11 16:46:16 +00:00
Luke Huang
d836918ca6 API council feedbacks for DnsResolver
To address the API review feedback provided by
the API council.

Bug: 129261432
Test: atest DnsResolverTest
Change-Id: I3de11c913682abf790850b45cd5d50ac28b3fc5c
2019-04-11 22:17:20 +08:00
Lorenzo Colitti
88c709e6e6 Add support for TAP interfaces in TestNetworkManager.
Bug: 72950854
Test: builds, boots
Change-Id: I88bfd7f37c0ba0228f8288fe92212618ce134e4f
Merged-In: I88bfd7f37c0ba0228f8288fe92212618ce134e4f
(cherry picked from commit 7f5140a668)
2019-04-11 12:04:23 +00:00
Lorenzo Colitti
7f5140a668 Merge "Add support for TAP interfaces in TestNetworkManager."
am: 5ceee7e861

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

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

Change-Id: I15a4acf4355e05833ed15bde3deb0db966f2a75a
2019-04-10 23:31:51 -07:00
Remi NGUYEN VAN
c7a083a15e Merge "Expose captive portal urls for configuration" into qt-dev 2019-04-11 03:44:08 +00:00
Benedict Wong
214d280eb8 [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 4dba79cc89 is in history

Change-Id: I3e0bd244d8a2ddf86cf4dab99d4a563ea1e2b01e
2019-04-10 11:14:47 -07:00
Benedict Wong
d4b112fee1 Merge changes I98573a5c,Ic7394f24
am: ca3c2504b5

Change-Id: I2ffeb6ef1a19f7b2982c3631fe2c040024fb53cb
2019-04-10 11:00:10 -07:00
Benedict Wong
ca3c2504b5 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
1c19cf383f 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
c24d2af084 Merge "Fix comment on StaticIpConfiguration#getDomains" am: a430dae4b7
am: a87e7d5a41

Change-Id: I6a2ff0368193aaa988585613d99662a01cf4fa26
2019-04-10 00:07:05 -07:00
Chenbo Feng
ec134363c0 Merge "Add smoke test for jni library" am: d38640b7d5
am: 46a3c2c655

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

Change-Id: Ia664b08eabe344470a5c08e5510f1a8f7132ac73
2019-04-09 23:54:09 -07:00
Chenbo Feng
46a3c2c655 Merge "Add smoke test for jni library"
am: d38640b7d5

Change-Id: Iedb44739539f63090b067c1a25d4e83c333caddb
2019-04-09 23:50:10 -07:00
Treehugger Robot
a430dae4b7 Merge "Fix comment on StaticIpConfiguration#getDomains" 2019-04-10 06:30:55 +00:00
Treehugger Robot
d38640b7d5 Merge "Add smoke test for jni library" 2019-04-10 06:30:26 +00:00
Lorenzo Colitti
4f370cefa2 Add support for TAP interfaces in TestNetworkManager.
Test: builds, boots
Change-Id: I88bfd7f37c0ba0228f8288fe92212618ce134e4f
2019-04-10 13:29:41 +09:00
Benedict Wong
0fed3d2c01 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
52e795deeb 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 6d3a92f7c2)
2019-04-10 03:23:58 +00:00
Remi NGUYEN VAN
fb6665c9cc 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 e3896f71e1)

Change-Id: I278f2888851d38edb59157f8623541fbe94549b6
2019-04-10 02:03:27 +00:00
Benedict Wong
5f6bc9d438 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
dc2d592e68 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
81e26c4f57 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 a7bfdf8d8b)
2019-04-09 21:37:26 +00:00
Benedict Wong
a7725f9fab Merge "Fix remove-before-add for IpSecService RefcountedResource" am: 3a9e68d173
am: dccdcedd6a

Change-Id: I416c2e43961ec0e1cc6b2fbcef970fbce858603b
2019-04-09 10:56:30 -07:00
Benedict Wong
dccdcedd6a Merge "Fix remove-before-add for IpSecService RefcountedResource"
am: 3a9e68d173

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

Change-Id: I6e9043be4c28b73856b72f80971e2b66f8b8926b
2019-04-09 06:54:57 -07:00
Junyu Lai
0da5aa04bf Merge "Fix onBlockedStatusChanged does not work on multiple networks" am: 4cc967d1ba
am: 4e628af901

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

Change-Id: Ia8edf1e9d0f49da5be2bac1889cd0001010a869b
2019-04-09 05:43:18 -07:00
Chalard Jean
a2f3c1bf21 Address leftover comments on aosp/894233
Cherry-pick from commit 061f7a7eef,
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
4cc967d1ba Merge "Fix onBlockedStatusChanged does not work on multiple networks" 2019-04-09 12:13:26 +00:00
Lorenzo Colitti
cc53471dcd [automerger skipped] Merge "Fix ConnectivityServiceTest fail." into qt-dev
am: 0bf3e765f8 -s ours
am skip reason: change_id I7f185e731db91c30a9b0f14aefbdbb067942190e with SHA1 716a9412cd is in history

Change-Id: I6eddfc7bae967c76c63521b7fbcabd78a913bfd4
2019-04-09 03:44:42 -07:00
Lorenzo Colitti
0bf3e765f8 Merge "Fix ConnectivityServiceTest fail." into qt-dev 2019-04-09 10:25:10 +00:00
Lorenzo Colitti
57269c078d [automerger skipped] Merge "Fix flaky UdpEncapsulationSocket test" into qt-dev
am: d74809c670 -s ours
am skip reason: change_id Idf040a67e53d9b9ec6e6c647ce24f8ada501d355 with SHA1 a06b814245 is in history

Change-Id: Ic9b6b8c2ca4aabd3ed18291a94992a2b67286064
2019-04-09 02:31:35 -07:00