diff options
author | Jaekyu Park <jk7744.park@samsung.com> | 2016-05-27 16:54:53 +0900 |
---|---|---|
committer | Jaekyu Park <jk7744.park@samsung.com> | 2016-05-27 16:54:53 +0900 |
commit | c0ccc37f6484ce5dd8310f4fa859f2ee56d135f4 (patch) | |
tree | 331318dcb9aee69a76aa5b5b894e137891311302 | |
parent | 7fa0985720f661113e7ffd70108150e983cd356b (diff) | |
download | inputmethod-tizen_2.4.tar.gz inputmethod-tizen_2.4.tar.bz2 inputmethod-tizen_2.4.zip |
Tizen 2.4 SDK Rev6 Releasesubmit/tizen_2.4/20160530.023118accepted/tizen/2.4/mobile/20160530.220223tizen_2.4accepted/tizen_2.4_mobile
-rw-r--r-- | src/inputmethod.cpp | 240 |
1 files changed, 220 insertions, 20 deletions
diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index 9c02a03..dcb4568 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -364,7 +364,6 @@ static ime_error_e _check_privilege (void) } } else { - LOGE("smack_new_label_from_self failed (%d)", ret); if (label) free(label); return IME_ERROR_OPERATION_FAILED; @@ -435,7 +434,7 @@ int ime_event_set_focus_in_cb(ime_focus_in_cb callback_func, void *user_data) ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -461,7 +460,7 @@ int ime_event_set_focus_out_cb(ime_focus_out_cb callback_func, void *user_data) ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -487,7 +486,7 @@ int ime_event_set_surrounding_text_updated_cb(ime_surrounding_text_updated_cb ca ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -513,7 +512,7 @@ int ime_event_set_input_context_reset_cb(ime_input_context_reset_cb callback_fun ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -539,7 +538,7 @@ int ime_event_set_cursor_position_updated_cb(ime_cursor_position_updated_cb call ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -565,7 +564,7 @@ int ime_event_set_language_requested_cb(ime_language_requested_cb callback_func, ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -591,7 +590,7 @@ int ime_event_set_language_set_cb(ime_language_set_cb callback_func, void *user_ ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -617,7 +616,7 @@ int ime_event_set_imdata_set_cb(ime_imdata_set_cb callback_func, void *user_data ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -643,7 +642,7 @@ int ime_event_set_imdata_requested_cb(ime_imdata_requested_cb callback_func, voi ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -669,7 +668,7 @@ int ime_event_set_layout_set_cb(ime_layout_set_cb callback_func, void *user_data ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -695,7 +694,7 @@ int ime_event_set_return_key_type_set_cb(ime_return_key_type_set_cb callback_fun ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -721,7 +720,7 @@ int ime_event_set_return_key_state_set_cb(ime_return_key_state_set_cb callback_f ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -747,7 +746,7 @@ int ime_event_set_geometry_requested_cb(ime_geometry_requested_cb callback_func, ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -773,7 +772,7 @@ int ime_event_set_process_key_event_cb(ime_process_key_event_cb callback_func, v ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -799,7 +798,7 @@ int ime_event_set_display_language_changed_cb(ime_display_language_changed_cb ca ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -825,7 +824,7 @@ int ime_event_set_rotation_degree_changed_cb(ime_rotation_degree_changed_cb call ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -851,7 +850,7 @@ int ime_event_set_accessibility_state_changed_cb(ime_accessibility_state_changed ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -877,7 +876,7 @@ int ime_event_set_option_window_created_cb(ime_option_window_created_cb callback ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -903,7 +902,7 @@ int ime_event_set_option_window_destroyed_cb(ime_option_window_destroyed_cb call ret = _check_privilege(); if (ret != IME_ERROR_NONE) { - LOGE("_check_privilege returned %d.", ret); + LOGW("_check_privilege returned %d.", ret); return ret; } @@ -915,11 +914,19 @@ int ime_event_set_option_window_destroyed_cb(ime_option_window_destroyed_cb call int ime_send_key_event(ime_key_code_e keycode, ime_key_mask_e keymask, bool forward_key) { + ime_error_e ret = IME_ERROR_NONE; + if (!g_running) { LOGW("IME_ERROR_NOT_RUNNING"); return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + if (forward_key) g_core.forward_key_event(-1, NULL, (sclu32)keycode, (sclu16)keymask); else @@ -930,6 +937,8 @@ int ime_send_key_event(ime_key_code_e keycode, ime_key_mask_e keymask, bool forw int ime_commit_string(const char *str) { + ime_error_e ret = IME_ERROR_NONE; + if (!str) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -940,6 +949,12 @@ int ime_commit_string(const char *str) return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + g_core.commit_string(-1, NULL, str); return IME_ERROR_NONE; @@ -947,11 +962,19 @@ int ime_commit_string(const char *str) int ime_show_preedit_string(void) { + ime_error_e ret = IME_ERROR_NONE; + if (!g_running) { LOGW("IME_ERROR_NOT_RUNNING"); return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + g_core.show_preedit_string(-1, NULL); return IME_ERROR_NONE; @@ -959,11 +982,19 @@ int ime_show_preedit_string(void) int ime_hide_preedit_string(void) { + ime_error_e ret = IME_ERROR_NONE; + if (!g_running) { LOGW("IME_ERROR_NOT_RUNNING"); return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + g_core.hide_preedit_string(-1, NULL); return IME_ERROR_NONE; @@ -971,6 +1002,8 @@ int ime_hide_preedit_string(void) int ime_update_preedit_string(const char *str, Eina_List *attrs) { + ime_error_e ret = IME_ERROR_NONE; + if (!str) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -981,6 +1014,12 @@ int ime_update_preedit_string(const char *str, Eina_List *attrs) return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + scim::AttributeList attrv; ime_preedit_attribute *attr = NULL; @@ -1000,6 +1039,8 @@ int ime_update_preedit_string(const char *str, Eina_List *attrs) int ime_request_surrounding_text(int maxlen_before, int maxlen_after) { + ime_error_e ret = IME_ERROR_NONE; + if (!g_event_callback.surrounding_text_updated) { LOGW("IME_ERROR_NO_CALLBACK_FUNCTION"); return IME_ERROR_NO_CALLBACK_FUNCTION; @@ -1010,6 +1051,12 @@ int ime_request_surrounding_text(int maxlen_before, int maxlen_after) return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + g_core.get_surrounding_text(NULL, maxlen_before, maxlen_after); return IME_ERROR_NONE; @@ -1017,6 +1064,8 @@ int ime_request_surrounding_text(int maxlen_before, int maxlen_after) int ime_delete_surrounding_text(int offset, int len) { + ime_error_e ret = IME_ERROR_NONE; + if (len <= 0) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1027,6 +1076,12 @@ int ime_delete_surrounding_text(int offset, int len) return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + g_core.delete_surrounding_text(offset, len); return IME_ERROR_NONE; @@ -1034,6 +1089,8 @@ int ime_delete_surrounding_text(int offset, int len) Evas_Object* ime_get_main_window(void) { + ime_error_e ret = IME_ERROR_NONE; + Evas_Object *win = NULL; if (!g_running) { @@ -1042,6 +1099,13 @@ Evas_Object* ime_get_main_window(void) return NULL; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + set_last_result(IME_ERROR_PERMISSION_DENIED); + LOGW("_check_privilege returned %d.", ret); + return NULL; + } + win = static_cast<Evas_Object*>(g_core.get_main_window()); if (win) { set_last_result(IME_ERROR_NONE); @@ -1056,6 +1120,8 @@ Evas_Object* ime_get_main_window(void) int ime_set_size(int portrait_width, int portrait_height, int landscape_width, int landscape_height) { + ime_error_e ret = IME_ERROR_NONE; + SclSize portrait_size, landscape_size; if (portrait_width < 1 || portrait_height < 1 || landscape_width < 1 || landscape_height < 1) { @@ -1068,6 +1134,12 @@ int ime_set_size(int portrait_width, int portrait_height, int landscape_width, i return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + portrait_size.width = portrait_width; portrait_size.height = portrait_height; @@ -1081,6 +1153,8 @@ int ime_set_size(int portrait_width, int portrait_height, int landscape_width, i int ime_create_option_window(void) { + ime_error_e ret = IME_ERROR_NONE; + if (!g_event_callback.option_window_created || !g_event_callback.option_window_destroyed) { LOGW("ime_create_option_window_cb() and ime_destroy_option_window_cb() callback functions are not set."); return IME_ERROR_NO_CALLBACK_FUNCTION; @@ -1091,6 +1165,12 @@ int ime_create_option_window(void) return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + if (g_core.create_option_window()) return IME_ERROR_NONE; else { @@ -1101,6 +1181,8 @@ int ime_create_option_window(void) int ime_destroy_option_window(Evas_Object *window) { + ime_error_e ret = IME_ERROR_NONE; + if (!g_event_callback.option_window_created || !g_event_callback.option_window_destroyed) { LOGW("ime_create_option_window_cb() and ime_destroy_option_window_cb() callback functions are not set."); return IME_ERROR_NO_CALLBACK_FUNCTION; @@ -1116,6 +1198,12 @@ int ime_destroy_option_window(Evas_Object *window) return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + g_core.destroy_option_window(window); return IME_ERROR_NONE; @@ -1123,6 +1211,8 @@ int ime_destroy_option_window(Evas_Object *window) int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout *layout) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !layout) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1133,6 +1223,12 @@ int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout * return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *layout = context->layout; return IME_ERROR_NONE; @@ -1140,6 +1236,8 @@ int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout * int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation_e *layout_variation) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !layout_variation) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1150,6 +1248,12 @@ int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *layout_variation = static_cast<ime_layout_variation_e>(context->layout_variation); return IME_ERROR_NONE; @@ -1157,6 +1261,8 @@ int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !cursor_pos) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1167,6 +1273,12 @@ int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos) return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *cursor_pos = context->cursor_pos; return IME_ERROR_NONE; @@ -1174,6 +1286,8 @@ int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos) int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapital_Type *autocapital_type) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !autocapital_type) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1184,6 +1298,12 @@ int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapita return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *autocapital_type = context->autocapital_type; return IME_ERROR_NONE; @@ -1191,6 +1311,8 @@ int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapita int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !return_key_type) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1201,6 +1323,12 @@ int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *return_key_type = context->return_key_type; return IME_ERROR_NONE; @@ -1208,6 +1336,8 @@ int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel int ime_context_get_return_key_state(ime_context_h context, bool *return_key_state) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !return_key_state) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1218,6 +1348,12 @@ int ime_context_get_return_key_state(ime_context_h context, bool *return_key_sta return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *return_key_state = static_cast<bool>(context->return_key_disabled); return IME_ERROR_NONE; @@ -1225,6 +1361,8 @@ int ime_context_get_return_key_state(ime_context_h context, bool *return_key_sta int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !prediction_mode) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1235,6 +1373,12 @@ int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *prediction_mode = static_cast<bool>(context->prediction_allow); return IME_ERROR_NONE; @@ -1242,6 +1386,8 @@ int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode int ime_context_get_password_mode(ime_context_h context, bool *password_mode) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !password_mode) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1252,6 +1398,12 @@ int ime_context_get_password_mode(ime_context_h context, bool *password_mode) return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *password_mode = static_cast<bool>(context->password_mode); return IME_ERROR_NONE; @@ -1259,6 +1411,8 @@ int ime_context_get_password_mode(ime_context_h context, bool *password_mode) int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *input_hint) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !input_hint) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1269,6 +1423,12 @@ int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *inp return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *input_hint = context->input_hint; return IME_ERROR_NONE; @@ -1276,6 +1436,8 @@ int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *inp int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Direction *bidi) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !bidi) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1286,6 +1448,12 @@ int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Directi return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *bidi = context->bidi_direction; return IME_ERROR_NONE; @@ -1293,6 +1461,8 @@ int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Directi int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang *language) { + ime_error_e ret = IME_ERROR_NONE; + if (!context || !language) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1303,6 +1473,12 @@ int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang * return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *language = context->language; return IME_ERROR_NONE; @@ -1310,6 +1486,8 @@ int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang * int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name) { + ime_error_e ret = IME_ERROR_NONE; + if (!dev_info || !dev_name) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1320,6 +1498,12 @@ int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name) return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + if (!dev_info->dev_name) *dev_name = strdup(""); else @@ -1330,6 +1514,8 @@ int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name) int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class *dev_class) { + ime_error_e ret = IME_ERROR_NONE; + if (!dev_info || !dev_class) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1340,6 +1526,12 @@ int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *dev_class = dev_info->dev_class; return IME_ERROR_NONE; @@ -1347,6 +1539,8 @@ int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class int ime_device_info_get_subclass(ime_device_info_h dev_info, Ecore_IMF_Device_Subclass *dev_subclass) { + ime_error_e ret = IME_ERROR_NONE; + if (!dev_info || !dev_subclass) { LOGW("IME_ERROR_INVALID_PARAMETER"); return IME_ERROR_INVALID_PARAMETER; @@ -1357,6 +1551,12 @@ int ime_device_info_get_subclass(ime_device_info_h dev_info, Ecore_IMF_Device_Su return IME_ERROR_NOT_RUNNING; } + ret = _check_privilege(); + if (ret != IME_ERROR_NONE) { + LOGW("_check_privilege returned %d.", ret); + return ret; + } + *dev_subclass = dev_info->dev_subclass; return IME_ERROR_NONE; |