Commit graph

5,737 commits

Message SHA1
Merge changes Ie66ba631,Ic42c09a3
am: 6525e97ea5

Change-Id: I5c8a3364f0244c5945be2bbe919aac2dcc4eba66

Benedict Wong   authored and   android-build-merger   commited 2019-03-08 06:35:04 -08:00
3feec059fa
Merge changes Ie66ba631,Ic42c09a3
* changes:
  Implement TestNetworkService
  Add shell TestNetworkManager and Service

Benedict Wong   authored and   Gerrit Code Review   commited 2019-03-07 23:32:55 +00:00
6525e97ea5
Merge "Fix TetheringEntitlementValueListener related API"
am: cdfb2b941d

Change-Id: Idd3a7110c32319b610d5dacad7e3632d759ac887

Mark Chien   authored and   android-build-merger   commited 2019-03-07 05:32:33 -08:00
71894fbf14
Merge "Fix TetheringEntitlementValueListener related API"
Mark Chien   authored and   Gerrit Code Review   commited 2019-03-07 13:21:53 +00:00
cdfb2b941d
Merge "Migrate frameworks/base/tests/net/ to androidx.test"
am: e69a7a1554

Change-Id: Ic6783d55ba6e6a4009569952b542b2a5a42501fe

Brett Chabot   authored and   android-build-merger   commited 2019-03-06 21:51:50 -08:00
29e6ab8d01
Merge "Migrate frameworks/base/tests/net/ to androidx.test"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-07 05:42:07 +00:00
e69a7a1554
Fix TetheringEntitlementValueListener related API
Test: -build, flash, boot
      -atest FrameworksNetTests
bug: 126701557
bug: 126392011

Change-Id: I6dda10fbfe8ffaef71269617750a22563396f5ea

markchien   commited 2019-03-07 13:33:21 +08:00
bf5ab01869
Implement TestNetworkService
This change adds the relevant JNI implementations, as well as the
implementations and NetworkAgent tracking code in the TestNetworkService.

TestNetworkService (And Manager) is designed for use exclusively in
testing code, allowing for the creation of TUN and IPsec backed networks
in test code. Specifically, this allows for testing of components such
as IP, DHCP, or DNS clients, as well as kernel features such as IPsec.

Access to the TestNetworkService will be conditioned upon the
MANAGE_TEST_NETWORKS permission that will be granted only to the Shell.
CTS will use UiAutomation.adoptShellPermissionIdentity() to gain the
ability to use this service.

Bug: 72950854
Test: CTS tests passing
Change-Id: Ie66ba631a548b5f9c6b5ed0797582f86688debe5

Benedict Wong   commited 2019-03-06 15:37:52 -08:00
2ffe4b8998
Merge "Add @UnsupportedAppUsage annotations"
am: 7e3ccaa77a

Change-Id: Ib760897a2d3de2672b4f19d66e238ebee9bfb239

Andrei-Valentin Onea   authored and   android-build-merger   commited 2019-03-06 09:41:34 -08:00
1504da0942
Merge "Add @UnsupportedAppUsage annotations"
Andrei-Valentin Onea   authored and   Gerrit Code Review   commited 2019-03-06 17:18:05 +00:00
7e3ccaa77a
Migrate frameworks/base/tests/net/ to androidx.test
Test: atest FrameworksNetTests
Change-Id: Iaa59d606f5e1678cc5aaca9ed37e184fad894e5d

Brett Chabot   commited 2019-03-05 09:05:47 -08:00
147f6cf341
Merge "Fix isActiveNetworkMetered for VPNs."
am: 8cf699851a

Change-Id: Ic219c083dffa426a8c6f548ff6a3f4b5c2555217

Varun Anand   authored and   android-build-merger   commited 2019-03-04 17:50:43 -08:00
cb011b799f
Merge "Fix isActiveNetworkMetered for VPNs."
Varun Anand   authored and   Gerrit Code Review   commited 2019-03-05 01:37:30 +00:00
8cf699851a
Merge "Adding new APN type for Mission Critical Services."
am: a32315e69a

Change-Id: I4ae43791c9444f792d69e27b76a5bf57f8dfb4c8

Amit Mahajan   authored and   android-build-merger   commited 2019-03-04 10:43:30 -08:00
65bde4b9a0
Merge "Adding new APN type for Mission Critical Services."
Amit Mahajan   authored and   Gerrit Code Review   commited 2019-03-04 18:23:30 +00:00
a32315e69a
Merge "Return not supported if no necessary socket option"
am: acb289f34e

Change-Id: I592d08040459e544a53861b4e8a0ee49a50f225b

Mark Chien   authored and   android-build-merger   commited 2019-03-04 01:28:12 -08:00
06477f2f37
Merge "Return not supported if no necessary socket option"
Mark Chien   authored and   Gerrit Code Review   commited 2019-03-04 09:16:07 +00:00
acb289f34e
Merge "Fixed all APIs not meeting API review requirement"
am: 37cde6b81d

Change-Id: I84c1b55e99bf89c818c365f4954d9e3921904636

Jack Yu   authored and   android-build-merger   commited 2019-03-02 20:40:56 -08:00
75d5f94bb5
Merge "Fixed all APIs not meeting API review requirement"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-03 04:27:32 +00:00
37cde6b81d
Merge "Ensure handleUpdateLinkProperties runs on the CS handler thread."
am: 57ca4b2743

Change-Id: I46e448611a23a9e75f05b0ab48d4af47175de6d4

Lorenzo Colitti   authored and   android-build-merger   commited 2019-03-01 21:58:39 -08:00
dc987ea9e3
Merge "Ensure handleUpdateLinkProperties runs on the CS handler thread."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-02 05:38:21 +00:00
57ca4b2743
Merge "getConnectionOwnerUid: Clarify documentation"
am: 72a6706e8b

Change-Id: I6d469968754a355871655f0a29c75e7305874bc3

Jeff Vander Stoep   authored and   android-build-merger   commited 2019-03-01 19:56:05 -08:00
563f40fb7f
Merge "getConnectionOwnerUid: Clarify documentation"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-02 03:42:22 +00:00
72a6706e8b
Merge "Fix Automated API Review: InetAddresses"
am: 4daca39083

Change-Id: I0125d756d2026656afca9e29b7963c0e724750ac

Paul Duffin   authored and   android-build-merger   commited 2019-03-01 19:15:54 -08:00
cd8d86ab93
Adding new APN type for Mission Critical Services.
Test: build
Bug: 124447962
Change-Id: I9f608badd363703394432640dc892a4465660b6d

Amit Mahajan   commited 2019-03-01 16:52:17 -08:00
b7aafd26aa
Fixed all APIs not meeting API review requirement
To address the API review feedback provided by
the API council.

Bug: 126702995
Bug: 126701710
Bug: 126702357
Bug: 126701113
Bug: 126701239
Bug: 126700713
Bug: 126700064
Test: Manual
Change-Id: I4b902c1fc2c09133022b05dacdda8964436205d2

Jack Yu   commited 2019-03-01 14:37:47 -08:00
9fc82e3a86
Fix Automated API Review: InetAddresses
Add @NonNull annotations as required by the automated review.

Bug: 126702338
Test: make checkbuild
Change-Id: I9057f06de8d7ea846af00d5cefa744d4206b4b63

Paul Duffin   commited 2019-03-01 14:06:18 +00:00
e59e8c6255
Add shell TestNetworkManager and Service
This adds the scaffolding for TestNetworkManager and TestNetworkService.
These are separate from the ConnectivityManager/ConnectivityService in
order to prevent polluting the API space, and making them harder to
maintain.

Bug: 72950854
Test: Compiles, CTS tests relying on this pass
Change-Id: Ic42c09a33d962471e2587ec27f3fab2d72bbcd42

Benedict Wong   commited 2019-02-28 21:46:58 -08:00
a4ca3c6312
Merge "Remove ConnectivityManager and its usages from NetworkStatsService."
am: 93dfa10da4

Change-Id: I2a2809d3a2ee4106cc131d61ace401f31c187844

Varun Anand   authored and   android-build-merger   commited 2019-02-28 19:18:33 -08:00
9e3e89cde6
Remove ConnectivityManager and its usages from NetworkStatsService.
NSS needed it for getting VpnInfo[], NetworkState[] and
activeLinkProperties which it used to query via ConnectivityManager.

For VpnInfo[], this was racy as NSS may ignore intermediate changes to a
VPN's underlying networks. See http://b/123961098 for more context.

It may also lead to deadlocks b/w ConnectivityService and
NetworkStatsService. See http://b/126245192 for more info.

This change will ensure that NSS is never contending on any of
ConnectivityService locks.

Bug: 123961098
Bug: 126245192
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: Id1da446b54d95ee68ed14079107b1a10318bcf8b
Merged-In: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6

Varun Anand   commited 2019-03-01 00:10:52 +00:00
f3fd8dd454
Fix isActiveNetworkMetered for VPNs.
This change is basically a revert of http://ag/3580901.
It was made because previously VPN capabilities did not use to update
based on its underlying networks. That is no longer the case anymore.

This was previously returning meteredness on the basis of VPN's first
underlying network which is incorrect in cases such as VPN using
multiple underlying networks, or VPN that has explicitly marked itself
as metered via VpnService.Builder#setMetered API.

Bug: 123936838
Test: atest FrameworksNetTests
Change-Id: Ia54b8570fbad4a638a6d43a95e0271c6baf66685

Varun Anand   commited 2019-02-28 13:18:11 -08:00
83b6d76c93
Add @UnsupportedAppUsage annotations
For packages:
  android.net
  android.net.wifi
  android.nfc

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Merged-In: I7489aad1dceeb18ed7ca48a1ed8829a668b3fa04
Change-Id: I16570aef456b45a5543bf889dddc7a0d25441928

Andrei Onea   commited 2019-02-28 14:39:20 +00:00
23393e21ec
Merge "Fix broken javadoc links"
am: 1dd83b17a9

Change-Id: I7f1ef96544450ae71af3b76783fcbdc7641a2d43

Chiachang Wang   authored and   android-build-merger   commited 2019-02-28 05:46:29 -08:00
83fa25b925
Merge "Fix broken javadoc links"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-02-28 13:34:52 +00:00
1dd83b17a9
Merge changes from topic "nat64"
am: 868f0589c8

Change-Id: I3f7f74c197dd5da3db7d8d41fa4a26aacf38c2e8

Lorenzo Colitti   authored and   android-build-merger   commited 2019-02-27 15:56:18 -08:00
17fdfe9945
Merge changes from topic "nat64"
* changes:
  Catch ServiceSpecificException instead of IllegalStateException.
  Manage NAT64 prefix discovery lifecycle in the framework.
  Track NAT64 in the framework and start clatd iff NAT64 detected
  Change Nat464Xlat lifecycle.
  Minor improvements to verifyTcpBufferSizeChange.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2019-02-27 23:37:42 +00:00
868f0589c8
getConnectionOwnerUid: Clarify documentation
Test: build
Bug: 117573763
Change-Id: Ia899a541987b9c72a83287ed69fc47ab4d38f680

Jeff Vander Stoep   commited 2019-02-27 13:37:37 -08:00
440df92ff3
Ensure handleUpdateLinkProperties runs on the CS handler thread.
In its own change for ease of rollbacks due to the risk of
possibly crashing existing codepaths.

Bug: 65674744
Test: atest FrameworksNetTests
Test: builds, boots. Wifi, cell data, private DNS work
Change-Id: I2c0acc1c7b8367803f17b4a12c1df0fdfbc29691

Lorenzo Colitti   commited 2019-02-27 18:21:22 +09:00
bb6bacc130
Catch ServiceSpecificException instead of IllegalStateException.
The old NetworkManagementService methods to start clatd threw
IllegalStateException, but the new netd methods throw
ServiceSpecificException. Update the catch clauses so that if
starting clatd fails, the system doesn't crash.

Also stop logging stack traces but only include the exception
message itself.

Bug: 65674744
Test: atest FrameworksNetTests
Test: connecting/disconnecting to v6-only wifi in a loop does not crash
Change-Id: I4a9ec7f104712fbbe08f4f67e3288df03e8ed873

Lorenzo Colitti   commited 2019-02-27 18:21:22 +09:00
cdd4722829
Fix broken javadoc links
Bug: 123683994
Test: Verify with javadoc
Change-Id: I4b1b936e3cf86104ace5fcb6829778710801f2d5

Chiachang Wang   commited 2019-02-27 17:18:40 +08:00
3b723c2ee8
Manage NAT64 prefix discovery lifecycle in the framework.
Currently NAT64 prefix discovery, which runs in netd, is started
by netd itself when a network is programmed with all-IPv6 DNS
servers. Unfortunately this is not correct because in many cases
we program DNS servers before the network is connected and it's
actually possible to send packets to them.

In general netd does not have enough visibility into network
lifecycle management to decide when to start and stop prefix
discovery. So move it into the framework with the rest of the
464xlat control plane.

Bug: 65674744
Test: atest FrameworksNetTests
Change-Id: I8fa051a9c216d9c05082bf7d0bbb0cbd56000162

Lorenzo Colitti   commited 2019-02-27 00:18:13 +09:00
84298d8e5e
Track NAT64 in the framework and start clatd iff NAT64 detected
Currently, both netd and clatd do NAT64 prefix detection, and we
start clatd on all IPv6-only networks regardless of whether netd
has detected a NAT64 prefix or not.

Instead, track the NAT64 prefix in the framework, and only start
clatd if the prefix is detected. This will allow us to remove
DNS64 detection in clatd, and pass the NAT64 prefix and the IPv6
address to clatd on the command line instead of clatd finding it
itself. That way, netd and the framework will always know how
464xlat is configured, and we'll be able to use that information
in netd.

Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: Ida32d5760c5aecf7aeebef08fdb596291b2ce14a

Lorenzo Colitti   commited 2019-02-25 11:42:00 +09:00
f7e1739d9b
Change Nat464Xlat lifecycle.
Currently, NetworkAgentInfo keeps a Nat464Xlat object only on
networks where we're starting clatd (i.e., IPv6-only networks).
Simplify this code by making the Nat464Xlat object final and
always non-null. This allows us to use Nat464Xlat to store
information, such as the NAT64 prefix, even if the clat daemon
has not been started yet.

Also, remove the STOPPING state which waits for the interface to
be removed. Instead, when stop() is called, immediately enter the
IDLE state.
- This is necessary in order to be able to call start() again
  before the interface removal notification has arrived.
- It's also arguably more correct than the current code,
  because when stop() returns clatd has already terminated
  (ClatdController::stopClatd calls waitpid), and thus the tun
  fd is already closed and the tun interface is gone.

Also, now that Nat464Xlat objects are reused after stop(), add
test coverage for calling start() after stop, in both cases:
- The notification that the previous interface was removed
  arrives before the second start().
- The notification that the previous interface was removed
  arrives after the second start() but before the notification
  that the second interface was added.

Also fix a couple of lint warnings.

Test: builds, boots
Test: atest FrameworksNetTests
Test: clatd stops when IPv4 address added
Test: clatd restarts after "adb shell killall clatd"
Change-Id: I3dc66d155aa27606681f3473daf2170434d8c6d0

Lorenzo Colitti   commited 2019-02-25 11:42:00 +09:00
7b0732fff7
Minor improvements to verifyTcpBufferSizeChange.
1. Remove "throws Exception" from the signature so it can be used
   in tests that do not already throw Exception.
2. Update comment to reflect the fact that TCP buffer sizes are
   set on default network switch, not on connect.
3. Move into the method a class-level static constant that is
   only used in that method.

Test: atest ConnectivityServiceTest
Change-Id: Ic2e4fbedc23065efc20e45ea84996b577a8e94b6

Lorenzo Colitti   commited 2019-02-25 11:41:50 +09:00
c11592ce7c
Merge "DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master" into stage-aosp-master
Xin Li   authored and   Android (Google) Code Review   commited 2019-02-23 00:39:16 +00:00
9528e63d19
Return not supported if no necessary socket option
In order to support tcp keepalive offload, some socket
options are necessary. If one of them isn't supported in
kernel, just return ERROR_HARDWARE_UNSUPPORTED to the
caller.
e.g.
TCP_REPAIR starts from kernel 3.5
TCP_REPAIR_QUEUE starts from kernel 3.5
TCP_QUEUE_SEQ starts from kernel 3.5
TCP_REPAIR_WINDOW starts from kernel version 4.8

Bug: 124453402
Test: -boot, flash, atest FrameworksNetTests
      -start tcp keepalive offload in kernel 4.4 and 4.9 device.

Change-Id: I6f87e5be2f2ca7aae1293820c164d0bc7b664eb6

markchien   authored and   Mark Chien   commited 2019-02-22 06:12:14 +00:00
822935397c
DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293
Change-Id: I2f9a524f2ba552de3f62e343075cf0abf400bbae

Xin Li   commited 2019-02-21 16:02:06 -08:00
596142b8d9
Merge "Add logging to NetworkStackClient"
am: edb26a53d3

Change-Id: I0fe820c6feab3caa9ad0739df100553b2d4374e0

Remi NGUYEN VAN   authored and   android-build-merger   commited 2019-02-21 14:28:46 -08:00
f39152e999
Merge "Add logging to NetworkStackClient"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-02-21 22:13:31 +00:00
edb26a53d3
Merge "Send special permission information to netd"
am: c60e99de22

Change-Id: I35aa015a9448b5f8563da0aee40afd3101df29ff

Chenbo Feng   authored and   android-build-merger   commited 2019-02-21 13:30:32 -08:00
4930ac3fea