am 03403712: Merge "DO NOT MERGE Add null check before disconnecting a device." into gingerbread

Merge commit '0340371297887290d7593d7c346e422a4c9ecd1a' into gingerbread-plus-aosp

* commit '0340371297887290d7593d7c346e422a4c9ecd1a':
  DO NOT MERGE Add null check before disconnecting a device.
This commit is contained in:
Jaikumar Ganesh
2010-10-13 11:13:33 -07:00
committed by Android Git Automerger

View File

@@ -379,7 +379,8 @@ public abstract class LocalBluetoothProfileManager {
@Override @Override
public boolean disconnect(BluetoothDevice device) { 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. // Downgrade prority as user is disconnecting the headset.
if (mService.getPriority(device) > BluetoothHeadset.PRIORITY_ON) { if (mService.getPriority(device) > BluetoothHeadset.PRIORITY_ON) {
mService.setPriority(device, BluetoothHeadset.PRIORITY_ON); mService.setPriority(device, BluetoothHeadset.PRIORITY_ON);