Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 329580e6 authored by Angela Wang's avatar Angela Wang Committed by Automerger Merge Worker
Browse files

Merge "BluetoothVolumeControl: Fix ClassCastException in registerCallback()"...

Merge "BluetoothVolumeControl: Fix ClassCastException in registerCallback()" into main am: 17c582b4

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2917506



Change-Id: I60fb62fa56fcb01a3b475aa3faccc4263665ce6d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ad4b8246 17c582b4
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -390,7 +390,31 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
                        service.registerCallback(mCallback, mAttributionSource, recv);
                    } else {
                        service.notifyNewRegisteredCallback(
                                (IBluetoothVolumeControlCallback) (callback),
                                new IBluetoothVolumeControlCallback.Stub() {
                                    @Override
                                    public void onVolumeOffsetChanged(
                                            BluetoothDevice device, int volumeOffset)
                                            throws RemoteException {
                                        Attributable.setAttributionSource(
                                                device, mAttributionSource);
                                        executor.execute(
                                                () ->
                                                        callback.onVolumeOffsetChanged(
                                                                device, volumeOffset));
                                    }

                                    @Override
                                    public void onDeviceVolumeChanged(
                                            BluetoothDevice device, int volume)
                                            throws RemoteException {
                                        Attributable.setAttributionSource(
                                                device, mAttributionSource);
                                        executor.execute(
                                                () ->
                                                        callback.onDeviceVolumeChanged(
                                                                device, volume));
                                    }
                                },
                                mAttributionSource,
                                recv);
                    }