Bug 921999 - Bluetooth Device connection status in Settings is incorrect if remote headset restores connection, r=gyeh

This commit is contained in:
Ben Tian 2014-01-23 10:46:45 +08:00
parent c6dc57b4db
commit c5682cb766
2 changed files with 16 additions and 0 deletions

View File

@ -676,6 +676,14 @@ BluetoothA2dpManager::HandleSinkPropertyChanged(const BluetoothSignal& aSignal)
BluetoothValue::TArrayOfBluetoothNamedValue);
const nsString& address = aSignal.path();
/**
* Update sink property only if
* - mDeviceAddress is empty (A2dp is disconnected), or
* - this property change is from the connected sink.
*/
NS_ENSURE_TRUE_VOID(mDeviceAddress.IsEmpty() ||
mDeviceAddress.Equals(address));
const InfallibleTArray<BluetoothNamedValue>& arr =
aSignal.value().get_ArrayOfBluetoothNamedValue();
MOZ_ASSERT(arr.Length() == 1);

View File

@ -257,6 +257,14 @@ BluetoothA2dpManager::HandleSinkPropertyChanged(const BluetoothSignal& aSignal)
MOZ_ASSERT(aSignal.value().type() == BluetoothValue::TArrayOfBluetoothNamedValue);
const nsString& address = aSignal.path();
/**
* Update sink property only if
* - mDeviceAddress is empty (A2dp is disconnected), or
* - this property change is from the connected sink.
*/
NS_ENSURE_TRUE_VOID(mDeviceAddress.IsEmpty() ||
mDeviceAddress.Equals(address));
const InfallibleTArray<BluetoothNamedValue>& arr =
aSignal.value().get_ArrayOfBluetoothNamedValue();
MOZ_ASSERT(arr.Length() == 1);