mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 19:25:43 +00:00
Bug 869306: Update call direction if call state changes, r=echou
This commit is contained in:
parent
d46bece2b0
commit
77a3d4dcb3
@ -1208,6 +1208,7 @@ void
|
||||
BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString& aNumber,
|
||||
const bool aIsOutgoing,
|
||||
bool aSend)
|
||||
{
|
||||
if (!IsConnected()) {
|
||||
@ -1222,6 +1223,7 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
|
||||
|
||||
uint16_t prevCallState = mCurrentCallArray[aCallIndex].mState;
|
||||
mCurrentCallArray[aCallIndex].mState = aCallState;
|
||||
mCurrentCallArray[aCallIndex].mDirection = !aIsOutgoing;
|
||||
|
||||
// Same logic as implementation in ril_worker.js
|
||||
if (aNumber.Length() && aNumber[0] == '+') {
|
||||
@ -1240,7 +1242,6 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
|
||||
SendCommand("+CIEV: ", CINDType::CALLHELD);
|
||||
break;
|
||||
case nsITelephonyProvider::CALL_STATE_INCOMING:
|
||||
mCurrentCallArray[aCallIndex].mDirection = true;
|
||||
|
||||
if (mCurrentCallIndex) {
|
||||
if (mCCWA) {
|
||||
@ -1274,14 +1275,12 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
|
||||
mBLDNProcessed = true;
|
||||
}
|
||||
|
||||
mCurrentCallArray[aCallIndex].mDirection = false;
|
||||
UpdateCIND(CINDType::CALLSETUP, CallSetupState::OUTGOING, aSend);
|
||||
|
||||
mSocket->GetAddress(address);
|
||||
OpenScoSocket(address);
|
||||
break;
|
||||
case nsITelephonyProvider::CALL_STATE_ALERTING:
|
||||
mCurrentCallArray[aCallIndex].mDirection = false;
|
||||
UpdateCIND(CINDType::CALLSETUP, CallSetupState::OUTGOING_ALERTING, aSend);
|
||||
|
||||
// If there's an ongoing call when the headset is just connected, we have
|
||||
|
@ -78,7 +78,9 @@ public:
|
||||
* @param aSend A boolean indicates whether we need to notify headset or not
|
||||
*/
|
||||
void HandleCallStateChanged(uint32_t aCallIndex, uint16_t aCallState,
|
||||
const nsAString& aNumber, bool aSend);
|
||||
const nsAString& aNumber, const bool aIsOutgoing,
|
||||
bool aSend);
|
||||
|
||||
bool IsConnected();
|
||||
void GetAddress(nsAString& aDeviceAddress);
|
||||
|
||||
|
@ -34,7 +34,8 @@ TelephonyListener::CallStateChanged(uint32_t aCallIndex,
|
||||
bool aIsOutgoing)
|
||||
{
|
||||
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
|
||||
hfp->HandleCallStateChanged(aCallIndex, aCallState, aNumber, true);
|
||||
hfp->HandleCallStateChanged(aCallIndex, aCallState, aNumber,
|
||||
aIsOutgoing, true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -48,7 +49,8 @@ TelephonyListener::EnumerateCallState(uint32_t aCallIndex,
|
||||
bool* aResult)
|
||||
{
|
||||
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
|
||||
hfp->HandleCallStateChanged(aCallIndex, aCallState, aNumber, false);
|
||||
hfp->HandleCallStateChanged(aCallIndex, aCallState, aNumber,
|
||||
aIsOutgoing, false);
|
||||
*aResult = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user