Commit Graph

13265 Commits

Author SHA1 Message Date
Bill Yi
01d8b26118 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I43815f54aac23b9f43bfd427b7b18f22c97e0b31
2021-05-24 18:13:23 -07:00
Baligh Uddin
395514fa3d Merge history of packages/Connectivity am: 2afd0986d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14700782

Change-Id: I7507f15a8a7b178035eda8af2345f19baa7267ec
2021-05-24 07:49:35 +00:00
Baligh Uddin
2afd0986d3 Merge history of packages/Connectivity
Modified Visibility / Includes for:
- Tethering/common/TetheringLib/Android.bp

Modified License Import for:
- framework/Android.bp
- service/Android.bp
- tests/common/Android.bp
- tests/deflake/Android.bp
- tests/integration/Android.bp
- tests/smoketest/Android.bp
- tests/unit/Android.bp
- tests/unit/jni/Android.bp
Modified Lint mapping for:
- framework/lint-baseline.xml
- service/lint-baseline.xml

BUG: 186628461
TEST: TH
Merged-In: Ie82d0fb34bda77543e31c82660c6f315efa87f62
Change-Id: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
2021-05-24 04:40:14 +00:00
TreeHugger Robot
958fe9a51d Merge changes I1de322c9,Id0983d4b into sc-dev
* changes:
  Improve IKEv2/IPsec VPN by proposing more IPsec algorithms
  Improve IKEv2/IPsec VPN by proposing more IKE algorithms
2021-05-22 05:05:51 +00:00
TreeHugger Robot
424e2ef3aa Merge "Check location permission for ConnDiags last." into sc-dev 2021-05-22 05:01:18 +00:00
TreeHugger Robot
08bbc34bbe Merge "Use CS identity to update setting while performing factory reset" into sc-dev 2021-05-22 04:59:28 +00:00
Yan Yan
f1ea9b302c Improve IKEv2/IPsec VPN by proposing more IPsec algorithms
This commit allows IKEv2/IPsec VPN to propose more algorithms that
newly added in IpSecAlgorithm. Those new algorithms have stronger
security guarantees and better performances.

This commit also removes algorithm name validation because all
algorithms are URL encoded to ensure no special characters create
problems due to their use by VpnProfile for list or field delimiting
(e.g. rfc7539esp(chacha20,poly1305))

Bug: 185265778
Test: atest FrameworksNetTests, CtsNetTestCases
Test: All new algorithms are manually verified
Change-Id: I1de322c95aacc8924e95bcdbcfdbd1ec441de99c
Merged-In: I1de322c95aacc8924e95bcdbcfdbd1ec441de99c
2021-05-21 23:33:23 +00:00
Mark Chien
eba760b272 Merge "Test tethered callback with TetheringInterface" into sc-dev am: fcda6f1131
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14622456

Change-Id: I12bc874b2c366ae2256a1a72eec5420f19814a8e
2021-05-21 16:26:30 +00:00
Cody Kesting
0b4be0203d Check location permission for ConnDiags last.
This CL updates ConnectivityService to check location permissions for
ConnectivityDiagnostics callbacks last in the permission check process.
This minimizes misattribution of location access for networks that an
app is not administering.

This CL also updates ConnectivityDiagnosticsManager documentation to
clearly state that location permissions are required in order to receive
callbacks.

Bug: 187310575
Test: atest ConnectivityDiagnosticsManagerTest
Test: atest ConnectivityServiceTest
Change-Id: I2dbeddac6273e2392ccaeae51a1c7776d6d3da75
Merged-In: I2dbeddac6273e2392ccaeae51a1c7776d6d3da75
(cherry picked from commit f3d0fc49db)
2021-05-21 16:22:50 +00:00
Mark Chien
fcda6f1131 Merge "Test tethered callback with TetheringInterface" into sc-dev 2021-05-21 16:04:47 +00:00
Junyu Lai
287890574d Merge "Add CTS for getAllNetworkStateSnapshots" into sc-dev am: 9a4c06f276
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14598438

Change-Id: I4b36375873be6cfde8b91ce9c0da3cc60478fb74
2021-05-21 09:53:17 +00:00
Junyu Lai
9a4c06f276 Merge "Add CTS for getAllNetworkStateSnapshots" into sc-dev 2021-05-21 09:36:49 +00:00
Treehugger Robot
fac2a72593 Use CS identity to update setting while performing factory reset
When apps try to call factoryReset to do networking reset, it
will result in updating the setting in SettingsProvider.
ContentProvider will verify if the package name of the caller
that initiated the request being processed on the current thread.
The package should belong to the calling UID. The setting update
started from the ConnectivityService context, so the package will
be android but the calling UID will be the calling app. It will
cause a SecurityException. The behavior is fine previously as its
known caller(Settings) shares system UID. But it will be a
problem for other callers, such as CTS. Thus, clear the identity
since the necessary permission check should be examined at the
top of the method. The following actions should be fine to be
proceed from the system itself. Also replace the user restriction
check via hasUserRestrictionForUser with the UserHandle created
from the calling uid to ensure it's verified with correct user.

Bug: 186061922
Test: Factory reset from Settings
Merged-In: If2dd69f702a1eafff331f9e71f6b92aeadfb715d
Change-Id: If2dd69f702a1eafff331f9e71f6b92aeadfb715d
(cherry picked from commit 10ba4b773b)
2021-05-21 08:01:37 +00:00
Chiachang Wang
0aa413eba7 Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities
Bug: 186061922
Test: atest CtsNetTestCases:android.net.NetworkCapabilitiesTest
Merged-In: I369e71dd6ae85da78e114ea8377967ab0bde787b
Change-Id: I369e71dd6ae85da78e114ea8377967ab0bde787b
(cherry picked from commit 0aa0790dec)
2021-05-21 07:54:46 +00:00
junyulai
3a64e80dee Add CTS for getAllNetworkStateSnapshots
Ignore-AOSP-First: Needs cherry-picks
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testGetAllNetworkStateSnapshots --rerun-until-failure 100
Test: atest
CtsNetTestCasesLatestSdk:android.net.cts.ConnectivityManagerTest on R
device
Bug: 188140631

Change-Id: I573b009bd05bbc0c855aaa6e20cb8ebde6729936
2021-05-21 06:43:31 +00:00
TreeHugger Robot
02619b4b1a Merge "Add CTS for NetworkAgentConfig#setSubscriberId" into sc-dev am: 323a05334b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14639705

Change-Id: I512829ff1fdd642e4c1d5577935c2a835b8ce872
2021-05-21 04:16:39 +00:00
TreeHugger Robot
323a05334b Merge "Add CTS for NetworkAgentConfig#setSubscriberId" into sc-dev 2021-05-21 03:50:11 +00:00
TreeHugger Robot
f9d1bbb566 Merge "Add more unit tests for ConnectivityManager S APIs" into sc-dev 2021-05-20 16:32:19 +00:00
markchien
960e5fa8b0 Fix tethering unit test fail in R am: 6cee9c5e04 am: 2aa768a7e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14660570

Change-Id: Ie7a89af1a6f7c02cfb79c88248f68ea4bd53e61c
2021-05-20 09:39:27 +00:00
markchien
2aa768a7e9 Fix tethering unit test fail in R am: 6cee9c5e04
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14660570

Change-Id: I357e2e93204fb67119e7ec81bcf9020b73912d88
2021-05-20 09:17:20 +00:00
markchien
82f99f95b7 Test tethered callback with TetheringInterface
The old callback only report interface list, new callback could provide
the mapping of interface and type. Replace old callback usage in cts
with new callback and check whether old callback could get the correct
interface list by comparing the result between old and new callback.

Bug: 162920185
Bug: 152203943
Test: atest CtsTetheringTest on S
      atest CtsTetheringTestLatestSdk on R
      atest MtsTetheringTestLatestSdk on S and R
Ignore-AOSP-First: Its dependences CL is not in aosp currently.

Change-Id: I2a0b8c43fb340c3eaed7f0f90464199222a24280
2021-05-20 09:02:39 +00:00
Les Lee
627c446560 Merge "Support to query TYPE_WIFI usage with subscriberId" into sc-dev 2021-05-20 08:55:59 +00:00
Paul Hu
5acfe4933e Merge "Register APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting observer" into sc-dev 2021-05-20 08:45:35 +00:00
markchien
6cee9c5e04 Fix tethering unit test fail in R
The change aosp/1708088 break tethering unit test in R.

Bug: 187946226
Test: atest TetheringTests in R and S
Change-Id: I4eb4b757f6d7cd3458964c81310dcf0687a4f091
Merged-In: I4eb4b757f6d7cd3458964c81310dcf0687a4f091
2021-05-20 14:52:01 +08:00
Junyu Lai
056b6649cd Add CTS for NetworkAgentConfig#setSubscriberId
Ignore-AOSP-First: Needs cherry-picks
Test: atest CtsNetTestCases:android.net.cts.NetworkAgentTest
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkAgentTest
      on R device
Bug: 188140631
Change-Id: I90d47ac9bd0570c0aed19402fa9be4e99e0f8621
2021-05-20 06:07:08 +00:00
Paul Hu
740da160bc Merge "Read APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting from PermissionMonitor" into sc-dev 2021-05-20 05:57:25 +00:00
TreeHugger Robot
6f0f141cd5 Merge "Check NETWORK_SETTINGS permission for getAllNetworkStateSnapshots" into sc-dev 2021-05-20 03:59:55 +00:00
Remi NGUYEN VAN
4c0e93f15b Merge "Remove legacy resources fallback from Connectivity" into sc-dev 2021-05-20 03:03:16 +00:00
Junyu Lai
ffda3053d1 Add more unit tests for ConnectivityManager S APIs
Ignore-AOSP-First: Avoid merge conflict
Test: atest android.net.ConnectivityManagerTest
Bug: 188657173
Change-Id: I33612650eb89486a14fcfc440ba0c357f4bb513c
2021-05-19 15:34:38 +00:00
Les Lee
8a2405cb6d Merge "Add metered filter for API: buildTemplateCarrier" into sc-dev 2021-05-19 14:32:29 +00:00
Junyu Lai
458a60dab5 Merge changes I3ba50cbd,I970ee365 into sc-dev
* changes:
  [FUI29] Migrate ConnectivityService to use getAllNetworkStateSnapshots
  [FUI27] Fix internal naming of notifyNetworkStatus
2021-05-19 12:36:03 +00:00
Junyu Lai
0dc5e2a8a2 Merge "[VCN21] Do not add NOT_VCN_MANAGED capability if specifier is present" into sc-dev 2021-05-19 11:31:39 +00:00
junyulai
35687f5979 [VCN21] Do not add NOT_VCN_MANAGED capability if specifier is present
Test: atest NetworkRequestTest#testBypassingVcn
Fix: 176939355
Fix: 188597540
Merged-In: I98dd3f4652dc067eb5c4666e952db6c854bcbb10
Change-Id: I98dd3f4652dc067eb5c4666e952db6c854bcbb10
  (cherry-picked from aosp/1705390)
2021-05-19 09:52:03 +00:00
Remi NGUYEN VAN
1ac0e834c9 Merge "Move config_apf* resources to NetworkStack" into sc-dev 2021-05-19 07:54:19 +00:00
Remi NGUYEN VAN
1423347938 Remove legacy resources fallback from Connectivity
Stop reading legacy resources as fallback, and only use resources in
ServiceConnectivityResources.

Bug: 185850634
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: I224f1ef9a1a8d6e636c7e9550845ab3e1394d7f3
2021-05-19 12:13:48 +09:00
lesl
f96f02703e Add metered filter for API: buildTemplateCarrier
This CL modifies NetworkTemplate#buildTemplateCarrier to force on
metered carrier network and rename to buildTemplateCarrierMetered.
This method was introduced recently and has no callers.

This method will be used in Settings and NetworkPolicyManagerService
to display and manage data usage on carrier metered networks.

Settings/NetworkPolicyManagerService will use it instead of the existing
method buildTemplateMobileAll method, which only matches metered networks.
That code will change from matching metered mobile networks to matching
metered carrier networks.

Note: The carrier metered network includes metered mobile network and
metered "merged carrier wifi network" that is a specific cerrier wifi network
which provides the same user experience as mobile.

Bug: 176396812
Test: atest -c NetworkTemplateTest
Change-Id: I7196d62bb60844458a6c4b1d94e2baccb71e15cd
Merged-In: I7196d62bb60844458a6c4b1d94e2baccb71e15cd
2021-05-19 02:53:39 +00:00
lesl
cf4a1b59ea Support to query TYPE_WIFI usage with subscriberId
Previous the API ignores subscriberId when network type is WIFI.
Allow caller to call querySummaryXXXX with TYPE: WIFI
+ subscriberId: IMSI to get carrier merged wifi usage which matches the wifi
network with the given IMSI.

Bug: 176396812
Test: atest -c NetworkStatsServiceTest
Change-Id: Ia033521a24e2bb56182d74a41bb2b39710571782
Merged-In: Ia033521a24e2bb56182d74a41bb2b39710571782
2021-05-19 02:53:16 +00:00
Remi NGUYEN VAN
be047e2855 Move config_apf* resources to NetworkStack
The resources are only read by NetworkStack through their respective
ApfCapabilities SystemApi methods.
As the resources are being migrated out of frameworks/base resources
anyway, move them directly to NetworkStack instead of moving them to
ServiceConnectivityResources.

Also test that the framework resources are not overlaid or modified.
This should avoid OEM integration errors where the overlays are kept as
in R, without overlaying the resource in the NetworkStack package.

Bug: 185850634
Test: atest CtsNetTestCases
BYPASS_INCLUSIVE_LANGUAGE_REASON=Need to mention legacy APIs

Merged-In: I7a15ddcad5af11fa307d9dbe3a77b31a1179e5b3
(clean cherry-pick)

Change-Id: I7a15ddcad5af11fa307d9dbe3a77b31a1179e5b3
2021-05-19 11:00:58 +09:00
Mark Chien
53fcccd8da Merge "Add the tethering type to TetheringEventCallback methods" into sc-dev 2021-05-18 14:48:27 +00:00
markchien
9935dbe03e Add the tethering type to TetheringEventCallback methods
Before this change, tethering always report a list of tethered
interfaces and the caller need to use each tethering type's interface
regex to matching tethered list to manual implement the mapping of
tethering type and interface. This change allow caller to get rid of
tethering interface regex.

Bug: 162920185
Bug: 152203943
Test: atest CtsTetheringTest on S
Ignore-AOSP-First: Currently aosp would automerge to mainlne-prod, merge
to sc-dev first to avoid adding new API to mainline-prod

CTS-Coverage-Bug: I already add cts test(ag/14622456), but Lint
still complaint because my cts is under packages/modules/Connectivity/
but it only check whether CL touching platform/cts
Change-Id: I91bcccd676d109c1b974497ac29bd366a41b8899
2021-05-18 14:47:43 +00:00
Paul Hu
206157788c Register APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting observer
PermissionMonitor register APPS_ALLOWED_ON_RESTRICTED_NETWORKS
setting observer to listen setting changed callback. Then update
or revoke permission for those apps.

Bug: 185149952
Test: atest FrameworksNetTests
Merged-In: I4b6a21bd3f47b7bcaac36fcabf1202a5a84a4520
(clean cherry-pick)

Change-Id: I4b6a21bd3f47b7bcaac36fcabf1202a5a84a4520
2021-05-18 14:19:56 +00:00
Paul Hu
deb3f2e7a7 Read APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting from PermissionMonitor
Let PermissionMonitor read APPS_ALLOWED_ON_RESTRICTED_NETWORKS
setting and grant netd system permission to uids whose package
name is listed in setting.

Bug: 185149952
Test: atest FrameworksNetTests
Merged-In: I856b545c0339a262abbe9d432cfda125bc82dc12
(clean cherry-pick)

Change-Id: I856b545c0339a262abbe9d432cfda125bc82dc12
2021-05-18 14:16:57 +00:00
Artur Satayev
f8a1897b29 Merge "Add bootclasspath_fragment." into sc-dev 2021-05-18 14:06:03 +00:00
TreeHugger Robot
255730e200 Merge "Check whether feature is enabled by compare with apex version" into mainline-prod am: 2b5ca309f9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14608089

Change-Id: If82b0f147e3f26813746e7f3c4df11f605bf4a94
2021-05-18 13:26:42 +00:00
TreeHugger Robot
2b5ca309f9 Merge "Check whether feature is enabled by compare with apex version" into mainline-prod 2021-05-18 12:56:16 +00:00
Chiachang Wang
646af9c067 Merge "Dump only NORMAL priority information if no priority assigned" into sc-dev 2021-05-18 11:57:53 +00:00
Treehugger Robot
c831d5a60b Merge "[VCN21.1] Verify capability is not added if specifier is present" am: 20d9f4722e am: 82e910ecc5 am: 68f8081aae
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1705134

Change-Id: Iba23024382a3b9ab8d8f0946eb902c6c3dd19975
2021-05-18 10:16:58 +00:00
Mark Chien
e66481b436 Merge "Check whether feature is enabled by compare with apex version" am: 84a8a13a92 am: c59d6fa12d am: 2d577ad3d2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1708088

Change-Id: Ifcc571196e302245816b663155bc57aabdef542b
2021-05-18 10:16:47 +00:00
Treehugger Robot
68f8081aae Merge "[VCN21.1] Verify capability is not added if specifier is present" am: 20d9f4722e am: 82e910ecc5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1705134

Change-Id: Iefa25664714ee187be4ddc4359afcd0968ab4ecf
2021-05-18 09:56:05 +00:00
Mark Chien
2d577ad3d2 Merge "Check whether feature is enabled by compare with apex version" am: 84a8a13a92 am: c59d6fa12d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1708088

Change-Id: Id993424e895917267ac5ffa43ab3362169c1d37c
2021-05-18 09:56:00 +00:00