Add app launch method for transaction event 06/155006/1 accepted/tizen/unified/20171012.075241 submit/tizen/20171012.025147
authorjh8801.jung <jh8801.jung@samsung.com>
Wed, 11 Oct 2017 22:53:44 +0000 (07:53 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Wed, 11 Oct 2017 23:23:35 +0000 (23:23 +0000)
Signed-off-by: jh8801.jung <jh8801.jung@samsung.com>
Change-Id: I9ce458111851889d42f0106593e743b63f61a94e

packaging/nfc-manager.spec
src/manager/include/net_nfc_app_util_internal.h
src/manager/net_nfc_app_util.c
src/manager/net_nfc_server_se.c

index 1885e16a46f4e9ff879738b7fd12a15a95c6cb8e..b527998bc889c72090f5f170707f5d2639c503f9 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       nfc-manager
 Summary:    NFC framework manager
-Version:    0.1.169
+Version:    0.1.170
 Release:    0
 Group:      Network & Connectivity/NFC
 License:    Flora-1.1
index 353714d2975f32656fa986b2f318643c8296958e..bcd19518c58ddc9389c86abe26522a8d0f2db890 100755 (executable)
@@ -52,6 +52,7 @@ bool net_nfc_app_util_is_dir(const char *path_name);
 int net_nfc_app_util_appsvc_launch(const char *operation, const char *uri, const char *mime, const char *data);
 int net_nfc_app_util_launch_se_transaction_app(net_nfc_se_type_e se_type, uint8_t * aid, uint32_t aid_len, uint8_t * param, uint32_t param_len);
 int net_nfc_app_util_launch_se_off_host_apdu_service_app(net_nfc_se_type_e se_type, uint8_t * aid, uint32_t aid_len, uint8_t * param, uint32_t param_len);
+int net_nfc_app_util_launch_se_transaction_app_by_aid(net_nfc_se_type_e se_type, uint8_t *aid, uint32_t aid_len, uint8_t *param, uint32_t param_len);
 int net_nfc_app_util_encode_base64(uint8_t * buffer, uint32_t buf_len, char *result, uint32_t max_result);
 int net_nfc_app_util_decode_base64(const char *buffer, uint32_t buf_len, uint8_t * result, uint32_t * res_len);
 bool net_nfc_app_util_check_launch_state();
index acccf625b6d66dfb49f6dd9c415739a52eb8dde1..2e644d9abe80a1fe60a960b5bc41d34a01cf5987 100755 (executable)
@@ -48,6 +48,7 @@
 #include "net_nfc_util_handover.h"
 #include "net_nfc_server_handover_internal.h"
 #include "net_nfc_server_handover.h"
+#include "net_nfc_server_route_table.h"
 //#include "syspopup_caller.h"
 
 /* nfc_not_supported_pop_up */
@@ -914,6 +915,50 @@ int net_nfc_app_util_launch_se_off_host_apdu_service_app(net_nfc_se_type_e se_ty
        return 0;
 }
 
+int net_nfc_app_util_launch_se_transaction_app_by_aid(net_nfc_se_type_e se_type, uint8_t *aid, uint32_t aid_len, uint8_t *param, uint32_t param_len)
+{
+       uid_t uid = 0;
+       bundle *bd = NULL;
+       route_table_handler_t *handler = NULL;
+
+       /* launch */
+       bd = bundle_create();
+
+       appsvc_set_operation(bd, "http://tizen.org/appcontrol/operation/nfc/transaction");
+
+       /* convert aid to aid string */
+       if (aid != NULL && aid_len > 0) {
+               char aid_string[1024] = { 0, };
+               data_s temp = { aid, aid_len };
+
+               net_nfc_util_binary_to_hex_string(&temp, aid_string, sizeof(aid_string));
+
+               SECURE_MSG("aid_string : %s", aid_string);
+               handler = net_nfc_server_route_table_find_handler_by_aid(aid_string);
+       }
+
+       if (param != NULL && param_len > 0) {
+               char param_string[1024] = { 0, };
+               data_s temp = { param, param_len };
+
+               net_nfc_util_binary_to_hex_string(&temp, param_string, sizeof(param_string));
+
+               SECURE_MSG("param_string : %s", param_string);
+               appsvc_add_data(bd, "data", param_string);
+       }
+
+       if (handler != NULL) {
+               if (net_nfc_util_get_login_user(&uid) == true) {
+                       SECURE_MSG("package name : %s, launch app uid : %d", handler->package, uid);
+                       aul_launch_app_for_uid(handler->package, bd, uid);
+               }
+       }
+
+       bundle_free(bd);
+
+       return 0;
+}
+
 int net_nfc_app_util_encode_base64(uint8_t * buffer, uint32_t buf_len, char *result, uint32_t max_result)
 {
        int ret = -1;
index 47d2f44119b4608d42ca3763250b23851707f718..fb73dff0c50762e745dfa0f1b054707463e5b491 100755 (executable)
@@ -3221,6 +3221,8 @@ static void se_transcation_thread_func(gpointer user_data)
                        net_nfc_app_util_launch_se_transaction_app(se_type, detail->aid.buffer, detail->aid.length, detail->param.buffer, detail->param.length);
 
                        net_nfc_app_util_launch_se_off_host_apdu_service_app(se_type, detail->aid.buffer, detail->aid.length, detail->param.buffer, detail->param.length);
+
+                       net_nfc_app_util_launch_se_transaction_app_by_aid(se_type, detail->aid.buffer, detail->aid.length, detail->param.buffer, detail->param.length);
                }
 
                DEBUG_SERVER_MSG("launch se app end");