diff options
Diffstat (limited to 'wearable/app/src/nsa-main.c')
-rwxr-xr-x | wearable/app/src/nsa-main.c | 61 |
1 files changed, 54 insertions, 7 deletions
diff --git a/wearable/app/src/nsa-main.c b/wearable/app/src/nsa-main.c index 9371d39..a92fc61 100755 --- a/wearable/app/src/nsa-main.c +++ b/wearable/app/src/nsa-main.c @@ -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 */ @@ -57,11 +57,8 @@ static void __back_clicked_cb(void *data, Evas_Object *obj, void *event_info) ad->radio_main = NULL; ad->current_view = V_MAIN; - circle_obj = eext_circle_object_genlist_add(ad->main_genlist, ad->circle_surface); - eext_circle_object_genlist_scroller_policy_set(circle_obj, - ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); - eext_rotary_object_event_activated_set(circle_obj, EINA_TRUE); - } else if (ad->current_view == V_MAIN) { + eext_rotary_object_event_activated_set(ad->main_circle_obj, EINA_TRUE); + } else { /* release Main view and exit application */ NSA_MEM_FREE(ad->payment_handler); @@ -102,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; @@ -137,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"); |