Fix PBAP Connection fails if HFP is restricted 08/143608/1
authorAnurag Biradar <biradar.a@samsung.com>
Thu, 3 Aug 2017 05:49:26 +0000 (11:19 +0530)
committerBiman Paul <biman.paul@samsung.com>
Thu, 10 Aug 2017 12:29:33 +0000 (17:59 +0530)
[Model] Z400F
[BinType] AP
[Customer] All

[Issue#] NA
[Request] Monitoring Test
[Occurrence Version] QG1

[Problem] If HFP Flag is restricted, further PBAP connection will get rejected
[Cause & Measure] On Incoming connection we are directly checking if HFP is
restricted or not without even considering incoming connection can be for
different profile.
Measure: Before rejecting the connection check for uuid is this connection
request is for HFP

[Checking Method] Connect to Meacapp(HFP and A2DP) -> From Profile View
Disconnect both connection -> Send PBAP connection request -> Check if
connection is possible or not.

[Team] Bluetooth
[Developer] Anurag B
[Solution company] Samsung
[Change Type] N/A

Change-Id: I9cd4067eeb5c55e563c6bdc4cf6595b0ec46d829

src/profile.c

index 41ddab1..af2db7d 100644 (file)
@@ -1470,20 +1470,19 @@ static void ext_confirm(GIOChannel *io, gpointer user_data)
        DBG("incoming connect from %s", addr);
 
 #ifdef TIZEN_FEATURE_BLUEZ_MODIFY
-{
-       struct btd_device *device;
-       gboolean restricted = FALSE;
-
-       device = btd_adapter_find_device(adapter_find(&src), &dst,
-                                                               BDADDR_BREDR);
-       if (device) {
-               restricted = device_is_profile_restricted(device, HFP_HS_UUID);
-               if (restricted) {
-                       DBG("HFP_HS is restricted");
-                       return;
+       if (g_strcmp0(uuid, HFP_AG_UUID) == 0) {
+               struct btd_device *device;
+               gboolean restricted = FALSE;
+               device = btd_adapter_find_device(adapter_find(&src), &dst,
+                                                                       BDADDR_BREDR);
+               if (device) {
+                       restricted = device_is_profile_restricted(device, HFP_HS_UUID);
+                       if (restricted) {
+                               DBG("HFP_HS is restricted");
+                               return;
+                       }
                }
        }
-}
 #endif
 
        conn = create_conn(server, io, &src, &dst);