Commit Graph

2615 Commits

Author SHA1 Message Date
Christopher Lane
4425300440 resolved conflicts for merge of 381ac080 to master am: 70cafe1b52
Original change: undetermined

Change-Id: If8f1d6522e00c087356a5ad6ea8a4b494ade54bd
2021-05-31 07:14:51 +00:00
paulhu
68aacb407a Update allowed on restricted networks getter/setter
As API review feedback, setting allowed on restricted networks
should be by uid instead of package name for security reason.
Thus, update the getter/setter to return/accept set of uids.

Bug: 188085693
Test: atest FrameworksNetTests
Ignore-AOSP-First: Needs cherry-picks
Change-Id: I979bf98075e6c9c0ed7e891582843fddb62643cb
2021-05-26 16:16:57 +08: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
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
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
9a4c06f276 Merge "Add CTS for getAllNetworkStateSnapshots" into sc-dev 2021-05-21 09:36:49 +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
f9d1bbb566 Merge "Add more unit tests for ConnectivityManager S APIs" into sc-dev 2021-05-20 16:32:19 +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
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
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
Remi NGUYEN VAN
1ac0e834c9 Merge "Move config_apf* resources to NetworkStack" into sc-dev 2021-05-19 07:54:19 +00: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
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
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
Treehugger Robot
20d9f4722e Merge "[VCN21.1] Verify capability is not added if specifier is present" 2021-05-18 08:35:06 +00:00
Lorenzo Colitti
ad9c644b6b Add a CTS tests for setIncludeOtherUidNetworks.
Bug: 187921303
Test: test-only change
Ignore-AOSP-First: avoid merge conflicts
Change-Id: I8e259041dad3fb9c38202cbb12b344de15f4101f
2021-05-18 04:43:20 +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
junyulai
f15fb56f73 [VCN21.1] Verify capability is not added if specifier is present
Test: atest NetworkRequestTest#testBypassingVcn
Bug: 176939355
Change-Id: I3fdd7a08ac9fd667633b68dc935abce024dd3a4d
2021-05-17 07:03:53 +00: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
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
TreeHugger Robot
6d13c8325b Merge "Move connectivity test defaults to tests/common" into sc-dev 2021-05-14 10:40:28 +00:00
Mark Chien
540f0d3ce3 Merge "Test mts against last stable api level" am: a59a146b36 am: 9015e276aa am: 726b814899
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1686012

Change-Id: I9d2d08b9c9397c247e2afd54b25a21631233c585
2021-05-14 10:26:06 +00:00
Mark Chien
726b814899 Merge "Test mts against last stable api level" am: a59a146b36 am: 9015e276aa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1686012

Change-Id: I34e9a66e7d603fe71c5ee1591787344e245b70ac
2021-05-14 10:03:22 +00:00
Mark Chien
a59a146b36 Merge "Test mts against last stable api level" 2021-05-14 09:00:11 +00:00
junyulai
c6422b78ea [FUI26] Address comments on aosp/1560408
Test: TH
Bug: 174123988
Change-Id: I949eeb8903e903d8ede90521442b1f917d5cdfeb
2021-05-14 15:57:44 +08:00
Remi NGUYEN VAN
dc56aa2620 Move connectivity test defaults to tests/common
The build file currently holds a single build rule in test/. Move it to
the existing build file in tests/common/Android.bp.

Test: m
Bug: 186628461
Change-Id: I3948c9b46e2647f945a22f16aad493e94fe50b4d
2021-05-14 07:24:53 +00:00
Treehugger Robot
3c5a00a31c Merge "Re-enable check for VpnTransportInfo session ID." am: 6748f93e56 am: c7ea77ce6a am: ad56a81b2d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1705135

Change-Id: I0e4deaccf95ea9422654e85a3fa4df9d6752455e
2021-05-14 06:41:40 +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
Treehugger Robot
ad56a81b2d Merge "Re-enable check for VpnTransportInfo session ID." am: 6748f93e56 am: c7ea77ce6a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1705135

Change-Id: If5ab413d6cea71a3dcc98634d7ad8a11fbd2bbd1
2021-05-14 06:25:15 +00:00
Treehugger Robot
6748f93e56 Merge "Re-enable check for VpnTransportInfo session ID." 2021-05-14 05:58:35 +00:00
Treehugger Robot
e7cbc00b27 Merge "Don't run testRequestBackgroundNetwork in instant app mode" am: 3531b188ce am: e7bb625eaf am: 0d5000dbbd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1695289

Change-Id: Icc5b0fff3d74f3f577e591fcb7046f4c42da558e
2021-05-14 05:09:38 +00:00
Treehugger Robot
0d5000dbbd Merge "Don't run testRequestBackgroundNetwork in instant app mode" am: 3531b188ce am: e7bb625eaf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1695289

Change-Id: Iec0e338d556495c7a2e14b273d8fefad31983dd8
2021-05-14 04:53:58 +00:00
Treehugger Robot
3531b188ce Merge "Don't run testRequestBackgroundNetwork in instant app mode" 2021-05-14 04:09:43 +00:00
Aaron Huang
9ff12842da Rename *Iface* APIs to *Interface*
Address API review feedback, other APIs have been refering to
these as "interface" instead of "iface" so migrate the APIs named
*Iface* to *Interface*.

(cherry-picked from ag/14326779)
Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Merged-In: I38b476e762fb57fa88c4a789092d0af6f5330d80
Change-Id: I38b476e762fb57fa88c4a789092d0af6f5330d80
2021-05-14 11:05:22 +08:00