diff options
4 files changed, 1 insertions, 61 deletions
diff --git a/android/app/src/com/android/bluetooth/hap/HapClientService.java b/android/app/src/com/android/bluetooth/hap/HapClientService.java index 64937abdd8..a2f228b287 100644 --- a/android/app/src/com/android/bluetooth/hap/HapClientService.java +++ b/android/app/src/com/android/bluetooth/hap/HapClientService.java @@ -772,17 +772,7 @@ public class HapClientService extends ProfileService { } private void notifyFeaturesAvailable(BluetoothDevice device, int features) { - if (mCallbacks != null) { - int n = mCallbacks.beginBroadcast(); - for (int i = 0; i < n; i++) { - try { - mCallbacks.getBroadcastItem(i).onHapFeaturesAvailable(device, features); - } catch (RemoteException e) { - continue; - } - } - mCallbacks.finishBroadcast(); - } + Log.d(TAG, "HAP device: " + device + ", features: " + String.format("0x%04X", features)); } private void notifyActivePresetChanged(BluetoothDevice device, int presetIndex, diff --git a/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientTest.java b/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientTest.java index 6b31044644..53b06cc765 100644 --- a/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientTest.java +++ b/android/app/tests/unit/src/com/android/bluetooth/hap/HapClientTest.java @@ -678,25 +678,6 @@ public class HapClientTest { * Test that native callback generates proper callback call. */ @Test - public void testStackEventOnFeaturesUpdate() { - doReturn(new ParcelUuid[]{BluetoothUuid.HAS}).when(mAdapterService) - .getRemoteUuids(any(BluetoothDevice.class)); - - mNativeInterface.onDeviceAvailable(getByteAddress(mDevice), 0x00); - mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice), 0x03); - - try { - verify(mCallback, after(TIMEOUT_MS).times(1)).onHapFeaturesAvailable(eq(mDevice), - eq(0x03)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } - } - - /** - * Test that native callback generates proper callback call. - */ - @Test public void testStackEventOnPresetSelected() { doReturn(new ParcelUuid[]{BluetoothUuid.HAS}).when(mAdapterService) .getRemoteUuids(any(BluetoothDevice.class)); @@ -953,13 +934,6 @@ public class HapClientTest { evt.valueInt1 = 0x01; // features mService.messageFromNative(evt); - try { - verify(mCallback, after(TIMEOUT_MS).times(1)).onHapFeaturesAvailable(eq(device), - eq(evt.valueInt1)); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } - // Inject some initial presets List<BluetoothHapPresetInfo> presets = new ArrayList<BluetoothHapPresetInfo>(Arrays.asList( diff --git a/framework/java/android/bluetooth/BluetoothHapClient.java b/framework/java/android/bluetooth/BluetoothHapClient.java index 4d1bd6ac1a..986c4adf14 100644 --- a/framework/java/android/bluetooth/BluetoothHapClient.java +++ b/framework/java/android/bluetooth/BluetoothHapClient.java @@ -141,17 +141,6 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable @Status int statusCode); /** - * Invoked to inform about HA device's feature set. - * - * @param device remote device - * @param hapFeatures the feature set integer with feature bits set. The inidividual bits - * are defined by Bluetooth SIG in Hearing Access Service specification. - * - * @hide - */ - void onHapFeaturesAvailable(@NonNull BluetoothDevice device, @Feature int hapFeatures); - - /** * Invoked to inform about the failed preset rename attempt. * * @param device remote device @@ -224,18 +213,6 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable } @Override - public void onHapFeaturesAvailable(@NonNull BluetoothDevice device, - @Feature int hapFeatures) { - 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.onHapFeaturesAvailable(device, hapFeatures)); - } - } - - @Override public void onSetPresetNameFailed(@NonNull BluetoothDevice device, int status) { Attributable.setAttributionSource(device, mAttributionSource); for (Map.Entry<BluetoothHapClient.Callback, Executor> callbackExecutorEntry: diff --git a/system/binder/android/bluetooth/IBluetoothHapClientCallback.aidl b/system/binder/android/bluetooth/IBluetoothHapClientCallback.aidl index 274c802ee9..2480b305e9 100644 --- a/system/binder/android/bluetooth/IBluetoothHapClientCallback.aidl +++ b/system/binder/android/bluetooth/IBluetoothHapClientCallback.aidl @@ -33,7 +33,6 @@ oneway interface IBluetoothHapClientCallback { void onPresetInfoChanged(in BluetoothDevice device, in List<BluetoothHapPresetInfo> presetInfoList, in int statusCode); - void onHapFeaturesAvailable(in BluetoothDevice device, in int hapFeatures); void onSetPresetNameFailed(in BluetoothDevice device, in int status); void onSetPresetNameForGroupFailed(in int hapGroupId, in int status); } |