Bug 940271 - Don't fire PropertyChanged if the device address has been already in the array, r=gyeh

This commit is contained in:
Eric Chou 2013-11-19 20:13:02 +08:00
Родитель 2fc7eca37d
Коммит 0fa0058d69
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -536,12 +536,13 @@ BondStateChangedCallback(bt_status_t aStatus, bt_bdaddr_t* aRemoteBdAddress,
nsAutoString remoteAddress;
BdAddressTypeToString(aRemoteBdAddress, remoteAddress);
bool bonded;
if (aState == BT_BOND_STATE_BONDING) {
// We don't need to handle bonding state
return;
} else if (aState == BT_BOND_STATE_NONE) {
// We don't need to handle bonding state
NS_ENSURE_TRUE_VOID(aState != BT_BOND_STATE_BONDING);
NS_ENSURE_FALSE_VOID(aState == BT_BOND_STATE_BONDED &&
sAdapterBondedAddressArray.Contains(remoteAddress));
bool bonded;
if (aState == BT_BOND_STATE_NONE) {
bonded = false;
sAdapterBondedAddressArray.RemoveElement(remoteAddress);
} else if (aState == BT_BOND_STATE_BONDED) {