Commit Graph

6069 Commits

Author SHA1 Message Date
Jack Yu
11db51010c Merge "Fixed all APIs not meeting API review requirement" am: a4c326157c am: 48ed523a6d
am: 93991029c5

Change-Id: I9683c9616e524013eda818e34d817d636ff1f365
2019-03-02 20:59:32 -08:00
Jack Yu
93991029c5 Merge "Fixed all APIs not meeting API review requirement" am: a4c326157c
am: 48ed523a6d

Change-Id: I4fceb789ebcfff76cc0205889e9c5084c83d4471
2019-03-02 20:50:08 -08:00
Jack Yu
48ed523a6d Merge "Fixed all APIs not meeting API review requirement"
am: a4c326157c

Change-Id: I84c1b55e99bf89c818c365f4954d9e3921904636
2019-03-02 20:40:56 -08:00
Treehugger Robot
a4c326157c Merge "Fixed all APIs not meeting API review requirement" 2019-03-03 04:27:32 +00:00
Lorenzo Colitti
f24cb3793d Merge "Ensure handleUpdateLinkProperties runs on the CS handler thread." am: bfe05b0388 am: e8e44c0a75
am: 7587fe6683

Change-Id: I507dfcdef170cfb02084899891308b078a6700de
2019-03-01 22:16:19 -08:00
Lorenzo Colitti
7587fe6683 Merge "Ensure handleUpdateLinkProperties runs on the CS handler thread." am: bfe05b0388
am: e8e44c0a75

Change-Id: I14555061639da3b04b4bca74c692ac94e5713c74
2019-03-01 22:06:58 -08:00
Lorenzo Colitti
e8e44c0a75 Merge "Ensure handleUpdateLinkProperties runs on the CS handler thread."
am: bfe05b0388

Change-Id: I46e448611a23a9e75f05b0ab48d4af47175de6d4
2019-03-01 21:58:39 -08:00
Treehugger Robot
bfe05b0388 Merge "Ensure handleUpdateLinkProperties runs on the CS handler thread." 2019-03-02 05:38:21 +00:00
Jeff Vander Stoep
6094312256 Merge "getConnectionOwnerUid: Clarify documentation" am: 1a4ffd5df1 am: 579402391a
am: 0b9ba97454

Change-Id: I4861a830f974d542452fb1ea8710438cf4fec14a
2019-03-01 20:24:38 -08:00
Jeff Vander Stoep
0b9ba97454 Merge "getConnectionOwnerUid: Clarify documentation" am: 1a4ffd5df1
am: 579402391a

Change-Id: I6897d552ed0a3f6ab6ac3616193fc4442cadc05a
2019-03-01 20:10:48 -08:00
Jeff Vander Stoep
579402391a Merge "getConnectionOwnerUid: Clarify documentation"
am: 1a4ffd5df1

Change-Id: I6d469968754a355871655f0a29c75e7305874bc3
2019-03-01 19:56:05 -08:00
Treehugger Robot
1a4ffd5df1 Merge "getConnectionOwnerUid: Clarify documentation" 2019-03-02 03:42:22 +00:00
Paul Duffin
935a1c5dd9 Merge "Fix Automated API Review: InetAddresses" am: 4daca39083 am: 1c0dc70654
am: e137413db2

Change-Id: I20a88429cd47bf16d7b2766fde5b978c33e9272b
2019-03-01 19:35:02 -08:00
Paul Duffin
e137413db2 Merge "Fix Automated API Review: InetAddresses" am: 4daca39083
am: 1c0dc70654

Change-Id: Ibcef646f539b1a871d8521d7216ecb6f7df8c0fd
2019-03-01 19:25:24 -08:00
Paul Duffin
1c0dc70654 Merge "Fix Automated API Review: InetAddresses"
am: 4daca39083

Change-Id: I0125d756d2026656afca9e29b7963c0e724750ac
2019-03-01 19:15:54 -08:00
Jack Yu
3ee7ba172e 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
2019-03-01 14:37:47 -08:00
Paul Duffin
3b6665ecac Fix Automated API Review: InetAddresses
Add @NonNull annotations as required by the automated review.

Bug: 126702338
Test: make checkbuild
Change-Id: I9057f06de8d7ea846af00d5cefa744d4206b4b63
2019-03-01 14:06:18 +00:00
Jeff Sharkey
9286f91971 All Parcelable CREATOR fields are @NonNull.
If they were null, then the Parcelable would fail to work.

Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
2019-02-28 23:29:04 -07:00
Varun Anand
e9e8b84237 [automerger skipped] Merge "Remove ConnectivityManager and its usages from NetworkStatsService." am: 93dfa10da4 am: 014fc924bc
am: cec5c73d8f -s ours
am skip reason: change_id I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6 with SHA1 65d59a826f is in history

Change-Id: I3ddc59f7abb5e3c0a2f4f54bb68632578948ee89
2019-02-28 19:35:07 -08:00
Varun Anand
cec5c73d8f Merge "Remove ConnectivityManager and its usages from NetworkStatsService." am: 93dfa10da4
am: 014fc924bc

Change-Id: Ieb10b88344dd4436913426961e6999577a469f36
2019-02-28 19:25:53 -08:00
Varun Anand
014fc924bc Merge "Remove ConnectivityManager and its usages from NetworkStatsService."
am: 93dfa10da4

Change-Id: I2a2809d3a2ee4106cc131d61ace401f31c187844
2019-02-28 19:18:33 -08:00
Varun Anand
65a199273f Merge "Remove ConnectivityManager and its usages from NetworkStatsService." 2019-03-01 01:14:34 +00:00
Varun Anand
5e980f4e3d 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
2019-03-01 00:10:52 +00:00
Varun Anand
65d59a826f 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: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6
2019-02-28 13:43:02 -08:00
Chiachang Wang
266ab95fe6 Merge "Fix broken javadoc links" am: e239dc818c am: ba54027efe
am: 4bc3afb4c8

Change-Id: Iffb9cfe0928ed37db61a7f684acb2b41b74c1bfa
2019-02-28 06:05:10 -08:00
Chiachang Wang
4bc3afb4c8 Merge "Fix broken javadoc links" am: e239dc818c
am: ba54027efe

Change-Id: I6423d51b19dd70a3e8a35841944d0c9c2a151768
2019-02-28 05:55:38 -08:00
Andrei-Valentin Onea
30fcf48f75 Merge "Add @UnsupportedAppUsage annotations" 2019-02-28 13:50:19 +00:00
Chiachang Wang
ba54027efe Merge "Fix broken javadoc links"
am: e239dc818c

Change-Id: I7f1ef96544450ae71af3b76783fcbdc7641a2d43
2019-02-28 05:46:29 -08:00
Treehugger Robot
e239dc818c Merge "Fix broken javadoc links" 2019-02-28 13:34:52 +00:00
Lorenzo Colitti
aea49ff19a Merge changes from topic "nat64" am: cfb7f03ec9 am: e98fe61189
am: 6c43228859

Change-Id: Iffd1a988d631c9285bad232cc60ae321abc866e8
2019-02-27 16:37:43 -08:00
Lorenzo Colitti
6c43228859 Merge changes from topic "nat64" am: cfb7f03ec9
am: e98fe61189

Change-Id: Iac01497eda611d334ee0ec2440f7d9f8bd27bd1f
2019-02-27 16:10:58 -08:00
Lorenzo Colitti
e98fe61189 Merge changes from topic "nat64"
am: cfb7f03ec9

Change-Id: I3f7f74c197dd5da3db7d8d41fa4a26aacf38c2e8
2019-02-27 15:56:18 -08:00
Lorenzo Colitti
cfb7f03ec9 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.
2019-02-27 23:37:42 +00:00
Jeff Vander Stoep
96c64edbd9 getConnectionOwnerUid: Clarify documentation
Test: build
Bug: 117573763
Change-Id: Ia899a541987b9c72a83287ed69fc47ab4d38f680
2019-02-27 13:37:37 -08:00
Andrei Onea
734999cff8 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
Change-Id: I7489aad1dceeb18ed7ca48a1ed8829a668b3fa04
2019-02-27 13:31:33 +00:00
Lorenzo Colitti
7ec341ab58 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
2019-02-27 18:21:22 +09:00
Lorenzo Colitti
b1ef6f7a8f 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
2019-02-27 18:21:22 +09:00
Chiachang Wang
0d92d1a79c Fix broken javadoc links
Bug: 123683994
Test: Verify with javadoc
Change-Id: I4b1b936e3cf86104ace5fcb6829778710801f2d5
2019-02-27 17:18:40 +08:00
Lorenzo Colitti
714b786585 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
2019-02-27 00:18:13 +09:00
Xin Li
e02f64d78c [automerger skipped] Merge "DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master" into stage-aosp-master am: 5d53623a89 -s ours
am: ac2d4841ca -s ours
am skip reason: subject contains skip directive

Change-Id: Id92cda80ee1afb5ebef1815480e14c4c674752fc
2019-02-25 19:17:12 -08:00
Xin Li
ac2d4841ca [automerger skipped] Merge "DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master" into stage-aosp-master
am: 5d53623a89 -s ours
am skip reason: subject contains skip directive

Change-Id: Ia5bdfa13266268f317d62fc56dfbb3501efb50ff
2019-02-25 18:42:07 -08:00
Xin Li
fa29eaeec0 [automerger skipped] DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master am: 2348103b5a -s ours
am: f0ebf61021 -s ours
am skip reason: subject contains skip directive

Change-Id: I2b3cf7ba11fc80010badbb212902a5507d5caae0
2019-02-25 17:16:05 -08:00
Xin Li
f0ebf61021 [automerger skipped] DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
am: 2348103b5a -s ours
am skip reason: subject contains skip directive

Change-Id: I6c115125bad894bbb597557f2e9c3de3eb2b95b5
2019-02-25 16:13:06 -08:00
Remi NGUYEN VAN
9a12f8c3d8 Merge "Add logging to NetworkStackClient" am: b4ef756571 am: 3c771cc3e6
am: 7bbea3f191

Change-Id: I7241888c779e8f47161dc2f555e140555134434c
2019-02-25 10:32:55 -08:00
Chenbo Feng
c4af054a40 Merge "Send special permission information to netd" am: 84537c00b2 am: 26018a4836
am: 3549052c98

Change-Id: Icb1fa5d980f74902fd085580a7534a5ad7cd00a0
2019-02-25 10:26:51 -08:00
Remi NGUYEN VAN
7bbea3f191 Merge "Add logging to NetworkStackClient" am: b4ef756571
am: 3c771cc3e6

Change-Id: Ib2f6bcda2429346d0418b460bc040fc5e9edbe97
2019-02-25 09:14:44 -08:00
Chenbo Feng
3549052c98 Merge "Send special permission information to netd" am: 84537c00b2
am: 26018a4836

Change-Id: I80271fa7c4e1c6a8e2eea55adf12abaece64d8da
2019-02-25 09:10:05 -08:00
Lorenzo Colitti
8d39bbf0a4 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
2019-02-25 11:42:00 +09:00
Lorenzo Colitti
07f10206e6 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
2019-02-25 11:42:00 +09:00
Lorenzo Colitti
b0e7a02891 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
2019-02-25 11:41:50 +09:00