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 */
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);
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;
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");