Fix merge conflict 19/208419/3 accepted/tizen/unified/20190624.115329 submit/tizen/20190624.074820
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 24 Jun 2019 06:49:05 +0000 (15:49 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 24 Jun 2019 07:41:17 +0000 (16:41 +0900)
Change-Id: Ib014b55edb95b0eafde42b3e39d17ff5929bf1ce

provider/download-provider-client-manager.c
provider/download-provider-client.c
provider/download-provider-main.c
provider/download-provider-network.c
provider/download-provider-notification-manager.c
provider/download-provider-notification.c

index 240e28b..bbdb82b 100755 (executable)
@@ -293,7 +293,6 @@ static int __dp_manage_client_requests(dp_client_slots_fmt *clients)
                                                        && dp_notification_manager_push_notification((void *)&clients[slot_index], (void *)request, DP_NOTIFICATION_ONGOING) < 0)
                                                TRACE_ERROR("failed to register notification for id:%d", request->id);
                                }
-
                                slot_index++;
 
                        } else {
index 78126af..ff6cd3e 100755 (executable)
@@ -553,21 +553,21 @@ static int __dp_request_get_info(dp_client_fmt *client, dp_ipc_fmt *ipc_info, dp
                        break;
                }
        case DP_PROP_PROXY:
-       {
-               char *string = NULL;
-               unsigned length = 0;
-               if (dp_db_get_property_string(client->dbhandle, ipc_info->id, DP_TABLE_REQUEST, DP_DB_COL_PROXY, (unsigned char **)&string, &length, &errorcode) < 0) {
-                       TRACE_ERROR("failed to get %s", dp_print_property(ipc_info->property));
-                       errorcode = DP_ERROR_NO_DATA;
-               }
-               int result = __dp_request_feedback_string(client->channel, ipc_info, string, length, errorcode);
-               if (result == DP_ERROR_IO_ERROR) {
-                       errorcode = DP_ERROR_IO_ERROR;
-                       TRACE_ERROR("check ipc sock:%d", client->channel);
+               {
+                       char *string = NULL;
+                       unsigned length = 0;
+                       if (dp_db_get_property_string(client->dbhandle, ipc_info->id, DP_TABLE_REQUEST, DP_DB_COL_PROXY, (unsigned char **)&string, &length, &errorcode) < 0) {
+                               TRACE_ERROR("failed to get %s", dp_print_property(ipc_info->property));
+                               errorcode = DP_ERROR_NO_DATA;
+                       }
+                       int result = __dp_request_feedback_string(client->channel, ipc_info, string, length, errorcode);
+                       if (result == DP_ERROR_IO_ERROR) {
+                               errorcode = DP_ERROR_IO_ERROR;
+                               TRACE_ERROR("check ipc sock:%d", client->channel);
+                       }
+                       free(string);
+                       break;
                }
-               free(string);
-               break;
-       }
        case DP_PROP_DESTINATION:
                {
                        char *string = NULL;
@@ -1072,22 +1072,21 @@ static int __dp_request_set_info(dp_client_slots_fmt *slot, dp_ipc_fmt *ipc_info
                        break;
                }
        case DP_PROP_PROXY:
-       {
-               char *recv_str = NULL;
-               errorcode = __dp_request_read_string(client->channel, ipc_info, &recv_str);
-               if (errorcode == DP_ERROR_NONE) {
-                       if (recv_str == NULL) {
-                               errorcode = DP_ERROR_INVALID_PARAMETER;
-                       } else {
-                               // write to database here
-                               if (dp_db_replace_property(client->dbhandle, ipc_info->id, DP_TABLE_REQUEST, DP_DB_COL_PROXY, (void *)recv_str, ipc_info->size, 2, &errorcode) < 0) {
-                                       TRACE_ERROR("failed to set %s errorcode:%s", dp_print_property(ipc_info->property), dp_print_errorcode(errorcode));
+               {
+                       char *recv_str = NULL;
+                       errorcode = __dp_request_read_string(client->channel, ipc_info, &recv_str);
+                       if (errorcode == DP_ERROR_NONE) {
+                               if (recv_str == NULL) {
+                                       errorcode = DP_ERROR_INVALID_PARAMETER;
+                               } else {
+                                       // write to database here
+                                       if (dp_db_replace_property(client->dbhandle, ipc_info->id, DP_TABLE_REQUEST, DP_DB_COL_PROXY, (void *)recv_str, ipc_info->size, 2, &errorcode) < 0)
+                                               TRACE_ERROR("failed to set %s errorcode:%s", dp_print_property(ipc_info->property), dp_print_errorcode(errorcode));
+                                       free(recv_str);
                                }
-                               free(recv_str);
                        }
+                       break;
                }
-               break;
-       }
        case DP_PROP_DESTINATION:
                {
                        char *recv_str = NULL;
@@ -1457,9 +1456,8 @@ static int __dp_request_unset_info(dp_client_fmt *client, dp_ipc_fmt *ipc_info,
                        TRACE_ERROR("failed to unset %s", dp_print_property(ipc_info->property));
                break;
        case DP_PROP_PROXY:
-               if (dp_db_unset_property_string(client->dbhandle, ipc_info->id, DP_TABLE_REQUEST, DP_DB_COL_PROXY, &errorcode) < 0) {
+               if (dp_db_unset_property_string(client->dbhandle, ipc_info->id, DP_TABLE_REQUEST, DP_DB_COL_PROXY, &errorcode) < 0)
                        TRACE_ERROR("failed to unset %s errorcode:%s", dp_print_property(ipc_info->property), dp_print_errorcode(errorcode));
-               }
                break;
        case DP_PROP_DESTINATION:
                // if downloading, change destination to da_agent
index 6e14414..1a2c14e 100755 (executable)
  * limitations under the License.
  */
 
+#define _GNU_SOURCE
+#include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <pthread.h>
 
 #include <systemd/sd-daemon.h>
 #include <glib-object.h>
@@ -63,6 +64,7 @@ int main(int argc, char **argv)
                curl_global_cleanup();
                return 0;
        } else {
+               pthread_setname_np(g_client_manager_tid, "dp-client-mgr");
                pthread_detach(g_client_manager_tid);
                TRACE_INFO("download main thread is created[%lu]", g_client_manager_tid);
        }
index f009855..060b2ea 100755 (executable)
@@ -96,41 +96,20 @@ static int __dp_get_network_connection_status(connection_h connection, connectio
                network_type = DP_NETWORK_ALL;
                TRACE_INFO("COMPANION MODE");
        } else if (type == CONNECTION_TYPE_WIFI) {
-               connection_wifi_state_e wifi_state;
-               wifi_state = CONNECTION_WIFI_STATE_DEACTIVATED;
-               if (connection_get_wifi_state(connection, &wifi_state) !=
-                               CONNECTION_ERROR_NONE) {
-                       TRACE_ERROR("Failed connection_get_wifi_state");
-               } else {
-                       if (wifi_state == CONNECTION_WIFI_STATE_CONNECTED) {
-                               TRACE_INFO("WIFI CONNECTED");
-                               network_type = DP_NETWORK_WIFI;
-                       }
-               }
+               TRACE_INFO("WIFI CONNECTED");
+               network_type = DP_NETWORK_WIFI;
        } else if (type == CONNECTION_TYPE_CELLULAR) {
-               connection_cellular_state_e cellular_state;
-               cellular_state = CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE;
-               if (connection_get_cellular_state(connection,
-                                       &cellular_state) != CONNECTION_ERROR_NONE) {
-                       TRACE_ERROR("Failed connection_get_cellular_state");
-               } else {
-                       if (cellular_state == CONNECTION_CELLULAR_STATE_CONNECTED) {
-                               TRACE_INFO("DATA NETWORK CONNECTED");
-                               network_type = DP_NETWORK_DATA_NETWORK;
-                       }
-               }
+               TRACE_INFO("DATA NETWORK CONNECTED");
+               network_type = DP_NETWORK_DATA_NETWORK;
        } else if (type == CONNECTION_TYPE_ETHERNET) {
-               connection_ethernet_state_e ethernet_state;
-               ethernet_state = CONNECTION_ETHERNET_STATE_DISCONNECTED;
-               if (connection_get_ethernet_state(connection,
-                                       &ethernet_state) != CONNECTION_ERROR_NONE) {
-                       TRACE_ERROR("Failed connection_get_ethernet_state");
-               } else {
-                       if (ethernet_state == CONNECTION_ETHERNET_STATE_CONNECTED) {
-                               TRACE_INFO("ETHERNET CONNECTED");
-                               network_type = DP_NETWORK_WIFI;
-                       }
-               }
+               TRACE_INFO("ETHERNET CONNECTED");
+               network_type = DP_NETWORK_WIFI;
+       } else if (type == CONNECTION_TYPE_BT) {
+               TRACE_INFO("BT CONNECTED");
+               network_type = DP_NETWORK_WIFI;
+       } else if (type == CONNECTION_TYPE_NET_PROXY) {
+               TRACE_INFO("NET PROXY CONNECTED");
+               network_type = DP_NETWORK_WIFI;
        } else {
                TRACE_INFO("DISCONNECTED");
                network_type = DP_NETWORK_OFF;
index 1d6510f..8c9170f 100644 (file)
@@ -452,9 +452,8 @@ static void __dp_notification_manager_check_notification()
                                        char *url = NULL;
                                        unsigned int len = 0;
                                        if (CLIENT_MUTEX_CHECKLOCK(&slot->mutex) == 0) {
-                                               if (dp_db_get_property_string(slot->client.dbhandle, download_id, DP_TABLE_REQUEST, DP_DB_COL_URL, (unsigned char **)&url, &len, &errorcode) < 0) {
+                                               if (dp_db_get_property_string(slot->client.dbhandle, download_id, DP_TABLE_REQUEST, DP_DB_COL_URL, (unsigned char **)&url, &len, &errorcode) < 0)
                                                        TRACE_ERROR("failed to get url id:%d error:%s", download_id, dp_print_errorcode(errorcode));
-                                               }
                                                CLIENT_MUTEX_UNLOCK(&slot->mutex);
                                        }
 
index 5120020..7890469 100755 (executable)
@@ -285,9 +285,7 @@ int dp_notification_ongoing_new(const char *url, const char *pkgname, const char
        if (url != NULL) {
                err = notification_set_text(noti_handle, NOTIFICATION_TEXT_TYPE_CONTENT, url, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
                if (err != NOTIFICATION_ERROR_NONE)
-               {
                        TRACE_ERROR("failed to set url error:%s", __dp_noti_error_str(err));
-               }
        }