Loading android/app/src/com/android/bluetooth/hap/HapClientService.java +5 −5 Original line number Diff line number Diff line Loading @@ -595,7 +595,7 @@ public class HapClientService extends ProfileService { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { try { mCallbacks.getBroadcastItem(i).onSelectActivePresetFailed(device, mCallbacks.getBroadcastItem(i).onPresetSelectionFailed(device, BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX); } catch (RemoteException e) { continue; Loading Loading @@ -630,7 +630,7 @@ public class HapClientService extends ProfileService { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { try { mCallbacks.getBroadcastItem(i).onSelectActivePresetForGroupFailed(groupId, mCallbacks.getBroadcastItem(i).onPresetSelectionForGroupFailed(groupId, BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX); } catch (RemoteException e) { continue; Loading Loading @@ -790,7 +790,7 @@ public class HapClientService extends ProfileService { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { try { mCallbacks.getBroadcastItem(i).onActivePresetChanged(device, presetIndex); mCallbacks.getBroadcastItem(i).onPresetSelected(device, presetIndex); } catch (RemoteException e) { continue; } Loading Loading @@ -832,7 +832,7 @@ public class HapClientService extends ProfileService { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { try { mCallbacks.getBroadcastItem(i).onSelectActivePresetFailed(device, mCallbacks.getBroadcastItem(i).onPresetSelectionFailed(device, stackEventStatusToProfileStatus(statusCode)); } catch (RemoteException e) { continue; Loading @@ -847,7 +847,7 @@ public class HapClientService extends ProfileService { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { try { mCallbacks.getBroadcastItem(i).onSelectActivePresetForGroupFailed(groupId, mCallbacks.getBroadcastItem(i).onPresetSelectionForGroupFailed(groupId, stackEventStatusToProfileStatus(statusCode)); } catch (RemoteException e) { continue; Loading android/app/tests/unit/src/com/android/bluetooth/hap/HapClientTest.java +9 −9 Original line number Diff line number Diff line Loading @@ -458,7 +458,7 @@ public class HapClientTest { verify(mNativeInterface, times(0)) .selectActivePreset(eq(mDevice), eq(0x00)); try { verify(mCallback, after(TIMEOUT_MS).times(1)).onSelectActivePresetFailed(eq(mDevice), verify(mCallback, after(TIMEOUT_MS).times(1)).onPresetSelectionFailed(eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading @@ -482,7 +482,7 @@ public class HapClientTest { // Verify Native Interface call mService.selectPresetForGroup(0x03, 0x00); try { verify(mCallback, after(TIMEOUT_MS).times(1)).onSelectActivePresetForGroupFailed( verify(mCallback, after(TIMEOUT_MS).times(1)).onPresetSelectionForGroupFailed( eq(0x03), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading Loading @@ -564,7 +564,7 @@ public class HapClientTest { doReturn(new ParcelUuid[]{BluetoothUuid.HAS}).when(mAdapterService) .getRemoteUuids(any(BluetoothDevice.class)); testConnectingDevice(mDevice); testOnActivePresetChanged(mDevice, 0x01); testOnPresetSelected(mDevice, 0x01); // Verify cached value Assert.assertEquals(0x01, mService.getActivePresetIndex(mDevice)); Loading @@ -585,7 +585,7 @@ public class HapClientTest { Assert.assertEquals(null, mService.getActivePresetInfo(mDevice2)); // Inject active preset change event testOnActivePresetChanged(mDevice2, 0x01); testOnPresetSelected(mDevice2, 0x01); // Check when active preset is known Assert.assertEquals(0x01, mService.getActivePresetIndex(mDevice2)); Loading Loading @@ -697,14 +697,14 @@ public class HapClientTest { * Test that native callback generates proper callback call. */ @Test public void testStackEventOnActivePresetChanged() { public void testOtackEventonPresetSelected() { doReturn(new ParcelUuid[]{BluetoothUuid.HAS}).when(mAdapterService) .getRemoteUuids(any(BluetoothDevice.class)); mNativeInterface.onActivePresetSelected(getByteAddress(mDevice), 0x01); try { verify(mCallback, after(TIMEOUT_MS).times(1)).onActivePresetChanged(eq(mDevice), verify(mCallback, after(TIMEOUT_MS).times(1)).onPresetSelected(eq(mDevice), eq(0x01)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading @@ -726,7 +726,7 @@ public class HapClientTest { mNativeInterface.onActivePresetSelectError(getByteAddress(mDevice), 0x05); try { verify(mCallback, after(TIMEOUT_MS).times(1)).onSelectActivePresetFailed(eq(mDevice), verify(mCallback, after(TIMEOUT_MS).times(1)).onPresetSelectionFailed(eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading Loading @@ -979,7 +979,7 @@ public class HapClientTest { HapClientStackEvent.PRESET_INFO_REASON_ALL_PRESET_INFO, presets); } private void testOnActivePresetChanged(BluetoothDevice device, int index) { private void testOnPresetSelected(BluetoothDevice device, int index) { HapClientStackEvent evt = new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); evt.device = device; Loading @@ -987,7 +987,7 @@ public class HapClientTest { mService.messageFromNative(evt); try { verify(mCallback, after(TIMEOUT_MS).times(1)).onActivePresetChanged(eq(device), verify(mCallback, after(TIMEOUT_MS).times(1)).onPresetSelected(eq(device), eq(evt.valueInt1)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading framework/api/system-current.txt +3 −3 Original line number Diff line number Diff line Loading @@ -261,10 +261,10 @@ package android.bluetooth { } public static interface BluetoothHapClient.Callback { method public void onActivePresetChanged(@NonNull android.bluetooth.BluetoothDevice, int); method public void onPresetInfoChanged(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.List<android.bluetooth.BluetoothHapPresetInfo>, int); method public void onSelectActivePresetFailed(@NonNull android.bluetooth.BluetoothDevice, int); method public void onSelectActivePresetForGroupFailed(int, int); method public void onPresetSelected(@NonNull android.bluetooth.BluetoothDevice, int); method public void onPresetSelectionFailed(@NonNull android.bluetooth.BluetoothDevice, int); method public void onPresetSelectionForGroupFailed(int, int); method public void onSetPresetNameFailed(@NonNull android.bluetooth.BluetoothDevice, int); method public void onSetPresetNameForGroupFailed(int, int); } Loading framework/java/android/bluetooth/BluetoothHapClient.java +13 −13 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable * @hide */ @SystemApi void onActivePresetChanged(@NonNull BluetoothDevice device, int presetIndex); void onPresetSelected(@NonNull BluetoothDevice device, int presetIndex); /** * Invoked inform about the result of a failed preset change attempt. Loading @@ -109,7 +109,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable * @hide */ @SystemApi void onSelectActivePresetFailed(@NonNull BluetoothDevice device, @Status int statusCode); void onPresetSelectionFailed(@NonNull BluetoothDevice device, @Status int statusCode); /** * Invoked to inform about the result of a failed preset change attempt. Loading @@ -122,7 +122,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable * @hide */ @SystemApi void onSelectActivePresetForGroupFailed(int hapGroupId, @Status int statusCode); void onPresetSelectionForGroupFailed(int hapGroupId, @Status int statusCode); /** * Invoked to inform about the preset list changes. Loading Loading @@ -175,35 +175,35 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable @SuppressLint("AndroidFrameworkBluetoothPermission") private final IBluetoothHapClientCallback mCallback = new IBluetoothHapClientCallback.Stub() { @Override public void onActivePresetChanged(@NonNull BluetoothDevice device, int presetIndex) { public void onPresetSelected(@NonNull BluetoothDevice device, int presetIndex) { Attributable.setAttributionSource(device, mAttributionSource); for (Map.Entry<BluetoothHapClient.Callback, Executor> callbackExecutorEntry: mCallbackExecutorMap.entrySet()) { BluetoothHapClient.Callback callback = callbackExecutorEntry.getKey(); Executor executor = callbackExecutorEntry.getValue(); executor.execute(() -> callback.onActivePresetChanged(device, presetIndex)); executor.execute(() -> callback.onPresetSelected(device, presetIndex)); } } @Override public void onSelectActivePresetFailed(@NonNull BluetoothDevice device, int status) { public void onPresetSelectionFailed(@NonNull BluetoothDevice device, int status) { Attributable.setAttributionSource(device, mAttributionSource); for (Map.Entry<BluetoothHapClient.Callback, Executor> callbackExecutorEntry: mCallbackExecutorMap.entrySet()) { BluetoothHapClient.Callback callback = callbackExecutorEntry.getKey(); Executor executor = callbackExecutorEntry.getValue(); executor.execute(() -> callback.onSelectActivePresetFailed(device, status)); executor.execute(() -> callback.onPresetSelectionFailed(device, status)); } } @Override public void onSelectActivePresetForGroupFailed(int hapGroupId, int statusCode) { public void onPresetSelectionForGroupFailed(int hapGroupId, int statusCode) { for (Map.Entry<BluetoothHapClient.Callback, Executor> callbackExecutorEntry: mCallbackExecutorMap.entrySet()) { BluetoothHapClient.Callback callback = callbackExecutorEntry.getKey(); Executor executor = callbackExecutorEntry.getValue(); executor.execute( () -> callback.onSelectActivePresetForGroupFailed(hapGroupId, statusCode)); () -> callback.onPresetSelectionForGroupFailed(hapGroupId, statusCode)); } } Loading Loading @@ -866,9 +866,9 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable /** * Selects the currently active preset for a HA device * * On success, {@link Callback#onActivePresetChanged(BluetoothDevice, int)} will be called with * On success, {@link Callback#onPresetSelected(BluetoothDevice, int)} will be called with * reason code {@link BluetoothStatusCodes#REASON_LOCAL_APP_REQUEST} * On failure, {@link Callback#onSelectActivePresetFailed(BluetoothDevice, int)} will be called. * On failure, {@link Callback#onPresetSelectionFailed(BluetoothDevice, int)} will be called. * * @param device is the device for which we want to set the active preset * @param presetIndex is an index of one of the available presets Loading Loading @@ -900,10 +900,10 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable * <p> This group call may replace multiple device calls if those are part of the * valid HAS group. Note that binaural HA devices may or may not support group. * * On success, {@link Callback#onActivePresetChanged(BluetoothDevice, int)} will be called * On success, {@link Callback#onPresetSelected(BluetoothDevice, int)} will be called * for each device within the group with reason code * {@link BluetoothStatusCodes#REASON_LOCAL_APP_REQUEST} * On failure, {@link Callback#onSelectActivePresetFailed(BluetoothDevice, int)} will be called * On failure, {@link Callback#onPresetSelectionFailed(BluetoothDevice, int)} will be called * for each device within the group. * * @param groupId is the device group identifier for which want to set the active preset Loading system/binder/android/bluetooth/IBluetoothHapClientCallback.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -27,9 +27,9 @@ import java.util.List; * @hide */ oneway interface IBluetoothHapClientCallback { void onActivePresetChanged(in BluetoothDevice device, in int presetIndex); void onSelectActivePresetFailed(in BluetoothDevice device, in int statusCode); void onSelectActivePresetForGroupFailed(in int hapGroupId, in int statusCode); void onPresetSelected(in BluetoothDevice device, in int presetIndex); void onPresetSelectionFailed(in BluetoothDevice device, in int statusCode); void onPresetSelectionForGroupFailed(in int hapGroupId, in int statusCode); void onPresetInfoChanged(in BluetoothDevice device, in List<BluetoothHapPresetInfo> presetInfoList, in int statusCode); Loading Loading
android/app/src/com/android/bluetooth/hap/HapClientService.java +5 −5 Original line number Diff line number Diff line Loading @@ -595,7 +595,7 @@ public class HapClientService extends ProfileService { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { try { mCallbacks.getBroadcastItem(i).onSelectActivePresetFailed(device, mCallbacks.getBroadcastItem(i).onPresetSelectionFailed(device, BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX); } catch (RemoteException e) { continue; Loading Loading @@ -630,7 +630,7 @@ public class HapClientService extends ProfileService { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { try { mCallbacks.getBroadcastItem(i).onSelectActivePresetForGroupFailed(groupId, mCallbacks.getBroadcastItem(i).onPresetSelectionForGroupFailed(groupId, BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX); } catch (RemoteException e) { continue; Loading Loading @@ -790,7 +790,7 @@ public class HapClientService extends ProfileService { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { try { mCallbacks.getBroadcastItem(i).onActivePresetChanged(device, presetIndex); mCallbacks.getBroadcastItem(i).onPresetSelected(device, presetIndex); } catch (RemoteException e) { continue; } Loading Loading @@ -832,7 +832,7 @@ public class HapClientService extends ProfileService { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { try { mCallbacks.getBroadcastItem(i).onSelectActivePresetFailed(device, mCallbacks.getBroadcastItem(i).onPresetSelectionFailed(device, stackEventStatusToProfileStatus(statusCode)); } catch (RemoteException e) { continue; Loading @@ -847,7 +847,7 @@ public class HapClientService extends ProfileService { int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { try { mCallbacks.getBroadcastItem(i).onSelectActivePresetForGroupFailed(groupId, mCallbacks.getBroadcastItem(i).onPresetSelectionForGroupFailed(groupId, stackEventStatusToProfileStatus(statusCode)); } catch (RemoteException e) { continue; Loading
android/app/tests/unit/src/com/android/bluetooth/hap/HapClientTest.java +9 −9 Original line number Diff line number Diff line Loading @@ -458,7 +458,7 @@ public class HapClientTest { verify(mNativeInterface, times(0)) .selectActivePreset(eq(mDevice), eq(0x00)); try { verify(mCallback, after(TIMEOUT_MS).times(1)).onSelectActivePresetFailed(eq(mDevice), verify(mCallback, after(TIMEOUT_MS).times(1)).onPresetSelectionFailed(eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading @@ -482,7 +482,7 @@ public class HapClientTest { // Verify Native Interface call mService.selectPresetForGroup(0x03, 0x00); try { verify(mCallback, after(TIMEOUT_MS).times(1)).onSelectActivePresetForGroupFailed( verify(mCallback, after(TIMEOUT_MS).times(1)).onPresetSelectionForGroupFailed( eq(0x03), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading Loading @@ -564,7 +564,7 @@ public class HapClientTest { doReturn(new ParcelUuid[]{BluetoothUuid.HAS}).when(mAdapterService) .getRemoteUuids(any(BluetoothDevice.class)); testConnectingDevice(mDevice); testOnActivePresetChanged(mDevice, 0x01); testOnPresetSelected(mDevice, 0x01); // Verify cached value Assert.assertEquals(0x01, mService.getActivePresetIndex(mDevice)); Loading @@ -585,7 +585,7 @@ public class HapClientTest { Assert.assertEquals(null, mService.getActivePresetInfo(mDevice2)); // Inject active preset change event testOnActivePresetChanged(mDevice2, 0x01); testOnPresetSelected(mDevice2, 0x01); // Check when active preset is known Assert.assertEquals(0x01, mService.getActivePresetIndex(mDevice2)); Loading Loading @@ -697,14 +697,14 @@ public class HapClientTest { * Test that native callback generates proper callback call. */ @Test public void testStackEventOnActivePresetChanged() { public void testOtackEventonPresetSelected() { doReturn(new ParcelUuid[]{BluetoothUuid.HAS}).when(mAdapterService) .getRemoteUuids(any(BluetoothDevice.class)); mNativeInterface.onActivePresetSelected(getByteAddress(mDevice), 0x01); try { verify(mCallback, after(TIMEOUT_MS).times(1)).onActivePresetChanged(eq(mDevice), verify(mCallback, after(TIMEOUT_MS).times(1)).onPresetSelected(eq(mDevice), eq(0x01)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading @@ -726,7 +726,7 @@ public class HapClientTest { mNativeInterface.onActivePresetSelectError(getByteAddress(mDevice), 0x05); try { verify(mCallback, after(TIMEOUT_MS).times(1)).onSelectActivePresetFailed(eq(mDevice), verify(mCallback, after(TIMEOUT_MS).times(1)).onPresetSelectionFailed(eq(mDevice), eq(BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading Loading @@ -979,7 +979,7 @@ public class HapClientTest { HapClientStackEvent.PRESET_INFO_REASON_ALL_PRESET_INFO, presets); } private void testOnActivePresetChanged(BluetoothDevice device, int index) { private void testOnPresetSelected(BluetoothDevice device, int index) { HapClientStackEvent evt = new HapClientStackEvent(HapClientStackEvent.EVENT_TYPE_ON_ACTIVE_PRESET_SELECTED); evt.device = device; Loading @@ -987,7 +987,7 @@ public class HapClientTest { mService.messageFromNative(evt); try { verify(mCallback, after(TIMEOUT_MS).times(1)).onActivePresetChanged(eq(device), verify(mCallback, after(TIMEOUT_MS).times(1)).onPresetSelected(eq(device), eq(evt.valueInt1)); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading
framework/api/system-current.txt +3 −3 Original line number Diff line number Diff line Loading @@ -261,10 +261,10 @@ package android.bluetooth { } public static interface BluetoothHapClient.Callback { method public void onActivePresetChanged(@NonNull android.bluetooth.BluetoothDevice, int); method public void onPresetInfoChanged(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.List<android.bluetooth.BluetoothHapPresetInfo>, int); method public void onSelectActivePresetFailed(@NonNull android.bluetooth.BluetoothDevice, int); method public void onSelectActivePresetForGroupFailed(int, int); method public void onPresetSelected(@NonNull android.bluetooth.BluetoothDevice, int); method public void onPresetSelectionFailed(@NonNull android.bluetooth.BluetoothDevice, int); method public void onPresetSelectionForGroupFailed(int, int); method public void onSetPresetNameFailed(@NonNull android.bluetooth.BluetoothDevice, int); method public void onSetPresetNameForGroupFailed(int, int); } Loading
framework/java/android/bluetooth/BluetoothHapClient.java +13 −13 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable * @hide */ @SystemApi void onActivePresetChanged(@NonNull BluetoothDevice device, int presetIndex); void onPresetSelected(@NonNull BluetoothDevice device, int presetIndex); /** * Invoked inform about the result of a failed preset change attempt. Loading @@ -109,7 +109,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable * @hide */ @SystemApi void onSelectActivePresetFailed(@NonNull BluetoothDevice device, @Status int statusCode); void onPresetSelectionFailed(@NonNull BluetoothDevice device, @Status int statusCode); /** * Invoked to inform about the result of a failed preset change attempt. Loading @@ -122,7 +122,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable * @hide */ @SystemApi void onSelectActivePresetForGroupFailed(int hapGroupId, @Status int statusCode); void onPresetSelectionForGroupFailed(int hapGroupId, @Status int statusCode); /** * Invoked to inform about the preset list changes. Loading Loading @@ -175,35 +175,35 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable @SuppressLint("AndroidFrameworkBluetoothPermission") private final IBluetoothHapClientCallback mCallback = new IBluetoothHapClientCallback.Stub() { @Override public void onActivePresetChanged(@NonNull BluetoothDevice device, int presetIndex) { public void onPresetSelected(@NonNull BluetoothDevice device, int presetIndex) { Attributable.setAttributionSource(device, mAttributionSource); for (Map.Entry<BluetoothHapClient.Callback, Executor> callbackExecutorEntry: mCallbackExecutorMap.entrySet()) { BluetoothHapClient.Callback callback = callbackExecutorEntry.getKey(); Executor executor = callbackExecutorEntry.getValue(); executor.execute(() -> callback.onActivePresetChanged(device, presetIndex)); executor.execute(() -> callback.onPresetSelected(device, presetIndex)); } } @Override public void onSelectActivePresetFailed(@NonNull BluetoothDevice device, int status) { public void onPresetSelectionFailed(@NonNull BluetoothDevice device, int status) { Attributable.setAttributionSource(device, mAttributionSource); for (Map.Entry<BluetoothHapClient.Callback, Executor> callbackExecutorEntry: mCallbackExecutorMap.entrySet()) { BluetoothHapClient.Callback callback = callbackExecutorEntry.getKey(); Executor executor = callbackExecutorEntry.getValue(); executor.execute(() -> callback.onSelectActivePresetFailed(device, status)); executor.execute(() -> callback.onPresetSelectionFailed(device, status)); } } @Override public void onSelectActivePresetForGroupFailed(int hapGroupId, int statusCode) { public void onPresetSelectionForGroupFailed(int hapGroupId, int statusCode) { for (Map.Entry<BluetoothHapClient.Callback, Executor> callbackExecutorEntry: mCallbackExecutorMap.entrySet()) { BluetoothHapClient.Callback callback = callbackExecutorEntry.getKey(); Executor executor = callbackExecutorEntry.getValue(); executor.execute( () -> callback.onSelectActivePresetForGroupFailed(hapGroupId, statusCode)); () -> callback.onPresetSelectionForGroupFailed(hapGroupId, statusCode)); } } Loading Loading @@ -866,9 +866,9 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable /** * Selects the currently active preset for a HA device * * On success, {@link Callback#onActivePresetChanged(BluetoothDevice, int)} will be called with * On success, {@link Callback#onPresetSelected(BluetoothDevice, int)} will be called with * reason code {@link BluetoothStatusCodes#REASON_LOCAL_APP_REQUEST} * On failure, {@link Callback#onSelectActivePresetFailed(BluetoothDevice, int)} will be called. * On failure, {@link Callback#onPresetSelectionFailed(BluetoothDevice, int)} will be called. * * @param device is the device for which we want to set the active preset * @param presetIndex is an index of one of the available presets Loading Loading @@ -900,10 +900,10 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable * <p> This group call may replace multiple device calls if those are part of the * valid HAS group. Note that binaural HA devices may or may not support group. * * On success, {@link Callback#onActivePresetChanged(BluetoothDevice, int)} will be called * On success, {@link Callback#onPresetSelected(BluetoothDevice, int)} will be called * for each device within the group with reason code * {@link BluetoothStatusCodes#REASON_LOCAL_APP_REQUEST} * On failure, {@link Callback#onSelectActivePresetFailed(BluetoothDevice, int)} will be called * On failure, {@link Callback#onPresetSelectionFailed(BluetoothDevice, int)} will be called * for each device within the group. * * @param groupId is the device group identifier for which want to set the active preset Loading
system/binder/android/bluetooth/IBluetoothHapClientCallback.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -27,9 +27,9 @@ import java.util.List; * @hide */ oneway interface IBluetoothHapClientCallback { void onActivePresetChanged(in BluetoothDevice device, in int presetIndex); void onSelectActivePresetFailed(in BluetoothDevice device, in int statusCode); void onSelectActivePresetForGroupFailed(in int hapGroupId, in int statusCode); void onPresetSelected(in BluetoothDevice device, in int presetIndex); void onPresetSelectionFailed(in BluetoothDevice device, in int statusCode); void onPresetSelectionForGroupFailed(in int hapGroupId, in int statusCode); void onPresetInfoChanged(in BluetoothDevice device, in List<BluetoothHapPresetInfo> presetInfoList, in int statusCode); Loading