if (dev->connected_mask & BT_STEREO_HEADSET_CONNECTED) {
ret = __bt_profile_disconnect_option((bt_ug_data *)dev->ugd,
dev, BT_STEREO_HEADSET_DEVICE);
+
} else {
ret = __bt_profile_connect_option((bt_ug_data *)dev->ugd,
dev, BT_STEREO_HEADSET_DEVICE);
+
}
#endif
FN_START;
int audio_profile;
+ int ret;
retv_if(ugd == NULL, BT_UG_FAIL);
retv_if(dev == NULL, BT_UG_FAIL);
if (type == BT_HEADSET_DEVICE || type == BT_STEREO_HEADSET_DEVICE ||
type == BT_MUSIC_PLAYER_DEVICE) {
- if (type == BT_STEREO_HEADSET_DEVICE)
+ if (type == BT_STEREO_HEADSET_DEVICE) {
audio_profile = BT_AUDIO_PROFILE_TYPE_A2DP;
+ /* set restriction : allowed */
+ ret = bt_device_set_profile_restricted(dev->addr_str, BT_RESTRICTED_PROFILE_A2DP, 0x0);
+ if (ret != BT_ERROR_NONE)
+ BT_ERR("Failed to set restriction");
+ }
#ifdef TIZEN_BT_A2DP_SINK_ENABLE
else if (type == BT_MUSIC_PLAYER_DEVICE)
audio_profile = BT_AUDIO_PROFILE_TYPE_A2DP_SINK;
#endif
- else
+ else {
+ /* set restriction : allowed */
audio_profile = BT_AUDIO_PROFILE_TYPE_HSP_HFP;
+ ret = bt_device_set_profile_restricted(dev->addr_str, BT_RESTRICTED_PROFILE_HFP_HS, 0x0);
+ if (ret != BT_ERROR_NONE)
+ BT_ERR("Failed to set restriction");
+ }
if (bt_audio_connect(dev->addr_str,
audio_profile) != BT_ERROR_NONE) {
FN_START;
int audio_profile;
+ int ret;
bt_ug_ipc_param_t param;
gboolean connected = FALSE;
gboolean connected_nap_profile = FALSE;
if (type == BT_HEADSET_DEVICE || type == BT_STEREO_HEADSET_DEVICE ||
type == BT_MUSIC_PLAYER_DEVICE) {
- if (type == BT_STEREO_HEADSET_DEVICE)
+ if (type == BT_STEREO_HEADSET_DEVICE) {
audio_profile = BT_AUDIO_PROFILE_TYPE_A2DP;
+ ret = bt_device_set_profile_restricted(dev->addr_str, BT_RESTRICTED_PROFILE_A2DP, 0x1);
+ if (ret != BT_ERROR_NONE)
+ BT_ERR("Failed to set restriction");
+ }
#ifdef TIZEN_BT_A2DP_SINK_ENABLE
else if (type == BT_MUSIC_PLAYER_DEVICE)
audio_profile = BT_AUDIO_PROFILE_TYPE_A2DP_SINK;
#endif
- else
+ else {
audio_profile = BT_AUDIO_PROFILE_TYPE_HSP_HFP;
+ ret = bt_device_set_profile_restricted(dev->addr_str, BT_RESTRICTED_PROFILE_HFP_HS, 0x1);
+ if (ret != BT_ERROR_NONE)
+ BT_ERR("Failed to set restriction");
+ }
+
if (bt_audio_disconnect(dev->addr_str,
audio_profile) != BT_ERROR_NONE) {