Merge "Try select preset independently after group operation failed" into main
This commit is contained in:
@@ -87,6 +87,7 @@ public class BluetoothDetailsHearingAidsPresetsControllerTest extends
|
||||
|
||||
when(mLocalManager.getProfileManager()).thenReturn(mProfileManager);
|
||||
when(mProfileManager.getHapClientProfile()).thenReturn(mHapClientProfile);
|
||||
when(mCachedDevice.getDevice()).thenReturn(mDevice);
|
||||
when(mCachedDevice.getProfiles()).thenReturn(List.of(mHapClientProfile));
|
||||
when(mCachedDevice.isConnectedHapClientDevice()).thenReturn(true);
|
||||
when(mCachedChildDevice.getDevice()).thenReturn(mChildDevice);
|
||||
@@ -251,6 +252,16 @@ public class BluetoothDetailsHearingAidsPresetsControllerTest extends
|
||||
assertThat(mController.getPreference().getSummary()).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onPresetSelectionForGroupFailed_selectPresetIsCalled() {
|
||||
when(mHapClientProfile.getHapGroup(mDevice)).thenReturn(TEST_HAP_GROUP_ID);
|
||||
mController.getPreference().setValue(String.valueOf(TEST_PRESET_INDEX));
|
||||
|
||||
mController.onPresetSelectionForGroupFailed(TEST_HAP_GROUP_ID, TEST_PRESET_INDEX);
|
||||
|
||||
verify(mHapClientProfile).selectPreset(mDevice, TEST_PRESET_INDEX);
|
||||
}
|
||||
|
||||
private BluetoothHapPresetInfo getTestPresetInfo() {
|
||||
BluetoothHapPresetInfo info = mock(BluetoothHapPresetInfo.class);
|
||||
when(info.getName()).thenReturn(TEST_PRESET_NAME);
|
||||
|
Reference in New Issue
Block a user