diff options
-rw-r--r-- | src/ui/setting_home.c | 12 | ||||
-rw-r--r-- | src/ui/setting_item_discovery.c | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/ui/setting_home.c b/src/ui/setting_home.c index 85aaa06..9477bc8 100644 --- a/src/ui/setting_home.c +++ b/src/ui/setting_home.c @@ -47,6 +47,11 @@ static void tizen_connect_power_on() if (ret != CONV_ERROR_NONE) { dlog_print(DLOG_ERROR, LOG_TAG, "tizen_connect_power_on error. ret = %d", ret); } + + ret = conv_internal_set_service_activation_state(tizen_connect_power_state); + if (ret != CONV_ERROR_NONE) { + dlog_print(DLOG_ERROR, LOG_TAG, "conv_internal_set_service_activation_state error. ret = %d", ret); + } } static void tizen_connect_power_off() @@ -55,10 +60,15 @@ static void tizen_connect_power_off() notice_disable(EINA_FALSE); tizen_connect_power_state = 0; - int ret = conv_internal_set_activation_state(0); + int ret = conv_internal_set_activation_state(tizen_connect_power_state); if (ret != CONV_ERROR_NONE) { dlog_print(DLOG_ERROR, LOG_TAG, "tizen_connect_power_off error. ret = %d", ret); } + + ret = conv_internal_set_service_activation_state(tizen_connect_power_state); + if (ret != CONV_ERROR_NONE) { + dlog_print(DLOG_ERROR, LOG_TAG, "conv_internal_set_service_activation_state error. ret = %d", ret); + } } static int get_tizen_connect_power_state() diff --git a/src/ui/setting_item_discovery.c b/src/ui/setting_item_discovery.c index fe8d1a2..24c7946 100644 --- a/src/ui/setting_item_discovery.c +++ b/src/ui/setting_item_discovery.c @@ -165,17 +165,23 @@ static void discovery_foreach_cb(conv_device_h device_h, int result, void *data) conv_device_get_property_string(device_h, CONV_DEVICE_NAME, &device_name); conv_device_get_property_string(device_h, CONV_DEVICE_TYPE, &device_type); - int index = ++devices_index; + int index; + for (index = 0; index <= devices_index; index++) { + if (!strcmp(devices_info[index]->mac_address, device_id)) { + return; + } + } + + index = ++devices_index; devices_info[index] = (device_info_s *) calloc(sizeof(device_info_s), 1); devices_info[index]->index = index; devices_info[index]->name = device_name; devices_info[index]->type = device_type; devices_info[index]->mac_address = device_id; - //elm_genlist_item_append(discovered_list, item_builder, devices_info[index], NULL, ELM_GENLIST_ITEM_NONE, show_discovery_deivce_selected_menu, devices_info[index]); elm_genlist_item_insert_after(genlist, device_list_item_builder, devices_info[index], NULL, title_item, ELM_GENLIST_ITEM_NONE, show_acl_menu, devices_info[index]); - break; + return; case CONV_DISCOVERY_RESULT_FINISHED : conv_destroy(conv_handle); |