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

Commit 29cd27bf authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

Fix NPE in BT audio connected states.

It's possible that we receive BT_AUDIO_CONNECTED/BT_AUDIO_DISCONNECTED signals from CallAudioRoutePeripheralAdapter. This was mainly being used as part of the legacy audio routing code and isn't required since we listen to the broadcasts in BluetoothStateReceiver already. Add a NPE check to disregard these messages if the device isn't specified.

Bug: 410872585
Flag: EXEMPT bug fix
Test: atest CallAudioRouteControllerTest
Change-Id: Idf50dfbe2200fa1e2de5d0a2c3a01d7561e0d638
parent 2aeb13f7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -759,7 +759,7 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
     * Message being handled: BT_AUDIO_CONNECTED
     */
    private void handleBtAudioActive(BluetoothDevice bluetoothDevice) {
        if (mIsPending) {
        if (mIsPending && bluetoothDevice != null) {
            Log.i(this, "handleBtAudioActive: is pending path");
            if (Objects.equals(mPendingAudioRoute.getDestRoute().getBluetoothAddress(),
                    bluetoothDevice.getAddress())) {
@@ -778,7 +778,7 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
     * Message being handled: BT_AUDIO_DISCONNECTED
     */
    private void handleBtAudioInactive(BluetoothDevice bluetoothDevice) {
        if (mIsPending) {
        if (mIsPending && bluetoothDevice != null) {
            Log.i(this, "handleBtAudioInactive: is pending path");
            if (Objects.equals(mPendingAudioRoute.getOrigRoute().getBluetoothAddress(),
                    bluetoothDevice.getAddress())) {