int error_code = 0;
char *app_id = NULL;
- char *error_message = NULL;
autofill_error_info_create(&eih);
rpc_port_autofill_error_info_get_app_id(error_info_h, &app_id);
rpc_port_autofill_error_info_get_error_code(error_info_h, &error_code);
- rpc_port_autofill_error_info_get_error_message(error_info_h, &error_message);
autofill_error_info_set_app_id(eih, app_id);
autofill_error_info_set_error_code(eih, error_code);
- autofill_error_info_set_error_message(eih, error_message);
- LOGD("error code : %d, message : %s", error_code, error_message);
+ LOGD("error code : %x", error_code);
if (app_id)
free(app_id);
- if (error_message)
- free(error_message);
-
if (ah) {
if (ah->autofill_error_info_received_cb)
ah->autofill_error_info_received_cb(ah, eih, ah->autofill_error_info_data);
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dlog.h>
+#include <unistd.h>
+
+#include "autofill_private.h"
+#include <autofill_common.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AUTOFILL"
+
+struct autofill_error_info_s {
+ char *app_id;
+ autofill_error_e error_code;
+};
+
+EXPORT_API int autofill_error_info_create(autofill_error_info_h *ei)
+{
+ if (!ei)
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+ struct autofill_error_info_s *eis = (autofill_error_info_h)calloc(1, sizeof(struct autofill_error_info_s));
+ if (!eis)
+ return AUTOFILL_ERROR_OUT_OF_MEMORY;
+
+ *ei = (autofill_error_info_h)eis;
+
+ return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_error_info_destroy(autofill_error_info_h ei)
+{
+ if (!ei)
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+ if (ei->app_id) {
+ free(ei->app_id);
+ ei->app_id = NULL;
+ }
+
+ free(ei);
+
+ return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_error_info_set_error_code(autofill_error_info_h ei, autofill_error_e error_code)
+{
+ if (!ei)
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+ ei->error_code = error_code;
+
+ return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_error_info_get_error_code(autofill_error_info_h ei, autofill_error_e *error_code)
+{
+ if (!ei || !error_code)
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+ *error_code = ei->error_code;
+
+ return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_error_info_set_app_id(autofill_error_info_h ei, const char *app_id)
+{
+ if (!ei || !app_id)
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+ if (ei->app_id)
+ free(ei->app_id);
+
+ ei->app_id = strdup(app_id);
+
+ return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_error_info_get_app_id(autofill_error_info_h ei, char **app_id)
+{
+ if (!ei || !app_id)
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+ if (!ei->app_id)
+ return AUTOFILL_ERROR_OPERATION_FAILED;
+
+ *app_id = strdup(ei->app_id);
+
+ return AUTOFILL_ERROR_NONE;
+}
int autofill_error_info_get_error_code(autofill_error_info_h ei, autofill_error_e *error_code);
/**
- * @brief Sets the error message in autofill error information.
- * @since_tizen 5.5
- * @param[in] ei The autofill error information handle
- * @param[in] error_message The autofill error message
- * @return 0 on success, otherwise a negative error value
- * @retval #AUTOFILL_ERROR_NONE No error
- * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int autofill_error_info_set_error_message(autofill_error_info_h ei, const char *error_message);
-
-/**
- * @brief Gets the error message in autofill error information.
- * @since_tizen 5.5
- * @remarks @a error_message must be released using free().
- * @param[in] ei The autofill error information handle
- * @param[out] error_message The autofill error message
- * @return 0 on success, otherwise a negative error value
- * @retval #AUTOFILL_ERROR_NONE No error
- * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #AUTOFILL_ERROR_OPERATION_FAILED Operation failure
- */
-int autofill_error_info_get_error_message(autofill_error_info_h ei, char **error_message);
-
-/**
* @}
*/
AUTOFILL_ERROR_AUTHENTICATION_FAILED = TIZEN_ERROR_AUTOFILL | 0x0003, /**< Authentication failed */
AUTOFILL_ERROR_COMMIT_FAILED = TIZEN_ERROR_AUTOFILL | 0x0004, /**< Failed to save autofill data */
AUTOFILL_ERROR_FILL_RESPONSE_FAILED = TIZEN_ERROR_AUTOFILL | 0x0005, /**< Failed to response fill request */
+ AUTOFILL_ERROR_SERVICE_NOT_CONNECTED = TIZEN_ERROR_AUTOFILL | 0x0006, /**< Unable to connect to Autofill Service */
+ AUTOFILL_ERROR_SERVICE_NOT_ALLOWED = TIZEN_ERROR_AUTOFILL | 0x0007, /**< Autofill Service is not allowed */
+ AUTOFILL_ERROR_SERVICE_NOT_ACTIVATED = TIZEN_ERROR_AUTOFILL | 0x0008, /**< Autofill Service is not activated */
+ AUTOFILL_ERROR_SAVED_VALUES_NOT_FOUND = TIZEN_ERROR_AUTOFILL | 0x0009, /**< Could not find saved values */
} autofill_error_e;
/**
EXPORT_API int autofill_service_send_error_info(int context_id, autofill_error_info_h h)
{
char *app_id = NULL;
- char *error_message = NULL;
autofill_error_e error_code;
rpc_port_autofill_svc_error_info_h error_info_h = NULL;
autofill_error_info_get_app_id(h, &app_id);
autofill_error_info_get_error_code(h, &error_code);
- autofill_error_info_get_error_message(h, &error_message);
/* create error info */
rpc_port_autofill_svc_error_info_create(&error_info_h);
rpc_port_autofill_svc_error_info_set_app_id(error_info_h, app_id);
rpc_port_autofill_svc_error_info_set_error_code(error_info_h, error_code);
- rpc_port_autofill_svc_error_info_set_error_message(error_info_h, error_message);
int ret = rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_invoke(g_send_error_cb, context_id, error_info_h);
if (app_id)
free(app_id);
- if (error_message)
- free(error_message);
-
rpc_port_autofill_svc_error_info_destroy(error_info_h);
return ret;
-}
\ No newline at end of file
+}
struct autofill_error_info {
string app_id;
int error_code;
- string error_message;
}
interface AutofillAppPort {
struct autofill_svc_error_info {
string app_id;
int error_code;
- string error_message;
}
interface AutofillSvcPort {