Bug 1203046 - Call |NRECNotification| once RFCOMM is connected. r=shuang

This commit is contained in:
Will Wang 2015-09-15 18:19:25 +08:00
Родитель 948e27e61b
Коммит 2a1c15bc8c
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -1399,9 +1399,7 @@ BluetoothHfpManager::ConnectionStateNotification(
} else if (aState == HFP_CONNECTION_STATE_CONNECTED) { } else if (aState == HFP_CONNECTION_STATE_CONNECTED) {
// Once RFCOMM is connected, enable NREC before each new SLC connection // Once RFCOMM is connected, enable NREC before each new SLC connection
mNrecEnabled = HFP_NREC_STARTED; NRECNotification(HFP_NREC_STARTED, mDeviceAddress);
NotifyConnectionStateChanged(
NS_LITERAL_STRING(BLUETOOTH_HFP_NREC_STATUS_CHANGED_ID));
} }
} }
@ -1478,6 +1476,12 @@ BluetoothHfpManager::DtmfNotification(char aDtmf, const nsAString& aBdAddress)
NotifyDialer(NS_ConvertUTF8toUTF16(message)); NotifyDialer(NS_ConvertUTF8toUTF16(message));
} }
/**
* NREC status will be set when:
* 1. Get an AT command from HF device.
* (Bluetooth HFP spec v1.6 merely defines for the "Disable" part.)
* 2. Once RFCOMM is connected, enable NREC before each new SLC connection.
*/
void void
BluetoothHfpManager::NRECNotification(BluetoothHandsfreeNRECState aNrec, BluetoothHfpManager::NRECNotification(BluetoothHandsfreeNRECState aNrec,
const nsAString& aBdAddr) const nsAString& aBdAddr)
@ -1488,7 +1492,6 @@ BluetoothHfpManager::NRECNotification(BluetoothHandsfreeNRECState aNrec,
nsCOMPtr<nsIObserverService> obs = services::GetObserverService(); nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
NS_ENSURE_TRUE_VOID(obs); NS_ENSURE_TRUE_VOID(obs);
// Set NREC status once getting AT command
mNrecEnabled = static_cast<bool>(aNrec); mNrecEnabled = static_cast<bool>(aNrec);
// Notify audio manager // Notify audio manager