Commit Graph

8820 Commits

Author SHA1 Message Date
android-build-team Robot
cc2fa4d962 Snap for 6388478 from 46a14ba7193440933587e68a32e26b5b7b87fc46 to mainline-release
Change-Id: I70b888fa342a8dd6df707f0443b7e69794578168
2020-04-12 07:08:54 +00:00
TreeHugger Robot
45160bca9f Merge "Set transport types to resolver" into rvc-dev am: a6182bb9da
Change-Id: I0ee02778a7e2a5bf54ec73edf34fe1a4d98c6ebe
2020-04-11 14:41:01 +00:00
TreeHugger Robot
a6182bb9da Merge "Set transport types to resolver" into rvc-dev 2020-04-11 14:25:27 +00:00
chenbruce
db2aad69ed 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
dbcce5454b Merge "Fix a theoretical NPE" into rvc-dev am: ce6aa16b80
Change-Id: I82c5df71163bfe14a5d0eb6b8fb3628cb67defb6
2020-04-11 05:16:38 +00:00
Treehugger Robot
b9db69f623 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
android-build-team Robot
a8cd88383f Snap for 6379507 from c14806197cb453e8e26558adf8c02db9567c036a to mainline-release
Change-Id: I2ddc68634a691db6c6321d47e2ac69e6f6637ead
2020-04-09 07:10:02 +00:00
TreeHugger Robot
082a9f45bf Merge "Set WifiAwareNetworkInfo into setTransportInfo()" into rvc-dev am: d8a5511b92
Change-Id: Ib40ba2aeb8ed06e4d91a74cf8261af0f5eac2a66
2020-04-08 09:59:54 +00:00
lucaslin
ec5e7af977 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
24692c2351 Merge "Add more tests in NetworkCapabilitiesTest.java" into rvc-dev am: 37fbb256e8
Change-Id: Iffc785851bd1f84d54ef067ef8e555ba57587b2c
2020-04-08 07:53:43 +00:00
Lucas Lin
37fbb256e8 Merge "Add more tests in NetworkCapabilitiesTest.java" into rvc-dev 2020-04-08 07:40:30 +00:00
lucaslin
c12fcce03c 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
android-build-team Robot
6cbdc589a4 Snap for 6374617 from fe295735335c6e51af11d092392785b9c20b672f to mainline-release
Change-Id: I252ad5b62ed86d63d4b93990377613033719c3c1
2020-04-08 07:17:55 +00:00
Junyu Lai
4d73db7f19 Merge "Fix NetworkStatsApiTest failed on Q device" into rvc-dev am: 69784419af
Change-Id: I7bc25a66b6d1c50c29ea7810d0ec02f6c783e0b6
2020-04-08 05:56:49 +00:00
Junyu Lai
69784419af Merge "Fix NetworkStatsApiTest failed on Q device" into rvc-dev 2020-04-08 05:55:57 +00:00
Chalard Jean
804ecccbdc 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
7ab8d925bf 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
4aae1e23cf 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
8433247d74 Merge "Fix a stupid NPE" into rvc-dev am: 18eb7e5570
Change-Id: I174ea95f65bce63043fb3fbe9f4d5a0839ae566e
2020-04-07 09:35:22 +00:00
Treehugger Robot
50756739b5 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
android-build-team Robot
3106eab53c Snap for 6371019 from 6f2fc99fbd543302f40049fd6c493a676cda4406 to mainline-release
Change-Id: I077942e37c7aa4ca802240ecbe1b0237249b97ba
2020-04-07 07:12:22 +00:00
Lorenzo Colitti
c5a8d8cb4a Merge "Refactor the Nat464Xlat function for simplicity." into rvc-dev am: 3661ab430b
Change-Id: Ia2e41676b853300ba6c8e72827dc9ab2b58da58c
2020-04-07 02:16:23 +00:00
Lorenzo Colitti
3661ab430b Merge "Refactor the Nat464Xlat function for simplicity." into rvc-dev 2020-04-07 02:13:33 +00:00
Maciej Zenczykowski
36da7897f1 Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." into rvc-dev am: e7d685f488
Change-Id: I4bc61d98c2dea4dd3edad2b3657adf3757ca728a
2020-04-06 23:59:23 +00:00
Lorenzo Colitti
24398db2b6 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
6c0cbccf96 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
417465419b Fix a bug where the legacy extra info is reset on connect. am: 26fc3f31ff
Change-Id: I40f25bc1af74f45bb442baae0a89f96c00f5e8ac
2020-04-06 12:49:11 +00:00
Chalard Jean
26fc3f31ff 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
74c73dc3b2 Merge "Add MatchAllNetworkSpecifierTest" into rvc-dev am: 5123e0509e
Change-Id: Ice0a1fad4a430175b49a047b824e97b1a8df955e
2020-04-06 09:46:21 +00:00
Lucas Lin
5123e0509e Merge "Add MatchAllNetworkSpecifierTest" into rvc-dev 2020-04-06 09:35:27 +00:00
android-build-team Robot
af6b2c47d8 Snap for 6367459 from 9727a0735712c46da133ac5f867b953d1364175e to mainline-release
Change-Id: I1570d936b933bad806034e9a99e07c4a72ac1b8c
2020-04-06 07:03:24 +00:00
Junyu Lai
48d226dd0c Merge changes from topic "am-5ce58db354ac494a84904378ca35c013-rvc-dev" into rvc-dev am: c6b106fbc1
Change-Id: Ie62147dc37f99d05fae4eecccc00f1b15f429220
2020-04-06 04:28:36 +00:00
junyulai
254fddb571 [SP26.2] add a method in NetworkStats that removes empty entries am: 56f59c493b
Change-Id: Ib92c9cff431d5f6f72598550cc7cc869b340c396
2020-04-06 04:28:34 +00:00
Junyu Lai
c6b106fbc1 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
c69180459a Merge "Fix setAdministratorUids tests on Q" into rvc-dev am: 0b4ad3a9d5
Change-Id: Ic59499e070b009dddedcaeb2e6905fb563779841
2020-04-06 02:24:38 +00:00
Remi NGUYEN VAN
0b4ad3a9d5 Merge "Fix setAdministratorUids tests on Q" into rvc-dev 2020-04-06 02:22:37 +00:00
Junyu Lai
b80fe74899 [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
56f59c493b [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
android-build-team Robot
f7d5763121 Snap for 6366237 from 31325cf276fc549dc64a8f4d37184310938b2356 to mainline-release
Change-Id: I25fd39a550778960892f33f25daf646317a3a82e
2020-04-05 07:10:24 +00:00
TreeHugger Robot
1c221a5295 Merge "Only apply VPN isolation if it's fully routed" into rvc-dev am: 147d1574b1
Change-Id: Ibd13db0076a1dcaefd3b006001d24ad3e763409f
2020-04-04 03:48:35 +00:00
TreeHugger Robot
147d1574b1 Merge "Only apply VPN isolation if it's fully routed" into rvc-dev 2020-04-04 03:44:46 +00:00
Remi NGUYEN VAN
24260d5e6d 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
03d15b5453 Merge "Make LinkPropertiesTest compatible with Q" into rvc-dev am: d8223ef5fc
Change-Id: I756521af50e0176817cc1502e5a5b2ad15979817
2020-04-03 08:17:06 +00:00
Remi NGUYEN VAN
d8223ef5fc Merge "Make LinkPropertiesTest compatible with Q" into rvc-dev 2020-04-03 07:52:26 +00:00
android-build-team Robot
b40af83157 Snap for 6360643 from 8b88e0f83723c94c8d831c90e2ae585590224cb2 to mainline-release
Change-Id: I151dca5c1b607e35c817f57b22b906818a769a70
2020-04-03 07:23:21 +00:00
Lorenzo Colitti
1dbf63da06 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
71863e9604 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
adcc974e20 Merge "Add more tests in LinkPropertiesTests.java" into rvc-dev am: 86ae134de8
Change-Id: Icb07eade679f34a7872050ca711aa45ffd11e462
2020-04-02 10:52:46 +00:00
Lorenzo Colitti
7fb7c3e0bf 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
86ae134de8 Merge "Add more tests in LinkPropertiesTests.java" into rvc-dev 2020-04-02 10:35:49 +00:00