am eb701df8: Merge "Cleanup references when turning BT off." into ics-mr1

* commit 'eb701df88cb3027d6323f9e2607cbe4d5ca93ac2':
  Cleanup references when turning BT off.
This commit is contained in:
Jaikumar Ganesh
2011-11-29 10:07:24 -08:00
committed by Android Git Automerger
9 changed files with 73 additions and 13 deletions

View File

@@ -2390,16 +2390,18 @@ public class BluetoothService extends IBluetooth.Stub {
}
BluetoothDeviceProfileState addProfileState(String address, boolean setTrust) {
BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
if (state != null) return state;
state = new BluetoothDeviceProfileState(mContext, address, this, mA2dpService, setTrust);
BluetoothDeviceProfileState state =
new BluetoothDeviceProfileState(mContext, address, this, mA2dpService, setTrust);
mDeviceProfileState.put(address, state);
state.start();
return state;
}
void removeProfileState(String address) {
BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
if (state == null) return;
state.quit();
mDeviceProfileState.remove(address);
}