Commit Graph

5678 Commits

Author SHA1 Message Date
Chalard Jean
dbe36dc5cf Merge "Deprecate getActiveLinkProperties." am: e429dfd104
am: 69a894623b

Change-Id: Iab302f94c8b33373831e1aa2aa4ff2beac9cf82f
2019-02-06 00:54:12 -08:00
Chalard Jean
69a894623b Merge "Deprecate getActiveLinkProperties."
am: e429dfd104

Change-Id: I745db0698d3fe76779e83c98aff9464a2b1b0709
2019-02-06 00:45:03 -08:00
Treehugger Robot
e429dfd104 Merge "Deprecate getActiveLinkProperties." 2019-02-06 08:32:10 +00:00
Chalard Jean
cc47b52a9c Deprecate getActiveLinkProperties.
There are other, more idiomatic ways to do this. Deprecating this
with usage limited to P will curb usage and reduce the maintenance
load.
This also deprecates the extra EXTRA_NETWORK_TYPE, which has
survived from an old world but has only been used in deprecated
broadcasts for some time.

Bug: 109783091
Test: eyeball current.txt
Change-Id: I87b74833bb4ec362ee3fd07511a66d318c29067d
2019-02-06 15:44:44 +09:00
Chalard Jean
020998a27b Merge "[KA03] Support tcp keepalive offload" am: 5f8ddc2eb1
am: 0bebdf2e1e

Change-Id: I695f8a96348b3033bd20a2a9d42ac9ee2bd485ad
2019-02-05 22:32:01 -08:00
Chalard Jean
0bebdf2e1e Merge "[KA03] Support tcp keepalive offload"
am: 5f8ddc2eb1

Change-Id: I7715266c2c24d3f5dd65cd0e375d99b16be6aea6
2019-02-05 22:19:41 -08:00
markchien
46f41d4b16 [KA03] Support tcp keepalive offload
When offload is starting, socket will be switched to repair
mode. Read and write on the socket will not be allowed until
repair mode is turned off. If remote packet arrives, repair
mode will be turned off automatically and a callback will
be raised to indicate that socket is ready to read from.

Bug: 114151147
Test: -atest FrameworksNetTests
      -manual

Change-Id: I0c335865912e183e7ad32a8ea12188f02ccde5fd
2019-02-06 12:22:22 +09:00
Chalard Jean
cba6514494 Merge "[KA02] internal cleanup and refactor for SocketKeepalive" am: 292da961e6
am: 3527414d22

Change-Id: I242fdacdd70729367f60da80a1a27d8f5a08dff6
2019-02-05 10:39:31 -08:00
Chalard Jean
3527414d22 Merge "[KA02] internal cleanup and refactor for SocketKeepalive"
am: 292da961e6

Change-Id: I211be98b0d3f5e1c7068a241cbd7e913ae72c461
2019-02-05 10:25:01 -08:00
junyulai
21c06d06ce [KA02] internal cleanup and refactor for SocketKeepalive
In previous change, the new SocketKeepalive API was exported.
But internally, old PacketKeepalive names and structures are
still used.

This change rename them properly for code consistency and also
refactor KeepalivePacketData to support different types of
KeepalivePacketData.

Bug: 114151147
Test: 1. atest FrameworksNetTests
      2. atest FrameworksWifiTests
      3. atest FrameworksTelephonyTests

Change-Id: Ia9917d12987e91e87e34ffb3f126e7bc7c9c187e
Merged-In: Ia9917d12987e91e87e34ffb3f126e7bc7c9c187e
2019-02-05 20:13:47 +09:00
Remi NGUYEN VAN
50a6165fc3 Merge changes from topic "bindprocess-resolv" am: 8b25d6c7d8
am: 79010e2cb5

Change-Id: I80f85170981c2f5b1ef949b5db88baf5fc101cd0
2019-01-31 00:19:37 -08:00
Remi NGUYEN VAN
79010e2cb5 Merge changes from topic "bindprocess-resolv"
am: 8b25d6c7d8

Change-Id: I3aacc6c2ae5242e28eec6e9e8e2a9a4b3e4f715d
2019-01-31 00:11:25 -08:00
Remi NGUYEN VAN
8b25d6c7d8 Merge changes from topic "bindprocess-resolv"
* changes:
  Allow use of bindProcessToNetwork only to change private DNS bypass.
  Allow bypassing private DNS via bindProcessToNetwork.
2019-01-31 07:52:04 +00:00
Mark Chien
9fc829242d Merge "Add get last entitlement value callback API" am: 13f0ce23a5
am: 5ba51d8c7f

Change-Id: I42892bdacaa41f9cea7e653f0bb9b5497192e5f6
2019-01-30 23:49:43 -08:00
Mark Chien
5ba51d8c7f Merge "Add get last entitlement value callback API"
am: 13f0ce23a5

Change-Id: I1961297c3fa31f5575ae3a11a3fc90d695cb7de5
2019-01-30 23:35:15 -08:00
Mark Chien
13f0ce23a5 Merge "Add get last entitlement value callback API" 2019-01-31 07:23:31 +00:00
markchien
5bd499ca4b Add get last entitlement value callback API
The callback would be used to notify entitlement value. If the
cache value indicates entitlement succeeded, it just fire
callback with cache value instead of run entitlement check.

Bug: 120887283
Test: atest FrameworksNetTests
Change-Id: I8afe928423bd75c54c61533a50a5c0814922ceb1
2019-01-31 12:31:55 +08:00
Lorenzo Colitti
3fadff929c Allow use of bindProcessToNetwork only to change private DNS bypass.
Currently it is not possible to change private DNS bypass by
doing:

  setProcessDefaultNetwork(network.getPrivateDnsBypassingCopy());
  setProcessDefaultNetwork(network);

because the code will ignore the change. Fix this by ensuring
that we always call bindProcessToNetwork (which does not have
side effects) and then only performing the expensive operations
(flushing DNS cache, upating socket pools) if the netId changed.

Bug: 112869080
Test: None
Change-Id: I5e8999cb11d8b8c1e9eb583fa8b3932f212accff
2019-01-31 13:08:24 +09:00
Varun Anand
f6a2a46752 Merge "Add an API that allows VPNs to declare themselves as metered." am: fcfc88d14e
am: 84bec449a3

Change-Id: Iab1d2a3bf27ec9c033253ccd48ce8026e3b18799
2019-01-30 19:39:50 -08:00
Varun Anand
84bec449a3 Merge "Add an API that allows VPNs to declare themselves as metered."
am: fcfc88d14e

Change-Id: Iadf012754e2e39f4b99efc97d5666dd0bc1ff2d6
2019-01-30 19:09:30 -08:00
Varun Anand
fcfc88d14e Merge "Add an API that allows VPNs to declare themselves as metered." 2019-01-31 02:43:25 +00:00
Remi NGUYEN VAN
1911c3fac5 Merge "Add SystemApi for captive portal metrics" am: 4369ea8416
am: b4eab23249

Change-Id: I15adc597039539d53e5c08dc5f8cac74bcb0eda2
2019-01-30 14:42:34 -08:00
Pavel Grafov
59bdc241e3 Merge "Nuke old setAlwaysOnVpnPackageForUser method." am: 35a8f1a38a
am: 871296a2f9

Change-Id: I7f0de294357ae6c691d38be52dd278eb37d42116
2019-01-30 14:36:37 -08:00
Remi NGUYEN VAN
b4eab23249 Merge "Add SystemApi for captive portal metrics"
am: 4369ea8416

Change-Id: I1d1406a10c33034cf379ea7735cb106d3c536c8e
2019-01-30 14:35:30 -08:00
Pavel Grafov
871296a2f9 Merge "Nuke old setAlwaysOnVpnPackageForUser method."
am: 35a8f1a38a

Change-Id: If3cb37b8fa19dd49b8595622b293886653d7a319
2019-01-30 14:27:01 -08:00
Remi NGUYEN VAN
4369ea8416 Merge "Add SystemApi for captive portal metrics" 2019-01-30 22:24:12 +00:00
Varun Anand
5ccd6bd9e4 Add an API that allows VPNs to declare themselves as metered.
For VPN apps targeting Q and above, they will by default be treated as
metered unless they override this setting before establishing VPN.

Bug: 120145746
Test: atest FrameworksNetTests
Test: On device tests verifying meteredness setup correctly for apps
targeting Q and apps targeting P.
Change-Id: Ia6d1f7ef244bc04ae2e28faa59625302b5994875
2019-01-30 14:09:03 -08:00
Pavel Grafov
1cf78de986 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
580483eb91 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
184600d0ad 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
6d834433ac Merge "Remove last NetworkStack usage of hidden APIs" am: 16ec5d038c
am: 0adf9260fc

Change-Id: I488fc028b8fd2aa5a09464082c65a4889a8a6b62
2019-01-29 21:27:50 -08:00
Remi NGUYEN VAN
0adf9260fc Merge "Remove last NetworkStack usage of hidden APIs"
am: 16ec5d038c

Change-Id: I27c78d09938f672a4428a17436d5ed0541170d0d
2019-01-29 21:13:46 -08:00
Remi NGUYEN VAN
9e7e213995 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
db8b553287 Merge "Add NetworkUtils utilities to SystemApi" am: 9cc31061fe
am: 48af15ae8b

Change-Id: I978bdb626c1f4c8bbe736c8bad1c74fb6a67b4b5
2019-01-29 03:29:01 -08:00
Remi NGUYEN VAN
48af15ae8b Merge "Add NetworkUtils utilities to SystemApi"
am: 9cc31061fe

Change-Id: I82f20718d86b08cd0916ee33300ca0ee734305a6
2019-01-29 03:17:41 -08:00
Remi NGUYEN VAN
a5225eaf51 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
dae2e37ce0 Merge "Add SocketUtils for NetworkStack" am: 75546d4e9d
am: 68a0c1de33

Change-Id: I89fe62b4baf63104359bb6741807bb2f1666cdd9
2019-01-28 22:57:39 -08:00
Pavel Grafov
a9c8b8a489 Merge "Whitelist packages from VPN lockdown." am: 2c13733fac
am: 4513467368

Change-Id: I10094606f74e6cdc5f4b0b6591cf776fd895b1d3
2019-01-28 21:34:03 -08:00
Remi NGUYEN VAN
68a0c1de33 Merge "Add SocketUtils for NetworkStack"
am: 75546d4e9d

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

Change-Id: I3332e495ba0c903dff3dbb9c53c5c4784ea519f4
2019-01-28 20:18:23 -08:00
Remi NGUYEN VAN
75546d4e9d Merge "Add SocketUtils for NetworkStack" 2019-01-28 23:14:08 +00:00
Pavel Grafov
2c13733fac Merge "Whitelist packages from VPN lockdown." 2019-01-28 20:15:49 +00:00
Remi NGUYEN VAN
6f08bb23a1 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
93bbacda97 Merge "Move NetworkUtils used by NetworkStack" am: 1ee45c9bfb
am: 1e69c8baca

Change-Id: I0d6a40c79e92d1de18c41cc50b72fbe33db13bdc
2019-01-28 01:30:17 -08:00
Remi NGUYEN VAN
1e69c8baca Merge "Move NetworkUtils used by NetworkStack"
am: 1ee45c9bfb

Change-Id: Ib83c3cb8ced0d226bd57375cd4600665d72fd962
2019-01-28 01:21:01 -08:00
Remi NGUYEN VAN
1ee45c9bfb Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 09:06:20 +00:00
Remi NGUYEN VAN
f554e1392c Merge "Add NetworkStack networking deps to SystemApi" am: 9188b49259
am: 05ec4875a0

Change-Id: I843cb189750666a2cb70b1960d49dfe797f3cf36
2019-01-28 00:35:46 -08:00
Remi NGUYEN VAN
05ec4875a0 Merge "Add NetworkStack networking deps to SystemApi"
am: 9188b49259

Change-Id: Id8b31f100ab07ca9a38f4cff26c719dd9d74bc54
2019-01-28 00:26:39 -08:00
Remi NGUYEN VAN
926e230392 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
d57b49cb4b 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