Commit Graph

6128 Commits

Author SHA1 Message Date
Chalard Jean
d28b0419e7 Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441 am: 3ee9b7f251 am: f468d78fa5 am: 35b284e0ff
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622621

Change-Id: I5fa8e7b8bf35a5464868fdca4d115b3f9132c65f
2021-03-17 22:13:06 +00:00
Chalard Jean
320315ac8c Merge "[NS01] Add NetworkScore" am: 1a645067e5 am: 8cde8bbe9a am: 2d07595731
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556099

Change-Id: I953a773f8914152578a98d71b43d0a2e30a51aba
2021-03-17 16:04:22 +00:00
Chalard Jean
b1cd4d7b9d Public API for per-profile network preference.
This patch defines the API, but does not make it public
yet as there is no implementation yet.

Test: none so far
Change-Id: I854a952dfe35cc80847eb62f522b1667b8e9b8a0
2021-03-16 12:13:27 +00:00
Chalard Jean
1a645067e5 Merge "[NS01] Add NetworkScore" 2021-03-16 06:36:07 +00:00
Aaron Huang
e29f0a55d8 Merge changes from topic "pacproxy-service" am: 16f50075b1 am: 688ae36dcb am: ce43593e5e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553959

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If6d34753e8bf9201e16121b8f3c6c83aa6358986
2021-03-15 12:56:09 +00:00
Aaron Huang
16f50075b1 Merge changes from topic "pacproxy-service"
* changes:
  Make PacProxyService be a system service
  Revert^2 "Refactor setCurrentProxyScriptUrl to a void method"
2021-03-15 11:49:45 +00:00
Chalard Jean
5c4bb91134 [NS01] Add NetworkScore
As attested by numerous TODOs in the code, a new way of
representing network quality and policy is needed instead
of an int.

An int representing the quality of the network requires
all parties using it to know how all other parties are
using it, and implementation details about the decision
algorithm. For all intents and purposes, the selection
is left to individual network factories who try to
achieve a desired result while piecing together all
possible states of the system.

As the number of such cases and desires increases, this
becomes both intractable and unmaintainable. Indeed, at
this time in the codebase nobody can really predict exactly
how a given change in score will affect selection across
the board, and it is essentially impossible to figure out
the behavior of network selection by inspecting the code
because the moving parts are scattered throughout the
entire codebase.

Having an object encapsulating policy and quality values
will let us centralize the selection and make it again
possible to maintain without knowledge of all behaviors
of all network factories. It will also provide better
guarantees of respecting policy, and allow bugfixes that
were not possible before because they'd touch too many
parts of the code.

Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Change-Id: I3185a6412b9b659798faf0c6882699e9c63cc115
2021-03-15 09:49:47 +00:00
Aaron Huang
5d31a15d84 Make PacProxyService be a system service
PacProxyInstaller class is running a thread all the time and is
listening to intent ACTION_PAC_REFRESH so it would be better to
make it be a system service with a manager class PacProxyManager
which is obtained with getSystemService(PacProxyManager.class).
Besides, rename PacProxyInstaller to PacProxyService will
be easier to know it's the service for PacProxyManager.

ConnectivityService is going to be a mainline module and it
needs constructor of PacProxyService to be SystemApi.
However, in current design, it needs to pass a handler and
an int arguments to the constructor which would be difficult
to maintain if just expose the constructor directly.

So, define a listener for the event that the current PAC
proxy has been installed so that the handler and the int
arguments can be removed from the constructor.

Bug: 177035719
Test: FrameworksNetTests
Change-Id: I2abff75ec59a17628ef006aad348c53fadbed076
2021-03-15 14:40:58 +08:00
Cody Kesting
a93e2f9545 Merge "Update Policy Listener API naming." 2021-03-12 21:32:08 +00:00
Cody Kesting
8b0d028c2c Merge "Update Policy Listener API naming." into sc-dev 2021-03-12 19:04:59 +00:00
Remi NGUYEN VAN
f6fdef09ca Merge "Move ParseException to Connectivity" am: cb35ed09da am: 75512d97f8 am: 7ef2e6d731
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626205

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iba0c91e109d04be28dca01c1997e74c06f12f60f
2021-03-12 06:13:12 +00:00
Remi NGUYEN VAN
cb35ed09da Merge "Move ParseException to Connectivity" 2021-03-12 04:27:55 +00:00
Cody Kesting
ae3c3593cb Update Policy Listener API naming.
This CL changes the policy listener API to be
VcnNetworkPolicyChangeListener (it was previously
VcnNetworkPolicyListener) per API Council guidance.

This CL also requires permission NETWORK_FACTORY for removing registered
policy listeners.

Bug: 181562364
Test: atest FrameworksVcnTests
Change-Id: I026eaefa62d8f64b9180fc182a7cf0605d83bf97
Merged-In: I026eaefa62d8f64b9180fc182a7cf0605d83bf97
(cherry picked from commit a96ec13821)
2021-03-11 09:48:22 -08:00
Remi NGUYEN VAN
c5479a0886 Add Ethernet, TestNetworkSpecifier API
Rename StringNetworkSpecifier to EthernetNetworkSpecifier (its only
production user), and make it module-lib API.
The original StringNetworkSpecifier file is actually kept to satisfy
some invalid dependencies; it will be removed separately.

This allows specifying an Ethernet interface with a non-deprecated API:
until this change the only way to do so would be to use
NetworkRequest#setSpecifier(String), which is deprecated.

Similarly, add the TestNetworkSpecifier API for TestNetworkManager, to
replace previous usage of StringNetworkSpecifier. TestNetworkManager is
module API, so TestNetworkSpecifier should be module API too. This
allows tests to request the test interface specifically, without using
the deprecated NetworkRequest#setSpecifier(String).

Bug: 179329291
Test: m
Merged-In: Iee569f5c8bbdc4bc979610e1191308281f3d4620

Change-Id: Iee569f5c8bbdc4bc979610e1191308281f3d4620
2021-03-11 23:02:02 +08:00
Remi NGUYEN VAN
ebacbf75b4 Move ParseException to Connectivity
ParseException is a public API class used to support Connectivity APIs,
so it should be in the same API surface as connectivity.

Bug: 181512874
Test: m
Change-Id: Ie1213de0d0facc8f409f7b4c2553abb382e4afbf
2021-03-11 17:19:18 +09:00
Lucas Lin
c4d7b9bc36 Merge "Expose TYPE_VPN_* constants" am: d2b8d781f8 am: 1fd78110a4 am: 9c617a1829
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625559

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic2cab78f0920e5805c27b14bef10417d6e018e94
2021-03-11 03:07:13 +00:00
Lucas Lin
d2b8d781f8 Merge "Expose TYPE_VPN_* constants" 2021-03-11 01:30:02 +00:00
lucaslin
62b2252831 Expose TYPE_VPN_* constants
Expose TYPE_VPN_* constants so that connectivity mainline module
can access them.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: Ic8d46a392f3deda5983c52b43585707fa2c98f57
2021-03-10 16:57:57 +08:00
Yan Yan
18f2e80fec Merge changes from topic "ike-params" am: a8d51aac66 am: c9e8841bad am: 417108425e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1608535

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I107255ab19d3407f4d7006a01a9a478daa4136ee
2021-03-10 05:18:08 +00:00
Yan Yan
a8d51aac66 Merge changes from topic "ike-params"
* changes:
  Support converting VcnControlPlaneIkeConfig to/from PersistableBundle
  Support converting IKE Options to/from PersistableBundle
  Support converting IkeConfigRequest to/from PersistableBundle
  Support converting IkeAuthEapConfig to/from PersistableBundle
  Support converting IkeAuthDigitalSignConfig to/from PersistableBundle
  Support converting IkeAuthConfig to/from PersistableBundle
  Support converting IkeSessionParams to/from PersistableBundle
2021-03-10 02:31:36 +00:00
Remi NGUYEN VAN
fe73dc1faf Merge "Remove unused buildNetworkIdentity" am: f182642b86 am: eef71ecf11 am: b61beb575e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622670

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifd1c5f5fc46131f6e5b586b76505e7f666547e96
2021-03-10 00:54:43 +00:00
Cody Kesting
a96ec13821 Update Policy Listener API naming.
This CL changes the policy listener API to be
VcnNetworkPolicyChangeListener (it was previously
VcnNetworkPolicyListener) per API Council guidance.

This CL also requires permission NETWORK_FACTORY for removing registered
policy listeners.

Bug: 181562364
Test: atest FrameworksVcnTests
Change-Id: I026eaefa62d8f64b9180fc182a7cf0605d83bf97
2021-03-09 15:36:11 -08:00
Remi NGUYEN VAN
020348499e Merge "Add Ethernet, TestNetworkSpecifier API" into sc-dev 2021-03-09 22:43:46 +00:00
Remi NGUYEN VAN
7f8fae2b3a Remove unused buildNetworkIdentity
The overload using a NetworkState is now unused.

Bug: 174123988
Change-Id: I22f2d2fffd2d70c08097d3217f01393ff8e75ab5
Test: m
2021-03-09 09:31:21 +00:00
Remi NGUYEN VAN
6d98157012 Add Ethernet, TestNetworkSpecifier API
Rename StringNetworkSpecifier to EthernetNetworkSpecifier (its only
production user), and make it module-lib API.
The original StringNetworkSpecifier file is actually kept to satisfy
some invalid dependencies; it will be removed separately.

This allows specifying an Ethernet interface with a non-deprecated API:
until this change the only way to do so would be to use
NetworkRequest#setSpecifier(String), which is deprecated.

Similarly, add the TestNetworkSpecifier API for TestNetworkManager, to
replace previous usage of StringNetworkSpecifier. TestNetworkManager is
module API, so TestNetworkSpecifier should be module API too. This
allows tests to request the test interface specifically, without using
the deprecated NetworkRequest#setSpecifier(String).

Bug: 179329291
Test: m
Change-Id: Iee569f5c8bbdc4bc979610e1191308281f3d4620
2021-03-09 07:46:48 +00:00
Remi NGUYEN VAN
facfd3bede Merge "Move OemNetworkPreferences to Connectivity" am: 23cca12865 am: 819f20feea am: 8ad13e49a0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620981

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I60a24c0fc878737e120414fe85786faacb425b09
2021-03-08 10:42:05 +00:00
Remi NGUYEN VAN
f9a30cfa4c Move OemNetworkPreferences to Connectivity
The data class supports a ConnectivityManager API, so it should be
together with the ConnectivityManager API surface.

Bug: 181512874
Test: m
Change-Id: I5642486ea0febcb08cadcbd4cd3f0c6056deae0e
2021-03-08 09:26:41 +09:00
Remi NGUYEN VAN
1623f60d39 Merge "Move NetworkState to Connectivity" am: d0355e1be2 am: e878fb157a am: 161b1278f7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620379

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icea1247fd498e8661cb8cba68d34a443004a246d
2021-03-05 12:32:57 +00:00
Junyu Lai
f2a3d989a0 Merge "[FUI23] Remove getNetworkQuotaInfo" am: 0bb7932183 am: 6da7e8ca6c am: 26050067a1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614982

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ideacbf9babef892b5906717ab7778e861a5698bd
2021-03-05 12:31:36 +00:00
Remi NGUYEN VAN
d0355e1be2 Merge "Move NetworkState to Connectivity" 2021-03-05 10:27:57 +00:00
Junyu Lai
0bb7932183 Merge "[FUI23] Remove getNetworkQuotaInfo" 2021-03-05 10:05:06 +00:00
Treehugger Robot
f34a8e1bb2 Merge "[FUI22] Support getAllNetworkStateSnapshot" am: 4c73e05c1d am: 1e1379b245 am: ee3fc01443
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614779

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I52f8339bd1cda35a3f26f28fd3c0165f6f6ff91e
2021-03-05 07:10:46 +00:00
Treehugger Robot
34fe7c1b58 Merge "Make VCN network policy listener oneway" am: dd2877eabe am: 6a95ca0b62 am: 00b31c836d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1619899

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1fce372f232d97b9df5e61c020bcc2932a77292e
2021-03-05 07:07:54 +00:00
Yan Yan
b84834df76 Merge "Revert "Use VERSION_CODES.S instead of VERSION_CODES.R + 1"" am: aef89adfdc am: b331ee3ff7 am: 84047d72cf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1619903

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9c4a57e4a54410dc5a86bdfed009b42c74c088c7
2021-03-05 05:22:50 +00:00
Treehugger Robot
4c73e05c1d Merge "[FUI22] Support getAllNetworkStateSnapshot" 2021-03-05 05:16:43 +00:00
Treehugger Robot
dd2877eabe Merge "Make VCN network policy listener oneway" 2021-03-05 04:25:22 +00:00
Janis Danisevskis
421c5739ea Merge "Keystore 2.0: Make VPN Keystore 2.0 ready." 2021-03-05 02:57:34 +00:00
Yan Yan
aef89adfdc Merge "Revert "Use VERSION_CODES.S instead of VERSION_CODES.R + 1"" 2021-03-05 02:30:21 +00:00
Yan Yan
713ec685cb Revert "Use VERSION_CODES.S instead of VERSION_CODES.R + 1"
This reverts commit 7f13ec417e.

Reason for revert:
1. The BUILD_VERSIONS.S is 1000, and thus it will prevent
   the code from requiring new algorithms on devices whose
   first sdk is 31 (e.g. cuttlefish), though these devices
   should be treated as first launched with SDK S.
2. It will break #testValidationForAlgosAddedInS, because
   the test code is using BUILD_VERSIONS.R to gate the test,
   which is inconsistent with the implementation.

Bug: 181887451
Test: atest IpSecAlgorithmTest
Change-Id: I5cd717c5ebd6086ae5cf9abf76311ae4fca0c6e9
2021-03-05 00:15:15 +00:00
Remi NGUYEN VAN
eb02d4969c Move NetworkState to Connectivity
NetworkState is becoming an internal implementation class, with
NetworkStateSnapshot replacing it as a proper API. Considering this it
belongs inside Connectivity.

Bug: 174123988
Test: m
Change-Id: I201f1a07c50d9da31e33f5c207875da8863ef57c
2021-03-05 08:56:55 +09:00
Yan Yan
f8bce7ede4 Support converting VcnControlPlaneIkeConfig to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(new tests added)
Change-Id: I38d066949d1543dc6b53a9e00ab6c1d1bd820c5f
2021-03-04 14:19:42 -08:00
Yan Yan
3d9908aa99 Support converting IKE Options to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: I28cad3cf4d8ccccb8233f76c631db3a302eb320b
2021-03-04 14:15:57 -08:00
Yan Yan
85414c1c24 Support converting IkeConfigRequest to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: I9a0f7ad91de41749fdf05629bf86bdb010ba13fb
2021-03-04 14:15:42 -08:00
Yan Yan
c3da07fb9c Support converting IkeAuthEapConfig to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: Ifaddd113d9267664404d75b7e4e5410622bf5d7b
2021-03-04 14:13:32 -08:00
Yan Yan
848568a3ce Support converting IkeAuthDigitalSignConfig to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: I62cdf4cb0297a394e0c97973e621b5c051ab0192
2021-03-04 13:30:48 -08:00
Yan Yan
ad1715a7d4 Merge changes I65dbc509,I1e338d9c,Ib4a0ed69,Iac7077b4,I9c53d425, ... am: 067b3dffa4 am: df66b72918 am: a688d224cf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1603710

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I11b6770287f670ec3cd9b53339377f0a4cabf14e
2021-03-04 21:01:31 +00:00
Cody Kesting
229a7dbe28 Merge changes from topic "vcn-status-cb" am: dcaf81ebff am: e37cfaa9f1 am: e4b29c4f11
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1597023

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8a248225ce7c7f8090224c873767330b1202234d
2021-03-04 21:00:54 +00:00
Yan Yan
2f0f6b575c Support converting IkeAuthConfig to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: I97d9a7db423711dbccea412b96f069fe1dbd2779
2021-03-04 12:37:43 -08:00
Yan Yan
067b3dffa4 Merge changes I65dbc509,I1e338d9c,Ib4a0ed69,Iac7077b4,I9c53d425, ...
* changes:
  Support converting IKE ID to/from PersistableBundle
  Support converting EAP-TTLS to/from PersistableBundle
  Support converting EAP-SIM, AKA and AKA' to/from PersistableBundle
  Support converting EapSessionConfig to/from PersistableBundle
  Support converting TunnelModeConfigRequest to/from PersistableBundle
  Support converting TunnelModeChildSessionParams to/from PersistableBundle
  Support converting ChildSaProposal to/from PersistableBundle
  Support converting IkeSaProposal to/from PersistableBundle
2021-03-04 18:30:17 +00:00
Cody Kesting
dcaf81ebff Merge changes from topic "vcn-status-cb"
* changes:
  Call VcnStatusCallback#onVcnStatusChanged on register.
  Remove VcnStatusCallback#onEnteredSafemode().
  Expose APIs for VcnStatusCallback.
2021-03-04 18:09:40 +00:00