Commit Graph

265 Commits

Author SHA1 Message Date
Lucas Lin
bdc4e22fe4 Merge "Modify the comment of getPrivateDnsMode" am: 625db39870
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640143

Change-Id: I46131b18e8e09d1c2b7a0b3fe5913511942b7096
2021-03-17 11:54:29 +00:00
Remi NGUYEN VAN
e74de6db5a Merge "Remove usage of networkAttributes" am: adf6d20f8f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1623260

Change-Id: I52a3125843e093c5a7d0d80c2a5c9608b397ea00
2021-03-17 11:51:17 +00:00
Lucas Lin
625db39870 Merge "Modify the comment of getPrivateDnsMode" 2021-03-17 11:25:18 +00:00
Remi NGUYEN VAN
adf6d20f8f Merge "Remove usage of networkAttributes" 2021-03-17 11:24:28 +00:00
Lucas Lin
47984f7022 Merge "Change the parameter type from ContentResolver to Context" am: 253a041a13
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639900

Change-Id: I6a91019bf0b10175885d146e77f98533ad702f8c
2021-03-17 07:02:18 +00:00
lucaslin
debfe6062a Modify the comment of getPrivateDnsMode
Bug: 172183305
Test: m
Change-Id: I2f1b44cf2a362b42f052ea5d34a5cec03d46e661
2021-03-17 14:53:35 +08:00
Lucas Lin
253a041a13 Merge "Change the parameter type from ContentResolver to Context" 2021-03-17 06:35:21 +00:00
Chalard Jean
1f51df82b1 Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441 am: 24a9b5cad6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622621

Change-Id: I641df2f25ba989af597952a03488c817c82323c2
2021-03-17 06:21:55 +00:00
Chalard Jean
24a9b5cad6 Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441
* changes:
  Remove per-user preference when the user is removed
  Expose the enterprise per-profile networking API.
  Implement setNetworkPreferenceForUser.
  Public API for per-profile network preference.
  Add tests for setNetworkPreferenceForUser
2021-03-17 05:48:18 +00:00
Remi NGUYEN VAN
d7bd61b340 Merge "Remove MessageUtils usage in VpnTransportInfo" am: 4ad3ac7de6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635041

Change-Id: If3c85705ecc0d27b9d365b302378329637474a80
2021-03-17 01:04:06 +00:00
Remi NGUYEN VAN
4ad3ac7de6 Merge "Remove MessageUtils usage in VpnTransportInfo" 2021-03-17 00:14:10 +00:00
Junyu Lai
96e1290b7a Merge "[VCN14] Expose registerBestMatchingNetworkCallback" am: 29908cf3c4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635047

Change-Id: I4d475e1a681473c244afe4d3eaaabbcfaa9af9d6
2021-03-16 23:43:07 +00:00
Junyu Lai
67a2b3eb30 Merge "[VCN13] Implement tracking best matching network" am: f98037abb3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633519

Change-Id: I58da6ebe747fe05609d9937814f4d47834418964
2021-03-16 16:39:41 +00:00
junyulai
bd1230675e [VCN14] Expose registerBestMatchingNetworkCallback
Test: m -j doc-comment-check-docs
Bug: 175662146
Change-Id: Ie67dd2f4f8d973de37bc64a03908d7cbb7c2b7ad
2021-03-16 21:30:56 +08:00
junyulai
7664f62d37 [VCN13] Implement tracking best matching network
This is done by:
  1. In requestNetwork, provide a basic permission check.
  2. rematchNetworksAndRequests: no change, since non listen
     requests will be automatically processed to track
     best satisfying network.
  3. applyNetworkReassignment: no change, since non-request
     will not be sent to factories.

Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback_noIssueToFactory
Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback_trackBestNetwork
Bug: 175662146
Change-Id: I8cf4ab334df6812d84cdda160e9b72b6f54062af
2021-03-16 21:30:55 +08:00
Paul Hu
7bd3aa2a13 Merge "Replace interal okhttp APIs" am: 4fe7ff8d1f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622669

Change-Id: I9f4e11b6e2ed2c5c09d7ea38e885de7186871edf
2021-03-16 12:44:35 +00:00
Paul Hu
4fe7ff8d1f Merge "Replace interal okhttp APIs" 2021-03-16 12:18:49 +00:00
Chalard Jean
0a4aefcec2 Expose the enterprise per-profile networking API.
Also unify the listener for Oem settings, which have
never been released as public API (it is slated to be
released in S).

Test: FrameworksNetTests
Change-Id: I84ba363dd0ec03871c37b1c3a31e5557d9aa12e7
2021-03-16 12:14:00 +00:00
Chalard Jean
76b0c7efda Implement setNetworkPreferenceForUser.
Test: FrameworksNetTests
Change-Id: I8f18083b5857289892fe8adea5f5ea3f5dbe0809
2021-03-16 12:13:46 +00:00
Chalard Jean
ad565e26d9 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
lucaslin
e2cd02d9ab Change the parameter type from ContentResolver to Context
Context is more useful than ContentResolver, it can provide more
information if we want to change the behavior in the future.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: I5702c7d74b862a76558b94f1abe2c6df9eb7f097
Merged-In: I5702c7d74b862a76558b94f1abe2c6df9eb7f097
2021-03-16 09:26:57 +00:00
Lucas Lin
3fa2c3e87a Merge "Add comments to describe the value of converting hex to decimal" am: 3453ec5024
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635221

Change-Id: Id012600c0f06b25c90598543a20673e6f515bf29
2021-03-16 09:05:38 +00:00
Lucas Lin
3453ec5024 Merge "Add comments to describe the value of converting hex to decimal" 2021-03-16 08:31:10 +00:00
Lucas Lin
0839a2791b Merge "Have a new API to get private DNS mode" am: b79ae17835
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620860

Change-Id: I2600965b38f3039c0cca1c39d294ad9665aeab17
2021-03-16 08:06:35 +00:00
Lucas Lin
b79ae17835 Merge "Have a new API to get private DNS mode" 2021-03-16 07:39:35 +00:00
Remi NGUYEN VAN
5f161d22cd Remove usage of networkAttributes
networkAttributes is a legacy configuration that is now only used to
configure which legacy type networks are supported, and what the restore
timer is for that network type, for the deprecated
startUsingNetworkFeature API.

Use a dedicated resource for the restore timers, and build supported
legacy network types using hasSystemFeature for wifi, wifi p2p,
bluetooth, proxy types, and TelephonyManager.isDataCapable for the
mobile types.

Bug: 146206136
Test: atest FrameworksNetTests
Change-Id: I3a771d3de6c5e912f18d2834e3a50af797ac4991
2021-03-16 16:01:40 +09:00
Chalard Jean
c8aa29e41e Merge "[NS01] Add NetworkScore" am: 2a9450c234
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556099

Change-Id: I71f1937ffd099283d7f753b843d4cf2a771fe22b
2021-03-16 06:53:52 +00:00
Remi NGUYEN VAN
ff2bca11b2 Merge "Add ParseException constructors to API" am: a10ea9b5ee
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635044

Change-Id: I2eca0681d3a94da26307663d56975327bbd06c6a
2021-03-16 06:49:08 +00:00
Chalard Jean
2a9450c234 Merge "[NS01] Add NetworkScore" 2021-03-16 06:36:07 +00:00
Remi NGUYEN VAN
a10ea9b5ee Merge "Add ParseException constructors to API" 2021-03-16 06:25:16 +00:00
Remi NGUYEN VAN
33674f408b Merge "Create ServiceConnectivityResources" am: d9d976f8f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620871

Change-Id: I91fb801ef2edf64fcaaf082f57eaadb3e7612efa
2021-03-16 03:11:25 +00:00
Remi NGUYEN VAN
d9d976f8f5 Merge "Create ServiceConnectivityResources" 2021-03-16 02:29:31 +00:00
paulhu
ffc4077333 Replace interal okhttp APIs
Connectivity is becoming a mainline module in S but mainline
modules are not allowed to use non-formal APIs. Thus, replace
internal okhttp APIs to stable libcore APIs which are created for
using HttpURLConnectionFactory.

Bug: 182238821
Test: atest FrameworksNetTests
Change-Id: I56ba1b9e6e94f9c6519c3f1c8f0c5993fccbe185
2021-03-15 23:06:15 +08:00
Aaron Huang
f0392a4704 Merge changes from topic "pacproxy-service" am: 87c4904ab2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553959

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I29e9e324f25e584d645900f83d31a00a4e151cbb
2021-03-15 12:12:48 +00:00
Aaron Huang
87c4904ab2 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
lucaslin
c296fccca1 Add comments to describe the value of converting hex to decimal
Bug: 172183305
Test: N/A
Change-Id: Id274295d6c8c97d3014214f875168ff968f79bb6
2021-03-15 09:55:39 +00:00
Chalard Jean
d637272b9c [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
Frank Li
b2a10bfdbd Merge "[CS15]Do not use hidden API of PlatformProperties" am: 08ad593dbb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1623261

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I623fd33e756f9ada6b73f716a30778fd6236f6ae
2021-03-15 08:42:02 +00:00
Frank Li
08ad593dbb Merge "[CS15]Do not use hidden API of PlatformProperties" 2021-03-15 08:01:26 +00:00
Remi NGUYEN VAN
871f91a517 Merge "Revert "Remove connectivity dependency on Preconditions"" am: 310ef3e954
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635220

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7dbcb1e49162210b44bd0cf2204b853c34bb5871
2021-03-15 07:44:21 +00:00
Remi NGUYEN VAN
310ef3e954 Merge "Revert "Remove connectivity dependency on Preconditions"" 2021-03-15 07:30:20 +00:00
Remi NGUYEN VAN
3f0e7dd4e7 Revert "Remove connectivity dependency on Preconditions"
This reverts commit fa5eacc89f.

Reason for revert: Build broken: b/182721112

Change-Id: Ibc84ec6d7900fdcf0bc14cd7036f9c08287711db
2021-03-15 07:27:44 +00:00
Paul Hu
70f311507c Merge "Replace InetAddress#parseNumericAddress" am: 2622bfd00a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8f1112eef6086798a6f089dde2f297828c0b4f2e
2021-03-15 07:06:12 +00:00
Paul Hu
2622bfd00a Merge "Replace InetAddress#parseNumericAddress" 2021-03-15 07:03:46 +00:00
Remi NGUYEN VAN
18925df41b Merge "Remove connectivity dependency on Preconditions" am: 00e1d9ee70
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628399

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3c0c2572ff84a2b163fb2e4e0f3e2cfec043313d
2021-03-15 07:03:36 +00:00
Aaron Huang
ed0fe3ecd3 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
Remi NGUYEN VAN
00e1d9ee70 Merge "Remove connectivity dependency on Preconditions" 2021-03-15 06:36:15 +00:00
lifr
c0d25c19b3 [CS15]Do not use hidden API of PlatformProperties
ConnectivityService is going to become a mainline module, and
it will not able to use hidden method anymore. Using PlatformProperties
as a static library instead of hidden API.

Bug: 170917042
Test: atest FrameworksNetTests
Merged-In: I3a3deca5d2e0f690db8c0061de2db2217376d268
Change-Id: I3a3deca5d2e0f690db8c0061de2db2217376d268
2021-03-15 14:14:18 +08:00
Remi NGUYEN VAN
59ad107b0f Merge "Remove VpnType usage in VpnTransportInfo" am: 8828fc0b65
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629273

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I41431bfba97a6fe0678b9a5dc72b19479d5d4c66
2021-03-15 02:07:39 +00:00
Remi NGUYEN VAN
a239a8e669 Merge "Create a service-connectivity-pre-jarjar library" am: 5d3948005d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625866

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I17ca508f3da731404306d6e65e9743120a7e0860
2021-03-15 02:05:41 +00:00