Commit Graph

10216 Commits

Author SHA1 Message Date
Aaron Huang
b9626ecd40 This contains a squash of two changes
>>>>>>>>>>>>>>>>>>>>>>
aosp/1284588
Adjust permission of NetworkProvider related API

- Allow an app holds NETWORK_SETTINGS to acess registerNetworkProvier()
  and unregisterNetworkProvider().
- To access declareNetworkRequestUnfulfillable(), allow an app holds
  MANAGE_TEST_NETWORKS to declare a unfulfillable request that contains
  TRANSPORT_TEST transport.

This makes easier to write cts to test.
>>>>>>>>>>>>>>>>>>>>>>
aosp/1285957
Add cts test for NetworkProvider

It will skip whole tests on Q device since NetworkProvider class
is introduced in R.

Result on Q device would be:
[1/1] android.net.NetworkProviderTest#skippedClassForDevSdkMismatch: IGNORED (3ms)
>>>>>>>>>>>>>>>>>>>>>>
Bug: 153614605
Bug: 153613690
Bug: 153612373
Test: atest FrameworksNetTests
      atest CtsNetTestCases:android.net.NetworkProviderTest
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkProviderTest
Change-Id: Ib6f42b8f0e94e8c2715a030587e065864edff25b
Merged-In: Ic9809e731aa811a51c2f82d189372169d99a5ed9
Merged-In: If7bfc7fae503e3497c37754697d0b148ff4cab3b
(cherry picked from commit 10138d42a8f3892fcdb129a39409efe42873f6fe)
2020-04-17 08:45:29 +00:00
Bruce Chen
22c40575a1 Merge "Add testTransportTypesEqual to dnsmanager test cases" into rvc-dev am: 60afb5ab62
Change-Id: I652f7383c805d0f5fc2274a731f8267336da53ec
2020-04-17 08:30:46 +00:00
Bruce Chen
a1ba33afea [automerger skipped] Merge "Add testTransportTypesEqual to dnsmanager test cases" into rvc-dev am: 60afb5ab62 -s ours
am skip reason: Change-Id I6b23ccc6ce1659fdfd9573dfcd895f2c20fa9417 with SHA-1 01950be123 is in history

Change-Id: Idd90cbeb0b95a28e160a3511f7239eefa51b5a92
2020-04-17 08:30:40 +00:00
Bruce Chen
60afb5ab62 Merge "Add testTransportTypesEqual to dnsmanager test cases" into rvc-dev 2020-04-17 08:25:23 +00:00
Lorenzo Colitti
68b7413eeb Merge "Support changing the NAT64 prefix without removing it." into rvc-dev am: 6f2a54e75e
Change-Id: Id40e2345fceb28434ff612267c0fefb57a85898d
2020-04-17 07:28:32 +00:00
Lorenzo Colitti
59cdea7585 Merge "Add a function to process LinkProperties coming from an agent." into rvc-dev am: 448beb4c26
Change-Id: I69373207be56e00686ce0a789c94104e481c00da
2020-04-17 07:28:10 +00:00
Lorenzo Colitti
5f0041e1a0 [automerger skipped] Merge "Support changing the NAT64 prefix without removing it." into rvc-dev am: 6f2a54e75e -s ours
am skip reason: Change-Id I789fe9d46d3ac5d074ae697d23013f24a9e0246d with SHA-1 7f3d684631 is in history

Change-Id: If5a81dac82fa47a29db835577eaad0cf706b49ba
2020-04-17 07:27:53 +00:00
Lorenzo Colitti
37852de0bc [automerger skipped] Merge "Add a function to process LinkProperties coming from an agent." into rvc-dev am: 448beb4c26 -s ours
am skip reason: Change-Id Ibeeb5f79e8afd3350c935934713d7882f2e0281f with SHA-1 18a58468c4 is in history

Change-Id: Ie2023ad25b1b0b95c05535a6db824e4c2babda9c
2020-04-17 07:27:30 +00:00
Lorenzo Colitti
6f2a54e75e Merge "Support changing the NAT64 prefix without removing it." into rvc-dev 2020-04-17 07:26:08 +00:00
Bruce Chen
4e54d05cbc Add testTransportTypesEqual to dnsmanager test cases
A test that ensures that NetworkCapabilities.TRANSPORT_* is eaual
to IDnsResolver.TRANSPORT_* for every possible value of each.

Bug: 153267602
Test: atest FrameworksNetTests
Merged-In: I6b23ccc6ce1659fdfd9573dfcd895f2c20fa9417
Change-Id: I3dd4ed0d1fcceca9c8aec9b3e6769603e4fa913b
(cherry picked from commit 5f28e6f881e0ea52e8e96c1207654ce44b0d05a1)
2020-04-17 05:25:31 +00:00
Aaron Huang
d584fbb66a Merge changes from topic "cts-networkprovider" am: ab8282eea7 am: 29d37fd0e9
Change-Id: I6aed3e0f92d92897239776b568b8074366c2ed3c
2020-04-17 04:44:46 +00:00
Lorenzo Colitti
5559f1edd9 Add a function to process LinkProperties coming from an agent.
There are tasks that need to be performed when receiving
LinkProperties directly from a NetworkAgent (either at
registration time or in subsequent updates).

Currently, the only example of such a task is calling
ensureDirectlyConnectedRoutes. This is currently done in
handleUpdateLinkProperties, which is often unnecessary,
because that method iscalled in many other cases than when
receiving properties directly from an agent. Ensuring directly
connected routes only needs to be done when receiving
LinkProperties from the agent, because ConnectivityService does
not directly manipulate routes.

This CL does not do much except remove these superfluous calls
and add the method. A future CL will add more code to the method.

Bug: 150648313
Test: atest ConnectivityServiceTest
Merged-In: Ibeeb5f79e8afd3350c935934713d7882f2e0281f
Change-Id: Ibeeb5f79e8afd3350c935934713d7882f2e0281f
2020-04-17 04:43:06 +00:00
Lorenzo Colitti
aa0c7d00cf Support changing the NAT64 prefix without removing it.
This cannot (currently) happen with DNS64 detection, but it can
happen with the PREF64 option.

Bug: 150648313
Test: atest ConnectivityServiceTest Nat464XlatTest --rerun-until-failure 100
Merged-In: I789fe9d46d3ac5d074ae697d23013f24a9e0246d
Change-Id: I789fe9d46d3ac5d074ae697d23013f24a9e0246d
2020-04-17 04:37:26 +00:00
Aaron Huang
29d37fd0e9 Merge changes from topic "cts-networkprovider" am: ab8282eea7
Change-Id: I3e86ba642bc86bb25dc45ef65328c014962c95db
2020-04-17 04:22:29 +00:00
Aaron Huang
ab8282eea7 Merge changes from topic "cts-networkprovider"
* changes:
  Add cts test for NetworkProvider
  Adjust permission of NetworkProvider related API
2020-04-17 03:59:47 +00:00
Bruce Chen
2bbce4526c Merge "Add testTransportTypesEqual to dnsmanager test cases" am: 0e97073a4d am: fe5c71b37f
Change-Id: I0ccca97191773aa77d1c85481d73e0adaf1d0b7a
2020-04-17 03:38:52 +00:00
Bruce Chen
fe5c71b37f Merge "Add testTransportTypesEqual to dnsmanager test cases" am: 0e97073a4d
Change-Id: Idae99c5d19fcffdaf568b79aaa3e1679347ea655
2020-04-17 03:23:18 +00:00
Bruce Chen
0e97073a4d Merge "Add testTransportTypesEqual to dnsmanager test cases" 2020-04-17 02:59:15 +00:00
Junyu Lai
be13787179 [automerger skipped] Merge "[SP27.3] Rename TestableNetworkStatsProvider" am: 9151f7c748 am: acaac38457 -s ours
am skip reason: Change-Id Ifa8175dc4e2fe2b907ec13b3bd2eca12974f5ea7 with SHA-1 09d50fe69d is in history

Change-Id: I5e14eec3e2a8af779c04801e9dabaa312db6ae08
2020-04-17 02:49:22 +00:00
Junyu Lai
acaac38457 Merge "[SP27.3] Rename TestableNetworkStatsProvider" am: 9151f7c748
Change-Id: If3f447e3029c3ccb9a21e00257f596dd690ef55a
2020-04-17 02:26:28 +00:00
Junyu Lai
9151f7c748 Merge "[SP27.3] Rename TestableNetworkStatsProvider" 2020-04-17 02:24:55 +00:00
Lorenzo Colitti
d9f0b86546 Merge "Add a function to process LinkProperties coming from an agent." am: 4cba5a3981 am: a77da57421
Change-Id: I66bc26522eb29666424db507437c83e0ab2a0b4d
2020-04-16 16:49:56 +00:00
Lorenzo Colitti
32dc5cae3c Merge "Support changing the NAT64 prefix without removing it." am: f09bc1734f am: 3813daab0b
Change-Id: I19050527eb41a58c7844972f34e92719d2344c27
2020-04-16 16:49:33 +00:00
Lorenzo Colitti
a77da57421 Merge "Add a function to process LinkProperties coming from an agent." am: 4cba5a3981
Change-Id: I7691b297b27065018e79b1808e35f9a02104a150
2020-04-16 16:38:01 +00:00
Lorenzo Colitti
3813daab0b Merge "Support changing the NAT64 prefix without removing it." am: f09bc1734f
Change-Id: I2616aba51bdad9afa2dddf6011355f14e4b5457e
2020-04-16 16:37:08 +00:00
Lorenzo Colitti
4cba5a3981 Merge "Add a function to process LinkProperties coming from an agent." 2020-04-16 16:25:29 +00:00
Lorenzo Colitti
f09bc1734f Merge "Support changing the NAT64 prefix without removing it." 2020-04-16 16:24:57 +00:00
chenbruce
01950be123 Add testTransportTypesEqual to dnsmanager test cases
A test that ensures that NetworkCapabilities.TRANSPORT_* is eaual
to IDnsResolver.TRANSPORT_* for every possible value of each.

Bug: 153267602
Test: atest FrameworksNetTests
Change-Id: I6b23ccc6ce1659fdfd9573dfcd895f2c20fa9417
2020-04-16 18:04:16 +08:00
Lorenzo Colitti
18a58468c4 Add a function to process LinkProperties coming from an agent.
There are tasks that need to be performed when receiving
LinkProperties directly from a NetworkAgent (either at
registration time or in subsequent updates).

Currently, the only example of such a task is calling
ensureDirectlyConnectedRoutes. This is currently done in
handleUpdateLinkProperties, which is often unnecessary,
because that method iscalled in many other cases than when
receiving properties directly from an agent. Ensuring directly
connected routes only needs to be done when receiving
LinkProperties from the agent, because ConnectivityService does
not directly manipulate routes.

This CL does not do much except remove these superfluous calls
and add the method. A future CL will add more code to the method.

Bug: 150648313
Test: atest ConnectivityServiceTest
Change-Id: Ibeeb5f79e8afd3350c935934713d7882f2e0281f
2020-04-16 16:23:07 +09:00
android-build-team Robot
27e4d106f3 Snap for 6399349 from d1f82dd3d84c78f230177d0c8935f03b6e7df3dc to mainline-release
Change-Id: Iab1e25b6719b5aeec2027b7e86413e42fc65ce9e
2020-04-16 07:12:34 +00:00
Aaron Huang
2bb072d54c Add cts test for NetworkProvider
It will skip whole tests on Q device since NetworkProvider class
is introduced in R.

Result on Q device would be:
[1/1] android.net.NetworkProviderTest#skippedClassForDevSdkMismatch: IGNORED (3ms)

Bug: 153614605
Bug: 153613690
Bug: 153612373
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkProviderTest
Change-Id: If7bfc7fae503e3497c37754697d0b148ff4cab3b
2020-04-16 06:40:20 +00:00
Aaron Huang
ebbfd3ccb9 Adjust permission of NetworkProvider related API
- Allow an app holds NETWORK_SETTINGS to acess registerNetworkProvier()
  and unregisterNetworkProvider().
- To access declareNetworkRequestUnfulfillable(), allow an app holds
  MANAGE_TEST_NETWORKS to declare a unfulfillable request that contains
  TRANSPORT_TEST transport.

This makes easier to write cts to test.

Bug: 153612373
Bug: 153614605
Test: atest FrameworksNetTests
      atest CtsNetTestCases:android.net.NetworkProviderTest
Change-Id: Ic9809e731aa811a51c2f82d189372169d99a5ed9
2020-04-16 14:03:55 +08:00
android-build-team Robot
ab1bbb5b38 Snap for 6398428 from bcb2d73e48ca3d4b1c14b85b055ba20103211896 to rvc-release
Change-Id: I0b5a894f5adc4f7fa731ce128432391d01cbe556
2020-04-16 01:02:25 +00:00
Junyu Lai
f678f57af2 Merge "[SM10] Adopt helper class to monitor RAT type change per sub" into rvc-dev am: dd44555083
Change-Id: I5dd2e734cd8ce6637c39e57a6b302447bc0f295f
2020-04-15 17:26:19 +00:00
Junyu Lai
2ae015277e Merge "[SM10] Adopt helper class to monitor RAT type change per sub" into rvc-dev am: dd44555083
Change-Id: I6cfb8d5a6d1306200d63afa6770df89472bd2f81
2020-04-15 17:26:05 +00:00
Junyu Lai
a9a966c265 Merge "[SP27.3] Rename TestableNetworkStatsProvider" into rvc-dev am: 3db3e009be
Change-Id: I5f1820bc4487bea25b75e1b82365d6833372b0c3
2020-04-15 17:25:21 +00:00
Junyu Lai
6a6e61517d Merge "[SP27.3] Rename TestableNetworkStatsProvider" into rvc-dev am: 3db3e009be
Change-Id: Ice8c64d926e026ebc9d993330a84d57007782a99
2020-04-15 17:24:41 +00:00
Lorenzo Colitti
7f3d684631 Support changing the NAT64 prefix without removing it.
This cannot (currently) happen with DNS64 detection, but it can
happen with the PREF64 option.

Bug: 150648313
Test: atest ConnectivityServiceTest Nat464XlatTest --rerun-until-failure 100
Change-Id: I789fe9d46d3ac5d074ae697d23013f24a9e0246d
2020-04-16 00:07:30 +09:00
Junyu Lai
dd44555083 Merge "[SM10] Adopt helper class to monitor RAT type change per sub" into rvc-dev 2020-04-15 11:49:01 +00:00
junyulai
d8d7916d95 [SP27.3] Rename TestableNetworkStatsProvider
Currently, TestableNetworkStatsProvider is a subclass of
INetworkStatsProvider. This is not very accurate naming after
API council review feedback since now we have
NetworkStatsProvider as a system api interface.

This is the counter-part change of actual renaming CL in
NetworkStack.

Test: atest FrameworksNetTests TetheringTests
Bug: 150643374
Change-Id: Ifa8175dc4e2fe2b907ec13b3bd2eca12974f5ea7
Merged-In: Ifa8175dc4e2fe2b907ec13b3bd2eca12974f5ea7
(cherry-picked from ag/10976522)
2020-04-15 19:01:13 +08:00
Junyu Lai
3db3e009be Merge "[SP27.3] Rename TestableNetworkStatsProvider" into rvc-dev 2020-04-15 10:44:23 +00:00
junyulai
c6081f9c50 [SM10] Adopt helper class to monitor RAT type change per sub
Test: atest NetworkStatsServiceTest
Bug: 146415925
Change-Id: I45c3aa9046b316c8cd0943543d620a22e4afefd1
Merged-In: I45c3aa9046b316c8cd0943543d620a22e4afefd1
(cherry picked from commit 219faff07bdc58c14fe58fc525e86383db1f8167)
2020-04-15 10:30:49 +00:00
android-build-team Robot
9620b4a363 Snap for 6396587 from e47239280fc63c4dde3772beb1e482c02d4b5166 to mainline-release
Change-Id: Ibed5f664412d6c329a4a82550a2d42644d20b6fb
2020-04-15 07:10:08 +00:00
android-build-team Robot
98eea9493e Snap for 6396429 from 7e96fc80873dddf0f9ce6db2ea986ac5b5bf5b4c to rvc-release
Change-Id: I6c44c8dedfc8e8370eb200c3e560a495ad554d9a
2020-04-15 02:11:28 +00:00
Benedict Wong
8e3914c162 Add filtering for IPsec algorithms in IKEv2 VPNs
This commit adds support for validating and filtering IPsec algorithms.
Without a public API exposing IKEv2 algorithms (and their respective
public APIs), the allowedAlgorithms can only filter the proposals for
IPsec (Child) SA algorithms.

Additionally, this removes the HMAC_SHA1 from the IKE SA's integrity
algorithm proposals due to insecurity

Bug: 153701879
Test: FrameworksNetTests passing, new tests added
Change-Id: I7e61a1612692db275b751330af5bacbf86836a8c
2020-04-14 18:07:36 -07:00
android-build-team Robot
68b8ca9373 Snap for 6393130 from bb3e9978110e7be3503e727583b802c813152ed4 to mainline-release
Change-Id: I2208ad19d62feeb20b9953215c11486a3ade7a9a
2020-04-14 07:14:46 +00:00
Chalard Jean
8ec489e448 [automerger skipped] Merge "Add instrumentation to test NetworkAgent." into rvc-dev am: 008a54b355 -s ours
am skip reason: Change-Id Ia83b1c896df63bb18e2aa4b74d6cc09eba990eb5 with SHA-1 be9447be58 is in history

Change-Id: I92c0c3da037eabed28f78c09ffad80074602dd5f
2020-04-14 05:13:38 +00:00
Chalard Jean
1021a87273 Merge "Add instrumentation to test NetworkAgent." into rvc-dev am: 008a54b355
Change-Id: Iadbfaa4dff8effc6c7ece6fd6f3af1a1dc58b7c0
2020-04-14 05:12:48 +00:00
Chalard Jean
008a54b355 Merge "Add instrumentation to test NetworkAgent." into rvc-dev 2020-04-14 04:54:33 +00:00
Chalard Jean
433c8ff695 Merge "Allow testing of signal strength" into rvc-dev am: 4947356664
Change-Id: If926a556bfe9e016254d427a78fa6061e9d2d6e0
2020-04-14 02:52:03 +00:00