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

Commit 17c582b4 authored by Angela Wang's avatar Angela Wang Committed by Gerrit Code Review
Browse files

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

parents 70ce9f05 b7881d20
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);
                    }