Bug 1027506 - [bluedroid] Don't reset call array after HFP link lost, r=echou

This commit is contained in:
Shawn Huang 2014-06-26 09:58:50 +08:00
parent 746617e31f
commit 4e3d86dd66
2 changed files with 13 additions and 6 deletions

View File

@ -371,17 +371,13 @@ BluetoothHfpManager::ResetCallArray()
}
void
BluetoothHfpManager::Reset()
BluetoothHfpManager::Cleanup()
{
mReceiveVgsFlag = false;
mDialingRequestProcessed = true;
mConnectionState = BTHF_CONNECTION_STATE_DISCONNECTED;
mPrevConnectionState = BTHF_CONNECTION_STATE_DISCONNECTED;
mAudioState = BTHF_AUDIO_STATE_DISCONNECTED;
// Phone & Device CIND
ResetCallArray();
mBattChg = 5;
mService = 0;
mRoam = 0;
@ -390,6 +386,16 @@ BluetoothHfpManager::Reset()
mController = nullptr;
}
void
BluetoothHfpManager::Reset()
{
// Phone & Device CIND
ResetCallArray();
// Clear Sco state
mAudioState = BTHF_AUDIO_STATE_DISCONNECTED;
Cleanup();
}
bool
BluetoothHfpManager::Init()
{
@ -818,7 +824,7 @@ BluetoothHfpManager::NotifyConnectionStateChanged(const nsAString& aType)
} else {
OnDisconnect(EmptyString());
}
Reset();
Cleanup();
}
}
}

View File

@ -136,6 +136,7 @@ private:
BluetoothHfpManager();
bool Init();
void Cleanup();
void HandleShutdown();
void HandleVolumeChanged(const nsAString& aData);