Add implemenation for appcontrol extra data 46/99246/1 accepted/tizen_common accepted/tizen_mobile accepted/tizen_wearable accepted/tizen/common/20161122.193056 accepted/tizen/mobile/20161123.000300 accepted/tizen/unified/20170309.031215 accepted/tizen/wearable/20161123.000325 submit/tizen/20161122.081705 submit/tizen_unified/20170308.100403
authorJihoon Jung <jh8801.jung@samsung.com>
Tue, 22 Nov 2016 08:12:38 +0000 (17:12 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Tue, 22 Nov 2016 08:13:21 +0000 (17:13 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: I0599e40ac22a1234acb5c35f592803c70499b923

packaging/ug-nfc-efl.spec
wearable/app/include/nsa-main.h
wearable/app/src/nsa-main.c

index bc83d31..33a4c0f 100644 (file)
@@ -16,7 +16,7 @@ ExcludeArch: %{arm} %ix86 x86_64
 
 Name:       ug-nfc-efl
 Summary:    NFC Setting UI
-Version:    3.1.3
+Version:    3.1.4
 Release:    0
 Group:      App/Network
 License:    Flora-1.1
index e13f5cb..8b2c1ef 100755 (executable)
@@ -53,6 +53,11 @@ typedef struct {
        int aid_count;
 } wallet_info_t;
 
+typedef enum {
+       NSA_OP_NFC = 1,
+       NSA_OP_TAP_N_PAY = 2
+} nsa_operation_type;
+
 typedef struct {
        Evas_Object *main_win;
        Evas_Object *main_layout;
@@ -73,6 +78,8 @@ typedef struct {
        int payment_wallet_cnt;
        GArray *payment_wallet_list;
        Evas_Object *radio_main;
+
+       nsa_operation_type op_type;
 } appdata;
 
 #ifdef __cplusplus
index 88a3081..a92fc61 100755 (executable)
@@ -34,7 +34,7 @@ static void __back_clicked_cb(void *data, Evas_Object *obj, void *event_info)
 
        elm_naviframe_item_pop(ad->navi_frame);
 
-       if (ad->current_view == V_TAP_N_PAY) {
+       if (ad->current_view == V_TAP_N_PAY && ad->op_type != NSA_OP_TAP_N_PAY) {
                Evas_Object *circle_obj;
 
                /* release Tap & Pay view */
@@ -58,7 +58,7 @@ static void __back_clicked_cb(void *data, Evas_Object *obj, void *event_info)
                ad->current_view = V_MAIN;
 
                eext_rotary_object_event_activated_set(ad->main_circle_obj, EINA_TRUE);
-       } else if (ad->current_view == V_MAIN) {
+       } else {
                /* release Main view and exit application */
                NSA_MEM_FREE(ad->payment_handler);
 
@@ -99,6 +99,47 @@ void _nsa_main_app_terminate(void *user_data)
        NSA_DEBUG("_nsa_main_app_terminate end");
 }
 
+static void __parse_service(app_control_h service, void *user_data)
+{
+       appdata *ad = user_data;
+       char *operation = NULL;
+       char *app_id = NULL;
+       char *ex_data = NULL;
+
+       ret_if(ad == NULL);
+
+       app_control_get_operation(service, &operation);
+       app_control_get_app_id(service, &app_id);
+       app_control_get_extra_data(service, "type", &ex_data);
+
+       NSA_DEBUG("operation [%s] >>>>> ", GET_SAFE_STRING(operation));
+       NSA_DEBUG("app_id [%s] >>>>> ", GET_SAFE_STRING(app_id));
+       NSA_DEBUG("extra data [%s] >>>>> ", GET_SAFE_STRING(ex_data));
+
+       ad->op_type = NSA_OP_NFC;
+       if (!ex_data) {
+               NSA_DEBUG_ERR("extra data is NULL");
+               goto end;
+       }
+
+       if (strncmp(operation, APP_CONTROL_OPERATION_SETTING_NFC,
+                       strlen(APP_CONTROL_OPERATION_SETTING_NFC)) == 0) {
+                       /* launched by app-control */
+                       if (strncmp(ex_data, "nfc", strlen("nfc")) == 0) {
+                               ad->op_type = NSA_OP_NFC;
+                       } else if (strncmp(ex_data, "tap_n_pay", strlen("tap_n_pay")) == 0) {
+                               ad->op_type = NSA_OP_TAP_N_PAY;
+                       }
+       }
+
+end:
+       NSA_MEM_FREE(operation);
+       NSA_MEM_FREE(app_id);
+       NSA_MEM_FREE(ex_data);
+
+       return;
+}
+
 void _nsa_main_app_service(app_control_h service, void *user_data)
 {
        appdata *ad = user_data;
@@ -134,7 +175,16 @@ void _nsa_main_app_service(app_control_h service, void *user_data)
        elm_object_part_content_set(ad->main_layout, "elm.swallow.content", ad->navi_frame);
        eext_object_event_callback_add(ad->navi_frame, EEXT_CALLBACK_BACK, __back_clicked_cb, ad);
 
-       _nsa_view_main_create(ad);
+       /* parse service data */
+       __parse_service(service, ad);
+
+       /* launch nss */
+       if (ad->op_type == NSA_OP_TAP_N_PAY){
+               _nsa_view_tap_n_pay_create(ad);
+       } else {
+               _nsa_view_main_create(ad);
+       }
+
        elm_win_activate(ad->main_win);
 
        NSA_DEBUG("_nsa_main_app_service end");