Commit Graph

14477 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
6ae56eaf3f Merge "[NS04] Introduce Network Offers and their callbacks" am: 393e7b3d6a am: 02e05de21f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556102

Change-Id: Ifc7c32e77a4aa7c183b0d074a8d04fe95a54d288
2021-05-13 15:52:52 +00:00
Lorenzo Colitti
ae93b39b60 Merge changes Ia5bc896c,I0c9406f4,I3108ee94 am: e562d167a5 am: 3a22116ce4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1705389

Change-Id: Ie2c28214c2158f49b6282d398ac41038014972bf
2021-05-13 15:51:59 +00:00
markchien
dfa5697a70 Use SettingsShim to hide different implementation in shim
TetheringService call different Settings API to check write settings
permission between R and S.

Bug: 182211575
Test: install S module to R device and both run mts tests build with S
and R.

Ignore-AOSP-First: to address the conflict
Change-Id: I3e7f6525e9776992bd96b17c132b749b12285bbd
2021-05-13 15:49:05 +00:00
Lorenzo Colitti
8f67bdec5a Re-enable check for VpnTransportInfo session ID.
This check was commented out because VpnTransportInfo was not
correctly propagated to ConnectivityService. This is now fixed.

Bug: 183938194
Test: atest CtsNetTestCases:NetworkAgentTest
Change-Id: Iab9987c8b58487ee44d8479b02e030c7e1e4465f
2021-05-14 00:47:55 +09:00
Mark Chien
08b89743de Merge "Fix some TetheringCoverageTest failure" 2021-05-13 15:46:02 +00:00
markchien
ac3e0bb7fc Fix MtsTetheringTest fail to access hidden tethering api problem
E.g. Accessing hidden method
Landroid/net/TetheringManager$TetheringInterfaceRegexps;
->getTetherableWifiRegexs()Ljava/util/List; (blacklist, linking, denied)

Bug: 183459282
Test: atest MtsTetheringTest on both R and S platform
Ignore-AOSP-First: change already in AOSP.

Change-Id: I3c5f08615fcf897fac59f2493be5337f78c2fdc7
2021-05-13 15:44:18 +00:00
Remi NGUYEN VAN
02e05de21f Merge "[NS04] Introduce Network Offers and their callbacks" am: 393e7b3d6a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556102

Change-Id: Ifcdc55f7b202b9fe1ea10c9546c07d4563e9988c
2021-05-13 15:35:10 +00:00
Junyu Lai
b355288839 Merge "No-op Refactoring of startTrackDefaultNetwork" am: 7fecf6a017 am: 784f54eefb am: 2584246084
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1697371

Change-Id: I189d3645845c462dfd7de3ae3190a50f5f726656
2021-05-13 15:31:29 +00:00
Lorenzo Colitti
3a22116ce4 Merge changes Ia5bc896c,I0c9406f4,I3108ee94 am: e562d167a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1705389

Change-Id: I30c22bae1e2df6497483fd863396f2abb6def278
2021-05-13 15:30:59 +00:00
Junyu Lai
5f32284acd Merge "No-op Refactoring of startTrackDefaultNetwork" am: 7fecf6a017 am: 784f54eefb am: 80ccb96458
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1697371

Change-Id: If974c537e869caa6c0f9914b04bc6dc696c76b9c
2021-05-13 15:30:25 +00:00
Remi NGUYEN VAN
cb9c71daf3 Merge "Move connectivity sources to packages/Connectivity" into sc-dev 2021-05-13 15:22:20 +00:00
Remi NGUYEN VAN
393e7b3d6a Merge "[NS04] Introduce Network Offers and their callbacks" 2021-05-13 15:11:45 +00:00
Lorenzo Colitti
e562d167a5 Merge changes Ia5bc896c,I0c9406f4,I3108ee94
* changes:
  Make VcnTransportInfoTest pass on AOSP.
  Immediately redact VcnTransportInfo.
  Do not automatically redact TransportInfo objects.
2021-05-13 15:11:01 +00:00
Junyu Lai
80ccb96458 Merge "No-op Refactoring of startTrackDefaultNetwork" am: 7fecf6a017 am: 784f54eefb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1697371

Change-Id: Ieda8a53749f35b5585488a1a6bd5e20b7891e75d
2021-05-13 15:06:56 +00:00
Junyu Lai
2584246084 Merge "No-op Refactoring of startTrackDefaultNetwork" am: 7fecf6a017 am: 784f54eefb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1697371

Change-Id: I7089860fd3174e87d6ff9e6a4da85025f47d8aec
2021-05-13 15:06:54 +00:00
Paul Hu
940854d668 Merge "Update mobile data preference getter/setter" am: a035d3a77c am: a7d1ee6f5e am: b6527ca6aa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702486

Change-Id: Ib55aaba8c8afc8a3152d83932bf345277bda35f9
2021-05-13 14:53:21 +00:00
Junyu Lai
784f54eefb Merge "No-op Refactoring of startTrackDefaultNetwork" am: 7fecf6a017
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1697371

Change-Id: I3a03e19384ba021aa176f681e7b288f5bde59638
2021-05-13 14:51:34 +00:00
Junyu Lai
7fecf6a017 Merge "No-op Refactoring of startTrackDefaultNetwork" 2021-05-13 14:32:00 +00:00
Paul Hu
b6527ca6aa Merge "Update mobile data preference getter/setter" am: a035d3a77c am: a7d1ee6f5e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702486

Change-Id: I950d4f95759fe17e2164014ab016d39d46ad5539
2021-05-13 14:29:43 +00:00
junyulai
a36f33ef90 [SP35] Pass data warning to tethering offload
This is supported by:
  1. Utilize the new API from both NetworkStatsProvider
     and IOffloadControl to send data warning quota to hardware.
     And pass the warning reached notification back to NPMS.
  2. Disable software solution introduced in R release for
     V1.1+ hardware, since now we can fully offload data warning
     and limit notification to hardware.

Test: atest TetheringTests
Fix: 149467454
Ignore-AOSP-First: avoid long automerger delay
Change-Id: Ie49461694d77ab7f25a549433b01b5b0167bd489
2021-05-13 22:08:10 +08:00
Paul Hu
a7d1ee6f5e Merge "Update mobile data preference getter/setter" am: a035d3a77c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702486

Change-Id: Ieb72b4f0284d5439f62037b9d68da054f276120d
2021-05-13 14:07:56 +00:00
junyulai
6d8da9f72d [SP34] Adapt onSetWarningAndLimit
This is a no-op change that just adapt new API from
NetworkStatsProvider to get warning and limit bytes at the same
time. This change also stores them locally for subsequent
patches to set warning bytes to hardware.

Test: Will be included in the subsequent patch.
Bug: 149467454
Ignore-AOSP-First: avoid long automerger delay
Change-Id: Iec01cb01fd1ce481ce0bd736762baddde1e38084
2021-05-13 21:55:31 +08:00
Paul Hu
a035d3a77c Merge "Update mobile data preference getter/setter" 2021-05-13 13:42:05 +00:00
Chalard Jean
823f81c36e [NS04] Introduce Network Offers and their callbacks
This patch introduces the concept of a network offer that
providers send to Connectivity to register for relevant
requests. This lets them see only requests that they can
hope to satisfy considering their capabilities and score
filters.

This is meant to replace the filtering mechanism currently
implemented by NetworkFactory. The reason for replacing
this mechanism is that the old mechanism does caps and
score filtering on the factory side, which requires these
two filters to be contextless and available system-wide,
including in separate processes from the system server.
These constraints severely limit and complexify in
particular what the score comparisons may look like. In
the past the score comparison was only integer-based,
making the code duplication not much of a problem, but as
this scheme is becoming unsustainable by spreading the
complexity of the selection across the entire stack, a
centralized mechanism is now necessary.

This patch only introduces the new objects and has CS
keep track of them, but does not actually use them yet.
Followup patches will implement the logic of calling
the offer callbacks.

Test: FrameworksNetTests NetworkStackTests FrameworksWifiTests
Bug: 167544279
Merged-In: Idec1fe8eb4ac6f562bf098e3dd470f11024d04f2
(clean cherry-pick)

Change-Id: Idec1fe8eb4ac6f562bf098e3dd470f11024d04f2
2021-05-13 13:20:43 +00:00
Remi NGUYEN VAN
028cb1b7a8 Move connectivity sources to packages/Connectivity
The service-connectivity sources should be in
packages/modules/Connectivity. Move them to
frameworks/base/packages/Connectivity, so that the whole directory can
be moved to the dedicated packages/modules/Connectivity git project.

Bug: 186628461
Test: m
Change-Id: I26d1a274058fa38763ad4f605549d880865b4d76
2021-05-13 12:44:09 +00:00
Remi NGUYEN VAN
0a749753d1 [automerger skipped] Merge "Move net unit tests to packages/Connectivity" am: 5b48156498 am: 47152e05a6 am: 78aa012678 -s ours
am skip reason: Merged-In I254ffd1c08ec058d594b4ea55cbae5505f8497cc with SHA-1 678277cc03 is already in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1706685

Change-Id: I8d08b8919e4b0dc129363e3e715374b22c4a3c0d
2021-05-13 12:08:41 +00:00
Remi NGUYEN VAN
78aa012678 Merge "Move net unit tests to packages/Connectivity" am: 5b48156498 am: 47152e05a6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1706685

Change-Id: Ibe1d2241c37d2945d3e9278948d4fa614f05ae08
2021-05-13 11:51:45 +00:00
Remi NGUYEN VAN
47152e05a6 Merge "Move net unit tests to packages/Connectivity" am: 5b48156498
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1706685

Change-Id: I86852c79cf06a3bc7b7ccaa18d83f70a2043b258
2021-05-13 11:32:36 +00:00
Lorenzo Colitti
a869887d4f Do not automatically redact TransportInfo objects.
Currently, NetworkCapabilities always redacts the TransportInfo
objects it contains whenever a defensive copy is made. This makes
it impossible to make a defensive copy on a TransportInfo
parcelled from another process without redacting it.

Stop redacting by default; instead rely on ConnectivityService
explicitly calling NetworkCapabilities' redacting constructor
when it returns a NetworkCapabilities object to an app via a
callback or synchronous call. This is currently done by
- createWithLocationInfoSanitizedIfNecessaryWhenParceled, which
  is called from callCallbackForRequest, getNetworkCapabilities,
  and getDefaultNetworkCapabilitiesForUser.
- getNetworkCapabilitiesWithoutUids, which is used when sending
  ConnectivityDiagnosticsManager callbacks. In this method,
  unconditionally redact all information, which is what the code
  did previously due to the default redaction setting for empty
  NetworkCapabilities objects being REDACT_ALL.

Bug: 183938194
Test: atest NetworkCapabilitiesTest
Test: atest FrameworksNetTests CtsNetTestCases HostsideVpnTests
Change-Id: I3108ee94cb0930958e071ba678c3554525b0db82
2021-05-13 20:24:19 +09:00
TreeHugger Robot
0b4086c713 Merge "[SP33] Adapt ITetheringOffloadCallback V1.1" into sc-dev 2021-05-13 10:38:33 +00:00
paulhu
344c11661f Update mobile data preference getter/setter
To satisfy OEM's requests, setting mobile data preference
should be by uid. Thus, update the getter/setter to
return/accept set of uids that need to apply mobile data
preference.

Bug: 171872461
Test: atest FrameworksNetTests
Change-Id: Id44efd2a6d820867f4405426c91e65b9ef155898
2021-05-13 10:35:29 +00:00
Chiachang Wang
5199d09ecb Merge "Add test for ConnectivityManager.setGlobalProxy()" am: 78c1663ba3 am: 650927c734 am: 5dc98a0880
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1688272

Change-Id: I98d641ba50a231e59862a7bae039407d7bf70535
2021-05-13 10:25:00 +00:00
Chiachang Wang
49c94c8500 Merge "Add test for ConnectivityManager.setGlobalProxy()" am: 78c1663ba3 am: 650927c734 am: 3fea4fa064
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1688272

Change-Id: I3a50a087f945bb951eb2eaff40838a0bea15e3b9
2021-05-13 10:23:57 +00:00
Chiachang Wang
3fea4fa064 Merge "Add test for ConnectivityManager.setGlobalProxy()" am: 78c1663ba3 am: 650927c734
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1688272

Change-Id: Id68f9718dedfdc294bda304c99e1d84281497e2c
2021-05-13 10:07:37 +00:00
Chiachang Wang
5dc98a0880 Merge "Add test for ConnectivityManager.setGlobalProxy()" am: 78c1663ba3 am: 650927c734
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1688272

Change-Id: I669ec8fe9be1b0f319df22e39a008dc298dfe66e
2021-05-13 10:07:33 +00:00
Chiachang Wang
650927c734 Merge "Add test for ConnectivityManager.setGlobalProxy()" am: 78c1663ba3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1688272

Change-Id: Iaf40a7004a6305ad86b985695bfe4a9ee9038c96
2021-05-13 09:44:29 +00:00
Chiachang Wang
78c1663ba3 Merge "Add test for ConnectivityManager.setGlobalProxy()" 2021-05-13 09:30:25 +00:00
Remi NGUYEN VAN
20f6b445a9 Merge "Move net unit tests to packages/Connectivity" into sc-dev 2021-05-13 09:09:35 +00:00
junyulai
5454e8978e [SP33] Adapt ITetheringOffloadCallback V1.1
This is a no-op change that redirect both V1.0 and V1.1 callback
events to the same handling function. Since the V1.1 callback
is extended from V1.0 callback, we can safely use V1.1
callback for both V1.0 and V1.1 control.

The change also provides interface for subsequent
OffloadController changes to set warning and limit at the
same time.

Test: atest TetheringTests
Bug: 149467454
Ignore-AOSP-First: avoid long automerger delay
Change-Id: I6505a04de8c57357dd1fa9ce898c13395e497816
2021-05-13 16:45:40 +08:00
Remi NGUYEN VAN
31022d6cda Move net unit tests to packages/Connectivity
Move the tests together with packages/Connectivity code, so both can be
moved to packages/modules/Connectivity together.

Also reorganize unit tests in a unit/ directory, as other tests
(integration/, common/ etc.) have been added in tests/net since they
were created. This makes the directory structure consistent.

Test: atest FrameworksNetTests
Bug: 187814163
Merged-In: I254ffd1c08ec058d594b4ea55cbae5505f8497cc

Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
2021-05-13 08:30:33 +00:00
Paul Hu
ec3209227c Merge "Add RESTRICTED_ALLOWED_APPS setting" am: e6d2b4663e am: 7023fe8242 am: 7c3e361c2d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689208

Change-Id: I59c9ff9a64eac6b3367169450ca2c063ef34ff3c
2021-05-13 06:36:18 +00:00
Paul Hu
7c3e361c2d Merge "Add RESTRICTED_ALLOWED_APPS setting" am: e6d2b4663e am: 7023fe8242
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689208

Change-Id: I9a30162499954c4ec3bcd97233256f973662f7ab
2021-05-13 06:19:25 +00:00
junyulai
b95083ea6a No-op Refactoring of startTrackDefaultNetwork
While the actual part that track default request is inside
UpstreamNetworkMonitor, instead of passing it from Tethering,
move it into counter-part CL and use it from
UpstreamNetworkMonitor.

Since the current code is replaced by registerSystemDefaultCallback
in Android S, implement it inside the api30 shim implementation
to provide an unified interface to tethering.

Test: atest TetheringCoverageTests
Bug: 185952829
Change-Id: Iaf21b6b662aa6aba79c2b75379128b8523f81f02
2021-05-13 14:07:40 +08:00
Remi NGUYEN VAN
678277cc03 Move net unit tests to packages/Connectivity
Move the tests together with packages/Connectivity code, so both can be
moved to packages/modules/Connectivity together.

Also reorganize unit tests in a unit/ directory, as other tests
(integration/, common/ etc.) have been added in tests/net since they
were created. This makes the directory structure consistent.

Test: atest FrameworksNetTests
Bug: 187814163
Ignore-AOSP-First: needs per-branch move for merge conflicts
Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
2021-05-13 05:55:44 +00:00
Paul Hu
7023fe8242 Merge "Add RESTRICTED_ALLOWED_APPS setting" am: e6d2b4663e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689208

Change-Id: I93c004e7356559436c7dbd95716e52db8fc1ba0d
2021-05-13 05:54:31 +00:00
paulhu
69afcd51db Add RESTRICTED_ALLOWED_APPS setting
This setting is OEM upstream requirement for third party apps
using restricted networks.

Bug: 185149952
Test: atests FrameworksNetTests
Change-Id: I5e16b46cf2935f38ee1e516bb8b85fa487cf9f61
2021-05-13 10:09:31 +08:00
Lorenzo Colitti
c7b7320f9d Merge changes from topic "transportinfo-explicit-redaction" into sc-dev
* changes:
  Immediately redact VcnTransportInfo.
  Do not automatically redact TransportInfo objects.
2021-05-12 22:46:36 +00:00
Lucas Lin
cbabb00407 [automerger skipped] Merge "Define PRIVATE_DNS_MODE_OPPORTUNISTIC locally" am: d56f4a700b am: 71d233730c am: 2732048e77 -s ours
am skip reason: Merged-In Iafcd861714d8aca44cede658ed630f9d5afd5e59 with SHA-1 75ba4e7873 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1696705

Change-Id: I54a257134e9830cd3809a59f5993cef1118f2e7e
2021-05-12 18:24:14 +00:00
Lucas Lin
5b6ea3329d [automerger skipped] Merge "Update PrivateDnsMode from StringDef to IntDef" am: a23e55da49 am: da89f66c81 am: bd90eed310 -s ours
am skip reason: Merged-In I23e7ec140066979726d769cabc5f7057bb2167e6 with SHA-1 57ee606244 is already in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1675562

Change-Id: I6bf6c1259a83fb9763b286941b7df8fe6e491bcf
2021-05-12 18:24:14 +00:00
Lucas Lin
01613adbe4 [automerger skipped] Merge "Define PRIVATE_DNS_MODE_OPPORTUNISTIC locally" am: d56f4a700b am: 71d233730c am: 97d4f16867 -s ours
am skip reason: Merged-In Iafcd861714d8aca44cede658ed630f9d5afd5e59 with SHA-1 75ba4e7873 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1696705

Change-Id: I9df59f2c0f1604ae72020d47b12f62dd91038b63
2021-05-12 18:22:29 +00:00