DO NOT MERGE Add null check before disconnecting a device.

Bug: 3076404
Change-Id: I8ef140395503816296124a38e42ab9cc7e6f7159
This commit is contained in:
Jaikumar Ganesh
2010-10-13 10:53:05 -07:00
parent d3a460cce7
commit 268d1f1e4b

View File

@@ -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);