Commit Graph

5656 Commits

Author SHA1 Message Date
android-build-team Robot
79cdc783ee Snap for 5180536 from 1151e49dce to pi-platform-release
Change-Id: I7c5a9c9e96572c32eadd97448c4886f9c9150a19
2019-02-09 02:33:11 +00:00
Remi NGUYEN VAN
794c7f2ee3 Remove hard-coded NetworkStack package name
Have the network stack pass its package name in
showProvisioningNotification instead.

Bug: 124033493
Test: flashed, WiFi and captive portal works
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I1f3312768ba1fb34e99a827e1fcdaf7510e318a8
2019-02-08 12:12:57 +09:00
Remi NGUYEN VAN
9da4305183 Merge "Check MAINLINE_NETWORK_STACK in ConnectivityService"
am: 2f96229cbd

Change-Id: I5bc7a8dae5667a1509f9741be571008a919b6461
2019-02-06 19:50:15 -08:00
Remi NGUYEN VAN
2f96229cbd Merge "Check MAINLINE_NETWORK_STACK in ConnectivityService" 2019-02-07 03:33:54 +00:00
Remi NGUYEN VAN
640909fadf Merge "Add API for NetworkStack to start captive portal"
am: 9d0e114e66

Change-Id: I72166f14ec4f7589a1dbd0334de37530ebccf88e
2019-02-06 18:49:45 -08:00
Remi NGUYEN VAN
9d0e114e66 Merge "Add API for NetworkStack to start captive portal" 2019-02-07 02:39:17 +00:00
Chalard Jean
f924dfe504 Merge "[KA04] Expose TCP socket keepalive API"
am: b099846c86

Change-Id: If8bc33ff30a529092802f9450a3772aaaa401c20
2019-02-06 07:22:31 -08:00
Chalard Jean
b099846c86 Merge "[KA04] Expose TCP socket keepalive API" 2019-02-06 15:13:02 +00:00
junyulai
0835a1eaea [KA04] Expose TCP socket keepalive API
The new set of API allows applications to request keepalives
offload for established TCP sockets over wifi.

However, the application must not write to or read from the
socket after calling this method, until specific callbacks are
called.

Bug: 114151147
Test: atest FrameworksNetTests FrameworksWifiTests NetworkStackTests

Change-Id: I3880505dbc35fefa34ef6c79555458ecf5d296a4
2019-02-06 22:51:42 +09:00
Chalard Jean
90cad47708 Merge "[KA03.5] Add stable AIDL parcelable for TcpKeepalivePacketData"
am: 6e55aca3fa

Change-Id: I3ee97cd66e19486ba0edd6cab58bd37b43a0904b
2019-02-06 01:29:24 -08:00
Chalard Jean
6e55aca3fa Merge "[KA03.5] Add stable AIDL parcelable for TcpKeepalivePacketData" 2019-02-06 09:19:07 +00:00
Remi NGUYEN VAN
097a597058 Check MAINLINE_NETWORK_STACK in ConnectivityService
Treat NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK as equivalent to
NETWORK_STACK, CONNECTIVITY_INTERNAL and NETWORK_SETTINGS combined.
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK is defined as signature
permission in NetworkStackPermissionStub, which is signed with the
platform certificate, so requirements are the same for both permissions.

The permission is defined by NetworkStackPermissionStub and only used by
NetworkStack, which must be signed with the same key as the stub.

Test: flashed, booted, WiFi works, also with changes on top removing
      CONNECTIVITY_INTERNAL and NETWORK_SETTINGS
Bug: 112869080
Change-Id: I9d0ea8fc99eadf7e902421efdba9b8bf535658b8
2019-02-06 17:57:09 +09:00
Chalard Jean
10a24f1d46 Merge "Deprecate getActiveLinkProperties."
am: 39d46d221b

Change-Id: I745db0698d3fe76779e83c98aff9464a2b1b0709
2019-02-06 00:45:03 -08:00
Treehugger Robot
39d46d221b Merge "Deprecate getActiveLinkProperties." 2019-02-06 08:32:10 +00:00
Remi NGUYEN VAN
94ff95bbcd Add API for NetworkStack to start captive portal
Endpoints protected with INTERACT_ACROSS_USERS_FULL, such as
startActivityAsUser, should only be used by modules signed with the
platform cert. The NetworkStack needs to have the system server start
the application so this restriction can be applied.

Bug: 123846255
Test: flashed, captive portal works from primary and secondary user
Change-Id: Ib3e427b3fd03ced80c02985e795f79b096a2ec9a
2019-02-06 16:38:32 +09:00
Chalard Jean
97021a1eeb 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
0b93464e32 Merge "[KA03] Support tcp keepalive offload"
am: 5f8ddc2eb1

Change-Id: I7715266c2c24d3f5dd65cd0e375d99b16be6aea6
2019-02-05 22:19:41 -08:00
junyulai
80d0356311 [KA03.5] Add stable AIDL parcelable for TcpKeepalivePacketData
Bug: 114151147
Test: atest FrameworksNetTests
Change-Id: I057dde79013b9eda5037b9a44f8eee06cc07352e
2019-02-06 14:07:39 +09:00
markchien
e5591ce2fa [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
839c99be82 Merge "[KA02] internal cleanup and refactor for SocketKeepalive"
am: 292da961e6

Change-Id: I211be98b0d3f5e1c7068a241cbd7e913ae72c461
2019-02-05 10:25:01 -08:00
junyulai
011b1f15c2 [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
4b8dee1177 Merge changes from topic "bindprocess-resolv"
am: af8e41c434

Change-Id: I3aacc6c2ae5242e28eec6e9e8e2a9a4b3e4f715d
2019-01-31 00:11:25 -08:00
Remi NGUYEN VAN
af8e41c434 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
ffe3d99f91 Merge "Add get last entitlement value callback API"
am: 029be80b79

Change-Id: I1961297c3fa31f5575ae3a11a3fc90d695cb7de5
2019-01-30 23:35:15 -08:00
Mark Chien
029be80b79 Merge "Add get last entitlement value callback API" 2019-01-31 07:23:31 +00:00
markchien
0f45bb9d3d 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
3c766ebc4d 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
d4bdf28a26 Merge "Add an API that allows VPNs to declare themselves as metered."
am: 35200a3b8a

Change-Id: Iadf012754e2e39f4b99efc97d5666dd0bc1ff2d6
2019-01-30 19:09:30 -08:00
Varun Anand
35200a3b8a Merge "Add an API that allows VPNs to declare themselves as metered." 2019-01-31 02:43:25 +00:00
Remi NGUYEN VAN
3efa288531 Merge "Add SystemApi for captive portal metrics"
am: b591097458

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

Change-Id: If3cb37b8fa19dd49b8595622b293886653d7a319
2019-01-30 14:27:01 -08:00
Remi NGUYEN VAN
b591097458 Merge "Add SystemApi for captive portal metrics" 2019-01-30 22:24:12 +00:00
Varun Anand
83759ee94b 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
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