Commit Graph

1010 Commits

Author SHA1 Message Date
Chalard Jean
b9e49ec514 Address comments on ag/14486203
Bug: 186458024
Test: comment-only change
Change-Id: I7b086abbb57354086e8fb1a41c63140f2227173f
2021-05-14 17:31:30 +09:00
Chalard Jean
81fc852de2 Merge "Make yield-to-bad-wifi behavior backward compatible with R" into sc-dev 2021-05-14 08:21:27 +00:00
Remi NGUYEN VAN
0d4293db8d [automerger skipped] Merge "Move NetIdManager, ProfileNetworkPreferences" am: e0316b6018 am: 611cf21fd2 am: d116ced363 -s ours
am skip reason: Merged-In I454e8a0a8d0e0f9e6d21a8e8faf5a9e299962ad4 with SHA-1 f19e30d337 is already in history

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

Change-Id: I15d4f795062ca5f44b9291e14c96e7fa6890e98a
2021-05-14 07:26:47 +00:00
Treehugger Robot
7d3f9da1c6 [automerger skipped] Merge "Move connectivity sources to packages/Connectivity" am: b249b941ee am: a69e3de8bb am: 786cd4a19a -s ours
am skip reason: Merged-In I26d1a274058fa38763ad4f605549d880865b4d76 with SHA-1 028cb1b7a8 is already in history

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

Change-Id: Idf91bcf36f6e79ab7f5c91d9939a3b7f742d73dd
2021-05-14 07:26:24 +00:00
Remi NGUYEN VAN
d116ced363 Merge "Move NetIdManager, ProfileNetworkPreferences" am: e0316b6018 am: 611cf21fd2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1705549

Change-Id: I486b0d2759200a5a1bb9679577f5d97ea43c252b
2021-05-14 07:08:58 +00:00
Treehugger Robot
786cd4a19a Merge "Move connectivity sources to packages/Connectivity" am: b249b941ee am: a69e3de8bb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1706845

Change-Id: Ia2b0715ed1f144216c1f64069757bf717a3f083f
2021-05-14 07:08:44 +00:00
Remi NGUYEN VAN
611cf21fd2 Merge "Move NetIdManager, ProfileNetworkPreferences" am: e0316b6018
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1705549

Change-Id: Ib8967ac75b038202430a74276a632b37973ed92b
2021-05-14 06:47:49 +00:00
Treehugger Robot
a69e3de8bb Merge "Move connectivity sources to packages/Connectivity" am: b249b941ee
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1706845

Change-Id: Id619f74f84699c8f63edad37beb63537b7c06b3d
2021-05-14 06:41:07 +00:00
Chalard Jean
6948544a4d Make yield-to-bad-wifi behavior backward compatible with R
Yielding cell wins to exiting wifi (whether good or bad).
It loses to bad wifi that's not exiting.

In R, yielding to bad wifi only affects wifis that are
unvalidated, but a wifi that is exiting should still be
dropped in favor of a cell that yields to bad wifi.

I had misunderstood the policy and implemented it wrong.
Now it's implemented right, and has careful tests.

Test: new tests for this
Bug: 186458024
Change-Id: Ib8637100d491e72a2edb837584ce55b7dda58524
2021-05-14 15:27:12 +09:00
Remi NGUYEN VAN
c71c789184 Move NetIdManager, ProfileNetworkPreferences
Move NetIdManager and ProfileNetworkPreferences from services/core to
packages/Connectivity/service.

This is a partial cherry-pick of a downstream change.

Bug: 186628461
Test: m
Merged-In: I454e8a0a8d0e0f9e6d21a8e8faf5a9e299962ad4
Change-Id: I6734c181dac39518b8d69be1e49d7f5f0a0a18da
2021-05-13 18:18:42 +00:00
Remi NGUYEN VAN
cdb45f8e37 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
Merged-In: I26d1a274058fa38763ad4f605549d880865b4d76
Change-Id: Ie0562db92ebee269b901926d763ae907bde61b98
2021-05-13 18:18:42 +00:00
Remi NGUYEN VAN
e4472e3151 [automerger skipped] Merge "[NS04] Introduce Network Offers and their callbacks" am: 393e7b3d6a am: 02e05de21f am: 6ae56eaf3f -s ours
am skip reason: Merged-In Idec1fe8eb4ac6f562bf098e3dd470f11024d04f2 with SHA-1 d1b498b16d is already in history

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

Change-Id: Idf45cf2f62c4ba2182f00ae2f05c150e0fdb6d21
2021-05-13 17:02:34 +00:00
Lorenzo Colitti
ec2208249c [automerger skipped] Merge changes Ia5bc896c,I0c9406f4,I3108ee94 am: e562d167a5 am: 3a22116ce4 am: ae93b39b60 -s ours
am skip reason: skipped by user lorenzo

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

Change-Id: Icc5d80d32409711650384577150e9d309788b001
2021-05-13 17:01:54 +00:00
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
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
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
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
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
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
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
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
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
Remi NGUYEN VAN
20f6b445a9 Merge "Move net unit tests to packages/Connectivity" into sc-dev 2021-05-13 09:09:35 +00: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
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
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
bd90eed310 Merge "Update PrivateDnsMode from StringDef to IntDef" am: a23e55da49 am: da89f66c81
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1675562

Change-Id: I0b2ad20c59397395175b82688cfe657af43a1b19
2021-05-12 17:59:57 +00:00
Lucas Lin
da89f66c81 Merge "Update PrivateDnsMode from StringDef to IntDef" am: a23e55da49
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1675562

Change-Id: I391d8dd2615f090d3112af69248aea70e334f62f
2021-05-12 17:23:45 +00:00
Lucas Lin
a23e55da49 Merge "Update PrivateDnsMode from StringDef to IntDef" 2021-05-12 17:09:50 +00:00
Chalard Jean
18a5fac66a Merge "Allow any transport with TEST if the network is restricted" am: 6e80f1c182 am: 5fdbf4d6de am: a6b91aafee
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702489

Change-Id: Ib8ee3109ba5525ce1b1c6c2bd5ebcdc0b48a5319
2021-05-12 14:44:30 +00:00
Remi NGUYEN VAN
0ad85e3e5e [automerger skipped] Merge "Use jniThrowErrnoException from JNIHelp" am: 25a08f056f am: e92d0602f1 am: b86c71b25a -s ours
am skip reason: Merged-In I257a9d55ce1f5a7c588e209b4a89d3e7a3e09994 with SHA-1 c1f2d31b39 is already in history

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

Change-Id: Ib3373d0634ceca77672cace31349edb4594fc46e
2021-05-12 14:43:22 +00:00
Remi NGUYEN VAN
7c690119f4 [automerger skipped] Merge "Move NetworkUtils JNI out of core/jni" am: 954385ffac am: 3c157047e2 am: d76107e54f -s ours
am skip reason: Merged-In I0b55dfe92f3cb6e848d79ac7953756f39aaa2597 with SHA-1 c58c993dda is already in history

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

Change-Id: I3724d722bc66d3c54fe1c8cebacc65c3c097e5f8
2021-05-12 14:42:55 +00:00
Remi NGUYEN VAN
85b7ed0848 [automerger skipped] Merge "Build framework-connectivity using module_current" am: eb0961067e am: d1104c9620 am: b51eefe6de -s ours
am skip reason: Merged-In I2d51d37d067bf6fe86e4dedf05855a2dd67ed57c with SHA-1 3b52af9c6e is already in history

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

Change-Id: I4cf3780210515b5849832055c88dd189d7d61177
2021-05-12 14:42:03 +00:00
Chalard Jean
a6b91aafee Merge "Allow any transport with TEST if the network is restricted" am: 6e80f1c182 am: 5fdbf4d6de
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702489

Change-Id: I8b42aa698f279774b8d5781811dc848c7d7ff713
2021-05-12 14:33:13 +00:00
Chalard Jean
5fdbf4d6de Merge "Allow any transport with TEST if the network is restricted" am: 6e80f1c182
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702489

Change-Id: Ic688c9d328242962c57631632b33236a69852ed6
2021-05-12 14:29:56 +00:00
Remi NGUYEN VAN
b86c71b25a Merge "Use jniThrowErrnoException from JNIHelp" am: 25a08f056f am: e92d0602f1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1703087

Change-Id: I52864a1dff894d827e97332ce9ddd506ae297270
2021-05-12 14:25:42 +00:00