Bug 804474 - Null address value in system message of "bluetooth-hfp-status-changed". r=qdot, a=blocking-basecamp

This commit is contained in:
Gina Yeh 2012-10-26 17:21:32 +08:00
Родитель 7d56a60b2a
Коммит b8a22bfb53
2 изменённых файлов: 13 добавлений и 8 удалений

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

@ -321,14 +321,16 @@ BluetoothHfpManager::NotifySettings()
type.AssignLiteral("bluetooth-hfp-status-changed");
name.AssignLiteral("connected");
uint32_t status = GetConnectionStatus();
v = status;
if (GetConnectionStatus() == SocketConnectionStatus::SOCKET_CONNECTED) {
v = true;
} else {
v = false;
}
parameters.AppendElement(BluetoothNamedValue(name, v));
name.AssignLiteral("address");
nsString address;
GetSocketAddr(address);
v = address;
GetSocketAddr(mDevicePath);
v = mDevicePath;
parameters.AppendElement(BluetoothNamedValue(name, v));
if (!BroadcastSystemMessage(type, parameters)) {
@ -835,12 +837,14 @@ BluetoothHfpManager::CallStateChanged(int aCallIndex, int aCallState,
void
BluetoothHfpManager::OnConnectSuccess()
{
// Cache device path for NotifySettings() since we can't get socket address
// when a headset disconnect with us
GetSocketAddr(mDevicePath);
if (mCurrentCallState == nsIRadioInterfaceLayer::CALL_STATE_CONNECTED ||
mCurrentCallState == nsIRadioInterfaceLayer::CALL_STATE_DIALING ||
mCurrentCallState == nsIRadioInterfaceLayer::CALL_STATE_ALERTING) {
nsString address;
GetSocketAddr(address);
OpenScoSocket(address);
OpenScoSocket(mDevicePath);
}
NotifySettings();

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

@ -54,6 +54,7 @@ private:
int mCurrentCallIndex;
int mCurrentCallState;
bool mReceiveVgsFlag;
nsString mDevicePath;
nsAutoPtr<BluetoothRilListener> mListener;
};