diff options
author | Roshan Pius <rpius@google.com> | 2019-08-08 13:33:52 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2019-08-08 13:37:48 -0700 |
commit | 1ca5e145a383d00e05b8ef1240abeaf08ddea70c (patch) | |
tree | c2be62344757b7e485f6d7a37850a4871e76a4ed /tests | |
parent | 09cb424df87eb6f4a1bb675ce80d08ffc3388cea (diff) |
Revert "WifiService: Ignore wifi state change API in crypt debounce state"
This reverts commit 840cdc08391ef0f24adf2f46fa1ea017d3d5eac4.
This is not needed in the new model because the wifi service will not
even be started in this mode. WifiManager will handle any API calls in
this scenario (added in ag/8606880).
Bug: 137374831
Test: Device boots up & connects to networks.
Change-Id: Iffd08f9ce4cd448bf245219a9a44d158dd60d25b
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java | 67 |
1 files changed, 1 insertions, 66 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java index 6b80d6aaf..3c07405c2 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java @@ -639,20 +639,6 @@ public class WifiServiceImplTest { } /** - * Verify that wifi is not enabled when wificontroller is not started. - */ - @Test - public void testSetWifiEnabledFailureWhenInCryptDebounce() throws Exception { - when(mFrameworkFacade.inStorageManagerCryptKeeperBounce()).thenReturn(true); - when(mContext.checkPermission(eq(android.Manifest.permission.NETWORK_SETTINGS), - anyInt(), anyInt())).thenReturn(PackageManager.PERMISSION_GRANTED); - when(mSettingsStore.handleWifiToggled(eq(true))).thenReturn(true); - when(mSettingsStore.isAirplaneModeOn()).thenReturn(false); - assertFalse(mWifiServiceImpl.setWifiEnabled(TEST_PACKAGE_NAME, true)); - verifyZeroInteractions(mWifiController); - } - - /** * Verify that wifi cannot be enabled by the apps targeting Q SDK. */ @Test @@ -885,20 +871,6 @@ public class WifiServiceImplTest { } /** - * Verify that wifi is not disabled when wificontroller is not started. - */ - @Test - public void testSetWifiDisabledFailureWhenInCryptDebounce() throws Exception { - when(mFrameworkFacade.inStorageManagerCryptKeeperBounce()).thenReturn(true); - when(mContext.checkPermission(eq(android.Manifest.permission.NETWORK_SETTINGS), - anyInt(), anyInt())).thenReturn(PackageManager.PERMISSION_GRANTED); - when(mSettingsStore.handleWifiToggled(eq(false))).thenReturn(false); - when(mSettingsStore.isAirplaneModeOn()).thenReturn(false); - assertFalse(mWifiServiceImpl.setWifiEnabled(TEST_PACKAGE_NAME, false)); - verifyZeroInteractions(mWifiController); - } - - /** * Verify that wifi cannot be disabled by the apps targeting Q SDK. */ @Test @@ -1140,19 +1112,6 @@ public class WifiServiceImplTest { } /** - * Verify does not start softap when wificontroller is not started. - */ - @Test - public void testStartSoftApWhenInCryptDebounce() { - when(mFrameworkFacade.inStorageManagerCryptKeeperBounce()).thenReturn(true); - - WifiConfiguration config = createValidSoftApConfiguration(); - boolean result = mWifiServiceImpl.startSoftAp(config); - assertFalse(result); - verifyZeroInteractions(mWifiController); - } - - /** * Verify a SecurityException is thrown when a caller without the correct permission attempts to * start softap. */ @@ -1176,18 +1135,6 @@ public class WifiServiceImplTest { } /** - * Verify does not stop softap when wificontroller is not started. - */ - @Test - public void testStopSoftApWhenInCryptDebounce() { - when(mFrameworkFacade.inStorageManagerCryptKeeperBounce()).thenReturn(true); - - boolean result = mWifiServiceImpl.stopSoftAp(); - assertFalse(result); - verifyZeroInteractions(mWifiController); - } - - /** * Verify SecurityException is thrown when a caller without the correct permission attempts to * stop softap. */ @@ -1542,19 +1489,6 @@ public class WifiServiceImplTest { } /** - * Only start LocalOnlyHotspot if device is in crypt debounce mode. - */ - @Test - public void testStartLocalOnlyHotspotFailsIfInCryptDebounce() throws Exception { - when(mWifiPermissionsUtil.isLocationModeEnabled()).thenReturn(true); - when(mFrameworkFacade.isAppForeground(anyInt())).thenReturn(true); - when(mFrameworkFacade.inStorageManagerCryptKeeperBounce()).thenReturn(true); - int result = mWifiServiceImpl.startLocalOnlyHotspot(mAppMessenger, mAppBinder, - TEST_PACKAGE_NAME); - assertEquals(LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE, result); - } - - /** * Only start LocalOnlyHotspot if we are not tethering. */ @Test @@ -1572,6 +1506,7 @@ public class WifiServiceImplTest { // Start another session without a stop, that should fail. assertFalse(mWifiServiceImpl.startSoftAp(createValidSoftApConfiguration())); + verifyNoMoreInteractions(mWifiController); } |