Disable NAP connection in IOT headed profile 99/254199/1 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/hotfix/20210305.054435 submit/tizen_6.0_hotfix/20210225.045718
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 25 Feb 2021 01:48:03 +0000 (10:48 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 25 Feb 2021 01:48:57 +0000 (10:48 +0900)
Change-Id: I9b60fc122d81490918500f7560e1c527d8b59fa0
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
standard/bt-callback.c
standard/bt-main-view.c
standard/bt-profile-view.c

index 12b983d..b3e421b 100644 (file)
@@ -812,6 +812,12 @@ void _bt_cb_bonding_created(int result, bt_device_info_s *dev_info,
                                        _bt_main_connect_device(ugd, new_dev);
                        } else {
                                BT_DBG("Net profile exists");
+
+                               if (TIZEN_COMMON) {
+                                       BT_DBG("Don't use NAP / PAN");
+                                       return;
+                               }
+
                                int connected = _bt_util_is_profile_connected(
                                                BT_NETWORK_SERVER_CONNECTED,
                                                new_dev->bd_addr);
index a89d761..47e77e6 100644 (file)
@@ -3726,12 +3726,23 @@ void _bt_main_connect_device(bt_ug_data *ugd, bt_dev_t *dev)
                                BT_ERR("Fail to connect HID device");
                        }
                }
-       } else if (dev->service_list & BT_SC_NAP_SERVICE_MASK) {
-               void *net_profile;
+       } else if (TIZEN_FEATURE_BT_HOG && (dev->is_le_device) && (ugd->connect_req == FALSE)) {
+               if (bt_gatt_connect(dev->addr_str, false) == BT_ERROR_NONE) {
+                       ugd->connect_req = TRUE;
+                       dev->status = BT_CONNECTING;
+               } else {
+                       BT_ERR("Fail to connect le device");
+               }
+       }
+
+       if (!TIZEN_COMMON) {
+               if (dev->service_list & BT_SC_NAP_SERVICE_MASK) {
+                       void *net_profile;
+
                        if (dev->net_profile) {
                                if (_bt_connect_net_profile(ugd->connection,
-                                                           dev->net_profile,
-                                                           dev) == BT_UG_ERROR_NONE) {
+                                                               dev->net_profile,
+                                                               dev) == BT_UG_ERROR_NONE) {
                                        ugd->connect_req = TRUE;
                                        dev->status = BT_CONNECTING;
                                } else {
@@ -3753,12 +3764,6 @@ void _bt_main_connect_device(bt_ug_data *ugd, bt_dev_t *dev)
                                        }
                                }
                        }
-       } else if (TIZEN_FEATURE_BT_HOG && (dev->is_le_device) && (ugd->connect_req == FALSE)) {
-               if (bt_gatt_connect(dev->addr_str, false) == BT_ERROR_NONE) {
-                       ugd->connect_req = TRUE;
-                       dev->status = BT_CONNECTING;
-               } else {
-                       BT_ERR("Fail to connect le device");
                }
        }
 
@@ -3844,36 +3849,38 @@ void _bt_main_disconnect_device(bt_ug_data *ugd, bt_dev_t *dev)
                         BT_ERR("Failed to disconnect gatt");
                 }
         } else {
-               void *net_profile;
-               gboolean connected = FALSE;
+                if (!TIZEN_COMMON) {
+                       void *net_profile;
+                       gboolean connected = FALSE;
 
-               connected = _bt_util_is_profile_connected(BT_NETWORK_CONNECTED,
-                                               dev->bd_addr);
-               if (connected) {
-                       if (dev->net_profile) {
-                               if (_bt_disconnect_net_profile(ugd->connection,
-                                               dev->net_profile, dev) ==
-                                                       BT_UG_ERROR_NONE) {
-                                       ugd->connect_req = true;
-                                       dev->status = BT_DISCONNECTING;
-                               } else {
-                                       BT_ERR("Fail to disconnect the net profile");
-                               }
-                       } else {
-                               net_profile =
-                                       _bt_get_registered_net_profile(
-                                                       ugd->connection,
+                       connected = _bt_util_is_profile_connected(BT_NETWORK_CONNECTED,
                                                        dev->bd_addr);
-                               if (net_profile) {
-                                       if (_bt_disconnect_net_profile(
-                                                       ugd->connection,
-                                                       net_profile, dev) ==
+                       if (connected) {
+                               if (dev->net_profile) {
+                                       if (_bt_disconnect_net_profile(ugd->connection,
+                                                       dev->net_profile, dev) ==
                                                                BT_UG_ERROR_NONE) {
                                                ugd->connect_req = true;
                                                dev->status = BT_DISCONNECTING;
                                        } else {
                                                BT_ERR("Fail to disconnect the net profile");
                                        }
+                               } else {
+                                       net_profile =
+                                               _bt_get_registered_net_profile(
+                                                               ugd->connection,
+                                                               dev->bd_addr);
+                                       if (net_profile) {
+                                               if (_bt_disconnect_net_profile(
+                                                               ugd->connection,
+                                                               net_profile, dev) ==
+                                                                       BT_UG_ERROR_NONE) {
+                                                       ugd->connect_req = true;
+                                                       dev->status = BT_DISCONNECTING;
+                                               } else {
+                                                       BT_ERR("Fail to disconnect the net profile");
+                                               }
+                                       }
                                }
                        }
                }
index d902e7d..32717a1 100644 (file)
@@ -1843,14 +1843,16 @@ static Evas_Object *__bt_profile_draw_genlist(bt_ug_data *ugd, bt_dev_t *dev_inf
        }
 
 #ifndef TIZEN_BT_A2DP_SINK_ENABLE
-       if (dev_info->service_list & BT_SC_NAP_SERVICE_MASK) {
-               /* NAP device */
-               git = elm_genlist_item_append(genlist, vd->network_itc,
-                                       dev_info, NULL,
-                                       ELM_GENLIST_ITEM_NONE,
-                                       __bt_profile_nap_option_item_sel,
-                                       dev_info);
-               vd->network_item = git;
+       if (!TIZEN_COMMON) {
+               if (dev_info->service_list & BT_SC_NAP_SERVICE_MASK) {
+                       /* NAP device */
+                       git = elm_genlist_item_append(genlist, vd->network_itc,
+                                               dev_info, NULL,
+                                               ELM_GENLIST_ITEM_NONE,
+                                               __bt_profile_nap_option_item_sel,
+                                               dev_info);
+                       vd->network_item = git;
+               }
        }
 #endif
        FN_END;