Merge "Avoid update the le audio mode as bluetooth turn off" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
1a5eb3ed59
@@ -105,4 +105,16 @@ public class BluetoothLeAudioModePreferenceControllerTest {
|
||||
assertThat(SystemProperties.get(LE_AUDIO_DYNAMIC_SWITCHER_MODE_PROPERTY, mListValues[0])
|
||||
.equals(mController.mNewMode)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onBluetoothTurnOff_shouldNotChangeLeAudioMode() {
|
||||
SystemProperties.set(LE_AUDIO_DYNAMIC_SWITCHER_MODE_PROPERTY, mListValues[1]);
|
||||
when(mBluetoothAdapter.isEnabled())
|
||||
.thenReturn(false);
|
||||
|
||||
mController.updateState(mPreference);
|
||||
final String mode = SystemProperties
|
||||
.get(LE_AUDIO_DYNAMIC_SWITCHER_MODE_PROPERTY, mListValues[0]);
|
||||
assertThat(mode.equals(mListValues[1])).isTrue();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user