am 8b525c07: Merge "Check for state before disconnecting." into gingerbread
Merge commit '8b525c076068eb38106dca05513816c01d8bdddb' into gingerbread-plus-aosp * commit '8b525c076068eb38106dca05513816c01d8bdddb': Check for state before disconnecting.
This commit is contained in:
@@ -367,6 +367,11 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub {
|
||||
int state = getSinkState(device);
|
||||
String path = mBluetoothService.getObjectPathFromAddress(device.getAddress());
|
||||
|
||||
switch (state) {
|
||||
case BluetoothA2dp.STATE_DISCONNECTED:
|
||||
case BluetoothA2dp.STATE_DISCONNECTING:
|
||||
return false;
|
||||
}
|
||||
// State is CONNECTING or CONNECTED or PLAYING
|
||||
handleSinkStateChange(device, state, BluetoothA2dp.STATE_DISCONNECTING);
|
||||
if (!disconnectSinkNative(path)) {
|
||||
|
||||
Reference in New Issue
Block a user