diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2019-06-05 12:53:29 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2019-06-05 19:04:41 +0900 |
commit | af9b7b297e43fe6fe347a6143d76bde2cb2363c6 (patch) | |
tree | 76e5dbe6a4085ccfb2568680a4b71a17ecbf26bc | |
parent | 7cbe8435dcd63c4ea74a978e3897e965e65700bd (diff) |
Address review comments on ag/7904889.
Bug: 130766237
Test: atest FrameworksWifiTests
Change-Id: I72f96bcc1ba36bdab02742e947ed370f7642fc95
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 14 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index ca00b572e..f35785645 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -5412,25 +5412,27 @@ public class ClientModeImpl extends StateMachine { // ConnectivityService of that fact so the system can treat it appropriately. WifiConfiguration config = getCurrentWifiConfiguration(); - boolean prompt = false; + boolean explicitlySelected = false; if (shouldEvaluateWhetherToSendExplicitlySelected(config)) { - // If prompt is true, the network was selected by the user via Settings or + // If explicitlySelected is true, the network was selected by the user via Settings or // QuickSettings. If this network has Internet access, switch to it. Otherwise, switch // to it only if the user confirms that they really want to switch, or has already // confirmed and selected "Don't ask again". - prompt = mWifiPermissionsUtil.checkNetworkSettingsPermission(config.lastConnectUid); + explicitlySelected = + mWifiPermissionsUtil.checkNetworkSettingsPermission(config.lastConnectUid); if (mVerboseLoggingEnabled) { - log("Network selected by UID " + config.lastConnectUid + " prompt=" + prompt); + log("Network selected by UID " + config.lastConnectUid + " explicitlySelected=" + + explicitlySelected); } } if (mVerboseLoggingEnabled) { - log("explictlySelected=" + prompt + " acceptUnvalidated=" + log("explictlySelected=" + explicitlySelected + " acceptUnvalidated=" + config.noInternetAccessExpected); } if (mNetworkAgent != null) { - mNetworkAgent.explicitlySelected(prompt, config.noInternetAccessExpected); + mNetworkAgent.explicitlySelected(explicitlySelected, config.noInternetAccessExpected); } setNetworkDetailedState(DetailedState.CONNECTED); diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java index 8dfd3e99f..026b3a44e 100644 --- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java @@ -2313,7 +2313,7 @@ public class ClientModeImplTest { // Expects that the code calls registerNetworkAgent and provides a way for the test to // verify the messages sent through the NetworkAgent to ConnectivityService. // We cannot just use a mock object here because mWifiNetworkAgent is private to CMI. - // TODO: consider exposing WifiNetworkAgent and using mocks. + // TODO (b/134538181): consider exposing WifiNetworkAgent and using mocks. ArgumentCaptor<Messenger> messengerCaptor = ArgumentCaptor.forClass(Messenger.class); verify(mConnectivityManager).registerNetworkAgent(messengerCaptor.capture(), any(NetworkInfo.class), any(LinkProperties.class), any(NetworkCapabilities.class), |