use of android.bluetooth.BluetoothCodecConfig 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.BluetoothCodecConfig 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);
}
use of android.bluetooth.BluetoothCodecConfig in project android_packages_apps_Settings by omnirom.
the class BluetoothChannelModeDialogPreferenceControllerTest method getSelectableIndex_verifyList.
@Test
public void getSelectableIndex_verifyList() {
BluetoothCodecConfig[] mCodecConfigs = { mCodecConfigAAC, mCodecConfigSBC };
mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, 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.CHANNEL_MODE_MONO));
indexList.add(mController.convertCfgToBtnIndex(BluetoothCodecConfig.CHANNEL_MODE_STEREO));
assertThat(mController.getSelectableIndex().containsAll(indexList)).isTrue();
assertThat(indexList.containsAll(mController.getSelectableIndex())).isTrue();
}
use of android.bluetooth.BluetoothCodecConfig in project android_packages_apps_Settings by omnirom.
the class BluetoothCodecDialogPreferenceControllerTest method writeConfigurationValues_checkCodec.
@Test
public void writeConfigurationValues_checkCodec() {
BluetoothCodecConfig[] mCodecConfigs = { mCodecConfigAAC, mCodecConfigSBC, mCodecConfigAPTX, mCodecConfigAPTXHD, mCodecConfigLDAC, mCodecConfigAAC, mCodecConfigSBC };
mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, null, mCodecConfigs);
when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus);
mController.onBluetoothServiceConnected(mBluetoothA2dp);
mController.writeConfigurationValues(1);
verify(mBluetoothA2dpConfigStore, atLeastOnce()).setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC);
mController.writeConfigurationValues(2);
verify(mBluetoothA2dpConfigStore).setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC);
mController.writeConfigurationValues(3);
verify(mBluetoothA2dpConfigStore).setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX);
mController.writeConfigurationValues(4);
verify(mBluetoothA2dpConfigStore).setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD);
mController.writeConfigurationValues(5);
verify(mBluetoothA2dpConfigStore).setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC);
}
use of android.bluetooth.BluetoothCodecConfig in project android_packages_apps_Settings by omnirom.
the class BluetoothCodecDialogPreferenceControllerTest 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).setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC);
}
Aggregations