diff options
author | lesl <lesl@google.com> | 2019-12-27 17:53:49 +0800 |
---|---|---|
committer | Les Lee <lesl@google.com> | 2020-01-10 08:35:21 +0000 |
commit | 066601945d79a3d312348e053431c39d93a5d4ed (patch) | |
tree | ed7b59214e336b31bcecd732ec0a2d2335ad0e54 | |
parent | 754475229c25766f0278b410b3f364a86049f531 (diff) |
softap: Add timeoutdelay customize and config update support.
1. Add timeoutdelay customize support.
2. Add config update support
Bug: 142752869
Test: atest frameworks/opt/net/wifi/tests/wifitests/
Test: Manual Test, fake shutdown timout configuration change
to force configuration update. Checked the log and UI behavior.
Change-Id: I7ef086b5115111892450b8c67840c58049e0a167
9 files changed, 262 insertions, 36 deletions
diff --git a/service/java/com/android/server/wifi/ActiveModeWarden.java b/service/java/com/android/server/wifi/ActiveModeWarden.java index f3f261c43..ae14ca795 100644 --- a/service/java/com/android/server/wifi/ActiveModeWarden.java +++ b/service/java/com/android/server/wifi/ActiveModeWarden.java @@ -26,6 +26,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.location.LocationManager; import android.net.wifi.SoftApCapability; +import android.net.wifi.SoftApConfiguration; import android.net.wifi.WifiManager; import android.os.BatteryStatsManager; import android.os.Handler; @@ -176,6 +177,11 @@ public class ActiveModeWarden { mWifiController.sendMessage(WifiController.CMD_UPDATE_AP_CAPABILITY, capability); } + /** Update SoftAp Configuration. */ + public void updateSoftApConfiguration(SoftApConfiguration config) { + mWifiController.sendMessage(WifiController.CMD_UPDATE_AP_CONFIG, config); + } + /** Emergency Callback Mode has changed. */ public void emergencyCallbackModeChanged(boolean isInEmergencyCallbackMode) { mWifiController.sendMessage( @@ -308,6 +314,14 @@ public class ActiveModeWarden { } } + private void updateConfigurationToSoftApModeManager(SoftApConfiguration config) { + for (ActiveModeManager manager : mActiveModeManagers) { + if (!(manager instanceof SoftApManager)) continue; + SoftApManager softApManager = (SoftApManager) manager; + softApManager.updateConfiguration(config); + } + } + /** * Method to enable a new client mode manager. */ @@ -550,6 +564,7 @@ public class ActiveModeWarden { static final int CMD_DEFERRED_RECOVERY_RESTART_WIFI = BASE + 22; static final int CMD_AP_START_FAILURE = BASE + 23; static final int CMD_UPDATE_AP_CAPABILITY = BASE + 24; + static final int CMD_UPDATE_AP_CONFIG = BASE + 25; private final EnabledState mEnabledState = new EnabledState(); private final DisabledState mDisabledState = new DisabledState(); @@ -710,6 +725,9 @@ public class ActiveModeWarden { case CMD_UPDATE_AP_CAPABILITY: updateCapabilityToSoftApModeManager((SoftApCapability) msg.obj); break; + case CMD_UPDATE_AP_CONFIG: + updateConfigurationToSoftApModeManager((SoftApConfiguration) msg.obj); + break; default: throw new RuntimeException("WifiController.handleMessage " + msg.what); } diff --git a/service/java/com/android/server/wifi/SoftApManager.java b/service/java/com/android/server/wifi/SoftApManager.java index 58c7f7e09..742a3d05d 100644 --- a/service/java/com/android/server/wifi/SoftApManager.java +++ b/service/java/com/android/server/wifi/SoftApManager.java @@ -70,9 +70,6 @@ import java.util.Locale; public class SoftApManager implements ActiveModeManager { private static final String TAG = "SoftApManager"; - // Minimum limit to use for timeout delay if the value from overlay setting is too small. - private static final int MIN_SOFT_AP_TIMEOUT_DELAY_MS = 600_000; // 10 minutes - @VisibleForTesting public static final String SOFT_AP_SEND_MESSAGE_TIMEOUT_TAG = TAG + " Soft AP Send Message Timeout"; @@ -96,6 +93,8 @@ public class SoftApManager implements ActiveModeManager { private final WifiMetrics mWifiMetrics; + private boolean mIsRandomizeBssid; + @NonNull private SoftApModeConfiguration mApConfig; @@ -173,6 +172,7 @@ public class SoftApManager implements ActiveModeManager { // may still be null if we fail to load the default config } if (softApConfig != null) { + mIsRandomizeBssid = softApConfig.getBssid() == null; softApConfig = mWifiApConfigStore.randomizeBssidIfUnset(mContext, softApConfig); } mApConfig = new SoftApModeConfiguration(apConfig.getTargetMode(), @@ -232,6 +232,16 @@ public class SoftApManager implements ActiveModeManager { } /** + * Update AP configuration. Called when setting update config via + * {@link WifiManager#setSoftApConfiguration(SoftApConfiguration)} + * + * @param config new AP config. + */ + public void updateConfiguration(@NonNull SoftApConfiguration config) { + mStateMachine.sendMessage(SoftApStateMachine.CMD_UPDATE_CONFIG, config); + } + + /** * Dump info about this softap manager. */ @Override @@ -452,6 +462,7 @@ public class SoftApManager implements ActiveModeManager { public static final int CMD_INTERFACE_DOWN = 8; public static final int CMD_SOFT_AP_CHANNEL_SWITCHED = 9; public static final int CMD_UPDATE_CAPABILITY = 10; + public static final int CMD_UPDATE_CONFIG = 11; private final State mIdleState = new IdleState(); private final State mStartedState = new StartedState(); @@ -542,6 +553,11 @@ public class SoftApManager implements ActiveModeManager { mCurrentSoftApCapability = new SoftApCapability(capability); } break; + case CMD_UPDATE_CONFIG: + SoftApConfiguration newConfig = (SoftApConfiguration) message.obj; + mApConfig = new SoftApModeConfiguration(mApConfig.getTargetMode(), + newConfig, mCurrentSoftApCapability); + break; default: // Ignore all other commands. break; @@ -552,7 +568,6 @@ public class SoftApManager implements ActiveModeManager { } private class StartedState extends State { - private int mTimeoutDelay; private WakeupMessage mSoftApTimeoutMessage; private SoftApTimeoutEnabledSettingObserver mSettingObserver; @@ -589,23 +604,20 @@ public class SoftApManager implements ActiveModeManager { } } - private int getConfigSoftApTimeoutDelay() { - int delay = mContext.getResources().getInteger( - R.integer.config_wifi_framework_soft_ap_timeout_delay); - if (delay < MIN_SOFT_AP_TIMEOUT_DELAY_MS) { - delay = MIN_SOFT_AP_TIMEOUT_DELAY_MS; - Log.w(TAG, "Overriding timeout delay with minimum limit value"); - } - Log.d(TAG, "Timeout delay: " + delay); - return delay; - } - private void scheduleTimeoutMessage() { - if (!mTimeoutEnabled) { + if (!mTimeoutEnabled || mConnectedClients.size() != 0) { + cancelTimeoutMessage(); return; } - mSoftApTimeoutMessage.schedule(SystemClock.elapsedRealtime() + mTimeoutDelay); - Log.d(TAG, "Timeout message scheduled"); + int timeout = mApConfig.getSoftApConfiguration().getShutdownTimeoutMillis(); + if (timeout == 0) { + timeout = mContext.getResources().getInteger( + R.integer.config_wifiFrameworkSoftApShutDownTimeoutMilliseconds); + } + mSoftApTimeoutMessage.schedule(SystemClock.elapsedRealtime() + + timeout); + Log.d(TAG, "Timeout message scheduled, delay = " + + timeout); } private void cancelTimeoutMessage() { @@ -689,11 +701,7 @@ public class SoftApManager implements ActiveModeManager { mWifiMetrics.addSoftApNumAssociatedStationsChangedEvent( mConnectedClients.size(), mApConfig.getTargetMode()); - if (mConnectedClients.size() == 0) { - scheduleTimeoutMessage(); - } else { - cancelTimeoutMessage(); - } + scheduleTimeoutMessage(); } private void setSoftApChannel(int freq, @WifiAnnotations.Bandwidth int apBandwidth) { @@ -745,7 +753,6 @@ public class SoftApManager implements ActiveModeManager { mIfaceIsDestroyed = false; onUpChanged(mWifiNative.isInterfaceUp(mApInterfaceName)); - mTimeoutDelay = getConfigSoftApTimeoutDelay(); Handler handler = mStateMachine.getHandler(); mSoftApTimeoutMessage = new WakeupMessage(mContext, handler, SOFT_AP_SEND_MESSAGE_TIMEOUT_TAG, @@ -852,12 +859,7 @@ public class SoftApManager implements ActiveModeManager { break; } mTimeoutEnabled = isEnabled; - if (!mTimeoutEnabled) { - cancelTimeoutMessage(); - } - if (mTimeoutEnabled && mConnectedClients.size() == 0) { - scheduleTimeoutMessage(); - } + scheduleTimeoutMessage(); break; case CMD_INTERFACE_STATUS_CHANGED: boolean isUp = message.arg1 == 1; @@ -909,6 +911,33 @@ public class SoftApManager implements ActiveModeManager { updateClientConnection(); } break; + case CMD_UPDATE_CONFIG: + SoftApConfiguration newConfig = (SoftApConfiguration) message.obj; + SoftApConfiguration currentConfig = mApConfig.getSoftApConfiguration(); + if (mIsRandomizeBssid) { + // Current bssid is ramdon because unset. Set back to null.. + currentConfig = new SoftApConfiguration.Builder(currentConfig) + .setBssid(null) + .build(); + } + if (!ApConfigUtil.checkConfigurationChangeNeedToRestart( + currentConfig, newConfig)) { + Log.d(TAG, "Configuration changed to " + newConfig); + boolean needRescheduleTimer = + mApConfig.getSoftApConfiguration().getShutdownTimeoutMillis() + != newConfig.getShutdownTimeoutMillis(); + mApConfig = new SoftApModeConfiguration(mApConfig.getTargetMode(), + newConfig, mCurrentSoftApCapability); + updateClientConnection(); + if (needRescheduleTimer) { + cancelTimeoutMessage(); + scheduleTimeoutMessage(); + } + } else { + Log.d(TAG, "Ignore the config: " + newConfig + + " update since it requires restart"); + } + break; default: return NOT_HANDLED; } diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 2bf5f473e..eb8a50227 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -1786,6 +1786,7 @@ public class WifiServiceImpl extends BaseWifiService { mLog.info("setSoftApConfiguration uid=%").c(uid).flush(); if (softApConfig == null) return false; if (WifiApConfigStore.validateApWifiConfiguration(softApConfig)) { + mActiveModeWarden.updateSoftApConfiguration(softApConfig); mWifiThreadRunner.post(() -> mWifiApConfigStore.setApConfiguration(softApConfig)); return true; } else { diff --git a/service/java/com/android/server/wifi/util/ApConfigUtil.java b/service/java/com/android/server/wifi/util/ApConfigUtil.java index 467327613..45d3a9a12 100644 --- a/service/java/com/android/server/wifi/util/ApConfigUtil.java +++ b/service/java/com/android/server/wifi/util/ApConfigUtil.java @@ -530,4 +530,20 @@ public class ApConfigUtil { return context.getResources().getBoolean( R.bool.config_wifi_softap_sae_supported); } + + /** + * Helper function for comparing two SoftApConfiguration. + * + * Return true if the difference between the two configurations requires a restart to apply. + */ + public static boolean checkConfigurationChangeNeedToRestart( + SoftApConfiguration currentConfig, SoftApConfiguration newConfig) { + return currentConfig.getSsid() != newConfig.getSsid() + || currentConfig.getBssid() != newConfig.getBssid() + || currentConfig.getSecurityType() != newConfig.getSecurityType() + || currentConfig.getPassphrase() != newConfig.getPassphrase() + || currentConfig.isHiddenSsid() != newConfig.isHiddenSsid() + || currentConfig.getBand() != newConfig.getBand() + || currentConfig.getChannel() != newConfig.getChannel(); + } } diff --git a/service/res/values/config.xml b/service/res/values/config.xml index 98a005e6d..2ba4e6a88 100644 --- a/service/res/values/config.xml +++ b/service/res/values/config.xml @@ -122,10 +122,9 @@ <integer translatable="false" name="config_wifiFrameworkScoreGoodRssiThreshold6ghz">-57</integer> <!-- Integer delay in milliseconds before shutting down soft AP when there - are no connected devices. Framework will enforce a minimum limit on - this value and this setting will be overridden if the provided value is - smaller than the limit. --> - <integer translatable="false" name="config_wifi_framework_soft_ap_timeout_delay">600000</integer> + are no connected devices. --> + <integer translatable="false" name="config_wifiFrameworkSoftApShutDownTimeoutMilliseconds">600000</integer> + <!-- Integer indicating maximum hardware supported client number of soft ap --> <integer translatable="false" name="config_wifiHardwareSoftapMaxClientCount">16</integer> diff --git a/service/res/values/overlayable.xml b/service/res/values/overlayable.xml index 7d63b3448..9d70aa9d8 100644 --- a/service/res/values/overlayable.xml +++ b/service/res/values/overlayable.xml @@ -54,7 +54,7 @@ <item type="integer" name="config_wifiFrameworkScoreEntryRssiThreshold6ghz" /> <item type="integer" name="config_wifiFrameworkScoreLowRssiThreshold6ghz" /> <item type="integer" name="config_wifiFrameworkScoreGoodRssiThreshold6ghz" /> - <item type="integer" name="config_wifi_framework_soft_ap_timeout_delay" /> + <item type="integer" name="config_wifiFrameworkSoftApShutDownTimeoutMilliseconds" /> <item type="string" name="config_wifi_random_mac_oui" /> <item type="string" name="config_wifiSoftap2gChannelList" /> <item type="string" name="config_wifiSoftap5gChannelList" /> diff --git a/tests/wifitests/src/com/android/server/wifi/ActiveModeWardenTest.java b/tests/wifitests/src/com/android/server/wifi/ActiveModeWardenTest.java index ff66dce6a..c29f0c8de 100644 --- a/tests/wifitests/src/com/android/server/wifi/ActiveModeWardenTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ActiveModeWardenTest.java @@ -2073,4 +2073,43 @@ public class ActiveModeWardenTest extends WifiBaseTest { verify(mClientModeManager, times(2)).start(); assertInEnabledState(); } + + @Test + public void testUpdateCapabilityInSoftApActiveMode() throws Exception { + SoftApCapability testCapability = new SoftApCapability(0); + enterSoftApActiveMode(); + mActiveModeWarden.updateSoftApCapability(testCapability); + mLooper.dispatchAll(); + verify(mSoftApManager).updateCapability(testCapability); + } + + @Test + public void testUpdateConfigInSoftApActiveMode() throws Exception { + SoftApConfiguration testConfig = new SoftApConfiguration.Builder() + .setSsid("Test123").build(); + enterSoftApActiveMode(); + mActiveModeWarden.updateSoftApConfiguration(testConfig); + mLooper.dispatchAll(); + verify(mSoftApManager).updateConfiguration(testConfig); + } + + @Test + public void testUpdateCapabilityInNonSoftApActiveMode() throws Exception { + SoftApCapability testCapability = new SoftApCapability(0); + enterClientModeActiveState(); + mActiveModeWarden.updateSoftApCapability(testCapability); + mLooper.dispatchAll(); + verify(mSoftApManager, never()).updateCapability(any()); + } + + @Test + public void testUpdateConfigInNonSoftApActiveMode() throws Exception { + SoftApConfiguration testConfig = new SoftApConfiguration.Builder() + .setSsid("Test123").build(); + enterClientModeActiveState(); + mActiveModeWarden.updateSoftApConfiguration(testConfig); + mLooper.dispatchAll(); + verify(mSoftApManager, never()).updateConfiguration(any()); + } + } diff --git a/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java b/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java index d382e62f5..d46f7dd1b 100644 --- a/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java @@ -149,7 +149,7 @@ public class SoftApManagerTest extends WifiBaseTest { when(mContext.getSystemService(Context.ALARM_SERVICE)) .thenReturn(mAlarmManager.getAlarmManager()); when(mContext.getResources()).thenReturn(mResources); - when(mResources.getInteger(R.integer.config_wifi_framework_soft_ap_timeout_delay)) + when(mResources.getInteger(R.integer.config_wifiFrameworkSoftApShutDownTimeoutMilliseconds)) .thenReturn(600000); when(mWifiNative.setCountryCodeHal( TEST_INTERFACE_NAME, TEST_COUNTRY_CODE.toUpperCase(Locale.ROOT))) @@ -1154,6 +1154,26 @@ public class SoftApManagerTest extends WifiBaseTest { new SoftApModeConfiguration(WifiManager.IFACE_IP_MODE_TETHERED, null, mTestSoftApCapability); startSoftApAndVerifyEnabled(apConfig); + verify(mResources) + .getInteger(R.integer.config_wifiFrameworkSoftApShutDownTimeoutMilliseconds); + + // Verify timer is scheduled + verify(mAlarmManager.getAlarmManager()).setExact(anyInt(), anyLong(), + eq(mSoftApManager.SOFT_AP_SEND_MESSAGE_TIMEOUT_TAG), any(), any()); + } + + @Test + public void schedulesTimeoutTimerOnStartWithConfigedValue() throws Exception { + Builder configBuilder = new SoftApConfiguration.Builder(); + configBuilder.setBand(SoftApConfiguration.BAND_2GHZ); + configBuilder.setSsid(TEST_SSID); + configBuilder.setShutdownTimeoutMillis(50000); + SoftApModeConfiguration apConfig = + new SoftApModeConfiguration(WifiManager.IFACE_IP_MODE_TETHERED, + configBuilder.build(), mTestSoftApCapability); + startSoftApAndVerifyEnabled(apConfig); + verify(mResources, never()) + .getInteger(R.integer.config_wifiFrameworkSoftApShutDownTimeoutMilliseconds); // Verify timer is scheduled verify(mAlarmManager.getAlarmManager()).setExact(anyInt(), anyLong(), @@ -1670,4 +1690,106 @@ public class SoftApManagerTest extends WifiBaseTest { WifiManager.SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION); verify(mListener).onStartFailure(); } + + @Test + public void testConfigurationChangedApplySinceDoesNotNeedToRestart() throws Exception { + Builder configBuilder = new SoftApConfiguration.Builder(); + configBuilder.setBand(SoftApConfiguration.BAND_2GHZ); + configBuilder.setSsid(TEST_SSID); + + SoftApModeConfiguration apConfig = new SoftApModeConfiguration( + WifiManager.IFACE_IP_MODE_TETHERED, configBuilder.build(), mTestSoftApCapability); + startSoftApAndVerifyEnabled(apConfig); + + // Verify timer is scheduled + verify(mAlarmManager.getAlarmManager()).setExact(anyInt(), anyLong(), + eq(mSoftApManager.SOFT_AP_SEND_MESSAGE_TIMEOUT_TAG), any(), any()); + verify(mCallback).onConnectedClientsChanged(new ArrayList<>()); + + mLooper.dispatchAll(); + + // Trigger Configuration Change + configBuilder.setShutdownTimeoutMillis(500000); + mSoftApManager.updateConfiguration(configBuilder.build()); + mLooper.dispatchAll(); + // Verify timer is canceled at this point since timeout changed + verify(mAlarmManager.getAlarmManager()).cancel(any(WakeupMessage.class)); + // Verify timer setup again + verify(mAlarmManager.getAlarmManager(), times(2)).setExact(anyInt(), anyLong(), + eq(mSoftApManager.SOFT_AP_SEND_MESSAGE_TIMEOUT_TAG), any(), any()); + + } + + @Test + public void testConfigurationChangedDoesNotApplySinceNeedToRestart() throws Exception { + Builder configBuilder = new SoftApConfiguration.Builder(); + configBuilder.setBand(SoftApConfiguration.BAND_2GHZ); + configBuilder.setSsid(TEST_SSID); + + SoftApModeConfiguration apConfig = new SoftApModeConfiguration( + WifiManager.IFACE_IP_MODE_TETHERED, configBuilder.build(), mTestSoftApCapability); + startSoftApAndVerifyEnabled(apConfig); + + // Verify timer is scheduled + verify(mAlarmManager.getAlarmManager()).setExact(anyInt(), anyLong(), + eq(mSoftApManager.SOFT_AP_SEND_MESSAGE_TIMEOUT_TAG), any(), any()); + + mLooper.dispatchAll(); + + // Trigger Configuration Change + configBuilder.setShutdownTimeoutMillis(500000); + configBuilder.setSsid(TEST_SSID + "new"); + mSoftApManager.updateConfiguration(configBuilder.build()); + mLooper.dispatchAll(); + // Verify timer cancel will not apply since changed config need to apply via restart. + verify(mAlarmManager.getAlarmManager(), never()).cancel(any(WakeupMessage.class)); + } + + @Test + public void testConfigChangeToSmallCauseClientDisconnect() throws Exception { + Builder configBuilder = new SoftApConfiguration.Builder(); + configBuilder.setBand(SoftApConfiguration.BAND_2GHZ); + configBuilder.setSsid(TEST_SSID); + configBuilder.setMaxNumberOfClients(2); + SoftApModeConfiguration apConfig = + new SoftApModeConfiguration(WifiManager.IFACE_IP_MODE_TETHERED, + configBuilder.build(), mTestSoftApCapability); + startSoftApAndVerifyEnabled(apConfig); + + verify(mCallback).onConnectedClientsChanged(new ArrayList<>()); + + mSoftApListenerCaptor.getValue().onConnectedClientsChanged( + TEST_NATIVE_CLIENT, true); + mLooper.dispatchAll(); + + verify(mCallback, times(2)).onConnectedClientsChanged( + Mockito.argThat((List<WifiClient> clients) -> + clients.contains(TEST_CONNECTED_CLIENT)) + ); + + verify(mWifiMetrics).addSoftApNumAssociatedStationsChangedEvent( + 1, apConfig.getTargetMode()); + // Verify timer is canceled at this point + verify(mAlarmManager.getAlarmManager()).cancel(any(WakeupMessage.class)); + + // Second client connect and max client set is 1. + mSoftApListenerCaptor.getValue().onConnectedClientsChanged( + TEST_NATIVE_CLIENT_2, true); + mLooper.dispatchAll(); + + verify(mCallback, times(3)).onConnectedClientsChanged( + Mockito.argThat((List<WifiClient> clients) -> + clients.contains(TEST_CONNECTED_CLIENT_2)) + ); + verify(mWifiMetrics).addSoftApNumAssociatedStationsChangedEvent( + 2, apConfig.getTargetMode()); + + // Trigger Configuration Change + configBuilder.setMaxNumberOfClients(1); + mSoftApManager.updateConfiguration(configBuilder.build()); + mLooper.dispatchAll(); + // Verify Disconnect will trigger + verify(mWifiNative).forceClientDisconnect( + any(), any(), anyInt()); + } } diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java index 376e12c21..f7c2722a4 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java @@ -1036,6 +1036,7 @@ public class WifiServiceImplTest extends WifiBaseTest { assertTrue(mWifiServiceImpl.setSoftApConfiguration(apConfig, TEST_PACKAGE_NAME)); mLooper.dispatchAll(); verify(mWifiApConfigStore).setApConfiguration(eq(apConfig)); + verify(mActiveModeWarden).updateSoftApConfiguration(apConfig); verify(mContext).enforceCallingOrSelfPermission( eq(android.Manifest.permission.NETWORK_SETTINGS), eq("WifiService")); } @@ -1050,6 +1051,7 @@ public class WifiServiceImplTest extends WifiBaseTest { eq("WifiService")); assertFalse(mWifiServiceImpl.setSoftApConfiguration(null, TEST_PACKAGE_NAME)); verify(mWifiApConfigStore, never()).setApConfiguration(isNull(SoftApConfiguration.class)); + verify(mActiveModeWarden, never()).updateSoftApConfiguration(any()); verify(mContext).enforceCallingOrSelfPermission( eq(android.Manifest.permission.NETWORK_SETTINGS), eq("WifiService")); } |