Commit Graph

1069 Commits

Author SHA1 Message Date
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
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
TreeHugger Robot
f9d1bbb566 Merge "Add more unit tests for ConnectivityManager S APIs" into sc-dev 2021-05-20 16:32:19 +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
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
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
Chiachang Wang
646af9c067 Merge "Dump only NORMAL priority information if no priority assigned" into sc-dev 2021-05-18 11:57:53 +00:00
Lorenzo Colitti
86714b1fd2 Allow unprivileged NetworkCallbacks to see other UIDs' networks.
Currently, unprivileged apps can call getAllNetworks() to see
all networks on the system, even networks that do not apply to
them. Allow them to do this via NetworkCallbacks as well.

This is the last piece of information that was only available
through getAllNetworks, so this CL deprecates that API.

Bug: 187921303
Test: new unit tests
Test: CTS test in other CL in topic
Change-Id: I30f1021927d3c8eae6525116c61ff4a4acecff6d
2021-05-18 12:24:07 +09:00
Chiachang Wang
12d32a673f Dump only NORMAL priority information if no priority assigned
The legacy design of "dumpsys connectivity" will only dump
information with NORMAL priority. It was updated to provide
both NORMAL and HIGH priority information in order to support
dump in bugreport. However, it will also affect the result
using dumpsys connectivity.

Update design to dump NORMAL priority only to align with legacy
design.

Bug: 188387185
Test: adb shell dumpsys connectivity
Test: adb bugreport and check the result in bugreport
Change-Id: I6825c5038e48e3060c0c3ad1512bd584ef6d10a7
Merged-In: I6825c5038e48e3060c0c3ad1512bd584ef6d10a7
2021-05-18 02:13:42 +00:00
Aaron Huang
1bbb7a7570 Merge "Add ConnectivityAnnotations class" into sc-dev 2021-05-17 14:07:45 +00:00
junyulai
7968fba7ad Check NETWORK_SETTINGS permission for getAllNetworkStateSnapshots
This is declared in the API surface, but the implementation
does not match.

Ignore-AOSP-First: Needs cherry-picks
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testGetAllNetworkStateSnapshots
Bug: 188140631
Change-Id: I97aa69651461ebe5c323ec669372f9a61b84e6a6
2021-05-17 21:53:18 +08:00
junyulai
0f57022302 [FUI29] Migrate ConnectivityService to use getAllNetworkStateSnapshots
Test: atest FrameworksNetTests
Bug: 174123988
Merged-In: I3ba50cbd8a7f60779c69ba85e10dc3cc8a52f8b1
Change-Id: I3ba50cbd8a7f60779c69ba85e10dc3cc8a52f8b1
  (cherry-picked from aosp/1620859)
2021-05-17 14:07:00 +08:00
junyulai
6322aeb7f0 [FUI27] Fix internal naming of notifyNetworkStatus
Test: TH
Bug: 174123988
Merged-In: I970ee365ca221956ee85788005d331374b5fa71a
Change-Id: I970ee365ca221956ee85788005d331374b5fa71a
  (cherry-picked from aosp/1620539)
2021-05-17 14:07:00 +08:00
Jayachandran Chinnakkannu
65a0e0d0e5 Merge "QOS filter matching support based on remote address and port number for connected sockets" am: 6c5553aaaa am: f84276bde1 am: 9896622bd3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1687813

Change-Id: I04ada71bdea2c3851fd6925126f6ff2bfdecad2c
2021-05-14 21:19:17 +00:00
Jayachandran Chinnakkannu
9896622bd3 Merge "QOS filter matching support based on remote address and port number for connected sockets" am: 6c5553aaaa am: f84276bde1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1687813

Change-Id: I6f1d972f822b022995cfdc99942f1167a4f8ef0d
2021-05-14 20:53:05 +00:00
Jayachandran Chinnakkannu
f84276bde1 Merge "QOS filter matching support based on remote address and port number for connected sockets" am: 6c5553aaaa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1687813

Change-Id: Ibd70a86d82d4810425288694f2e3904d471a2d24
2021-05-14 20:28:38 +00:00
Jayachandran Chinnakkannu
6c5553aaaa Merge "QOS filter matching support based on remote address and port number for connected sockets" 2021-05-14 20:02:30 +00:00
Junyu Lai
3239a62913 Merge "[FUI26] Address comments on aosp/1560408" am: 8f03f1e788 am: e5929c073c am: 13bcaf5446
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1618845

Change-Id: I8c62d218953027ee2fb5426ddacae5a6f8bb6c73
2021-05-14 12:20:10 +00:00
Junyu Lai
13bcaf5446 Merge "[FUI26] Address comments on aosp/1560408" am: 8f03f1e788 am: e5929c073c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1618845

Change-Id: If6b9da9ce754f33868305075013b0f82ff64fedb
2021-05-14 12:03:29 +00:00
Junyu Lai
e5929c073c Merge "[FUI26] Address comments on aosp/1560408" am: 8f03f1e788
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1618845

Change-Id: Idde0e161d6241a5c45c0b751e1fca912ed10c7a8
2021-05-14 11:48:14 +00:00
Junyu Lai
8f03f1e788 Merge "[FUI26] Address comments on aosp/1560408" 2021-05-14 11:34:09 +00:00
Paul Hu
5aa8c52638 Merge "Address [set|get]RestrictedAllowedApps API review feedback" am: 16c34f0d8b am: 38544887c7 am: 95f5f547fc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1708327

Change-Id: Ia8e395132226d23fdfb8cd4c93c004c459386104
2021-05-14 11:00:38 +00:00
Paul Hu
95f5f547fc Merge "Address [set|get]RestrictedAllowedApps API review feedback" am: 16c34f0d8b am: 38544887c7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1708327

Change-Id: Iedd6429e956f77ba595f5dd6029c48a487ddbf0c
2021-05-14 10:41:33 +00:00
TreeHugger Robot
6d13c8325b Merge "Move connectivity test defaults to tests/common" into sc-dev 2021-05-14 10:40:28 +00:00
Paul Hu
38544887c7 Merge "Address [set|get]RestrictedAllowedApps API review feedback" am: 16c34f0d8b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1708327

Change-Id: I0c9966c379e956fbf8a01d81d5f1dd0e68662763
2021-05-14 10:25:37 +00:00
Aaron Huang
489b5a96ee [automerger skipped] Merge "Rename *Iface* APIs to *Interface*" am: 7bb6abb413 am: c0ad457264 am: 9dc99ca54b -s ours
am skip reason: Merged-In I38b476e762fb57fa88c4a789092d0af6f5330d80 with SHA-1 a10cc3aa60 is already in history

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

Change-Id: I39709941a1770435d9a2e221025b46eed5d32ea0
2021-05-14 10:07:18 +00:00
Treehugger Robot
5c6bb2dfdb Merge "Reference unreachable netId from INetd" am: 01be14fd53 am: 68413f8a69 am: 3bf71e4e85
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1708326

Change-Id: Ia8db25ba86450341d4b9278eba350014fa3b880c
2021-05-14 10:06:00 +00:00
Paul Hu
16c34f0d8b Merge "Address [set|get]RestrictedAllowedApps API review feedback" 2021-05-14 10:00:39 +00:00
TreeHugger Robot
27ec718008 Merge "Address comments on ag/14486203" into sc-dev 2021-05-14 09:59:43 +00:00
Aaron Huang
9dc99ca54b Merge "Rename *Iface* APIs to *Interface*" am: 7bb6abb413 am: c0ad457264
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1693585

Change-Id: I9aa62677f52ac78916c518d1378a05bda143f676
2021-05-14 09:44:33 +00:00
Aaron Huang
c0ad457264 Merge "Rename *Iface* APIs to *Interface*" am: 7bb6abb413
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1693585

Change-Id: I62fa0403c8b2d78e7e7a90be8ac804576ec27456
2021-05-14 09:36:36 +00:00
Treehugger Robot
3bf71e4e85 Merge "Reference unreachable netId from INetd" am: 01be14fd53 am: 68413f8a69
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1708326

Change-Id: I2f14897dda29c6ea4469952e56a0fa0e1c8a9a8f
2021-05-14 09:36:35 +00:00
Chiachang Wang
ab124bea0c Merge "Replace clearAll with withoutDefaultCapabilities" into sc-dev 2021-05-14 09:32:42 +00:00
Aaron Huang
7bb6abb413 Merge "Rename *Iface* APIs to *Interface*" 2021-05-14 09:11:29 +00:00
Treehugger Robot
68413f8a69 Merge "Reference unreachable netId from INetd" am: 01be14fd53
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1708326

Change-Id: Iedbf9e9b150c95aa0da6a7b20af0dd1412703e2b
2021-05-14 08:39:18 +00:00