If we call bluetooth_telephony_audio_open API in next step 6,
the API call fails.
bluetooth-audio.c: bt_ag_open_sco(259) > ALREADY_DONE(0xffff8103)
1. bt_audio_initialize();
2. bt_ag_open_sco();
3. bt_ag_close_sco();
4. bt_audio_deinitialize();
5. bt_audio_initialize();
6. bt_ag_open_sco();
The cause was the headset state was not initailized.
(Because telephony library could not get the event
- bt_audio_deinitailize also remove the event handler)
Change-Id: Ia724205e394dda8ee956805e951fb40385e623d2
/*Callback and user applicaton data*/
telephony_info.cb = cb;
telephony_info.user_data = user_data;
+ telephony_info.headset_state = BLUETOOTH_STATE_DISCONNETED;
dbus_error_init(&dbus_error);
conn = dbus_g_connection_get_connection(telephony_dbus_info.conn);
telephony_info.cb = NULL;
telephony_info.user_data = NULL;
telephony_info.call_count = 0;
+ telephony_info.headset_state = BLUETOOTH_STATE_DISCONNETED;
/*Remove BT enabled signal*/
dbus_g_proxy_disconnect_signal(