Commit Graph

5623 Commits

Author SHA1 Message Date
Pavel Grafov
4ed5cbd750 Nuke old setAlwaysOnVpnPackageForUser method.
All callers have migrated to 4-argument one.

Test: builds
Bug: 77468593
Change-Id: I253515f6b0100b675505646339e5b82d373c9429
2019-01-30 19:56:36 +00:00
Lorenzo Colitti
3a1cb9d615 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
2019-01-31 00:55:47 +09:00
Remi NGUYEN VAN
fb43a914d3 Add SystemApi for captive portal metrics
The metrics go through NetworkMonitor in the NetworkStack so that they
can be upgraded to new metrics in the future.

Test: flashed, captive portal login works, metrics shown in events log
Bug: 112869080
Merged-In: I4bccfbd87bae5b2d65e45c7a5918aa45ab5d76e8
Change-Id: Ib5e2126788f8d56a00a56d7efcd33c5f9a37a6de
2019-01-30 22:54:27 +09:00
Remi NGUYEN VAN
19542eea9e Merge "Remove last NetworkStack usage of hidden APIs"
am: 16ec5d038c

Change-Id: I27c78d09938f672a4428a17436d5ed0541170d0d
2019-01-29 21:13:46 -08:00
Remi NGUYEN VAN
6e82be4e4a 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
2019-01-30 10:23:24 +09:00
Remi NGUYEN VAN
5896eb1b1a Merge "Add NetworkUtils utilities to SystemApi"
am: 9cc31061fe

Change-Id: I82f20718d86b08cd0916ee33300ca0ee734305a6
2019-01-29 03:17:41 -08:00
Remi NGUYEN VAN
c7fe99fdbe 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
2019-01-29 17:30:26 +09:00
Remi NGUYEN VAN
e90dc24b2c Merge "Add SocketUtils for NetworkStack"
am: 37053eb78e

Change-Id: I0db40afbf2de55d77d9d5493e556f499d2383f59
2019-01-28 21:19:36 -08:00
Pavel Grafov
f6c5ef95d1 Merge "Whitelist packages from VPN lockdown."
am: 76e3e0052c

Change-Id: I3332e495ba0c903dff3dbb9c53c5c4784ea519f4
2019-01-28 20:18:23 -08:00
Remi NGUYEN VAN
37053eb78e Merge "Add SocketUtils for NetworkStack" 2019-01-28 23:14:08 +00:00
Pavel Grafov
76e3e0052c Merge "Whitelist packages from VPN lockdown." 2019-01-28 20:15:49 +00:00
Remi NGUYEN VAN
a628730d0a 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
2019-01-28 20:11:27 +09:00
Remi NGUYEN VAN
249646cc60 Merge "Move NetworkUtils used by NetworkStack"
am: 8f8deae60f

Change-Id: Ib83c3cb8ced0d226bd57375cd4600665d72fd962
2019-01-28 01:21:01 -08:00
Remi NGUYEN VAN
8f8deae60f Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 09:06:20 +00:00
Remi NGUYEN VAN
5fb799d7ee Merge "Add NetworkStack networking deps to SystemApi"
am: 9188b49259

Change-Id: Id8b31f100ab07ca9a38f4cff26c719dd9d74bc54
2019-01-28 00:26:39 -08:00
Remi NGUYEN VAN
e167e117c1 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
2019-01-28 13:45:17 +09:00
Remi NGUYEN VAN
8bd18cff9a 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
2019-01-28 13:28:35 +09:00
Pavel Grafov
3aeb3f3455 Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Change-Id: I9119c139ab07a761ce5dfd1365b70eb905fd32dc
2019-01-25 19:59:03 +00:00
Dan Albert
8840cbd3fa Merge "Revert "Whitelist packages from VPN lockdown.""
am: 7e81ae73b4

Change-Id: Ibaf799dc2664a6b3b743030da956679a3414ad9d
2019-01-24 13:45:19 -08:00
Dan Albert
7e81ae73b4 Merge "Revert "Whitelist packages from VPN lockdown."" 2019-01-24 21:08:46 +00:00
Dan Albert
45f1a24661 Revert "Whitelist packages from VPN lockdown."
This reverts commit f1a610a1c2.

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

Change-Id: Iaf5c8aa4a8720eb2852da8cd91c81a77ccb92b68
2019-01-24 21:05:39 +00:00
Irina Dumitrescu
83662532c8 Merge "Add API for proxy configuration over VPN."
am: b11e29d4b3

Change-Id: I647aec5f7678668b8ef7d616150adac1086dbbdd
2019-01-24 10:08:07 -08:00
Treehugger Robot
b11e29d4b3 Merge "Add API for proxy configuration over VPN." 2019-01-24 17:52:22 +00:00
Pavel Grafov
4934a54f2e Merge "Whitelist packages from VPN lockdown."
am: bec7854508

Change-Id: I329e24f1359a11a72ae9d0a23d2dc5b5de5aa8a7
2019-01-24 09:49:42 -08:00
Pavel Grafov
bec7854508 Merge "Whitelist packages from VPN lockdown." 2019-01-24 17:34:55 +00:00
Pavel Grafov
f1a610a1c2 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
2019-01-24 16:17:11 +00:00
Irina Dumitrescu
de132bb6d6 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
2019-01-24 16:07:20 +00:00
Lucas Lin
37f5d453ee Merge "Popup a notification after logging in the captive portal network"
am: 01eeab4954

Change-Id: I78321e10014525dfb02da29ee2f3cd4487bf30db
2019-01-24 03:27:36 -08:00
Lucas Lin
01eeab4954 Merge "Popup a notification after logging in the captive portal network" 2019-01-24 11:06:12 +00:00
Remi NGUYEN VAN
61c2962d74 Merge "Add additional SystemApi for NetworkStack"
am: 24f1f0be3c

Change-Id: I2614b1484498ad9d285be5f6628a94983f1561e4
2019-01-24 02:06:15 -08:00
Remi NGUYEN VAN
24f1f0be3c Merge "Add additional SystemApi for NetworkStack" 2019-01-24 09:55:01 +00:00
lucaslin
b1e8e385dd Popup a notification after logging in the captive portal network
Captive portal app will be auto dismissed after user login the
captive portal network. In order to improve the user experience,
popup a notification to notify user that the captive portal
network is connected.

Bug: 113629026
Test: 1.atest FrameworksNetTests:NetworkNotificationManagerTest
      2.Connect to a captive portal network and login, check if
      there is a notification popup.

Change-Id: Id54d12268e107af2f213c2bb348c5f7908e880f4
2019-01-24 15:55:30 +08:00
Junyu Lai
81a501ea8d Merge changes from topic "ka05"
am: 455df13823

Change-Id: I2448348d1501ca50daac87f4c06c120b4de3b2ae
2019-01-23 21:24:06 -08:00
Junyu Lai
455df13823 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
2019-01-24 05:06:39 +00:00
junyulai
d05a192fbe [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
2019-01-24 00:40:25 +08:00
Remi NGUYEN VAN
3bf01b0fbe Merge changes I1250730c,I7d00848c
am: 4bcdcfebd4

Change-Id: I2f19490a2340bdc2630162dfe9a277dffc5041fa
2019-01-23 08:26:33 -08:00
Lorenzo Colitti
0b27bd5aeb Merge "Stop depending on the ConnectivityService default request."
am: bb5952107d

Change-Id: Iae908cb959d50870923bce4dbe1bfed5f4c26c2c
2019-01-23 08:14:33 -08:00
Remi NGUYEN VAN
d9f75865cf Add additional SystemApi for NetworkStack
Members in this CL were missed in earlier changes.

Test: m
Bug: 112869080
Merged-In: I8b5b80ea7b267357eb0387d504a2f78358d6d502
Change-Id: I8b9b15f8b91962f3ef554fd222a825e471806c9e
2019-01-24 01:01:13 +09:00
junyulai
4c95b08a23 [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
2019-01-23 23:17:17 +08:00
Remi NGUYEN VAN
4bcdcfebd4 Merge changes I1250730c,I7d00848c
* changes:
  Create a wrapper for IpClient
  Move IpClient to NetworkStack
2019-01-23 15:05:00 +00:00
Lorenzo Colitti
bb5952107d Merge "Stop depending on the ConnectivityService default request." 2019-01-23 12:29:40 +00:00
Lorenzo Colitti
0d1aaee1dd Stop depending on the ConnectivityService default request.
This avoids the need to expose ConnectivityService implementation
details as @SystemApi and the complexities that would be required
to make NetworkCapabilities parcelable in stable AIDL.

Bug: 112869080
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: Icd5d25b9b8e9b7a7d1899b000c92dc4976c3b3d7
2019-01-23 18:10:06 +09:00
Luke Huang
ee35d6a4f2 Merge changes from topic "Java async dns"
am: 6fd9d58242

Change-Id: Ia08a8300887315d673f398b1340b2f44ce501b14
2019-01-23 01:06:19 -08:00
Luke Huang
6fd9d58242 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
Remi NGUYEN VAN
290455ec58 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
edcf128bbc Merge "Add getAvoidBadWifi system API"
am: 1aa810b0f3

Change-Id: Ifdf913669df84df3e3b158d5527895236e6758b7
2019-01-22 17:41:46 -08:00
Remi NGUYEN VAN
1aa810b0f3 Merge "Add getAvoidBadWifi system API" 2019-01-23 01:13:01 +00:00
Chalard Jean
3b0efeaf61 Merge changes If71fadd2,I42047185
am: 2b428221cb

Change-Id: Ie15258f09adb7f1cc53c558e1d3d5fdaf8d93476
2019-01-22 15:12:54 -08:00
Chalard Jean
2b428221cb 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
03ee99b190 Merge "Migrate ICaptivePortal to stable AIDL"
am: eb7c53718a

Change-Id: Id0844ec4d438dcc1f6c1028552dd21da6bd76584
2019-01-22 14:25:09 -08:00