Commit Graph

8803 Commits

Author SHA1 Message Date
Chiachang Wang
f0bfba755b Merge "Add more tests for CaptivePortalData" into rvc-dev am: ecbf648b62
Change-Id: I68bf2166d3fafbcab03ec17ea5f134209798e242
2020-04-14 01:21:59 +00:00
Chiachang Wang
02adeaa9c1 Merge "Move CaptivePortalDataTest to common test to support cts" into rvc-dev am: 7448287450
Change-Id: I56149a0d137fa346affd22278a7fbfecbb7b0643
2020-04-14 01:21:16 +00:00
Chiachang Wang
cec556227a 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
Merged-In: I6d3826922f16816d5b18ed3540266442a0ed3e49
(cherry picked from commit d9f9bf34637f699608fa3b919b3c85f3d5514a83)
2020-04-14 01:13:21 +00:00
Chiachang Wang
be79897cb5 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
Merged-In: Iddd00e1c85abe767b1a41a1761d3266ba322dba6
Change-Id: Iddd00e1c85abe767b1a41a1761d3266ba322dba6
2020-04-13 12:50:01 +00:00
TreeHugger Robot
97d89a171a Merge "Set transport types to resolver" into rvc-dev am: 89d243c5c3
Change-Id: I0ee02778a7e2a5bf54ec73edf34fe1a4d98c6ebe
2020-04-11 14:41:01 +00:00
TreeHugger Robot
89d243c5c3 Merge "Set transport types to resolver" into rvc-dev 2020-04-11 14:25:27 +00:00
chenbruce
37a06201f0 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
Change-Id: I6527cde0e177ba08c886576131b35fc769c2bb53
2020-04-11 14:39:59 +08:00
Chalard Jean
567ec866ad Merge "Fix a theoretical NPE" into rvc-dev am: ce6aa16b80
Change-Id: I82c5df71163bfe14a5d0eb6b8fb3628cb67defb6
2020-04-11 05:16:38 +00:00
Treehugger Robot
7d75bc365b Fix a theoretical NPE
Test: NetworkAgentTests
Bug: 153718627

Change-Id: I955b6dac6de48b12696dc640f131f5983ac552df
Merged-In: I08f57cce0cd85d5cd66e9a0ef948224290e9200e
(cherry picked from commit 31492c708746a51f70c74913a4d6cd97bf06ae63, aosp/1284575)
2020-04-11 03:26:27 +00:00
TreeHugger Robot
5e896db967 Merge "Set WifiAwareNetworkInfo into setTransportInfo()" into rvc-dev am: d8a5511b92
Change-Id: Ib40ba2aeb8ed06e4d91a74cf8261af0f5eac2a66
2020-04-08 09:59:54 +00:00
lucaslin
75f688be48 Set WifiAwareNetworkInfo into setTransportInfo()
Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:NetworkCapabilitiesTest
Change-Id: Ibbe1cd126d6538003fbb1e5e85892bfb15a920e8
2020-04-08 08:11:10 +00:00
Lucas Lin
62b8f38312 Merge "Add more tests in NetworkCapabilitiesTest.java" into rvc-dev am: 1f4713bd4f
Change-Id: Iffc785851bd1f84d54ef067ef8e555ba57587b2c
2020-04-08 07:53:43 +00:00
Lucas Lin
1f4713bd4f Merge "Add more tests in NetworkCapabilitiesTest.java" into rvc-dev 2020-04-08 07:40:30 +00:00
lucaslin
7bc3c6f517 Add more tests in NetworkCapabilitiesTest.java
Test deduceRestrictedCapability(), getAdministratorUids(),
setAdministratorUids(), getNetworkSpecifier(), getOwnerUid(),
setLinkDownstreamBandwidthKbps(), setLinkUpstreamBandwidthKbps(),
setSignalStrength() and Builder().

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest
Change-Id: I525941c47b71cd61ee872fd4d71b02a5d3767e21
Merged-In: I90c7a8c47710ea4ad8e8d2682c10440fd7f82270
2020-04-08 07:37:49 +00:00
Junyu Lai
306f1d6506 Merge "Fix NetworkStatsApiTest failed on Q device" into rvc-dev am: dd8bbd4996
Change-Id: I7bc25a66b6d1c50c29ea7810d0ec02f6c783e0b6
2020-04-08 05:56:49 +00:00
Junyu Lai
dd8bbd4996 Merge "Fix NetworkStatsApiTest failed on Q device" into rvc-dev 2020-04-08 05:55:57 +00:00
Chalard Jean
d2949a4c5c Merge "Add trivial dependencies tests for the network stack" into rvc-dev am: 976f35b0fe
Change-Id: I24ed3891a893bf5cc6cc16b3210b2e4264008ce7
2020-04-08 04:37:32 +00:00
Junyu Lai
7192912f3e Fix NetworkStatsApiTest failed on Q device
Currently, the addEntry method is used in constructor of test,
which is not correct since there is no such method in Q devices.

Thus, initialize of NetworkStats variables outside of constructor.

Test: atest NetworkStatsApiTest
Test: atest CtsNetTestCasesLatestSdk:NetworkStatsApiTest on Q device
Bug: 150644692
Change-Id: Ibf2f8118c459a8d7a0992deca8f0f339ccd1bcea
Merged-In: Ibf2f8118c459a8d7a0992deca8f0f339ccd1bcea
(cherry picked from commit ae023a8bbd3a7482fd66547d58759c88e100f207)
2020-04-08 03:13:10 +00:00
Treehugger Robot
ff3c00dda0 Add trivial dependencies tests for the network stack
Test: this
Bug: 153033018

Change-Id: I3e66752ebfb5f4324d897210ce26ddaf67f53228
Merged-In: Ie3c15ed25ef3088d3b9b650ffc7f34f49efa6b81
(cherry picked from commit c79353f2e4a99635bcf6eb9177c971f268f71204, aosp/1275998)
2020-04-07 10:09:10 +00:00
Chalard Jean
93ef311226 Merge "Fix a stupid NPE" into rvc-dev am: 18eb7e5570
Change-Id: I174ea95f65bce63043fb3fbe9f4d5a0839ae566e
2020-04-07 09:35:22 +00:00
Treehugger Robot
25fd4c1695 Fix a stupid NPE
Okay so this is really not a behavior change as it converts an
NPE into an illegal argument exception, but still, that's what
should happen (and that's what the upcoming test actually tests
for).

Test: upcoming NetworkAgentTest
Bug: 139268426
Change-Id: I0d9b8cb8f8dcb587b9430b486b863efb9e9e77ef
Merged-In: I3e17211c03bc74426bf5e2e414ec322d73b0060b
(cherry picked from commit 827d7ceea1e83cca9ba3f6189e20b6780c0194ed, aosp/1277595)
2020-04-07 07:29:10 +00:00
Lorenzo Colitti
5c76aad621 Merge "Refactor the Nat464Xlat function for simplicity." into rvc-dev am: 672da12990
Change-Id: Ia2e41676b853300ba6c8e72827dc9ab2b58da58c
2020-04-07 02:16:23 +00:00
Lorenzo Colitti
672da12990 Merge "Refactor the Nat464Xlat function for simplicity." into rvc-dev 2020-04-07 02:13:33 +00:00
Maciej Zenczykowski
75cb2c3a02 Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." into rvc-dev am: e7d685f488
Change-Id: I4bc61d98c2dea4dd3edad2b3657adf3757ca728a
2020-04-06 23:59:23 +00:00
Lorenzo Colitti
5ce7a7e6e0 Refactor the Nat464Xlat function for simplicity.
This makes the code easier to understand by making state
transitions more explicit. It also makes it easier to address a
TODO to turn the class into a StateMachine.

This should be an exact no-op refactoring. The current cases
covered by the code (all mutually exclusive) are:

1. requiresClat && !isPrefixDiscoveryStarted
   Action: startPrefixDiscovery()
   Equivalent to IDLE && requiresClat, because
   isPrefixDiscoveryStarted returns true for every state except
   IDLE.

2. requiresClat && isPrefixDiscoveryStarted && shouldStartClat
   Action: start()
   Equivalent to DISCOVERING && shouldStartClat,
   because isPrefixDiscoveryStarted is true in DISCOVERING,
   STARTING, and RUNNING, but start() does nothing if mState is
   STARTING or RUNNING.

3. requiresClat && isPrefixDiscoveryStarted && !shouldStartClat
   Action: stop()
   Equivalent to (STARTING or RUNNING) && !shouldStartClat,
   because isPrefixDiscoveryStarted is true in DISCOVERING,
   STARTING, and RUNNING, but stop() does nothing if mState is
   not STARTING or RUNNING.

4. !requiresClat && isStarted
   Action: stop()
   Equivalent to (STARTING or RUNNING) && !requiresClat,
   because isStarted() is only true in STARTING and RUNNING.

5. !requiresClat && !isStarted && isPrefixDiscoveryStarted
   Action: leaveStartedState()
   Equivalent to DISCOVERING && !requiresClat, because
   the only state with isPrefixDiscoveryStarted and !isStarted
   is DISCOVERING.

Also, simplify case #5. In this case, calling leaveStartedState
is superfluous, because in the DISCOVERING state:
- There is no need to call unregisterObserver, since the observer
  is only registered when entering STARTING and is unregistered
  when going back to DISCOVERING or IDLE.
- mIface and mBaseIface don't need to be set to null because they
  are only set to non-null when entering STARTING and nulled out
  when going back to DISCOVERING or IDLE.

Bug: 126113090
Bug: 150648313
Test: covered by existing ConnectivityServiceTest and Nat464XlatTest
Merged-In: Ice536bcb269cc8b040c6e7a72c15d0bc8b5bd235
Change-Id: Ice536bcb269cc8b040c6e7a72c15d0bc8b5bd235
2020-04-06 15:46:38 +00:00
Lorenzo Colitti
b5a18f3d93 Rename the *Nat64Prefix to *Nat64PrefixFromDns.
This just a rename with no functional changes at all. It is
preparation for supporting getting the NAT64 prefix from the
RA.

Bug: 150648313
Test: covered by existing ConnectivityServiceTest and Nat464XlatTest
Merged-In: Ia9a09a708870827b1e4cf068f930fa9542dd116c
Change-Id: Ia9a09a708870827b1e4cf068f930fa9542dd116c
2020-04-06 15:45:14 +00:00
Chalard Jean
17abc3d4c8 Fix a bug where the legacy extra info is reset on connect. am: 910aad052e
Change-Id: I40f25bc1af74f45bb442baae0a89f96c00f5e8ac
2020-04-06 12:49:11 +00:00
Chalard Jean
910aad052e Fix a bug where the legacy extra info is reset on connect.
Bug: 149459996
Test: NetworkAgentTest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests

Change-Id: I3e437f0fe2eb28f1d621551a8daf164a06af83fc
Merged-In: I3e437f0fe2eb28f1d621551a8daf164a06af83fc
(cherry picked from commit a3fdb94a32eda40e322b7dbdaf3fad9b42bfbbb9, originally aosp/1277602)
2020-04-06 11:14:59 +00:00
Lucas Lin
d87b51093b Merge "Add MatchAllNetworkSpecifierTest" into rvc-dev am: 956c2ab718
Change-Id: Ice0a1fad4a430175b49a047b824e97b1a8df955e
2020-04-06 09:46:21 +00:00
Lucas Lin
956c2ab718 Merge "Add MatchAllNetworkSpecifierTest" into rvc-dev 2020-04-06 09:35:27 +00:00
Junyu Lai
40003c550b Merge changes from topic "am-5ce58db354ac494a84904378ca35c013-rvc-dev" into rvc-dev am: b0ebae0f51
Change-Id: Ie62147dc37f99d05fae4eecccc00f1b15f429220
2020-04-06 04:28:36 +00:00
junyulai
a4cd066c8b [SP26.2] add a method in NetworkStats that removes empty entries am: 6d926c23ea
Change-Id: Ib92c9cff431d5f6f72598550cc7cc869b340c396
2020-04-06 04:28:34 +00:00
Junyu Lai
b0ebae0f51 Merge changes from topic "am-5ce58db354ac494a84904378ca35c013-rvc-dev" into rvc-dev
* changes:
  [SP26] add CTS for NetworkStats
  [SP26.2] add a method in NetworkStats that removes empty entries
2020-04-06 04:15:39 +00:00
Remi NGUYEN VAN
14cdde3f9c Merge "Fix setAdministratorUids tests on Q" into rvc-dev am: 6a1d55826c
Change-Id: Ic59499e070b009dddedcaeb2e6905fb563779841
2020-04-06 02:24:38 +00:00
Remi NGUYEN VAN
6a1d55826c Merge "Fix setAdministratorUids tests on Q" into rvc-dev 2020-04-06 02:22:37 +00:00
Junyu Lai
b0be675f0d [SP26] add CTS for NetworkStats
Test: atest NetworkStatsApiTest
Test: atest CtsNetTestCasesLatestSdk:NetworkStatsApiTest on Q device
Bug: 150644692
Change-Id: I690704b43cfd16de70c4c83916f6d750cf613f67
Merged-In: I690704b43cfd16de70c4c83916f6d750cf613f67
(cherry picked from commit 5c670a2714f3ed783b6d5245714d0039c8fd1e9c)
2020-04-06 02:21:17 +00:00
junyulai
6d926c23ea [SP26.2] add a method in NetworkStats that removes empty entries
In current design, entries with zeros are preserved after
addition/subtraction. These entries are not very useful
and lead to difficulty of verifying the result of
addition/subtraction.

However, change the behavior in the original NetworkStats
is considered risky in current stage.

Thus, this change provide a function that could remove these
empty entries in tests.

Test: atest FrameworksNetTests
Bug: 152827872
Bug: 150644692

Change-Id: I40a76935d55712b8083ee1e17e137a8a4ef5e029
Merged-In: I40a76935d55712b8083ee1e17e137a8a4ef5e029
(cherry picked from commit 6c7bef3064dbe949b7b213036b8e70c125ddd343)
2020-04-06 02:18:50 +00:00
TreeHugger Robot
4756ddf2d8 Merge "Only apply VPN isolation if it's fully routed" into rvc-dev am: 5e2617781a
Change-Id: Ibd13db0076a1dcaefd3b006001d24ad3e763409f
2020-04-04 03:48:35 +00:00
TreeHugger Robot
5e2617781a Merge "Only apply VPN isolation if it's fully routed" into rvc-dev 2020-04-04 03:44:46 +00:00
Remi NGUYEN VAN
ad9693ca57 Fix setAdministratorUids tests on Q
setAdministratorUids does not exist on Q, so such tests must be skipped
on Q devices.

Bug: 147903575
Test: atest CtsNetTestCasesLatestSdk on Q and AOSP devices
Merged-In: I1b362660de9733bb9f0ede1ed5cf62279bf1c05e
Change-Id: I1b362660de9733bb9f0ede1ed5cf62279bf1c05e
2020-04-03 09:42:33 +00:00
Remi NGUYEN VAN
006ef16b04 Merge "Make LinkPropertiesTest compatible with Q" into rvc-dev am: 75cdb045dc
Change-Id: I756521af50e0176817cc1502e5a5b2ad15979817
2020-04-03 08:17:06 +00:00
Remi NGUYEN VAN
75cdb045dc Merge "Make LinkPropertiesTest compatible with Q" into rvc-dev 2020-04-03 07:52:26 +00:00
Lorenzo Colitti
3143cb6fa3 Merge "Added a new capability for temporarily unmetered network." into rvc-dev am: 0edabc5e4e
Change-Id: I2954f582524903c542a65439fba05af6cc37aa0f
2020-04-03 05:07:14 +00:00
Jack Yu
2bd176d185 Added a new capability for temporarily unmetered network.
Added a new network capability TEMOPORARILY_NOT_METERED to support
the case that a network can temporarily become unmetered. This
allows carriers to deploy unmetered 5G network. When devices
camp on 5G network, this capability will be dynamically added
to the network and will be removed once leaving 5G coverage.

Bug: 153081494
Test: Manual
Change-Id: I10e26cb0852e67f614e7b9c4e49f95e078602e21
2020-04-02 19:28:41 -07:00
Lorenzo Colitti
b3792be0fa Merge "Add more tests in LinkPropertiesTests.java" into rvc-dev am: 5f67a3c20f
Change-Id: Icb07eade679f34a7872050ca711aa45ffd11e462
2020-04-02 10:52:46 +00:00
Lorenzo Colitti
332e75ab1b Only apply VPN isolation if it's fully routed
VPN is considered fully routed if both IPv4 and IPv6 have
either a default route or a prohibit route.

Bug: 145332510
Test: atest FrameworksNetTests
Merged-In: I59cf48552bca98092d1212e3d718fd420add5458
Change-Id: I59cf48552bca98092d1212e3d718fd420add5458
2020-04-02 10:36:19 +00:00
Lorenzo Colitti
5f67a3c20f Merge "Add more tests in LinkPropertiesTests.java" into rvc-dev 2020-04-02 10:35:49 +00:00
Aaron Huang
d2485f672d Make LinkPropertiesTest compatible with Q
CompareResult had been moved from LinkProperties to LinkPropertiesUtils
so this change ignores testCompareResult() on Q and only check
compareAllRoutes() works while android version is at least R.

Bug: 151782584
Test: atest CtsNetTestCasesLatestSdk:LinkPropertiesTest
Merged-In: I38b0d83abf983b3bcc01fc6aea2e5cc307734198
Change-Id: I38b0d83abf983b3bcc01fc6aea2e5cc307734198
2020-04-02 03:30:49 +00:00
Chiachang Wang
c4e9983ed6 Merge "Update constructor of NetworkMonitor" into rvc-dev am: d7df0c13d9
Change-Id: Iea5f995291bdbe3081c8f7ded5bf4f3f50e6c7d1
2020-04-01 09:11:13 +00:00
Lucas Lin
a8e60b64a1 Add MatchAllNetworkSpecifierTest
Bug: 139268426
Bug: 135998869
Test: atest CtsNetTestCasesLatestSdk:MatchAllNetworkSpecifierTest

Change-Id: I6c6911041aff1b245e576109a879247cc256093b
Merged-In: Ib593708d5621ff20e6a0c31e5698b2b658f64d45
(cherry picked from commit f46c71b420f4089e0f36a296ed5b59398794f538)
2020-04-01 06:27:43 +00:00