From 4e0a1bafa7a86e2840c855846f3fdaee9cd00424 Mon Sep 17 00:00:00 2001 From: Rebecca Silberstein Date: Thu, 9 Mar 2017 15:04:08 -0800 Subject: SoftApManager: retrieve config when null To support temporary softap configs, SoftApManager will not automatically write out passed in configs to the WifiApConfigStore. This means that Settings will need to continue explicitly saving config changes through the WifiManager API and cannot depend on a call to start softap to write a new config. Bug: 35809698 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: frameworks/base/wifi/tests/runtests.sh Test: Wifi integration tests Change-Id: I60e138ada3258e29ed4f411616e85b553c7dd34d --- service/java/com/android/server/wifi/SoftApManager.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/SoftApManager.java b/service/java/com/android/server/wifi/SoftApManager.java index c8a15cf36..64f4a1494 100644 --- a/service/java/com/android/server/wifi/SoftApManager.java +++ b/service/java/com/android/server/wifi/SoftApManager.java @@ -61,6 +61,8 @@ public class SoftApManager implements ActiveModeManager { private final WifiMetrics mWifiMetrics; + private WifiConfiguration mApConfig; + /** * Listener for soft AP state changes. */ @@ -90,18 +92,19 @@ public class SoftApManager implements ActiveModeManager { mApInterface = apInterface; mNwService = nms; mWifiApConfigStore = wifiApConfigStore; - if (config != null) { - mWifiApConfigStore.setApConfiguration(config); + if (config == null) { + mApConfig = mWifiApConfigStore.getApConfiguration(); + } else { + mApConfig = config; } mWifiMetrics = wifiMetrics; } /** - * Start soft AP with the current saved config. + * Start soft AP with the supplied config. */ public void start() { - mStateMachine.sendMessage(SoftApStateMachine.CMD_START, - mWifiApConfigStore.getApConfiguration()); + mStateMachine.sendMessage(SoftApStateMachine.CMD_START, mApConfig); } /** -- cgit v1.2.3