Commit graph android_packages_modules_Co.../core/java
Message SHA1
Allow bypassing private DNS via bindProcessToNetwork.
Currently, bypassing private DNS requires calling the deprecated
setProcessDefaultNetworkForHostResolution. Allow apps to do this
via the non-deprecated binProcessForNetwork as well.

This has fewer backwards compatibility concerns than the
alternative approach of having setProcessDefaultNetwork call
setProcessDefaultNetworkForHostResolution. That approach would
have been problematic, for example, if an app did:

  cm.bindProcessToNetwork(network);
  ...
  cm.bindProcessToNetwork(null);

In this case, it would be difficult to know whether to clear the
resolver mapping as well: what if an app had also called
setProcessDefaultNetworkForHostResolution?

Similarly, it would be difficult to know what to do if an app did:

  cm.setProcessDefaultNetworkForHostResolution(network);
  cm.bindProcessToNetwork(null);

This approach does not have these concerns, and has no effect
on apps that don't call Network.getPrivateDnsBypassingCopy, which
regular apps don't have permission to use. It also provides a
path to deprecate setProcessDefaultNetworkForHostResolution.

Bug: 112869080
Test: atest android.net.cts.ConnectivityManagerTest android.net.cts.MultinetworkApiTest
Change-Id: I4158a37b6ed87a9a9b2677c526dcfee8af48e483

Lorenzo Colitti   commited 2019-01-31 00:55:47 +09:00
3a1cb9d615
Remove last NetworkStack usage of hidden APIs
Includes various small changes to stop using hidden APIs

Test: make NetworkStack
Test: flashed, booted, WiFi and tethering working
Bug: 112869080
Change-Id: Id2830795a444f484b377ed6437435a1cd833697a

Remi NGUYEN VAN   commited 2019-01-30 10:23:24 +09:00
6e82be4e4a
Add NetworkUtils utilities to SystemApi
attach*Filter and addArpEntry are necessary for the NetworkStack but are
only usable for apps that have system permissions.
Also includes system API for IpPrefix, LinkAddress, LinkProperties,
Network, and static modifier in ApfCapabilities that were missed in
previous CLs.

Test: Builds, flashed, WiFi works
Bug: 112869080
Change-Id: If141ae6a2f9145f5af64ba002ca44938f39b90a9

Remi NGUYEN VAN   commited 2019-01-29 17:30:26 +09:00
c7fe99fdbe
Merge "Add SocketUtils for NetworkStack"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-28 23:14:08 +00:00
37053eb78e
Merge "Whitelist packages from VPN lockdown."
Pavel Grafov   authored and   Gerrit Code Review   commited 2019-01-28 20:15:49 +00:00
76e3e0052c
Add SocketUtils for NetworkStack
These utilities can only be used for privileged apps. The underlying
implementation cannot be @SystemApi.

Test: m
Bug: 112869080
Change-Id: Idfa90561102e5b03ab2b79486d3ad46457128bf8

Remi NGUYEN VAN   commited 2019-01-28 20:11:27 +09:00
a628730d0a
Merge "Move NetworkUtils used by NetworkStack"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-28 09:06:20 +00:00
8f8deae60f
Move NetworkUtils used by NetworkStack
Depending on usage move into NetworkStackUtils or shared
Inet4AddressUtils.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Merged-In: Ie20dcee375b377236004a7689890729493aca857
Change-Id: Ib8d000529872796022706a35050fdc2c7141f2ab

Remi NGUYEN VAN   commited 2019-01-28 13:45:17 +09:00
e167e117c1
Add NetworkStack networking deps to SystemApi
Cherry-pick with conflicts fixed in CaptivePortalLoginActivity imports.
Test: atest FrameworksNetTests
Bug: 112869080
Merged-In: Id59dc06fb85e4ac88098f56b621ec880610759ce
Change-Id: I3c05e8fdd70497426d4fa433295c4fbdad07d9c9

Remi NGUYEN VAN   commited 2019-01-28 13:28:35 +09:00
8bd18cff9a
Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Change-Id: I9119c139ab07a761ce5dfd1365b70eb905fd32dc

Pavel Grafov   commited 2019-01-25 19:59:03 +00:00
3aeb3f3455
Merge "Revert "Whitelist packages from VPN lockdown.""
Dan Albert   authored and   Gerrit Code Review   commited 2019-01-24 21:08:46 +00:00
7e81ae73b4
Revert "Whitelist packages from VPN lockdown."
This reverts commit f1a610a1c2.

Reason for revert: broke pi-dev-plus-aosp

Change-Id: Iaf5c8aa4a8720eb2852da8cd91c81a77ccb92b68

Dan Albert   commited 2019-01-24 21:05:39 +00:00
45f1a24661
Merge "Add API for proxy configuration over VPN."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-01-24 17:52:22 +00:00
b11e29d4b3
Merge "Whitelist packages from VPN lockdown."
Pavel Grafov   authored and   Gerrit Code Review   commited 2019-01-24 17:34:55 +00:00
bec7854508
Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Test: MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot
Change-Id: I7f6c5b9172063b588feacd6b9930a6cb88f764ab
Merged-In: I7f6c5b9172063b588feacd6b9930a6cb88f764ab

Pavel Grafov   commited 2019-01-24 16:17:11 +00:00
f1a610a1c2
Add API for proxy configuration over VPN.
Test: runtest -x
frameworks/base/tests/net/java/com/android/server/ConnectivityServiceTest.java
&& atest HostsideVpnTests
Bug: 76001058
Change-Id: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a
Merged-In: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a

Irina Dumitrescu   commited 2019-01-24 16:07:20 +00:00
de132bb6d6
Merge "Add additional SystemApi for NetworkStack"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-24 09:55:01 +00:00
24f1f0be3c
Merge changes from topic "ka05"
* changes:
  [KA05] Export keepalive offload api for IpSec Nat-T file descriptor
  [KA01] export SocketKeepalive API for NAT-T keepalive

Junyu Lai   authored and   Gerrit Code Review   commited 2019-01-24 05:06:39 +00:00
455df13823
[KA05] Export keepalive offload api for IpSec Nat-T file descriptor
Adds system api of createSocketKeepalive to take file descriptor,
so privileged apps could use it without the need of IpSecService.

Bug: 114151147
Test: atest FrameworksNetTests
Change-Id: If926c21704b6ed73a0adfcadad732b97b42bacae

junyulai   commited 2019-01-24 00:40:25 +08:00
d05a192fbe
Add additional SystemApi for NetworkStack
Members in this CL were missed in earlier changes.

Test: m
Bug: 112869080
Merged-In: I8b5b80ea7b267357eb0387d504a2f78358d6d502
Change-Id: I8b9b15f8b91962f3ef554fd222a825e471806c9e

Remi NGUYEN VAN   commited 2019-01-24 01:01:13 +09:00
d9f75865cf
[KA01] export SocketKeepalive API for NAT-T keepalive
The new set of API replace the PacketKeepalive system API
which is only specific for IPsec NAT-T keepalive packet. Allows
applications to request different types of keepalives through
the same set of API.

By using keepalives, applications could request system to
periodically send specific packets on their behalf, using
hardware offload to save battery power.

This change would only address interface change and test part of
original functionality. After all reference of PacketKeepalive
are removed, another change would be submitted to remove old
API.

Bug: 114151147
Test: atest FrameworksNetTests
Change-Id: I3367666810acc44d5ad20e19acd4bf936e8b5d9c

junyulai   commited 2019-01-23 23:17:17 +08:00
4c95b08a23
Merge changes I1250730c,I7d00848c
* changes:
  Create a wrapper for IpClient
  Move IpClient to NetworkStack

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-23 15:05:00 +00:00
4bcdcfebd4
Merge changes from topic "Java async dns"
* changes:
  Add asynchronous DNS query API in Java
  Add jni method for DnsResolver

Luke Huang   authored and   Gerrit Code Review   commited 2019-01-23 08:48:23 +00:00
6fd9d58242
Move IpClient to NetworkStack
Test: atest FrameworksNetTests NetworkStackTests
Bug: b/112869080
Change-Id: I7d00848c052382cd1b6ce458868bed6a1e9e8ec5

Remi NGUYEN VAN   commited 2019-01-23 16:44:21 +09:00
290455ec58
Merge "Add getAvoidBadWifi system API"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-23 01:13:01 +00:00
1aa810b0f3
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

Luke Huang   commited 2019-01-23 00:07:43 +08:00
6d23e740f8
Add jni method for DnsResolver
Test: built, flashed, booted
      atest DnsResolverTest

Change-Id: Iff730ec918f4db1ba0216f90a12550fe26e271d0

Luke Huang   commited 2019-01-23 00:07:43 +08:00
4e5831aecc
Add getAvoidBadWifi system API
This helps remove the dependency on MultinetworkPolicyTracker from
IpClient.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: If56791dbed564772f25a859f301b8b52d84e38a3

Remi NGUYEN VAN   commited 2019-01-22 15:57:34 +00:00
27de63e494
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

Remi NGUYEN VAN   commited 2019-01-23 00:53:13 +09:00
44ed85862c
Merge "Add API for VPN apps to query always-on and lockdown."
Pavel Grafov   authored and   Gerrit Code Review   commited 2019-01-22 14:43:06 +00:00
5e135e2bdc
Add LinkProps and NetworkCaps methods to SystemApi
Added methods are used by the NetworkStack.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: I8822d43c1a4981ca39289525685b3f975fb0e8d5

Remi NGUYEN VAN   commited 2019-01-22 16:57:16 +09:00
109f8d5585
Merge "Add NetworkMonitor constants to SystemApi"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-22 03:03:37 +00:00
a1e4e0bc23
Merge "Add fields used by NetworkStack to the API"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-21 23:20:26 +00:00
aa983b7f1c
Add fields used by NetworkStack to the API
Test: m
Bug: 112869080
Change-Id: I59f6d5ae8a601b7496548b87f137a577f2365a37

Remi NGUYEN VAN   commited 2019-01-21 23:03:25 +09:00
85b9665073
Add API for VPN apps to query always-on and lockdown.
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Bug: 72628179
Change-Id: I73cb0888f7049b12ab0cdfa62678c3846e074d3b

Pavel Grafov   commited 2019-01-21 13:48:45 +00:00
e87b7ceaa6
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

Remi NGUYEN VAN   commited 2019-01-21 21:11:15 +09:00
70ab67f1ce
Add stable AIDL parcelables for IIpClient API
Test: atest FrameworksNetTests NetworkStackTests
Bug: b/112869080
Change-Id: Ia4ac1eb482850a06c4dc1b6c1fe55d33d4087388

Remi NGUYEN VAN   commited 2019-01-21 12:54:24 +09:00
699aefeb81
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

Remi NGUYEN VAN   commited 2019-01-16 15:27:27 +09:00
8f7bc647b5
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

Lorenzo Colitti   commited 2019-01-12 02:16:34 +09:00
981b34f6b8
Merge "Move NetworkMonitor to NetworkStack"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-11 05:08:52 +00:00
b35979db6b
Move NetworkMonitor to NetworkStack
Bug: b/112869080
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I1b8b6a3f4390adbabf92fb9e48da61c47b08b2ec

Remi NGUYEN VAN   commited 2019-01-11 09:59:11 +09:00
8539129ad9
Merge "Add PCSCF to LinkProperties."
Chalard Jean   authored and   Gerrit Code Review   commited 2019-01-10 05:55:05 +00:00
a99e1eeb9d
Merge "Move DhcpServer to NetworkStack app"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-09 10:42:48 +00:00
82ef768e0c
Move DhcpServer to NetworkStack app
Test: atest FrameworksNetTests && atest NetworkStackTests
Bug: b/112869080

Change-Id: I96c40e63e9ceb37b67705bdd4d120307e114715b

Remi NGUYEN VAN   commited 2019-01-09 15:42:16 +09:00
a35360c1b6
Add nullability annotations to public methods of ConnManager.
This is mainly for Kotlin compatibility.
https://android-developers.googleblog.com/2018/08/android-pie-sdk-is-now-more-kotlin.html

Bug: 122437895
Test: no logic changes
Change-Id: Ic1b9a774aee0099397b1ccfd958ff3b61d69a7fb

Chalard Jean   commited 2019-01-07 19:35:09 +09:00
158702db55
Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687

Mathew Inwood   commited 2018-12-28 14:26:35 +00:00
bdfc1fcb7a
Merge "Unhide LinkProperties, NetworkCapabilities, NetworkRequest APIs"
Paul Hu   authored and   Gerrit Code Review   commited 2018-12-21 15:21:03 +00:00
6f8696cf67
Merge "Deprecate NetworkInfo"
Junyu Lai   authored and   Gerrit Code Review   commited 2018-12-21 09:56:39 +00:00
84a764b1f4
Deprecate NetworkInfo
Currently NetworkInfo is used by Apps to get information of
network. However, to get such information, Apps need to poll
NetworkInfo frequently from ConnectivityService.

In order to increase the stability and reduce the maintain
effort, all functionalities provided by NetworkInfo are targeted
to be replaced or removed entirely.

Apps should use ConnectivityManager.NetworkCallback instead, to
get faster and more detailed updates from connectivity changes.

Or, apps could use getNetworkCapabilities or getLinkProperties
to get information synchronously, but should not mix the
callbacks and synchronous methods together.

Bug: 113629330
Test: atest FrameworksNetTests
Change-Id: Ie8faf620958c3fa0a4a2f233b35b825de0e99ffc

junyulai   commited 2018-12-20 16:36:10 +08:00
9826e7f292
Merge "Fixed toString() printing error"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-12-19 17:39:58 +00:00
9952ebd7d5