From a076125d6b3c3451c5e18b6533fef78213357357 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 13 Nov 2012 10:48:36 +0200 Subject: [PATCH] core: Fix remote_uuids setting for external profiles --- src/profile.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/profile.c b/src/profile.c index 187dae6eb..e29564206 100644 --- a/src/profile.c +++ b/src/profile.c @@ -903,9 +903,21 @@ static int ext_disconnect_dev(struct btd_device *dev, static void ext_get_defaults(struct ext_profile *ext) { if (ext->enable_client && !ext->remote_uuids[0]) { + const char *remote_uuid; + g_strfreev(ext->remote_uuids); ext->remote_uuids = g_new0(char *, 2); - ext->remote_uuids[0] = g_strdup(ext->uuid); + + if (strcasecmp(ext->uuid, HFP_HS_UUID) == 0) + remote_uuid = HFP_AG_UUID; + else if (strcasecmp(ext->uuid, HFP_AG_UUID) == 0) + remote_uuid = HFP_HS_UUID; + else if (strcasecmp(ext->uuid, HSP_HS_UUID) == 0) + remote_uuid = HSP_AG_UUID; + else + remote_uuid = ext->uuid; + + ext->remote_uuids[0] = g_strdup(remote_uuid); } if (strcasecmp(ext->uuid, SPP_UUID) == 0) { -- 2.47.3