DO NOT MERGE Add null check before disconnecting a device.
Bug: 3076404 Change-Id: I8ef140395503816296124a38e42ab9cc7e6f7159
This commit is contained in:
@@ -379,7 +379,8 @@ public abstract class LocalBluetoothProfileManager {
|
||||
|
||||
@Override
|
||||
public boolean disconnect(BluetoothDevice device) {
|
||||
if (mService.getCurrentHeadset().equals(device)) {
|
||||
BluetoothDevice currDevice = mService.getCurrentHeadset();
|
||||
if (currDevice != null && currDevice.equals(device)) {
|
||||
// Downgrade prority as user is disconnecting the headset.
|
||||
if (mService.getPriority(device) > BluetoothHeadset.PRIORITY_ON) {
|
||||
mService.setPriority(device, BluetoothHeadset.PRIORITY_ON);
|
||||
|
Reference in New Issue
Block a user