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

Commit 5dfcb838 authored by Joseph Pirozzo's avatar Joseph Pirozzo
Browse files

AVRCP Controller getCurrentCalls NPE

Check for null call list if media device and phone call device are
different.

Bug: 138256493
Test: Connect 2 phones, one HFP one A2DP, receive incomming call.
Change-Id: I5f5c85d65283add3790dfaa1f252c3a14127f822
parent b61b321f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.bluetooth.a2dpsink;

import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadsetClientCall;
import android.content.Context;
import android.content.pm.PackageManager;
import android.media.AudioAttributes;
@@ -361,7 +362,10 @@ public class A2dpSinkStreamHandler extends Handler {
        }
        HeadsetClientService headsetClientService = HeadsetClientService.getHeadsetClientService();
        if (targetDevice != null && headsetClientService != null) {
            return headsetClientService.getCurrentCalls(targetDevice).size() > 0;
            List<BluetoothHeadsetClientCall> currentCalls =
                    headsetClientService.getCurrentCalls(targetDevice);
            if (currentCalls == null) return false;
            return currentCalls.size() > 0;
        }
        return false;
    }