char app_id[MAX_ASSISTANT_INFO_STR_LEN];
char name[MAX_ASSISTANT_INFO_STR_LEN];
int cnt_lang;
- bool enabled;
}assistant_info_t;
static assistant_info_t __assistant_info[MAX_ASSISTANT_NUM];
}
bool __get_assistant_enable_status(const char* app_id, char* assistants) {
- char* temp = strtok(assistants, ";");
+ char* str_ptr = NULL;
+ char* temp = strtok_r(assistants, ";", &str_ptr);
while(temp) {
if (!strncmp(app_id, temp, MAX_ASSISTANT_INFO_STR_LEN)) {
return true;
}
- temp = strtok(NULL, ";");
+ temp = strtok_r(NULL, ";", &str_ptr);
}
return false;
}
strncpy(__assistant_info[_assistant_info_index].name, name, MAX_ASSISTANT_INFO_STR_LEN);
__assistant_info[_assistant_info_index].name[MAX_ASSISTANT_INFO_STR_LEN - 1] = '\0';
__assistant_info[_assistant_info_index].cnt_lang = cnt_lang;
- __assistant_info[_assistant_info_index].enabled = __get_assistant_enable_status(app_id, vconf_get_str(APPID_URL));;
_assistant_info_index++;
} else {
return -1;
return res;
}
-int ma_assistant_info_get_app_id(ma_assistant_info_h handle, char **app_id) {
- if (NULL == handle)
+int ma_assistant_info_get_app_id(ma_assistant_info_h handle, char** app_id) {
+ if (NULL == handle || NULL == app_id)
return MA_ERROR_INVALID_PARAMETER;
assistant_info_t* info = (assistant_info_t*)handle;
if (NULL == info->app_id)
return MA_ERROR_NOT_SUPPORTED;
*app_id = (char*)info->app_id;
return MA_ERROR_NONE;
+}
+
+int ma_assistant_info_get_enabled_status(ma_assistant_info_h handle, bool* status) {
+ if (NULL == handle || NULL == status)
+ return MA_ERROR_INVALID_PARAMETER;
+ assistant_info_t* info = (assistant_info_t*)handle;
+ if (NULL == info->app_id)
+ return MA_ERROR_NOT_SUPPORTED;
+ *status = __get_assistant_enable_status(info->app_id, vconf_get_str(APPID_URL));
+ return MA_ERROR_NONE;
+}
+
+int ma_assistant_info_get_name(ma_assistant_info_h handle, char** name) {
+ if (NULL == handle || NULL == name)
+ return MA_ERROR_INVALID_PARAMETER;
+ assistant_info_t* info = (assistant_info_t*)handle;
+ if (NULL == info->name)
+ return MA_ERROR_NOT_SUPPORTED;
+ *name = (char*)info->name;
+ return MA_ERROR_NONE;
}
\ No newline at end of file
* @since_tizen 5.5
*
* @remarks You must not release @a app_id using free().
- * @param[in] handle The handle to the assistant's information
+ * @param[in] handle The handle to the assistant's information
* @param[in] app_id The application ID of the given assistant handle
*
* @return @c 0 on success, otherwise a negative error value
* @retval #MA_ERROR_NOT_SUPPORTED Not supported
* @retval #MA_ERROR_INVALID_PARAMETER Invalid parameter
*/
-int ma_assistant_info_get_app_id(ma_assistant_info_h handle, char **app_id);
+int ma_assistant_info_get_app_id(ma_assistant_info_h handle, char** app_id);
+
+/**
+ * @brief Retreives app id of the specific handle.
+ * @since_tizen 5.5
+ *
+ * @remarks You must not release @a app_id using free().
+ * @param[in] handle The handle to the assistant's information
+ * @param[in] status The enable status of the given assistant handle
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MA_ERROR_NONE Successful
+ * @retval #MA_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MA_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int ma_assistant_info_get_enabled_status(ma_assistant_info_h handle, bool* status);
+
+/**
+ * @brief Retreives app id of the specific handle.
+ * @since_tizen 5.5
+ *
+ * @remarks You must not release @a app_id using free().
+ * @param[in] handle The handle to the assistant's information
+ * @param[in] name The application name of the given assistant handle
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #MA_ERROR_NONE Successful
+ * @retval #MA_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MA_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int ma_assistant_info_get_name(ma_assistant_info_h handle, char** name);
#ifdef __cplusplus
}
#endif