From: InHong Han Date: Wed, 6 May 2020 08:41:37 +0000 (+0900) Subject: Modified to send show_notification message when mobile is disconnected X-Git-Tag: accepted/tizen/5.5/unified/20200507.152357~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19c75cd455514701a094c536957a29e3beba45fc;p=platform%2Fcore%2Fuifw%2Fcapi-ui-sticker.git Modified to send show_notification message when mobile is disconnected Change-Id: I8013592edbb13703a0d1553295d49d86430de47b --- diff --git a/receiver/inc/sticker_request.h b/receiver/inc/sticker_request.h index 583bd9a..9fa6f2e 100644 --- a/receiver/inc/sticker_request.h +++ b/receiver/inc/sticker_request.h @@ -23,7 +23,8 @@ using namespace std; typedef enum { REQUEST_TYPE_SYNC, - REQUEST_TYPE_FEATURE_REQ + REQUEST_TYPE_FEATURE_REQ, + REQUEST_TYPE_SHOW_NOTIFICATION } request_type; struct StickerRequest { diff --git a/receiver/src/ft.cpp b/receiver/src/ft.cpp index ae52546..b375757 100644 --- a/receiver/src/ft.cpp +++ b/receiver/src/ft.cpp @@ -492,6 +492,16 @@ void send_disconnect_message() void request_show_sync_notification() { JsonObject *j_object = NULL; + + if (!priv_data.socket) { + job_progress = TRUE; + StickerRequest pending_request; + pending_request.req_type = REQUEST_TYPE_SHOW_NOTIFICATION; + ReqQueue.push(pending_request); + LOGI("Push show notification request"); + return; + } + j_object = json_object_new(); if (j_object == NULL) { LOGE("json object create error"); @@ -503,6 +513,8 @@ void request_show_sync_notification() if (_send_json_data(j_object) == FALSE) { LOGE("Failed to send STICKER_REQUEST_NOTI_REQ"); + } else { + job_progress = TRUE; } json_object_unref(j_object); @@ -586,6 +598,11 @@ static bool process_request_queue() if (request_sticker_data(request.mode.c_str(), request.category.c_str(), request.type.c_str())) ReqQueue.pop(); } + else if (request.req_type == REQUEST_TYPE_SHOW_NOTIFICATION) { + LOGD("[Request to show notification]"); + request_show_sync_notification(); + ReqQueue.pop(); + } return true; }