use of android.bluetooth.BluetoothCodecStatus in project android_packages_apps_Settings by omnirom.
the class BluetoothSampleRateDialogPreferenceControllerTest method getSelectableIndex_verifyList.
@Test
public void getSelectableIndex_verifyList() {
BluetoothCodecConfig[] mCodecConfigs = { mCodecConfigAAC, mCodecConfigSBC };
mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, mCodecConfigs);
when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus);
mController.onBluetoothServiceConnected(mBluetoothA2dp);
List<Integer> indexList = new ArrayList<>();
indexList.add(mController.getDefaultIndex());
indexList.add(mController.convertCfgToBtnIndex(BluetoothCodecConfig.SAMPLE_RATE_48000));
indexList.add(mController.convertCfgToBtnIndex(BluetoothCodecConfig.SAMPLE_RATE_88200));
assertThat(mController.getSelectableIndex().containsAll(indexList)).isTrue();
assertThat(indexList.containsAll(mController.getSelectableIndex())).isTrue();
}
use of android.bluetooth.BluetoothCodecStatus in project android_packages_apps_Settings by omnirom.
the class AbstractBluetoothDialogPreferenceControllerTest method getSelectableConfigs_verifyConfig.
@Test
public void getSelectableConfigs_verifyConfig() {
mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, mCodecConfigs);
when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus);
mController.onBluetoothServiceConnected(mBluetoothA2dp);
assertThat(mController.getSelectableConfigs(null)).isEqualTo(mCodecConfigs);
}
use of android.bluetooth.BluetoothCodecStatus in project android_packages_apps_Settings by omnirom.
the class BluetoothBitPerSampleDialogPreferenceControllerTest method writeConfigurationValues_selectDefault_setHighest.
@Test
public void writeConfigurationValues_selectDefault_setHighest() {
BluetoothCodecConfig[] mCodecConfigs = { mCodecConfigAAC, mCodecConfigSBC };
mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, mCodecConfigs);
when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus);
mController.onBluetoothServiceConnected(mBluetoothA2dp);
mController.writeConfigurationValues(0);
verify(mBluetoothA2dpConfigStore).setBitsPerSample(BluetoothCodecConfig.BITS_PER_SAMPLE_24);
}
use of android.bluetooth.BluetoothCodecStatus in project android_packages_apps_Settings by omnirom.
the class BluetoothBitPerSampleDialogPreferenceControllerTest method getSelectableIndex_verifyList.
@Test
public void getSelectableIndex_verifyList() {
BluetoothCodecConfig[] mCodecConfigs = { mCodecConfigAAC, mCodecConfigSBC };
mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, mCodecConfigs);
when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus);
mController.onBluetoothServiceConnected(mBluetoothA2dp);
List<Integer> indexList = new ArrayList<>();
indexList.add(mPreference.getDefaultIndex());
indexList.add(mController.convertCfgToBtnIndex(BluetoothCodecConfig.BITS_PER_SAMPLE_16));
indexList.add(mController.convertCfgToBtnIndex(BluetoothCodecConfig.BITS_PER_SAMPLE_24));
assertThat(mController.getSelectableIndex().containsAll(indexList)).isTrue();
assertThat(indexList.containsAll(mController.getSelectableIndex())).isTrue();
}
use of android.bluetooth.BluetoothCodecStatus in project android_packages_apps_Settings by omnirom.
the class BluetoothChannelModeDialogPreferenceControllerTest method writeConfigurationValues_selectDefault_setHighest.
@Test
public void writeConfigurationValues_selectDefault_setHighest() {
BluetoothCodecConfig[] mCodecConfigs = { mCodecConfigAAC, mCodecConfigSBC };
mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, null, mCodecConfigs);
when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus);
mController.onBluetoothServiceConnected(mBluetoothA2dp);
mController.writeConfigurationValues(0);
verify(mBluetoothA2dpConfigStore).setChannelMode(BluetoothCodecConfig.CHANNEL_MODE_STEREO);
}
Aggregations