Commit graph android_packages_modules_Co.../framework/src/android/net/ConnectivityManager.java
Message SHA1
Merge "Expose systemReady for SystemServer" am: 56564e061c am: d77b8f6384 am: a71f7d4697
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640142

Change-Id: I95488b39a32ed9086839eab6c457ed6f75472df1

Lucas Lin   authored and   Automerger Merge Worker   commited 2021-03-18 18:27:08 +00:00
7d528eeee3
Merge "Expose APIs for Settings" am: e584943ca1 am: 65ec6feca0 am: 9ecd16980c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644202

Change-Id: I13a56aa7dcc19efef3dc268fabfa52069360eb18

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-18 18:26:16 +00:00
c93ae1c2a9
Merge "Move constants to MODULE_LIB" am: 8c288603d1 am: 9759496ca0 am: 42e932bc2e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640141

Change-Id: I514f5a3d1a4b1498f58170ac652ede394ddf6aeb

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-18 18:24:57 +00:00
3303b63519
resolve merge conflicts of c85aeee86ec35f9e942e02e7d13450dce47b1325 to sc-dev
Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: Idd5d75e0e9a7ad4f840b88da55d28fbaa2275dd0

Paul Hu   commited 2021-03-18 14:50:05 +00:00
4e8bb42a55
Merge "Expose systemReady for SystemServer"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-18 13:40:54 +00:00
56564e061c
Merge "Expose APIs for Settings"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-03-18 13:27:47 +00:00
e584943ca1
Merge "Move constants to MODULE_LIB"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-18 12:29:38 +00:00
8c288603d1
Merge "Add more connectivity module settings"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-18 12:22:55 +00:00
b998511728
Add multipath preference, background status API
Add APIs for getMultipathPreference and getRestrictBackgroundStatus.
Both are used by Connectivity to back the external
ConnectivityManager.getRestrictBackgroundStatus, and
ConnectivityManager.getMultipathPreference APIs.

Test: atest CtsNetTestCases
      atest ConnectivityServiceTests
      atest NetworkPolicyManagerServiceTest
Bug: 176289731
Change-Id: I8a03162b2f6691086bb64e75ffd354cdfca7f86a

Remi NGUYEN VAN   commited 2021-03-18 06:08:00 +00:00
1fdeb50d9a
Add more connectivity module settings
Add more connectivity module settings and update all references
to ConnectivitySettingsManager.

Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: Ie96fbd0996ed3acb37099b6270bf3d4c2e558e9a

paulhu   commited 2021-03-18 11:58:29 +08:00
c9925e096b
Expose APIs for Settings
ConnectivityManager will be a part of incoming connectivity
mainline. Settings will no longer to access the hidden methods.
For those methods that accept the interaction from users, they
should be exposed as formal interface to allow the
functionality. Expose them to API surface.

Bug: 172183305
Test: make update-api
Change-Id: Id4533b94291766bb060af0091b5ccb81a00630fd

Chiachang Wang   commited 2021-03-18 11:18:56 +08:00
f9294e7cd1
Merge "Remove Protocol.BASE_* usage in Connectivity" am: 5a819fb84d am: 41fe4bfcd4 am: b9a3b1b03b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629266

Change-Id: I0bb7aec183efdeed894447a3b5abc446b9ca46c8

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-17 22:20:59 +00:00
c13ff4aff6
Merge "Modify the comment of getPrivateDnsMode" am: 625db39870 am: bdc4e22fe4 am: afcec9cbfe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640143

Change-Id: I60147e1c828e5d82556e58b67b8f138f63228e8f

Lucas Lin   authored and   Automerger Merge Worker   commited 2021-03-17 22:19:20 +00:00
3fca5b232f
Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441 am: 24a9b5cad6 am: 1f51df82b1 am: 35b284e0ff
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622621

Change-Id: I5fa8e7b8bf35a5464868fdca4d115b3f9132c65f

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-17 22:13:06 +00:00
0f15b90f34
Merge "[VCN14] Expose registerBestMatchingNetworkCallback" am: 29908cf3c4 am: 96e1290b7a am: 71bc2b560d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635047

Change-Id: Ic0cb87f3ac4e9df7b0b6e2d0344c43e66499900e

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-03-17 22:08:56 +00:00
88ee4f1d03
Merge "[VCN13] Implement tracking best matching network" am: f98037abb3 am: 67a2b3eb30 am: 14865c4e07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633519

Change-Id: Ie252014cd9047c27fad3e451b80047493935dc3d

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-03-17 16:08:50 +00:00
b4d8384170
Merge "Add comments to describe the value of converting hex to decimal" am: 3453ec5024 am: 3fa2c3e87a am: 172cce09da
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635221

Change-Id: I0f978fd5fa0283a40db2897478483d680d44e9e9

Lucas Lin   authored and   Automerger Merge Worker   commited 2021-03-17 16:05:47 +00:00
76c10401b5
Merge "[NS01] Add NetworkScore" am: 2a9450c234 am: c8aa29e41e am: 2d07595731
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556099

Change-Id: I953a773f8914152578a98d71b43d0a2e30a51aba

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-17 16:04:22 +00:00
7f2fddf60e
Merge "Remove Protocol.BASE_* usage in Connectivity"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-17 14:53:26 +00:00
5a819fb84d
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

Remi NGUYEN VAN   commited 2021-03-17 20:56:50 +09:00
1b9f03a190
Modify the comment of getPrivateDnsMode
Bug: 172183305
Test: m
Change-Id: I2f1b44cf2a362b42f052ea5d34a5cec03d46e661

lucaslin   commited 2021-03-17 14:53:35 +08:00
debfe6062a
Merge "Change the parameter type from ContentResolver to Context"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-17 06:35:21 +00:00
253a041a13
Expose systemReady for SystemServer
SystemServer cannot call the hidden API of ConnectivityManager
after it becomes a part of mainline module. So expose the hidden
API for SystemServer.

Bug: 182963354
Test: m services
Change-Id: I9c1dc8eb1401dbdc069d5c9fc3992f4c7939b70e

lucaslin   commited 2021-03-17 14:16:55 +08:00
10774b7ebc
Move constants to MODULE_LIB
These constants are used by a MODULE_LIBRARIES API, they should
have the same visibility.

Test: ConnectivityServiceTest
Change-Id: I14cb189d949fe552f463cae3002801fd8cf8230c

Chalard Jean   commited 2021-03-17 14:59:24 +09:00
bef6b09cd9
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

Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-17 05:48:18 +00:00
24a9b5cad6
[VCN14] Expose registerBestMatchingNetworkCallback
Test: m -j doc-comment-check-docs
Bug: 175662146
Change-Id: Ie67dd2f4f8d973de37bc64a03908d7cbb7c2b7ad

junyulai   commited 2021-03-16 21:30:56 +08:00
bd1230675e
[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

junyulai   commited 2021-03-16 21:30:55 +08:00
7664f62d37
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

Chalard Jean   commited 2021-03-16 12:14:00 +00:00
0a4aefcec2
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

Chalard Jean   commited 2021-03-16 12:13:27 +00:00
ad565e26d9
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

lucaslin   authored and   Lucas Lin   commited 2021-03-16 09:26:57 +00:00
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

lucaslin   commited 2021-03-16 17:25:28 +08:00
2a4c17c3b3
Merge "Add comments to describe the value of converting hex to decimal"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-16 08:31:10 +00:00
3453ec5024
Merge "Have a new API to get private DNS mode"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-16 07:39:35 +00:00
b79ae17835
Add comments to describe the value of converting hex to decimal
Bug: 172183305
Test: N/A
Change-Id: Id274295d6c8c97d3014214f875168ff968f79bb6

lucaslin   authored and   Lucas Lin   commited 2021-03-15 09:55:39 +00:00
c296fccca1
[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

Chalard Jean   commited 2021-03-15 09:49:47 +00:00
d637272b9c
Merge "Revert "Remove connectivity dependency on Preconditions"" am: 310ef3e954 am: 871f91a517 am: b5437344c6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635220

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I04b48a4afef8d62d1368f5c7f7d907cb5e12c82e

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-15 08:26:55 +00:00
6f8207999e
Merge "Remove connectivity dependency on Preconditions" am: 00e1d9ee70 am: 18925df41b am: 4879735886
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628399

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia618516b1cd0096b9550dea38703bde3692915cf

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-15 08:25:36 +00:00
90efff4cf0
Merge "Revert "Remove connectivity dependency on Preconditions""
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-15 07:30:20 +00:00
310ef3e954
Revert "Remove connectivity dependency on Preconditions"
This reverts commit fa5eacc89f.

Reason for revert: Build broken: b/182721112

Change-Id: Ibc84ec6d7900fdcf0bc14cd7036f9c08287711db

Remi NGUYEN VAN   commited 2021-03-15 07:27:44 +00:00
3f0e7dd4e7
Merge "Remove connectivity dependency on Preconditions"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-15 06:36:15 +00:00
00e1d9ee70
Merge "Have a new API to get private DNS mode" into sc-dev
Lucas Lin   authored and   Android (Google) Code Review   commited 2021-03-15 01:00:25 +00:00
28f6ce21af
Merge "Remove hidden INVALID_RESOURCE_ID in unused param" am: de66768a6c am: 21c40a1905 am: 2e5256b1a2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628299

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibfe6a57de8deb33fc4a63acdf0ea264d5e506883

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-12 10:44:34 +00:00
335d43f06e
Have a new API to get private DNS mode
- Expose PRIVATE_DNS_MODE_OFF, PRIVATE_DNS_MODE_OPPORTUNISTIC and
PRIVATE_DNS_MODE_PROVIDER_HOSTNAME for external users.
- Since PRIVATE_DNS_DEFAULT_MODE_FALLBACK might be changed from
release to release, so it cannot be exposed as a system API.
Remove PRIVATE_DNS_DEFAULT_MODE_FALLBACK and have a new API -
getPrivateDnsMode() for users to get the private DNS mode instead.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I02a1e91b4eafb5f5df3eada1c07b99849a050c3c
Merged-In: I02a1e91b4eafb5f5df3eada1c07b99849a050c3c

lucaslin   commited 2021-03-12 17:56:09 +08:00
889dcda9c4
Merge "Remove hidden INVALID_RESOURCE_ID in unused param"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-12 08:57:55 +00:00
de66768a6c
Have a new API to get private DNS mode
- Expose PRIVATE_DNS_MODE_OFF, PRIVATE_DNS_MODE_OPPORTUNISTIC and
PRIVATE_DNS_MODE_PROVIDER_HOSTNAME for external users.
- Since PRIVATE_DNS_DEFAULT_MODE_FALLBACK might be changed from
release to release, so it cannot be exposed as a system API.
Remove PRIVATE_DNS_DEFAULT_MODE_FALLBACK and have a new API -
getPrivateDnsMode() for users to get the private DNS mode instead.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCases
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testPrivateDnsPolicy
Change-Id: I02a1e91b4eafb5f5df3eada1c07b99849a050c3c

lucaslin   commited 2021-03-12 16:11:27 +08:00
180f44f0f2
Merge "ConnectivityManager: Provide API's to include location sensitive info" am: a03f3bbf0e am: e0e069d4cf am: 0659f32f4d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1595396

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icf60935623b62e29cb2ba52b4de554c7f0d78ef1

Roshan Pius   authored and   Automerger Merge Worker   commited 2021-03-12 07:12:03 +00:00
926fb37c83
Merge "ConnectivityManager: Provide API's to include location sensitive info"
Roshan Pius   authored and   Gerrit Code Review   commited 2021-03-12 05:56:29 +00:00
a03f3bbf0e
Merge changes Ib80f814f,Ic605e489 am: 3ef74f3cab am: ca62593ba7 am: 7b190776ba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626209

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I47862eeec4f74a0901b8b866dd6ffa906bd9e62f

Lucas Lin   authored and   Automerger Merge Worker   commited 2021-03-12 04:58:40 +00:00
fecca448ba
Merge changes Ib80f814f,Ic605e489
* changes:
  Use new API - getIpSecNetIdRange() in IpSecService
  Add a new API to get the network ID range of IPSec tunnel interface

Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-12 03:30:32 +00:00
3ef74f3cab
ConnectivityManager: Provide API's to include location sensitive info
Existing NetworkCallback users will get NetworkCapabilities with
location sensitive data removed (except for ownerUid which will be
added for existing apps for backwards compatibility). Apps
have to opt-in to receive location sensitive data.

Note: This was chosen because WifiInfo is the only TransportInfo tha
has location sensitive info & that was added only in Android 12. If we
choose to default to true, all existings apps retrieving
NetworkCapabilities for wifi networks will be blamed for location access
unnecessarily.

Changes:
i) Add a flag in NetworkCallback creation to retrieve
NetworkCapabilities with location sensitive info in their callback.
(More flags are being planned for NetworkCallback for throttling
callback frequency, etc)
ii) For NetworkCapabilities.getOwnerUid(), we will continue to send the
data for apps targeting older SDK (since this is an existing field and
the new flag defaults location sensitive data to off).

Bug: 156867433
Test: atest android.net
Test: atest com.android.server
Change-Id: If70b5ea6f5c8885f0c353c8df08a826d55fe7f7a

Roshan Pius   commited 2021-03-11 18:27:18 -08:00
e08bc1803c