Commit Graph

3721 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
e693d49c0a Merge changes I1250730c,I7d00848c
* changes:
  Create a wrapper for IpClient
  Move IpClient to NetworkStack
2019-01-23 15:05:00 +00:00
Treehugger Robot
773f3f5bf3 Merge "[MS11] Implement findL2Key" 2019-01-23 11:01:43 +00:00
Luke Huang
31ff0616d1 Merge changes from topic "Java async dns"
* changes:
  Add asynchronous DNS query API in Java
  Add jni method for DnsResolver
2019-01-23 08:48:23 +00:00
Chalard Jean
8d1a890c5c [MS11] Implement findL2Key
Bug: 113554482
Test: old tests pass, new tests added
Change-Id: I2e93c88c30eae614a6db04abe698e8edf7fa6a43
2019-01-23 16:54:37 +09:00
Remi NGUYEN VAN
3c600a15a1 Move IpClient to NetworkStack
Test: atest FrameworksNetTests NetworkStackTests
Bug: b/112869080
Change-Id: I7d00848c052382cd1b6ce458868bed6a1e9e8ec5
2019-01-23 16:44:21 +09:00
Remi NGUYEN VAN
58582a36fc Merge "Add getAvoidBadWifi system API" 2019-01-23 01:13:01 +00:00
Chalard Jean
022daeb874 Merge changes If71fadd2,I42047185
* changes:
  [MS10] Address leftover comments on MS03 and MS07
  [MS09] Implement isSameNetwork.
2019-01-22 22:50:21 +00:00
Remi NGUYEN VAN
eb7c53718a Merge "Migrate ICaptivePortal to stable AIDL" 2019-01-22 22:03:44 +00:00
Tobias Thierer
f86156158c Merge "Deprecate SSLCertificateSocketFactory" 2019-01-22 16:57:50 +00:00
Luke Huang
00b15f33ab Add asynchronous DNS query API in Java
DnsResolver for asynchronous DNS querying
DnsPacket for parsing answer

Test: built, flashed, booted
      atest DnsResolverTest
      atest DnsPacketTest

Change-Id: Id014bc7387dd940cfaa270f68e7d4d85fab320a0
2019-01-23 00:07:43 +08:00
Luke Huang
92ae35ec9f Add jni method for DnsResolver
Test: built, flashed, booted
      atest DnsResolverTest

Change-Id: Iff730ec918f4db1ba0216f90a12550fe26e271d0
2019-01-23 00:07:43 +08:00
Remi NGUYEN VAN
97f69c2f8d Add getAvoidBadWifi system API
This helps remove the dependency on MultinetworkPolicyTracker from
IpClient.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: If56791dbed564772f25a859f301b8b52d84e38a3
2019-01-22 15:57:34 +00:00
Remi NGUYEN VAN
1e6b186023 Migrate ICaptivePortal to stable AIDL
Also add required API for the captive portal app to stop using hidden
members.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Merged-In: I62b457e709fa199822bb8f80b0eab990be4ded93
Change-Id: I62b457e709fa199822bb8f80b0eab990be4ded93
2019-01-23 00:53:13 +09:00
Pavel Grafov
479c0769f1 Merge "Add API for VPN apps to query always-on and lockdown." 2019-01-22 14:43:06 +00:00
Remi NGUYEN VAN
491f53523a Merge changes Ieef54d84,Ica3e88c2
* changes:
  Remove NetworkStack dependencies on hidden members
  Expose ServiceSpecificException as @SystemApi.
2019-01-22 13:00:10 +00:00
Remi NGUYEN VAN
91c81c13b6 Merge "Add SystemApi utility for raw sockets." 2019-01-22 12:38:33 +00:00
Chalard Jean
b67e493653 [MS10] Address leftover comments on MS03 and MS07
- Fix the copyright year in IPMSDatabase.java.
- Add missing Override annotations.
- Remove random l2keys, use fixed strings.
- Rename the method in OnNetworkAttributesRetrieved that puzzlingly
  nobody noticed was wrong.

Test: atest IpMemoryStoreServiceTest
Bug: 113554482
Change-Id: If71fadd23e158a4be299d112bfce75690b1ed8e8
2019-01-22 19:10:48 +09:00
Chalard Jean
a39756a58a [MS09] Implement isSameNetwork.
Test: Old tests pass, new tests pass too.
Bug: 113554482

Change-Id: I420471853f3fab7725cba7ae500cebdce1912e43
2019-01-22 19:10:48 +09:00
Remi NGUYEN VAN
c1c02dcb65 Remove NetworkStack dependencies on hidden members
- DhcpClient only shares its handler with IpClient, and NetworkMonitor
   has its own handler: remove Protocol.BASE_DHCP,
   Protocol.BASE_NETWORK_MONITOR
 - Remove dependency on Network.netid in NetworkMonitor
 - Remove dependency on Sets.newArraySet in DhcpServingParams
 - Remove dependency on formatDuration() in DhcpClient
 - Replace isMetered() with hasCapability() in NetworkMonitor
 - Use WifiManager.isScanAlwaysAvailable instead of reading setting

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Ieef54d847ddc081fb33cbad0b050b06d2e52548e
2019-01-22 18:48:12 +09:00
Remi NGUYEN VAN
811f6385be Add SystemApi utility for raw sockets.
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Id228bf3317b6933314174571697ee256b2f18452
2019-01-22 17:50:33 +09:00
Remi NGUYEN VAN
94a055737e Add LinkProps and NetworkCaps methods to SystemApi
Added methods are used by the NetworkStack.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: I8822d43c1a4981ca39289525685b3f975fb0e8d5
2019-01-22 16:57:16 +09:00
Remi NGUYEN VAN
8586a43f31 Merge "Add NetworkStack metrics to system API" 2019-01-22 07:48:39 +00:00
Remi NGUYEN VAN
c3a6317b0b Merge "Add NetworkMonitor constants to SystemApi" 2019-01-22 03:03:37 +00:00
Remi NGUYEN VAN
60b9ad2ec3 Merge "Add IIpClient API for IpClient" 2019-01-22 01:10:17 +00:00
Remi NGUYEN VAN
33a04d0ff9 Merge changes I5a6174a4,Idfbfdf54
* changes:
  Acquire lock to write NetworkStackConnector
  Allow Bluetooth to bind to NetworkStack
2019-01-21 23:31:07 +00:00
Remi NGUYEN VAN
7b84fb336f Add NetworkStack metrics to system API
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Ie52c55f248c173e2a5ee603ecd004fbac9004ac1
2019-01-21 23:24:41 +00:00
Remi NGUYEN VAN
79a6d5e30c Merge "Add fields used by NetworkStack to the API" 2019-01-21 23:20:26 +00:00
Remi NGUYEN VAN
800e843862 Acquire lock to write NetworkStackConnector
As Java reference writes are atomic, the previous code should not have
issues, but since mConnector is marked @GuardedBy it could trigger
static analysis.

Test: m
Change-Id: I5a6174a4f32c349e593d0a16d58293d608a487c7
2019-01-21 23:21:40 +09:00
Remi NGUYEN VAN
31f1d0cd8d Add fields used by NetworkStack to the API
Test: m
Bug: 112869080
Change-Id: I59f6d5ae8a601b7496548b87f137a577f2365a37
2019-01-21 23:03:25 +09:00
Pavel Grafov
cb3b895f1d Add API for VPN apps to query always-on and lockdown.
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Bug: 72628179
Change-Id: I73cb0888f7049b12ab0cdfa62678c3846e074d3b
2019-01-21 13:48:45 +00:00
Remi NGUYEN VAN
7731c5bae2 Add NetworkMonitor constants to SystemApi
NetworkMonitor lives in the NetworkStack which must only use system
APIs. This includes constants used by NetworkMonitor and captive portal
login.

Bug: 112869080
Test: m
Merged-In: I8b5f0bb61c3ef0d2f33af7dd67b72ac6c5a1d1b5
Change-Id: I4879568d3fbf9435767c8d4d0ab5198d421a2f4f
2019-01-21 21:11:15 +09:00
Adam Vartanian
6caa816a63 Deprecate SSLCertificateSocketFactory
See the bug for the full context, but the short version is that this
class is difficult to use properly, has a number of questionable
methods, ignores the provider system, and largely exists to support
functionality for which there are now standard APIs.

Test: make docs
Change-Id: I3b155b23bba41a72f20c149986318b75fa6d2eb0
Fixes: 112031620
2019-01-21 11:10:57 +00:00
Chalard Jean
ca046e898b Merge changes I2ddfef0c,I49bee0c9
* changes:
  [MS08] Read back attributes and blobs.
  [MS07] Implement storeNetworkAttributes and storeBlob.
2019-01-21 09:34:41 +00:00
Remi NGUYEN VAN
a5d31f53b6 Add IIpClient API for IpClient
The API will be used to interact with IpClient once it is moved to the
NetworkStack process.
This change keeps compatibility with the previous API so that clients
can be migrated independently.

Test: atest FrameworksNetTests NetworkStackTests
Bug: b/112869080
Change-Id: I57d8164afae849230bbc0e25f17859c0b22d0f29
2019-01-21 18:25:46 +09:00
Remi NGUYEN VAN
69b967f5d0 Allow Bluetooth to bind to NetworkStack
Test: flashed, verified bluetooth tethering gets IP address
Bug: b/112869080
Change-Id: Idfbfdf54754fea46eb0099b9b9a3bdc29dd241e0
2019-01-21 18:25:01 +09:00
Chalard Jean
91549b6d1b [MS07] Implement storeNetworkAttributes and storeBlob.
Test: New tests in IpMemoryStore
Bug: 113554482

Change-Id: I49bee0c903247e77ab93517efbe44548313cf1a4
2019-01-21 15:21:09 +09:00
Remi NGUYEN VAN
6b0b2b735e Add stable AIDL parcelables for IIpClient API
Test: atest FrameworksNetTests NetworkStackTests
Bug: b/112869080
Change-Id: Ia4ac1eb482850a06c4dc1b6c1fe55d33d4087388
2019-01-21 12:54:24 +09:00
Etan Cohen
836ad571eb [CS] Add an option to block sensitive network specifier
Network specifiers are used for 2 purposes:

- As part of network requests to specify more information on the type
  of requested networks.
- On network agents to specify information about their networks.

The network specifiers of the requests and agents are matched to each
other. However, the agent network specifier may contain sensitive
information which we do not want forwarded to any app.

This CL adds an option to strip out this agent network specifier before
the network capabilities are forwarded to the app.

Bug: 122160111
Test: atest ConnectivityServiceTest (frameworks/base/tests/net)
Test: atest frameworks/base/tests/net
Test: atest frameworks/opt/net/wifi/tests/wifitests
Test: atest frameworks/opt/telephony/tests/telephonytests
Test: atest frameworks/opt/net/ethernet/tests
Test: atest android.net.cts - some flakiness!
Test: act.py ThroughputTest
Test: act.py DataPathTest
Test: atest SingleDeviceTest (cts)
Change-Id: If08d312ff814bdde1147518f923199e6349503d5
2019-01-17 16:30:05 -08:00
Remi NGUYEN VAN
c37177a7d6 Merge "Add stable AIDL parcelables for LinkProperties" 2019-01-17 08:30:18 +00:00
Remi NGUYEN VAN
4855a2e2c6 Add stable AIDL parcelables for LinkProperties
Test: atest android.net.shared.LinkPropertiesParcelableUtilTest
Bug: b/112869080
Change-Id: I2b69980e25bae9f51fb5b8cd3cafb403e6bd53da
2019-01-17 13:11:12 +09:00
Chalard Jean
796c9446f7 Merge changes I09167532,I7df77a99,I67797b3f,Ic27e706f
* changes:
  [MS06] Add the relevance utils.
  [MS05] Pretty print the data classes of IPMS.
  [MS04] Add an executor to the memory store.
  [MS03] Add the contract for the IPMS database.
2019-01-16 12:14:46 +00:00
Remi NGUYEN VAN
b68c3499c1 Add Nat64Prefix to LinkProperties copy constructor
The attribute is copied when parceling/unparceling so should also be
preserved in the copy constructor.

Test: tests based on this pass
Change-Id: Ia48d94fc075e6414f537dad181a236be5a32b41b
2019-01-16 15:27:27 +09:00
Chalard Jean
8fe503f192 [MS05] Pretty print the data classes of IPMS.
Test: A commando of monkeys has been dispatched to make sure
      this pretty-printing is very, very pretty.
      Also one human has made sure of this by printing instances
      to the log.
Bug: 116512211

Change-Id: I7df77a997a982a0b3d444502cc69de5544f70736
2019-01-15 14:16:07 +09:00
Chalard Jean
61e27abf28 [MS03] Add the contract for the IPMS database.
Test: Some more boilerplate that doesn't exactly need tests as such.
      The important thing is that the database can store and retrieve
      data, not that it creates as specific file or schema.
Bug: 116512211

Change-Id: Ic27e706f15754b34d7bc26626a92d895a15a083d
2019-01-15 14:12:39 +09:00
Lorenzo Colitti
59b34472c9 Add the NAT64 prefix to LinkProperties.
Currently we support exactly one NAT64 prefix. This matches what
other components in the system (Dns64Configuration, clatd, etc.)
support.

Test: atest FrameworksNetTests
Change-Id: I45a11cebe43a5e1c60d50eca7889cb317565b598
2019-01-12 02:16:34 +09:00
Chalard Jean
f89d7bee9e [MS02] Write the skeleton for the IP memory store.
This implements a minimal contract for the IP Memory Store
feature.

Test: Created new tests for parcelable code. For the rest, created
      empty tests, but there is no logic, it's boilerplate day
Bug: 116512211
Change-Id: I15dc6275b370d671385ddfdb058a8b8d39952d6e
2019-01-11 15:01:00 +09:00
Chalard Jean
8c141bdb8f [MS01] Add the IP memory store service.
Bug: 116512211
Test: Added initial tests
Change-Id: I9d9af4097e3e2d7afd9956b9cbfa29a9f9558ae0
2019-01-11 15:00:36 +09:00
Remi NGUYEN VAN
81552d610a Merge "Move NetworkMonitor to NetworkStack" 2019-01-11 05:08:52 +00:00
Remi NGUYEN VAN
e67b0c3aee Move NetworkMonitor to NetworkStack
Bug: b/112869080
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I1b8b6a3f4390adbabf92fb9e48da61c47b08b2ec
2019-01-11 09:59:11 +09:00
Chalard Jean
64e495b274 Merge "Add PCSCF to LinkProperties." 2019-01-10 05:55:05 +00:00