Commit graph android_packages_modules_Co.../framework
Message SHA1
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
Implement setNetworkPreferenceForUser.
Test: FrameworksNetTests
Change-Id: I8f18083b5857289892fe8adea5f5ea3f5dbe0809

Chalard Jean   commited 2021-03-16 12:13:46 +00:00
76b0c7efda
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
Merge "[NS01] Add NetworkScore"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-16 06:36:07 +00:00
2a9450c234
Merge "Add ParseException constructors to API"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-16 06:25:16 +00:00
a10ea9b5ee
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

paulhu   commited 2021-03-15 23:06:15 +08:00
ffc4077333
Merge changes from topic "pacproxy-service" am: 87c4904ab2 am: f0392a4704 am: ce43593e5e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553959

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If6d34753e8bf9201e16121b8f3c6c83aa6358986

Aaron Huang   authored and   Automerger Merge Worker   commited 2021-03-15 12:56:09 +00:00
4b86da1a15
Merge changes from topic "pacproxy-service"
* changes:
  Make PacProxyService be a system service
  Revert^2 "Refactor setCurrentProxyScriptUrl to a void method"

Aaron Huang   authored and   Gerrit Code Review   commited 2021-03-15 11:49:45 +00:00
87c4904ab2
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 "Replace InetAddress#parseNumericAddress" am: 2622bfd00a am: 70f311507c am: 8df091c115
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia6f19204d54688ea6af69d503c6dae441ff7afce

Paul Hu   authored and   Automerger Merge Worker   commited 2021-03-15 08:26:28 +00:00
fb32206f12
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 "Replace InetAddress#parseNumericAddress"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-15 07:03:46 +00:00
2622bfd00a
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

Aaron Huang   commited 2021-03-15 14:40:58 +08:00
ed0fe3ecd3
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 "Remove VpnType usage in VpnTransportInfo" am: 8828fc0b65 am: 59ad107b0f am: 2fb1c6649c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629273

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia2c66e0c97bc383237782f6116398b225c26e3ea

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-15 03:30:53 +00:00
228cd067db
Merge "Remove VpnType usage in VpnTransportInfo"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-15 01:52:30 +00:00
8828fc0b65
Add ParseException constructors to API
ParseException constructors are used by both platform and mainline
module code, so they can't be package-private.
Removing dependencies on either side is not possible as the class
itself is part of the public API, and supports APIs on both sides.

Having the constructors part of the API makes the class usable by both
sides.

Fixes: 182705505
Test: CtsNetTestCases for APIs using the exception
Change-Id: Ia396ab2fa3afaed3cf474c8e60f72fc7f3f4fded

Remi NGUYEN VAN   commited 2021-03-15 10:26:02 +09:00
25dcabf72d
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
Remove MessageUtils usage in VpnTransportInfo
MessageUtils is a hidden utility, and including a jarjared copy in
framework-connectivity would add complexity.
It is only used in VpnTransportInfo, where it would parse VPN constants
when the class is loaded in each process. Considering the performance
and maintenance cost using numerical type codes in toString() seems to
be a better tradeoff.

Bug: 177046265
Test: m
Change-Id: Ie71cc816f86e020b44ed1c86349b5c9204dee3cf

Remi NGUYEN VAN   commited 2021-03-14 15:45:14 +09:00
3a87589ff6
Replace InetAddress#parseNumericAddress
-Connectivity is becoming a mainline module in S but mainline
modules are not allowed to use non-formal APIs. Thus, replace
non-formal API InetAddress#parseNumericAddress to
InetAddresses#parseNumericAddress.
- Add deprecated method legacyParseIpAndMask() for IpPrefix and
LinkAddress. Because InetAddresses#parseNumericAddress has
a little different behavior in some case, but these two classes
should keep working as before. So these two classes will use
the new deprecated method.

Bug: 181756157
Test: FrameworksNetTests
Change-Id: I1c96b75f0b8d5e93304a39b4a8c8849964e5e810

paulhu   commited 2021-03-12 19:57:40 +08:00
0494b85ffb
Merge "Remove usage of hidden InetSocketAddress constructor" am: 7e9e7dce89 am: ba744b34b8 am: afcdfff9c6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625901

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia8b76d3c6e18c2c38d86c5c4bd5a75b6a02437a4

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-12 10:45:30 +00:00
65bf3af20b
Merge "Remove hidden @NetworkType in NetworkInfo" am: e01042965a am: 19feee80d0 am: b618bb7728
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628359

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4868ba91efd24c4544dc6ce044e1b76d50c1a611

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-12 10:45:09 +00:00
5bcce41201
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
Merge "Use ParcelDescriptor.fromSocket instead of getFileDescriptor" am: c899c4fee6 am: 3a146b660e am: bb09bdec94
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625439

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I446cca57e6841c923ea89ce8f8eddfd1b8e60b79

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-12 10:43:59 +00:00
b85b9d04f0
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
Remove VpnType usage in VpnTransportInfo
The VpnType annotation is a hidden symbol, and should be
kept hidden as annotations are disallowed by API guidelines.

Remove its usage in VpnTransportInfo as users of annotated constants
that build against API stubs are expected not to use the annotation.

Bug: 173331190
Test: m
Change-Id: I171fa57f6279defad081c3cd16265d58ec55e57d

Remi NGUYEN VAN   commited 2021-03-12 18:30:30 +09:00
9b47fcca83
Merge changes from topics "vcn04", "vcn12" am: 992f747392 am: 4c60c95d3c am: f263dba043
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628400

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3db655c53a855fe418ba5c6fd8230622805966d5

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-03-12 09:07:00 +00:00
c3b7651a0b
Merge "Remove usage of hidden InetSocketAddress constructor"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-12 09:02:15 +00:00
7e9e7dce89
Merge "Remove hidden @NetworkType in NetworkInfo"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-12 08:59:35 +00:00
e01042965a
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
Merge "Use ParcelDescriptor.fromSocket instead of getFileDescriptor"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-12 08:57:47 +00:00
c899c4fee6
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 changes from topics "vcn04", "vcn12"
* changes:
  [VCN12] Expose setSubIds/getSubIds APIs
  [VCN04] Add Subscription Id set into NetworkCapabilities

Junyu Lai   authored and   Gerrit Code Review   commited 2021-03-12 07:12:59 +00:00
992f747392
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 "Remove Slog usage in NetworkState" am: 18cc3dc34f am: c3d9db6ed9 am: 1c38988a79
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628360

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0345579ab38ffd06dc548d7c268f1e2dff2c7b9d

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-12 06:13:59 +00:00
c69d5f1255
Merge "Move ParseException to Connectivity" am: 24162a26ff am: f80b769f4e am: 7ef2e6d731
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626205

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iba0c91e109d04be28dca01c1997e74c06f12f60f

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-12 06:13:12 +00:00
c6f0e0a928
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 "Remove Slog usage in NetworkState"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-12 05:12:26 +00:00
18cc3dc34f
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 "Move ParseException to Connectivity"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-12 04:27:55 +00:00
24162a26ff
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