Remove airplane mode restriction on hotspot
This isn't needed anymore since we support this now. Test: robotests Bug: 111681176 Change-Id: I0292f0a38347e4fa3414170e0351a53f5997a192
This commit is contained in:
@@ -111,36 +111,6 @@ public class WifiTetherPreferenceControllerTest {
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReceiver_turnOnAirplaneMode_clearPreferenceSummary() {
|
||||
final ContentResolver cr = mock(ContentResolver.class);
|
||||
when(mContext.getContentResolver()).thenReturn(cr);
|
||||
Settings.Global.putInt(cr, Settings.Global.AIRPLANE_MODE_ON, 1);
|
||||
mController.displayPreference(mScreen);
|
||||
final BroadcastReceiver receiver = ReflectionHelpers.getField(mController, "mReceiver");
|
||||
final Intent broadcast = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
|
||||
|
||||
receiver.onReceive(RuntimeEnvironment.application, broadcast);
|
||||
|
||||
assertThat(mPreference.getSummary().toString()).isEqualTo(
|
||||
"Unavailable because airplane mode is turned on");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReceiver_turnOffAirplaneMode_displayOffSummary() {
|
||||
final ContentResolver cr = mock(ContentResolver.class);
|
||||
when(mContext.getContentResolver()).thenReturn(cr);
|
||||
Settings.Global.putInt(cr, Settings.Global.AIRPLANE_MODE_ON, 0);
|
||||
mController.displayPreference(mScreen);
|
||||
final BroadcastReceiver receiver = ReflectionHelpers.getField(mController, "mReceiver");
|
||||
final Intent broadcast = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
|
||||
|
||||
receiver.onReceive(RuntimeEnvironment.application, broadcast);
|
||||
|
||||
assertThat(mPreference.getSummary().toString()).isEqualTo(
|
||||
"Not sharing internet or content with other devices");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHandleWifiApStateChanged_stateEnabling_showEnablingSummary() {
|
||||
mController.handleWifiApStateChanged(WifiManager.WIFI_AP_STATE_ENABLING, 0 /* reason */);
|
||||
|
@@ -73,17 +73,7 @@ public class WifiTetherSwitchBarControllerTest {
|
||||
mController = new WifiTetherSwitchBarController(mContext,
|
||||
new SwitchBarController(mSwitchBar));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void constructor_airplaneModeOn_switchBarDisabled() {
|
||||
Settings.Global.putInt(RuntimeEnvironment.application.getContentResolver(),
|
||||
Settings.Global.AIRPLANE_MODE_ON, 1);
|
||||
|
||||
new WifiTetherSwitchBarController(mContext, new SwitchBarController(mSwitchBar));
|
||||
|
||||
assertThat(mSwitchBar.isEnabled()).isFalse();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void startTether_fail_resetSwitchBar() {
|
||||
when(mNetworkPolicyManager.getRestrictBackground()).thenReturn(false);
|
||||
|
Reference in New Issue
Block a user