Commit Graph

9560 Commits

Author SHA1 Message Date
Chalard Jean
dbc4a88dcb [automerger skipped] Merge "Add trivial dependencies tests for the network stack" into rvc-dev am: 976f35b0fe -s ours am: 4d07c3951a -s ours
am skip reason: Change-Id Ie3c15ed25ef3088d3b9b650ffc7f34f49efa6b81 with SHA-1 77c7660522 is in history

Change-Id: Ia94c32fbc0e2aee1fd8d860b0ffc7068a5deb94d
2020-04-08 04:49:55 +00:00
Chalard Jean
9cfb37346c [automerger skipped] Merge "Add trivial dependencies tests for the network stack" into rvc-dev am: 976f35b0fe am: 804ecccbdc -s ours
am skip reason: Change-Id Ie3c15ed25ef3088d3b9b650ffc7f34f49efa6b81 with SHA-1 77c7660522 is in history

Change-Id: I55ddfc307214b110c223d91b3cc0cdd601d0aca1
2020-04-08 04:49:40 +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
Chalard Jean
4d07c3951a [automerger skipped] Merge "Add trivial dependencies tests for the network stack" into rvc-dev am: 976f35b0fe -s ours
am skip reason: Change-Id Ie3c15ed25ef3088d3b9b650ffc7f34f49efa6b81 with SHA-1 77c7660522 is in history

Change-Id: I08107ba6c907bae11c1f304d82cde94d7ce2e306
2020-04-08 04:37:22 +00:00
Junyu Lai
d47f47e05d Merge "Fix NetworkStatsApiTest failed on Q device" am: b0104c84f8 am: 5bc64c9683 am: ef0725dbb3
Change-Id: Ibac7b46edb13a05c825dd34ffd9c7626c33019f2
2020-04-07 11:33:47 +00:00
Junyu Lai
ef0725dbb3 Merge "Fix NetworkStatsApiTest failed on Q device" am: b0104c84f8 am: 5bc64c9683
Change-Id: Ie10c2bb91fabe8289c649333c215ab6dc22f18ff
2020-04-07 11:19:54 +00:00
Junyu Lai
5bc64c9683 Merge "Fix NetworkStatsApiTest failed on Q device" am: b0104c84f8
Change-Id: I3657e473a5c8ba45da7f1845ce860c0a494878f7
2020-04-07 11:04:39 +00:00
Junyu Lai
b0104c84f8 Merge "Fix NetworkStatsApiTest failed on Q device" 2020-04-07 10:49:19 +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
461ef867f6 [automerger skipped] Merge "Fix a stupid NPE" into rvc-dev am: 18eb7e5570 -s ours am: a29050fdf8 -s ours
am skip reason: Change-Id I3e17211c03bc74426bf5e2e414ec322d73b0060b with SHA-1 380318053b is in history

Change-Id: Icab560cf608837222727b6176155d96498838870
2020-04-07 09:56:20 +00:00
Chalard Jean
918cecc999 [automerger skipped] Merge "Fix a stupid NPE" into rvc-dev am: 18eb7e5570 am: 8433247d74 -s ours
am skip reason: Change-Id I3e17211c03bc74426bf5e2e414ec322d73b0060b with SHA-1 380318053b is in history

Change-Id: I2fcb07147f02fd51c2ae145c9278930b439b71c9
2020-04-07 09:56:05 +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
Chalard Jean
a29050fdf8 [automerger skipped] Merge "Fix a stupid NPE" into rvc-dev am: 18eb7e5570 -s ours
am skip reason: Change-Id I3e17211c03bc74426bf5e2e414ec322d73b0060b with SHA-1 380318053b is in history

Change-Id: I041a05e6f01033bb559628ae8b18f169e551c3fd
2020-04-07 09:34:26 +00:00
Treehugger Robot
1db026d821 Merge "Add trivial dependencies tests for the network stack" am: 7621ca16a3 am: f742c99f57 am: 120d4606c5
Change-Id: Id17b2dbc60daf0328ce6fe0dd78920ca09285ce7
2020-04-07 09:18:09 +00:00
Treehugger Robot
120d4606c5 Merge "Add trivial dependencies tests for the network stack" am: 7621ca16a3 am: f742c99f57
Change-Id: I081907a334d98bf4b793d714b82133ed217bb969
2020-04-07 09:13:01 +00:00
Treehugger Robot
f742c99f57 Merge "Add trivial dependencies tests for the network stack" am: 7621ca16a3
Change-Id: I940782a1ae97759085a4a6f67c0358e6bfdbd328
2020-04-07 08:55:37 +00:00
Treehugger Robot
7621ca16a3 Merge "Add trivial dependencies tests for the network stack" 2020-04-07 08:34:44 +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
Lucas Lin
9a146fc3b0 Merge "Add more tests in NetworkCapabilitiesTest.java" am: ba3f22eaa6 am: cedaa78ac2 am: 610c0a6f4a
Change-Id: Ice4f8e2383586c9f68209028d7c3cd281f39f3a5
2020-04-07 07:27:03 +00:00
Lucas Lin
610c0a6f4a Merge "Add more tests in NetworkCapabilitiesTest.java" am: ba3f22eaa6 am: cedaa78ac2
Change-Id: If955360da1fb75e174a4ecfff46988f65db17c8a
2020-04-07 07:14:28 +00:00
junyulai
ff97691273 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
2020-04-07 15:07:16 +08:00
Lucas Lin
cedaa78ac2 Merge "Add more tests in NetworkCapabilitiesTest.java" am: ba3f22eaa6
Change-Id: Ie50a0e4e332dd16c7300efb488f4ac4f25c3b6c9
2020-04-07 06:59:14 +00:00
Lucas Lin
ba3f22eaa6 Merge "Add more tests in NetworkCapabilitiesTest.java" 2020-04-07 06:45:09 +00:00
Treehugger Robot
f79c33a9fb Merge "Fix a stupid NPE" am: 16f4882784 am: b3f7f04518 am: 57e2a625f5
Change-Id: Ib5fa0c4ae1c73094bbe08468170c96d4dc0692a5
2020-04-07 06:32:14 +00:00
Treehugger Robot
57e2a625f5 Merge "Fix a stupid NPE" am: 16f4882784 am: b3f7f04518
Change-Id: I68e5702008a82d93c634fd45c2bd83a33fdf0cd2
2020-04-07 06:18:28 +00:00
Treehugger Robot
b3f7f04518 Merge "Fix a stupid NPE" am: 16f4882784
Change-Id: I3a167339e4007e5cb16488e701b9ca16937da265
2020-04-07 06:02:50 +00:00
Treehugger Robot
16f4882784 Merge "Fix a stupid NPE" 2020-04-07 05:53:10 +00:00
Chalard Jean
77c7660522 Add trivial dependencies tests for the network stack
Test: this
Bug: 153033018
Change-Id: Ie3c15ed25ef3088d3b9b650ffc7f34f49efa6b81
2020-04-07 14:42:00 +09:00
lucaslin
3df2ebcb83 Add more tests in NetworkCapabilitiesTest.java
Test deduceRestrictedCapability(), getAdministratorUids(),
setAdministratorUids(), getNetworkSpecifier(), getOwnerUid(),
setLinkDownstreamBandwidthKbps(), setLinkUpstreamBandwidthKbps()
and setSignalStrength().

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest
Change-Id: I90c7a8c47710ea4ad8e8d2682c10440fd7f82270
2020-04-07 11:58:22 +08:00
Automerger Merge Worker
4a5cfee38a Merge "[automerger skipped] Merge "Refactor the Nat464Xlat function for simplicity." into rvc-dev am: 3661ab430b -s ours am: f639a6d666 -s ours" into rvc-d1-dev-plus-aosp 2020-04-07 02:37:33 +00:00
Lorenzo Colitti
3a75ab7430 [automerger skipped] Merge "Refactor the Nat464Xlat function for simplicity." into rvc-dev am: 3661ab430b -s ours am: f639a6d666 -s ours
am skip reason: Change-Id Ice536bcb269cc8b040c6e7a72c15d0bc8b5bd235 with SHA-1 0d6e50a29d is in history

Change-Id: I67f2aa65a97322ae21c0d97cba2bafaf4ff32aae
2020-04-07 02:37:28 +00:00
Lorenzo Colitti
51a1b8aa94 [automerger skipped] Merge "Refactor the Nat464Xlat function for simplicity." into rvc-dev am: 3661ab430b am: c5a8d8cb4a -s ours
am skip reason: Change-Id Ice536bcb269cc8b040c6e7a72c15d0bc8b5bd235 with SHA-1 0d6e50a29d is in history

Change-Id: I8c089ff672fc8f986adcc79e79ba92105f966fd0
2020-04-07 02:37:26 +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
f639a6d666 [automerger skipped] Merge "Refactor the Nat464Xlat function for simplicity." into rvc-dev am: 3661ab430b -s ours
am skip reason: Change-Id Ice536bcb269cc8b040c6e7a72c15d0bc8b5bd235 with SHA-1 0d6e50a29d is in history

Change-Id: I27d77c0e0cc88c015cfe1012d4b83a1159b1b05b
2020-04-07 02:15:47 +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
53b7a2a8ab [automerger skipped] Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." into rvc-dev am: e7d685f488 am: 36da7897f1 -s ours
am skip reason: Change-Id Ia9a09a708870827b1e4cf068f930fa9542dd116c with SHA-1 6c0cbccf96 is in history

Change-Id: Ic85370f7dd42d5c3b38058363538b9563d6acce8
2020-04-07 00:28:15 +00:00
Maciej Zenczykowski
cc3f09073e [automerger skipped] Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." into rvc-dev am: e7d685f488 -s ours am: f07a33158f -s ours
am skip reason: Change-Id Ia9a09a708870827b1e4cf068f930fa9542dd116c with SHA-1 d523d1416d is in history

Change-Id: I605e7b6f6f1a63b90cf48f2ceba7778aa8571e90
2020-04-07 00:27:54 +00:00
Maciej Zenczykowski
f07a33158f [automerger skipped] Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." into rvc-dev am: e7d685f488 -s ours
am skip reason: Change-Id Ia9a09a708870827b1e4cf068f930fa9542dd116c with SHA-1 d523d1416d is in history

Change-Id: I4646da7aaeb7844ef2c0dc9e3a15b15607f095ea
2020-04-06 23:59: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
dfe2200177 [automerger skipped] Fix a bug where the legacy extra info is reset on connect. am: 26fc3f31ff am: 47f1e830a6 -s ours
am skip reason: Change-Id I3e437f0fe2eb28f1d621551a8daf164a06af83fc with SHA-1 26fc3f31ff is in history

Change-Id: I565a7396eb1d42edfaea3bb71ddb77f0618c43ad
2020-04-06 13:14:49 +00:00
Chalard Jean
ba62094f3d Fix a bug where the legacy extra info is reset on connect. am: 26fc3f31ff am: 417465419b
Change-Id: I318c30661d2ca6cc745ee6b830c1e2fecffe9131
2020-04-06 13:13:52 +00:00
Chalard Jean
47f1e830a6 Fix a bug where the legacy extra info is reset on connect. am: 26fc3f31ff
Change-Id: I0e21281a7cccbcd095ac6e6e26111ecc9ce5ab35
2020-04-06 12:49:13 +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
Lorenzo Colitti
9dd20e012e Merge "Refactor the Nat464Xlat function for simplicity." am: b51a47360b am: 55462d27a2 am: ee85002f9b
Change-Id: I0f598e2e79c596903d25e5852b982951da03093c
2020-04-06 11:42:51 +00:00
Lorenzo Colitti
ee85002f9b Merge "Refactor the Nat464Xlat function for simplicity." am: b51a47360b am: 55462d27a2
Change-Id: I8cb3fb435baae54f5e811cae1efb603d585a28e9
2020-04-06 11:24:19 +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
Lorenzo Colitti
55462d27a2 Merge "Refactor the Nat464Xlat function for simplicity." am: b51a47360b
Change-Id: I4947abc132dcd0c83b44f2c23362049ee1073214
2020-04-06 11:01:50 +00:00
Lorenzo Colitti
b51a47360b Merge "Refactor the Nat464Xlat function for simplicity." 2020-04-06 10:38:54 +00:00