Commit Graph

8403 Commits

Author SHA1 Message Date
Lorenzo Colitti
09fdc32cda Merge "Refactor the Nat464Xlat function for simplicity." am: b51a47360b am: 55462d27a2
Change-Id: I4ba3a3822efcc1b6787c729d38317fbc5148aca4
2020-04-06 11:34:04 +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
Chalard Jean
1ab18b4550 Merge "Fix a bug where the legacy extra info is reset on connect." am: 7e2d55206e am: 9f964ebc15
Change-Id: Ifa0b2239ccd0c09708085ee68c39454e1eceeffe
2020-04-06 06:34:58 +00:00
Chalard Jean
9f964ebc15 Merge "Fix a bug where the legacy extra info is reset on connect." am: 7e2d55206e
Change-Id: Ia0a2afe359cac6adfd33d2f839eddb8bd14b5f43
2020-04-06 06:17:46 +00:00
Chalard Jean
7e2d55206e Merge "Fix a bug where the legacy extra info is reset on connect." 2020-04-06 06:04:46 +00:00
Chalard Jean
56c327341e Fix a bug where the legacy extra info is reset on connect.
Bug: 149459996
Test: NetworkAgentTest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I5f8f6d962ee3317e101d19518c767b3c327c0c47
2020-04-06 12:46:19 +09:00
Lorenzo Colitti
0d6e50a29d 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
Change-Id: Ice536bcb269cc8b040c6e7a72c15d0bc8b5bd235
2020-04-04 16:24:58 +09:00
Remi NGUYEN VAN
acddbef838 Merge "Fix setAdministratorUids tests on Q" am: 7e3fc61cf1 am: a59e208450
Change-Id: I77012e94e128ec0c88ac8c6c3b316c4b29a3784f
2020-04-03 08:42:26 +00:00
Remi NGUYEN VAN
a59e208450 Merge "Fix setAdministratorUids tests on Q" am: 7e3fc61cf1
Change-Id: I1f9a335e4f7b97d2af47745709d90cfdab353154
2020-04-03 08:17:00 +00:00
Remi NGUYEN VAN
7e3fc61cf1 Merge "Fix setAdministratorUids tests on Q" 2020-04-03 07:54:59 +00:00
Lorenzo Colitti
4fe4daa582 Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." am: 426ce6ee78 am: 0d904a3b18
Change-Id: Iafcc7caea3ef4b87e2651da8dcbf972704022930
2020-04-02 15:25:30 +00:00
Lorenzo Colitti
0d904a3b18 Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." am: 426ce6ee78
Change-Id: I542f805511fe770c7869b4ba989416c179d28687
2020-04-02 15:06:25 +00:00
Lorenzo Colitti
426ce6ee78 Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." 2020-04-02 14:45:11 +00:00
Lorenzo Colitti
d523d1416d 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
Change-Id: Ia9a09a708870827b1e4cf068f930fa9542dd116c
2020-04-02 22:48:03 +09:00
Chalard Jean
44dfd2a6b7 Merge changes from topics "api-fix-networkagent", "satisfiedby" am: 9122e56202 am: 0d7aa85f99
Change-Id: I237ed648bf6f8533e6c8e79dc44a8240c0e32e7a
2020-04-02 06:38:02 +00:00
Chalard Jean
a9c11746b8 Address further API council comments. am: 691a34d96b am: 811833721f
Change-Id: I8c9fa0413e3c62180eae20951e559b69e53ea049
2020-04-02 06:37:56 +00:00
Chalard Jean
0d7aa85f99 Merge changes from topics "api-fix-networkagent", "satisfiedby" am: 9122e56202
Change-Id: I1149e5d0c93885d401817d65af02b6ae47f51dfc
2020-04-02 06:15:02 +00:00
Chalard Jean
811833721f Address further API council comments. am: 691a34d96b
Change-Id: I237fc6a82df362d5463e8e518967de28735bf2da
2020-04-02 06:14:55 +00:00
Chalard Jean
9122e56202 Merge changes from topics "api-fix-networkagent", "satisfiedby"
* changes:
  Rename satisfiedBy into canBeSatisfiedBy
  Address further API council comments.
2020-04-02 05:51:02 +00:00
Remi NGUYEN VAN
824f80b129 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
Change-Id: I1b362660de9733bb9f0ede1ed5cf62279bf1c05e
2020-04-02 13:58:03 +09:00
Lorenzo Colitti
af13955e1a Merge "Only apply VPN isolation if it's fully routed" am: 5c5d1a1282 am: d24e7fb5a1
Change-Id: I76fd2c58d688ea45f9b30e9efd24235bea2eadf9
2020-04-02 04:51:36 +00:00
Lorenzo Colitti
d24e7fb5a1 Merge "Only apply VPN isolation if it's fully routed" am: 5c5d1a1282
Change-Id: I5267b567e1b9babe3bc95d2984262dc864681a2d
2020-04-02 04:32:04 +00:00
Lorenzo Colitti
5c5d1a1282 Merge "Only apply VPN isolation if it's fully routed" 2020-04-02 04:10:12 +00:00
Junyu Lai
cf73cd2f67 Merge changes from topic "sp26-networkstats-cts" am: e71d3cf971 am: 8ea70c1969
Change-Id: Icd22765bf76b3b37935928169722afed65469105
2020-04-02 02:41:02 +00:00
junyulai
f66f5151db [SP26.2] add a method in NetworkStats that removes empty entries am: 1052557f33 am: 378271190c
Change-Id: I99eef67c05afb7d6432d5dbf32494d2f5b56b1a5
2020-04-02 02:41:00 +00:00
Junyu Lai
8ea70c1969 Merge changes from topic "sp26-networkstats-cts" am: e71d3cf971
Change-Id: I124f0def6fdaad8f1726df23edc87b6aa7856586
2020-04-02 02:21:26 +00:00
junyulai
378271190c [SP26.2] add a method in NetworkStats that removes empty entries am: 1052557f33
Change-Id: Ieee0896672625f3bab9ec02a5efa495a9d1f001b
2020-04-02 02:21:20 +00:00
Junyu Lai
e71d3cf971 Merge changes from topic "sp26-networkstats-cts"
* changes:
  [SP26] add CTS for NetworkStats
  [SP26.2] add a method in NetworkStats that removes empty entries
2020-04-02 02:00:59 +00:00
Chalard Jean
c62f9a53d8 Rename satisfiedBy into canBeSatisfiedBy
Test: FrameworksNetTests NetworkStackTests
Bug: 152238712
Change-Id: I076876a6662bde143ef7d315ce3767acafff93c1
Merged-In: I076876a6662bde143ef7d315ce3767acafff93c1
2020-04-01 20:38:30 +08:00
junyulai
1052557f33 [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
2020-04-01 16:46:08 +08:00
junyulai
e47c7e42e5 [SP26] add CTS for NetworkStats
Test: atest NetworkStatsApiTest
Test: atest CtsNetTestCasesLatestSdk:NetworkStatsApiTest on Q device
Bug: 150644692
Change-Id: I690704b43cfd16de70c4c83916f6d750cf613f67
2020-04-01 16:46:08 +08:00
Rubin Xu
ab8cf306ea 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
Change-Id: I59cf48552bca98092d1212e3d718fd420add5458
2020-04-01 09:36:29 +01:00
Chalard Jean
691a34d96b Address further API council comments.
Test: FrameworksNetTests NetworkStackTests
Bug: 152238712
Copy from ag/10866511
Change-Id: I8a785ae0e74e659c317deaaa28c203356c7766ed
Merged-In: I8a785ae0e74e659c317deaaa28c203356c7766ed
2020-04-01 16:01:04 +08:00
Aaron Huang
c33f766a4b Merge changes from topics "networkagent_api", "networkprovider_api" am: f210e24871 am: 72b40b49e0
Change-Id: I94103f998bf4648ca5678f1c5f8e8ac3a27668d5
2020-04-01 05:58:42 +00:00
Chalard Jean
426ae9ae3e Update NetworkAgentConfig API for council comments am: aea539a13e am: 1b2a71f06d
Change-Id: Ibbf9c6b33189bd91f6602344eaa0d455e4628977
2020-04-01 05:58:40 +00:00
Chalard Jean
e5c7b82daf Update the NetworkAgent API for council comments am: f5d1bfd77f am: 4bc45aba0a
Change-Id: Ic462bc2884a4d8196bec3c997fa01063786553ab
2020-04-01 05:58:37 +00:00
Aaron Huang
72b40b49e0 Merge changes from topics "networkagent_api", "networkprovider_api" am: f210e24871
Change-Id: I553a53bc4612fc367591738d9669e354730fdacc
2020-04-01 05:47:04 +00:00
Chalard Jean
1b2a71f06d Update NetworkAgentConfig API for council comments am: aea539a13e
Change-Id: I195c50ee1db2dd26b7c06f4ecbd6dbccc38895ef
2020-04-01 05:46:58 +00:00
Chalard Jean
4bc45aba0a Update the NetworkAgent API for council comments am: f5d1bfd77f
Change-Id: I1337011740d2c34f886a6d2975bd3da24f371bb8
2020-04-01 05:46:50 +00:00
Aaron Huang
f210e24871 Merge changes from topics "networkagent_api", "networkprovider_api"
* changes:
  Update the NetworkProvider API for council comments
  Update NetworkAgentConfig API for council comments
  Update the NetworkAgent API for council comments
2020-04-01 05:33:28 +00:00
Cody Kesting
168e31bd6f Merge "Update CS helper for clearing NetworkCapabilities UIDs." am: 28ce6a8970 am: 2ecef3416b
Change-Id: Ia0658afeaa207b90ae66b1a9ba708de9f837f7bd
2020-03-31 20:45:25 +00:00
Cody Kesting
ce64e241f0 Merge "Simplify unregister logic for Connectivity Diagnostics callbacks." am: bf4f1d9e98 am: b51ef5b7d7
Change-Id: Iaed3a58dbac1ad9af72a98d520fe80decf5d6ff6
2020-03-31 20:45:16 +00:00
Cody Kesting
2ecef3416b Merge "Update CS helper for clearing NetworkCapabilities UIDs." am: 28ce6a8970
Change-Id: I6769788d7c0fade7bcab912c6a68f91161b25992
2020-03-31 20:33:17 +00:00
Cody Kesting
b51ef5b7d7 Merge "Simplify unregister logic for Connectivity Diagnostics callbacks." am: bf4f1d9e98
Change-Id: I798827a3505f460a5baf633ee2d3fb2422d65137
2020-03-31 20:32:59 +00:00
Cody Kesting
28ce6a8970 Merge "Update CS helper for clearing NetworkCapabilities UIDs." 2020-03-31 20:18:17 +00:00
Cody Kesting
bf4f1d9e98 Merge "Simplify unregister logic for Connectivity Diagnostics callbacks." 2020-03-31 20:18:01 +00:00
Cody Kesting
d938597099 Merge "Clarify comments for Connectivity Diagnostics reports." am: 87ce14f328 am: 1d99c7333f
Change-Id: Iebf142364062115dc0272bbb98a74ce4a5e8e98a
2020-03-31 18:17:26 +00:00
Cody Kesting
76735b967c Merge "Sort administrator UIDs for NetworkCapabilities." am: c350963548 am: 8d84479831
Change-Id: I9232fddcc25e3cecdeb594729c7446434befd03b
2020-03-31 18:17:06 +00:00
Cody Kesting
afa1c97490 Merge "Add combine() and equals() for NetworkCapabilities admin UIDs." am: e4df39ba4b am: e0463c56eb
Change-Id: I20b4addc5bc60b53bd1c857a803ab30b2ed8c004
2020-03-31 18:16:36 +00:00