Commit Graph

260 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
d2f03002c9 Add connectivity protos to framework-connectivity
The protos are built separately by framework-connectivity from framework
protos, keeping only android.net protos for the connectivity jar.

Bug: 171860710
Test: m framework-connectivity.impl
Change-Id: I2c4a37ff2ee9e8efde49885feeafa27dcff7ca2c
2021-03-18 08:07:20 +00:00
Remi NGUYEN VAN
9416eece40 Merge "Add framework-connectivity.impl" am: 0fcb8d6db4 am: 74a87c1b2a am: 6e77056745
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635039

Change-Id: Ief30f77f949669d9b52ae3a6fe84f8db91179841
2021-03-18 04:36:38 +00:00
Remi NGUYEN VAN
74a87c1b2a Merge "Add framework-connectivity.impl" am: 0fcb8d6db4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635039

Change-Id: I9956c78228c2d04e20edf6fee1061861e26978b9
2021-03-18 03:33:42 +00:00
Paul Hu
1ef84e6de6 Merge "Add ConnectivitySettingsManager" am: 3e17e82ab1 am: af229a6c7b am: b43a0ed287
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641759

Change-Id: Ib5ec1f8cc443d1b92215e6ab200fa383d719d053
2021-03-17 22:21:22 +00:00
Remi NGUYEN VAN
a481bd785f Merge "Remove Protocol.BASE_* usage in Connectivity" am: 7ffb87e4ce am: e4a8d2ff33 am: ec5b8f3b24
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629266

Change-Id: I0bb7aec183efdeed894447a3b5abc446b9ca46c8
2021-03-17 22:20:59 +00:00
Lucas Lin
d04269e96d Merge "Modify the comment of getPrivateDnsMode" am: de9a3af4de am: e0e9636048 am: 388c821087
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640143

Change-Id: I60147e1c828e5d82556e58b67b8f138f63228e8f
2021-03-17 22:19:20 +00:00
Chalard Jean
63d9588dca Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441 am: bf97a3ab5e am: ba22df4f9d am: 2d82b40262
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622621

Change-Id: I5fa8e7b8bf35a5464868fdca4d115b3f9132c65f
2021-03-17 22:13:06 +00:00
Remi NGUYEN VAN
8d2f1d6f06 Merge "Remove MessageUtils usage in VpnTransportInfo" am: 0b33d35188 am: e1aa50a18a am: 8248cbc3da
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635041

Change-Id: Ibf1592220cedb387d8edba27a7bbe49a36f42dc0
2021-03-17 22:10:16 +00:00
Junyu Lai
f4cbe4d191 Merge "[VCN14] Expose registerBestMatchingNetworkCallback" am: 29908cf3c4 am: 789f3829a0 am: b77d000812
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635047

Change-Id: Ic0cb87f3ac4e9df7b0b6e2d0344c43e66499900e
2021-03-17 22:08:56 +00:00
Junyu Lai
2ac4e6eee4 Merge "[VCN13] Implement tracking best matching network" am: f98037abb3 am: 4377c5d40c am: b56ee13b44
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633519

Change-Id: Ie252014cd9047c27fad3e451b80047493935dc3d
2021-03-17 16:08:50 +00:00
Paul Hu
082ec98e2a Merge "Replace interal okhttp APIs" am: e3ed08a24d am: c7b4df71f6 am: 970d67d760
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622669

Change-Id: Ida687a8987385ef4525e41e609d7c8fedda9f1da
2021-03-17 16:07:31 +00:00
Lucas Lin
51121bf08f Merge "Add comments to describe the value of converting hex to decimal" am: 26f778d2bd am: dc6444c414 am: 8885169a2e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635221

Change-Id: I0f978fd5fa0283a40db2897478483d680d44e9e9
2021-03-17 16:05:47 +00:00
Chalard Jean
1cda30b0a2 Merge "[NS01] Add NetworkScore" am: 98de10a7a1 am: 18294fcbb3 am: a73e64726f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556099

Change-Id: I953a773f8914152578a98d71b43d0a2e30a51aba
2021-03-17 16:04:22 +00:00
Remi NGUYEN VAN
5a66dd85b2 Merge "Add ParseException constructors to API" am: ef7b38b334 am: 2299e83d12 am: 40078d1567
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635044

Change-Id: I4e4b1f4a70fcfaa43fa9b612e7fbd151093fd8fe
2021-03-17 16:03:23 +00:00
Remi NGUYEN VAN
1142754c99 Add framework-connectivity.impl
The library will be included in the connectivity module APEX when
migrating its sources out of framework-minus-apex.

Bug: 171540887
Test: m
Change-Id: I1595521eaced6e6997c076bb56b06ffdd22a4fa0
2021-03-18 00:29:08 +09:00
Paul Hu
af229a6c7b Merge "Add ConnectivitySettingsManager" am: 3e17e82ab1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641759

Change-Id: I84e3e2eb6f507abf6220b43886f6ab9e1fad4218
2021-03-17 15:27:02 +00:00
Remi NGUYEN VAN
e4a8d2ff33 Merge "Remove Protocol.BASE_* usage in Connectivity" am: 7ffb87e4ce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629266

Change-Id: Ieca69d4ff1d2a7f3b369bb4dcabaa702fbab4594
2021-03-17 15:19:31 +00:00
Paul Hu
3e17e82ab1 Merge "Add ConnectivitySettingsManager" 2021-03-17 14:57:32 +00:00
Remi NGUYEN VAN
7ffb87e4ce Merge "Remove Protocol.BASE_* usage in Connectivity" 2021-03-17 14:53:26 +00:00
Remi NGUYEN VAN
be83a4afc5 Merge "Remove extra comment" 2021-03-17 12:16:09 +00:00
Remi NGUYEN VAN
a711b3f96c Remove Protocol.BASE_* usage in Connectivity
ConnectivityManager and NetworkAgent do not share their handler with any
other component, so there is no reason to use addresses that do not
overlap. Protocol.BASE_* was written to allow for interaction "between
different StateMachine implementations without a conflict", but the
classes do not use StateMachine, and they do not have such interactions.

Bug: 177046265
Test: atest FrameworksNetTests
Change-Id: I18c341d4a2c01cb9559d682a9ad1ff259e6b5855
2021-03-17 20:56:50 +09:00
Remi NGUYEN VAN
eade234e2a Remove extra comment
This fixes a merge conflict with downstream branches due to an
incomplete cherry-pick.

Bug: 171540887
Test: m

Change-Id: I27a8f20f1a1d83b472700648f3f5a68413a76ac3
Merged-In: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
2021-03-17 10:58:08 +00:00
paulhu
1510c9c29f Add ConnectivitySettingsManager
This class is used to manager the connectivity module related
settings.

Bug: 182538166
Test: make
Change-Id: I5e02e719ce0d305d7c8a45fefb850d7b981f07eb
2021-03-17 18:24:16 +08:00
lucaslin
73c9860a06 Modify the comment of getPrivateDnsMode
Bug: 172183305
Test: m
Change-Id: I2f1b44cf2a362b42f052ea5d34a5cec03d46e661
2021-03-17 14:53:35 +08:00
Lucas Lin
8d638d9434 Merge "Change the parameter type from ContentResolver to Context" 2021-03-17 06:35:21 +00:00
Chalard Jean
bf97a3ab5e 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
Lucas Lin
576f7c849f Merge "Change the parameter type from ContentResolver to Context" into sc-dev 2021-03-17 03:27:28 +00:00
Remi NGUYEN VAN
0b33d35188 Merge "Remove MessageUtils usage in VpnTransportInfo" 2021-03-17 00:14:10 +00:00
junyulai
bd62226850 [VCN14] Expose registerBestMatchingNetworkCallback
Test: m -j doc-comment-check-docs
Bug: 175662146
Change-Id: Ie67dd2f4f8d973de37bc64a03908d7cbb7c2b7ad
2021-03-16 21:30:56 +08:00
junyulai
8cae3c748f [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
e3ed08a24d Merge "Replace interal okhttp APIs" 2021-03-16 12:18:49 +00:00
Chalard Jean
cc9ad15cd2 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
9d96818bf2 Implement setNetworkPreferenceForUser.
Test: FrameworksNetTests
Change-Id: I8f18083b5857289892fe8adea5f5ea3f5dbe0809
2021-03-16 12:13:46 +00:00
Chalard Jean
03433057cb 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
1162662032 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
lucaslin
acd3ded007 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
2021-03-16 17:25:28 +08:00
Lucas Lin
26f778d2bd Merge "Add comments to describe the value of converting hex to decimal" 2021-03-16 08:31:10 +00:00
Lucas Lin
11a286c9b5 Merge "Have a new API to get private DNS mode" 2021-03-16 07:39:35 +00:00
Chalard Jean
98de10a7a1 Merge "[NS01] Add NetworkScore" 2021-03-16 06:36:07 +00:00
Remi NGUYEN VAN
ef7b38b334 Merge "Add ParseException constructors to API" 2021-03-16 06:25:16 +00:00
paulhu
e5852fbc9a 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
3519718a56 Merge changes from topic "pacproxy-service" am: 267bebc6a9 am: de062690cc am: 2b89f2ae7f
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
267bebc6a9 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
286330701c 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
dd75352682 [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
Remi NGUYEN VAN
5b5607e0cd Merge "Revert "Remove connectivity dependency on Preconditions"" am: c407499db5 am: 46adcba662 am: d38a017b28
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635220

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I04b48a4afef8d62d1368f5c7f7d907cb5e12c82e
2021-03-15 08:26:55 +00:00
Paul Hu
ffd7c1f14f Merge "Replace InetAddress#parseNumericAddress" am: 67503fefc6 am: 23be8da17e am: 174ffe652c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia6f19204d54688ea6af69d503c6dae441ff7afce
2021-03-15 08:26:28 +00:00
Remi NGUYEN VAN
d92103dfc0 Merge "Remove connectivity dependency on Preconditions" am: 83c34e272a am: b8c6c46986 am: 3ddc646220
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628399

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia618516b1cd0096b9550dea38703bde3692915cf
2021-03-15 08:25:36 +00:00
Remi NGUYEN VAN
c407499db5 Merge "Revert "Remove connectivity dependency on Preconditions"" 2021-03-15 07:30:20 +00:00
Remi NGUYEN VAN
00c531f4e0 Revert "Remove connectivity dependency on Preconditions"
This reverts commit 1c17c88002.

Reason for revert: Build broken: b/182721112

Change-Id: Ibc84ec6d7900fdcf0bc14cd7036f9c08287711db
2021-03-15 07:27:44 +00:00