summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Jiang <qiangjiang@google.com>2020-09-17 16:58:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-09-17 16:58:44 +0000
commit5c4bf8901180740a1af479677bf3417ffe9812fe (patch)
tree1baa3fe6b2382d8ac29fa0ee3b9baa0505305d65
parentfc9e673c98e39ca4af02743f153c829825805774 (diff)
parent8d45aeeb4d59b14a6bf25505d0de9a00bd4d2828 (diff)
Merge "[Suggestion] Make allowAutoJoin consist for suggestion" into rvc-qpr-dev
-rw-r--r--service/java/com/android/server/wifi/NetworkSuggestionNominator.java2
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java1
-rw-r--r--tests/wifitests/src/com/android/server/wifi/NetworkSuggestionNominatorTest.java1
3 files changed, 3 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/NetworkSuggestionNominator.java b/service/java/com/android/server/wifi/NetworkSuggestionNominator.java
index b174be5e0..8c901cff9 100644
--- a/service/java/com/android/server/wifi/NetworkSuggestionNominator.java
+++ b/service/java/com/android/server/wifi/NetworkSuggestionNominator.java
@@ -246,6 +246,7 @@ public class NetworkSuggestionNominator implements WifiNetworkSelector.NetworkNo
mLocalLog.log("Failed to add network suggestion");
continue;
}
+ mWifiConfigManager.allowAutojoin(result.getNetworkId(), config.allowAutojoin);
WifiConfiguration currentWCmConfiguredNetwork =
mWifiConfigManager.getConfiguredNetwork(result.netId);
// Try to enable network selection
@@ -276,6 +277,7 @@ public class NetworkSuggestionNominator implements WifiNetworkSelector.NetworkNo
mLocalLog.log("Failed to add network suggestion");
return null;
}
+ mWifiConfigManager.allowAutojoin(result.getNetworkId(), wifiConfiguration.allowAutojoin);
if (!mWifiConfigManager.updateNetworkSelectionStatus(result.getNetworkId(),
WifiConfiguration.NetworkSelectionStatus.DISABLED_NONE)) {
mLocalLog.log("Failed to make network suggestion selectable");
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index 45a5d90b9..83cabf756 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -1132,7 +1132,6 @@ public class WifiConfigManager {
newInternalConfig.noInternetAccessExpected = externalConfig.noInternetAccessExpected;
newInternalConfig.ephemeral = externalConfig.ephemeral;
newInternalConfig.osu = externalConfig.osu;
- newInternalConfig.trusted = externalConfig.trusted;
newInternalConfig.fromWifiNetworkSuggestion = externalConfig.fromWifiNetworkSuggestion;
newInternalConfig.fromWifiNetworkSpecifier = externalConfig.fromWifiNetworkSpecifier;
newInternalConfig.useExternalScores = externalConfig.useExternalScores;
diff --git a/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionNominatorTest.java b/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionNominatorTest.java
index 9c5631882..1e0677316 100644
--- a/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionNominatorTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionNominatorTest.java
@@ -1046,6 +1046,7 @@ public class NetworkSuggestionNominatorTest extends WifiBaseTest {
ArgumentCaptor.forClass(WifiConfiguration.class);
verify(mWifiConfigManager, times(candidates.length)).addOrUpdateNetwork(
wifiConfigurationCaptor.capture(), anyInt(), anyString());
+ verify(mWifiConfigManager, times(candidates.length)).allowAutojoin(anyInt(), anyBoolean());
for (int i = 0; i < candidates.length; i++) {
WifiConfiguration addedWifiConfiguration = null;
for (WifiConfiguration configuration : wifiConfigurationCaptor.getAllValues()) {