Commit Graph

8468 Commits

Author SHA1 Message Date
Lorenzo Colitti
a00f03dd61 Merge "Support learning the NAT64 prefix from two different sources." am: 204b31920f
Change-Id: I8778773dab5f46aec6bf18c83d9766687307ca25
2020-04-20 11:20:58 +00:00
Lorenzo Colitti
204b31920f Merge "Support learning the NAT64 prefix from two different sources." 2020-04-20 11:05:52 +00:00
Lorenzo Colitti
e2eade021a Support learning the NAT64 prefix from two different sources.
The NAT64 prefix from the RA always takes precedence over the
NAT64 prefix from DNS discovery, because it is detected faster,
and detecting it does not require sending any packets.

Bug: 150648313
Test: new unit test
Change-Id: Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902
2020-04-20 16:50:53 +09:00
Aaron Huang
15a2eae782 Merge "Add network agent to enhance NetworkProvider test" am: 147d253956
Change-Id: Ib1b65aec6398f4e6a1cc2e14ec86d669be88ab74
2020-04-20 07:41:36 +00:00
Aaron Huang
147d253956 Merge "Add network agent to enhance NetworkProvider test" 2020-04-20 07:20:25 +00:00
Aaron Huang
54e05b5d08 Merge "Move DhcpInfoTest to frameworks/base/tests/net/common" am: e66ba51271
Change-Id: I7179f2e312d1e8237b211cb60eee5c08cd759197
2020-04-17 14:54:34 +00:00
Aaron Huang
82948ddb1c Move DhcpInfoTest to frameworks/base/tests/net/common
Address comment from aosp/1162443.
Move to FrameworksNetCommonTests so that it can be run in
cts test and presubmit test.

Also change package name from android.net.cts to android.net

Bug: 154299158
Test: atest FrameworksNetTest
      atest CtsNetTestCasesLatestSdk:android.net.DhcpInfoTest
Change-Id: I42a965ae5cb748fdd80b4d5c0f8b26f36f74be72
2020-04-17 18:26:20 +08:00
Aaron Huang
8d2f514530 Add network agent to enhance NetworkProvider test
Add network agent to test more situation that could get the
onNetworkRequested callback.

Bug: 153614605
Bug: 153613690
Bug: 153612373
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkProviderTest
Change-Id: Id494a1697cc1b73e8e56ae585a69faec31c59f52
2020-04-17 17:26:07 +08: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
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
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
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
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
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
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
Chalard Jean
926dbce337 Merge "Allow testing of signal strength" am: 836df36aee
Change-Id: I2300fe5c9be8a781fea67358c5e1774872b29f7c
2020-04-13 17:32:30 +00:00
Chalard Jean
836df36aee Merge "Allow testing of signal strength" 2020-04-13 17:27:06 +00:00
Chalard Jean
6dcb6a943c Merge "Add instrumentation to test NetworkAgent." am: eb1d6593c5
Change-Id: I799ad6fa5d6f1bf522414081bac75c952ad2baf7
2020-04-13 15:05:03 +00:00
Chalard Jean
eb1d6593c5 Merge "Add instrumentation to test NetworkAgent." 2020-04-13 14:47:58 +00:00
Chalard Jean
6b59b8fbcc Allow testing of signal strength
- Let any process with NETWORK_SETTINGS register for signal strength
  wakeup.
- Allow agents registering test networks to assign them a signal
  strength.

Test: NetworkAgentTest
Bug: 139268426
Change-Id: I2b4b89be3e69f4853fd6978d2c8f5c8eb4271f21
2020-04-13 21:55:32 +09:00
Chiachang Wang
3251b09f29 Merge "Add more tests for CaptivePortalData" am: 422052213c
Change-Id: I68aaf60a82227d647dbf3394ae6ec87627426a7e
2020-04-13 10:07:11 +00:00
Chiachang Wang
422052213c Merge "Add more tests for CaptivePortalData" 2020-04-13 09:46:20 +00:00
Chiachang Wang
a59282f5e5 Merge "Move CaptivePortalDataTest to common test to support cts" am: 40c78f06d5
Change-Id: If5a2f476285d3e276d6fdbb695514489de18cb50
2020-04-13 09:12:26 +00:00
Chiachang Wang
d4a9e976e8 Add more tests for CaptivePortalData
Add missing tests to cover all system APIs

Bug: 152280218
Bug: 150640683
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalDataTest on
      both Q and R device
Change-Id: I6d3826922f16816d5b18ed3540266442a0ed3e49
2020-04-13 08:58:48 +00:00
Chiachang Wang
40c78f06d5 Merge "Move CaptivePortalDataTest to common test to support cts" 2020-04-13 08:56:31 +00:00
Chiachang Wang
210a4da6ed Move CaptivePortalDataTest to common test to support cts
Commit has to on top of aosp/1281921 to skip whole test in Q
device since CaptivePortalData class is introduced in R.

Result in Q will be:
[1/1] android.net.CaptivePortalDataTest#skippedClassForDevSdkMismatch: IGNORED

Bug: 152280218
Bug: 150640683
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalDataTest on
      both Q and R device
Change-Id: Iddd00e1c85abe767b1a41a1761d3266ba322dba6
2020-04-13 08:13:04 +00:00
Lorenzo Colitti
c368e9352b Merge "Set transport types to resolver" am: d275ec139a
Change-Id: I26b6e523bbc6ccd6e57a1b30782b74c6c33a7fbb
2020-04-13 07:22:21 +00:00
Lorenzo Colitti
d275ec139a Merge "Set transport types to resolver" 2020-04-13 07:03:20 +00:00
Chalard Jean
be9447be58 Add instrumentation to test NetworkAgent.
Test: NetworkAgentTest, new tests using this API
Bug: 139268426
Change-Id: Ia83b1c896df63bb18e2aa4b74d6cc09eba990eb5
2020-04-13 15:44:07 +09:00
chenbruce
7b2f898a9a Set transport types to resolver
For a given network, resolver doesn't know what transport types are.
Therefore, when a new network is created or transport types are changed
in a give network, transport types will be updated and sent by calling
setResolverConfiguration(). In the same time, if link properties or
transport types are null, setResolverConfiguration() won't be called.
The original behaviors of setResolverConfiguration() aren't changed.
Only increasing one new behavior that when a given network has transport
type change, calling setResolverConfiguration() directly and resolver
updates the transport types for that given network.

Bug: 143732914
Test: atest FrameworksNetTests
      atest FrameworksNetIntegrationTests
Merged-In: I03fc5c62dfd9a51a78a720860531df282fdecc20
Change-Id: I6527cde0e177ba08c886576131b35fc769c2bb53
2020-04-11 23:00:13 +08:00
Hall Liu
98e3a26b78 Merge changes from topic "phonestatelistener-limit-rvc-dev" am: 24e6e442b7
Change-Id: I23df0fed3c46b2aeb3bf561e82460ffc41a6928c
2020-04-11 00:56:02 +00:00
Hall Liu
24e6e442b7 Merge changes from topic "phonestatelistener-limit-rvc-dev"
* changes:
  Add gating, logging for PhoneStateListener's limit
  Institute limit on PhoneStateListener
2020-04-11 00:36:13 +00:00
Xin Li
0a70e4c3d0 Merge "DO NOT MERGE - Merge qt-qpr1-dev-plus-aosp@6382244 into stag-aosp-master" into stage-aosp-master 2020-04-10 18:42:15 +00:00
Treehugger Robot
49021c2c68 Merge "Fix a theoretical NPE" am: e21dccde6b
Change-Id: Idf4cb0acbfb9bc8fef43d42be477778e8ec2fc09
2020-04-10 16:44:25 +00:00
Treehugger Robot
e21dccde6b Merge "Fix a theoretical NPE" 2020-04-10 16:25:07 +00:00
Chalard Jean
35a06972cc Fix a theoretical NPE
Test: NetworkAgentTests
Bug: 153718627
Change-Id: I08f57cce0cd85d5cd66e9a0ef948224290e9200e
2020-04-10 23:08:00 +09:00
Lucas Lin
c42c6af0c6 Merge "Set WifiAwareNetworkInfo into setTransportInfo()" am: 6056ec00bf am: 663817b515
Change-Id: I6ca0f9041b3a3b30ee98a00420c08723c8a57be8
2020-04-09 03:12:57 +00:00
Lucas Lin
663817b515 Merge "Set WifiAwareNetworkInfo into setTransportInfo()" am: 6056ec00bf
Change-Id: Ib99da397256138cb16ce7873df50996e1fe8be1a
2020-04-09 02:53:46 +00:00
lucaslin
311bd48fe8 Set WifiAwareNetworkInfo into setTransportInfo()
Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:NetworkCapabilitiesTest
Change-Id: Ibbe1cd126d6538003fbb1e5e85892bfb15a920e8
Merged-In: Ibbe1cd126d6538003fbb1e5e85892bfb15a920e8
2020-04-08 10:09:16 +00:00
Hall Liu
a85ea98c7a Add gating, logging for PhoneStateListener's limit
Add gating via PlatformCompat and DeviceConfig and logging via
PlatformCompat to the limit instituted on per-process listeners

Fixes: 152074216
Test: atest CtsTelephonyHostCases
Change-Id: I4d6681d90705b68c3349f4124e434a29b50fd3a2
Merged-In: I4d6681d90705b68c3349f4124e434a29b50fd3a2
2020-04-07 17:13:19 -07:00
Junyu Lai
c16786d68d Merge "Fix NetworkStatsApiTest failed on Q device" am: b0104c84f8 am: 5bc64c9683
Change-Id: Icc2e59feaf95ffa002cfbc85f849e87b01af5181
2020-04-07 11:26:44 +00:00