From: Injun Yang Date: Mon, 15 May 2017 02:15:27 +0000 (+0900) Subject: Redundant code optimization for GattService event X-Git-Tag: accepted/tizen/3.0/common/20170719.081600~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3429548aaf66d9e8fcd17471582fee6b1ea99723;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Redundant code optimization for GattService event [Model] All [BinType] AP [Customer] OPEN [Issue#] N/A [Request] Internal [Occurrence Version] N/A [Problem] When below interface removed, check the unnecessary condition org.bluez.GattDescriptor1 org.bluez.GattCharacteristic1 [Cause & Measure] When Characteristic or Descriptor is removed, checking watcher list is not required. Just check it for org.bluez.GattService1 interface [Checking Method] Connection with iOS GM [Team] Basic Connection [Developer] Injun Yang [Solution company] Samsung [Change Type] Specification change Change-Id: Id587ffe489526c75cdfd9192c721a03a3eebcd9d --- diff --git a/bt-api/bt-event-handler.c b/bt-api/bt-event-handler.c index b08466e..c20a310 100644 --- a/bt-api/bt-event-handler.c +++ b/bt-api/bt-event-handler.c @@ -3413,19 +3413,19 @@ static void __bt_manager_event_filter(GDBusConnection *connection, return; } - _bt_convert_device_path_to_address(path, address); - _bt_convert_addr_string_to_type(change.device_addr.addr, address); - _bt_convert_addr_string_to_secure_string(secure_address, address); - - if (_bluetooth_gatt_check_service_change_watcher_address(&change.device_addr) - == FALSE) { - BT_INFO("GATT Service [%s] removed, but no watcher for %s", - path, secure_address); - return; - } - while (g_variant_iter_loop(interface_iter, "s", &interface_str)) { if (g_strcmp0(interface_str, GATT_SERV_INTERFACE) == 0) { + _bt_convert_device_path_to_address(path, address); + _bt_convert_addr_string_to_type(change.device_addr.addr, address); + _bt_convert_addr_string_to_secure_string(secure_address, address); + + if (_bluetooth_gatt_check_service_change_watcher_address(&change.device_addr) + == FALSE) { + BT_INFO("GATT Service [%s] removed, but no watcher for %s", + path, secure_address); + return; + } + change.svc_path = g_strdup(path); change.change_type = BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE;