@Test public void testRefreshRadioState() { mockRadio.setEnabled(true); radioToggler.refreshRadioState(); shadowLooper.runToEndOfTasks(); Assert.assertTrue(radioToggler.getRadioEnabled()); mockRadio.setEnabled(false); radioToggler.refreshRadioState(); shadowLooper.runToEndOfTasks(); Assert.assertFalse(radioToggler.getRadioEnabled()); }
public void refreshRadioState() { Message msg = mHandler.obtainMessage(MSG_REFRESH_RADIO_STATE); if (!mHandler.hasMessages(MSG_REFRESH_RADIO_STATE)) { mHandler.sendMessage(msg); } }
RadioToggler { public void refreshRadioState() { Message msg = mHandler.obtainMessage(MSG_REFRESH_RADIO_STATE); if (!mHandler.hasMessages(MSG_REFRESH_RADIO_STATE)) { mHandler.sendMessage(msg); } } }
RadioToggler { public void refreshRadioState() { Message msg = mHandler.obtainMessage(MSG_REFRESH_RADIO_STATE); if (!mHandler.hasMessages(MSG_REFRESH_RADIO_STATE)) { mHandler.sendMessage(msg); } } RadioToggler(Radio radio, PartialWakeLock wakeLock, long radioToggleWaitMs); }
RadioToggler { public void refreshRadioState() { Message msg = mHandler.obtainMessage(MSG_REFRESH_RADIO_STATE); if (!mHandler.hasMessages(MSG_REFRESH_RADIO_STATE)) { mHandler.sendMessage(msg); } } RadioToggler(Radio radio, PartialWakeLock wakeLock, long radioToggleWaitMs); boolean getRadioEnabled(); void refreshRadioState(); void toggleRadio(boolean enable); }
RadioToggler { public void refreshRadioState() { Message msg = mHandler.obtainMessage(MSG_REFRESH_RADIO_STATE); if (!mHandler.hasMessages(MSG_REFRESH_RADIO_STATE)) { mHandler.sendMessage(msg); } } RadioToggler(Radio radio, PartialWakeLock wakeLock, long radioToggleWaitMs); boolean getRadioEnabled(); void refreshRadioState(); void toggleRadio(boolean enable);  }