Move adjustCandidateWithUserSelection to WifiNetworkSelector

WifiNetworkSelector#setUserConnectChoice contains all of the logic for
favoring a user selected network over other visible networks present at
the last round on network selection. However, the logic for using this
data is contained in
SavedNetworkEvaluator#adjustCandidateWithUserSelection. This has the
side effect that RecommendedNetworkEvaluator or any new NetworkEvaluator
in the future can override the user's explicit intent to choose a
specific network. This change moves adjustCandidateWithUserSelection to
WifiNetworkSelector, fixing this bug and bringing all user connect
choice logic into the same class, WifiNetworkSelector.

Set a candidate ScanResult for every WifiConfiguration in
SavedNetworkEvaluator, regardless of whether it is externally scored.
This ensures that the user connect choice is respected if an externally
scored network is selected by a user over a secure saved network.

Bug: 34971941
Test: ./runtests.sh
Change-Id: I8730aee89dbee0ebb97161a56f00c026139ef5c9
4 files changed
tree: 7bf04959f7971bb1527dfcbadc29dd8cedd09c1d
  1. service/
  2. PREUPLOAD.cfg