Commit Graph

8451 Commits

Author SHA1 Message Date
Automerger Merge Worker
24ef2d6098 Merge changes from topic "NS-A44_lingerstate" am: 47be84c872 am: faadf36430 am: 2fdf36c01b
Change-Id: Ic9ea1c879cfcf145f569a388b52c6b7de0e8bb87
2020-02-12 16:00:34 +00:00
Automerger Merge Worker
2fdf36c01b Merge changes from topic "NS-A44_lingerstate" am: 47be84c872 am: faadf36430
Change-Id: If045bc0da9babaf9d5a67031986c1fe4d75f2dc3
2020-02-12 15:48:31 +00:00
Automerger Merge Worker
faadf36430 Merge changes from topic "NS-A44_lingerstate" am: 47be84c872
Change-Id: Ibec8f280ad0b256d3d9b065a541063fc63d5a356
2020-02-12 15:29:30 +00:00
Chalard Jean
47be84c872 Merge changes from topic "NS-A44_lingerstate"
* changes:
  [NS B10] Cleanup : remove mRematchedNetworks
  [NS B09] Create NetworkRanker
  [NS B08] More simplification
  [NS B07] More simplification
  [NS B06] Simplification
  [NS B05] Remove old dead code
  [NS B04] Make the network selection request-major.
  [NS B03] Add debug log showing the reassignment
  [NS B02] Split out a function to apply a NetworkReassignment
  [NS B01] Move the computation loop to a separate function
  [NS A44 2/2] Apply requests after all networks rematching is computed
  [NS A44 1/2] Update linger state before processing listens
2020-02-12 15:13:10 +00:00
Chalard Jean
88e5b87102 [NS B10] Cleanup : remove mRematchedNetworks
This is better computed by the code that applies the change
than by the code that computes the reassignment

Test: FrameworksNetTests
Change-Id: I13e2764fd9b29145499085c3bb56de88a97d6c3c
2020-02-12 21:23:45 +09:00
Chalard Jean
58d486ce9b [NS B09] Create NetworkRanker
Bug: 113554781
Test: FrameworksNetTests
Change-Id: Ia534247144f479fe896e1a6e05b906103cd10005
2020-02-12 20:57:45 +09:00
Chalard Jean
32c2090b4d [NS B08] More simplification
Only computing the reassignment does not actually change the
default network.

Test: FrameworksNetTests
Change-Id: I21ddf5cc1e3d3817055dbda4246e38ceb0732407
2020-02-12 20:57:44 +09:00
Chalard Jean
75f7b1a2a7 [NS B07] More simplification
The new reassignment does not contain these useless lines
any more.

Test: FrameworksNetTests
Change-Id: I1583aebe94e529ce2b36e191a6e1f49c976bf29a
2020-02-12 20:57:44 +09:00
Chalard Jean
8049afd48d [NS B06] Simplification
This check is now unnecessary, seeing how the code adding these
changes is now guaranteed to only add at most one change for
each request.

Test: FrameworksNetTests
Change-Id: Ia0443602d9c89ee413e956df9c7b79f8f74813f7
2020-02-12 20:57:43 +09:00
Chalard Jean
a58fdce574 [NS B05] Remove old dead code
Test: FrameworksNetTests
Change-Id: I553721b327b76ede0e76b9fb7a0130fcae012175
2020-02-12 20:52:17 +09:00
Chalard Jean
013fb14441 [NS B04] Make the network selection request-major.
This patch marks the most important turning point of this
refactoring. Cleanups removing unused code will follow.

Replace the old network-major reassignment computation with a
much simpler and faster loop that takes each request and assigns
it the highest-scoring network.

All tests pass, of course.

Bug: 113554781
Test: FrameworksNetTests
Change-Id: Ie143802995155151a38a4eb1d2f26c3f29e556bd
2020-02-12 20:52:17 +09:00
Chalard Jean
373391b2cd [NS B03] Add debug log showing the reassignment
dumpString for a reassignment looks like :

NetworkReassignment :
  Rematched networks : [100 CELLULAR], [101 WIFI]
  6 : 100 → 101
  8 : null → 101

toString looks like :

NetReassign [4 : 100 → 101, 5 : null → 101]

If no changes, then it looks like
NetworkReassignment : no changes

Bug: 113554781
Test: Manual
Change-Id: If9eeadb7ee317dee2d91ca1feca3091ae39e9bae
2020-02-12 20:52:17 +09:00
Chalard Jean
d4a4a30aef [NS B02] Split out a function to apply a NetworkReassignment
This makes the rematchAllNetworksAndRequests function, which
is the nexus of the rematching code, very straightforward and
easy to read.

Bug: 113554781
Test: FrameworksNetTests
Change-Id: I5cea4ed7e06439494700d88ab202b696402fa360
2020-02-12 20:52:17 +09:00
Chalard Jean
42909302fb [NS B01] Move the computation loop to a separate function
Bug: 113554781
Test: FrameworksNetTests
Change-Id: I6c28c7af5c600d35aa1e9328b6c988dadb921f51
2020-02-12 20:52:17 +09:00
Chalard Jean
208f81bb50 [NS A44 2/2] Apply requests after all networks rematching is computed
This patch finally separates completely computing the rematch
from all the side effects. A collateral effect of this is to
compute correctly the background network state in
rematchNetworkAndRequests, which compensates the breakage
from the previous patch.

Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: I998c729c385940168fcd6ba3f2e01911f1844ce1
2020-02-12 20:52:17 +09:00
Chalard Jean
1a1d2783cb [NS A44 1/2] Update linger state before processing listens
To compute accurately whether a network is in the background, the
linger state needs to be updated. Do that before computing whether
a network is in the background and possibly calling
applyBackgroundChangeForRematch.

However ! As of this patch, rematchNetworksAndRequests computes
a wrong value when adding to the list of affected networks, because
it is looking at intermediate global state. Somehow this used to
compensate exactly for the way reading back the state was wrong.
There might have been a few undetected bugs there, but none is
known.

As such, as of this patch, rematchNetworksAndRequests still
computes a wrong value while the computation when applying that
state now computes the right one, so the tests do not pass.
This patch must be checked in together with A44 2/2 which will
fix the computation in rematchNetworksAndRequests, but is kept
separate for ease of review.

Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: Iaeed0d11bfa09f292f232ae020e944e430bc0184
2020-02-12 20:52:17 +09:00
Automerger Merge Worker
eae2ac95b0 [automerger skipped] Merge changes Ibc9b1965,I288ea32f am: 7fa63afe6d am: 5177c42147 am: d8b184d809 -s ours
am skip reason: Change-Id I35fc4a814238635fa95981649c27230dda319afa with SHA-1 ac2dee9f70 is in history

Change-Id: I12a9deb9ada16ad5438844a1b057047188ecc05b
2020-02-12 06:51:35 +00:00
Automerger Merge Worker
9404fe8a48 [automerger skipped] Add a systemapi constructor for NetworkAgent am: 1a8802b0e1 am: de6d7d5a25 am: b92adf5eae -s ours
am skip reason: Change-Id I288ea32fac07a9a486e2ea451a2c9b098446a74c with SHA-1 124ecc47bf is in history

Change-Id: I5e28684a0aa3734b53b1316823b179b9895d0793
2020-02-12 06:51:31 +00:00
Automerger Merge Worker
d8b184d809 Merge changes Ibc9b1965,I288ea32f am: 7fa63afe6d am: 5177c42147
Change-Id: Ie9e18056da529defae5c5a0065607cd972d30b80
2020-02-12 06:35:42 +00:00
Automerger Merge Worker
b92adf5eae Add a systemapi constructor for NetworkAgent am: 1a8802b0e1 am: de6d7d5a25
Change-Id: I091a6c7d8e92c22ca9393b5c974fcda5356d4102
2020-02-12 06:35:39 +00:00
Automerger Merge Worker
5177c42147 Merge changes Ibc9b1965,I288ea32f am: 7fa63afe6d
Change-Id: I6eb675ddfa609dcc3031e916ce49959e42cf53f6
2020-02-12 06:25:49 +00:00
Automerger Merge Worker
de6d7d5a25 Add a systemapi constructor for NetworkAgent am: 1a8802b0e1
Change-Id: I3fa3ec32d3c580ba0b7f2d515e08d27dd6af5bcd
2020-02-12 06:25:42 +00:00
Aaron Huang
a29902b59b Fix invalid usage of javadoc
CP from ag/10125651

Test: this change removes invalid usage
Change-Id: Ibc9b1965ec7aa545c0dae71d741c3802d3a9fa12
Merged-In: I35fc4a814238635fa95981649c27230dda319afa
2020-02-12 06:10:10 +00:00
Chalard Jean
1a8802b0e1 Add a systemapi constructor for NetworkAgent
Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
      make doc-comment-check-docs
Change-Id: I288ea32fac07a9a486e2ea451a2c9b098446a74c
Merged-In: I288ea32fac07a9a486e2ea451a2c9b098446a74c
2020-02-11 16:26:10 +08:00
Automerger Merge Worker
68909f5907 [automerger skipped] Merge "Fix review comments on aosp/1213524" am: 90d4f6d94e -s ours am: 9f501726ad -s ours am: 86cc2bce2f -s ours
am skip reason: Change-Id I621cfbe165996c67b201ca2dd2f95a5ab9af10ee with SHA-1 2e966fe619 is in history

Change-Id: I0fe69f7c3e729f4317b7bbead5d4dc575fa83ba6
2020-02-11 04:05:16 +00:00
Automerger Merge Worker
86cc2bce2f [automerger skipped] Merge "Fix review comments on aosp/1213524" am: 90d4f6d94e -s ours am: 9f501726ad -s ours
am skip reason: Change-Id I621cfbe165996c67b201ca2dd2f95a5ab9af10ee with SHA-1 cf59536753 is in history

Change-Id: I6a138aa326a628fca7eda309f5627dd47a0ca56e
2020-02-11 03:52:28 +00:00
Automerger Merge Worker
9f501726ad [automerger skipped] Merge "Fix review comments on aosp/1213524" am: 90d4f6d94e -s ours
am skip reason: Change-Id I621cfbe165996c67b201ca2dd2f95a5ab9af10ee with SHA-1 cf59536753 is in history

Change-Id: I1016fc76028aeafa9f15841b4e2951957aa11578
2020-02-11 03:43:38 +00:00
Aaron Huang
90d4f6d94e Merge "Fix review comments on aosp/1213524" 2020-02-11 03:33:08 +00:00
Chalard Jean
2e58250b89 Fix review comments on aosp/1213524
This is necessary to avoid subsequent conflicts.

Test: none needed
Change-Id: I6e2cd9188e0e4bd7c71c6c56635f192dce73f325
Merged-In: I621cfbe165996c67b201ca2dd2f95a5ab9af10ee
2020-02-10 08:28:04 +00:00
Automerger Merge Worker
f87d823667 Merge "rm libbinderthreadstate" am: d072174fbc am: 4041565ef6 am: cd4a924e90
Change-Id: I167e26697d1356280cec9c5eefb361359f6da4a8
2020-02-09 23:54:34 +00:00
Automerger Merge Worker
cd4a924e90 Merge "rm libbinderthreadstate" am: d072174fbc am: 4041565ef6
Change-Id: I25aacc3f1cd9c3544e90934c37cff5a973a7bd7b
2020-02-09 23:44:07 +00:00
Automerger Merge Worker
4041565ef6 Merge "rm libbinderthreadstate" am: d072174fbc
Change-Id: Ib7de947aa4ee5b349c9576355869702ac94d8624
2020-02-09 23:27:45 +00:00
Treehugger Robot
d072174fbc Merge "rm libbinderthreadstate" 2020-02-09 23:06:21 +00:00
Automerger Merge Worker
23e4a45d1f Merge "[NS A43] Separate updating the linger timer and sending LOSING" am: 10c32e38a2 am: 42a3342ed7 am: 8a7b232080
Change-Id: Ia51cd7174e24744c8b2d3566f9e7b12f47504564
2020-02-09 07:34:46 +00:00
Automerger Merge Worker
f97b8c5f40 Merge "[NS A42] Move writing to the reassignment to the computation" am: 113d552eff am: f0c7699e38 am: 5fff418068
Change-Id: If7fc3f8d859cfa7ba0bb7d638dbe5cae741cae71
2020-02-09 07:34:27 +00:00
Automerger Merge Worker
8a7b232080 Merge "[NS A43] Separate updating the linger timer and sending LOSING" am: 10c32e38a2 am: 42a3342ed7
Change-Id: Id7ed8f80307d2e1252195a6aef62e51d0c4e7f27
2020-02-09 07:21:19 +00:00
Automerger Merge Worker
5fff418068 Merge "[NS A42] Move writing to the reassignment to the computation" am: 113d552eff am: f0c7699e38
Change-Id: Iebe3dbd3b98f4b92486e86c48b0e50b6713b2aa6
2020-02-09 07:20:57 +00:00
Automerger Merge Worker
42a3342ed7 Merge "[NS A43] Separate updating the linger timer and sending LOSING" am: 10c32e38a2
Change-Id: I4b8e7eec2df77d04700582542d6f3f2fb455c2af
2020-02-09 07:06:13 +00:00
Automerger Merge Worker
f0c7699e38 Merge "[NS A42] Move writing to the reassignment to the computation" am: 113d552eff
Change-Id: Ic04c72d0720bb53a38329dbcbc75cd914e1296c0
2020-02-09 07:05:54 +00:00
Chalard Jean
10c32e38a2 Merge "[NS A43] Separate updating the linger timer and sending LOSING" 2020-02-09 06:51:06 +00:00
Chalard Jean
113d552eff Merge "[NS A42] Move writing to the reassignment to the computation" 2020-02-09 06:50:48 +00:00
Automerger Merge Worker
1c65bc8d13 Merge "[NS A41] Cut out a function to update NAI info" am: 956532eb3e am: ffc43638ef am: fab9832dc7
Change-Id: Ie40f6e1428a7d3a98bb2b83bb6ac9f9224aa3de7
2020-02-09 05:45:49 +00:00
Automerger Merge Worker
fab9832dc7 Merge "[NS A41] Cut out a function to update NAI info" am: 956532eb3e am: ffc43638ef
Change-Id: If22b44893c33c3640a85eed7e6dc0ce888018059
2020-02-09 05:33:29 +00:00
Automerger Merge Worker
ffc43638ef Merge "[NS A41] Cut out a function to update NAI info" am: 956532eb3e
Change-Id: I668fe3095ee9184b50db83d8f52f572dc57cfa1f
2020-02-09 05:09:07 +00:00
Chalard Jean
956532eb3e Merge "[NS A41] Cut out a function to update NAI info" 2020-02-09 04:56:37 +00:00
Automerger Merge Worker
29a294b0af Merge "Fix typo in ConnectivityDiagnosticsManager constant." am: 5ee2390f0b am: 406345a19c am: 00afbce489
Change-Id: I0677a6a31defcb6412f132dcbbfd54f02c82baf7
2020-02-07 17:37:44 +00:00
Automerger Merge Worker
00afbce489 Merge "Fix typo in ConnectivityDiagnosticsManager constant." am: 5ee2390f0b am: 406345a19c
Change-Id: Iab752a848a8017fbfdc4517502d5a39d8201a682
2020-02-07 17:22:37 +00:00
Automerger Merge Worker
406345a19c Merge "Fix typo in ConnectivityDiagnosticsManager constant." am: 5ee2390f0b
Change-Id: Icaae03ca1895de4012deed1c1b81b16fad4ba439
2020-02-07 17:08:20 +00:00
Cody Kesting
5ee2390f0b Merge "Fix typo in ConnectivityDiagnosticsManager constant." 2020-02-07 16:57:19 +00:00
TreeHugger Robot
9a77e64d44 Merge "Use framework-tethering-stub instead of framework-tethering" 2020-02-07 11:32:23 +00:00