APIs that are generated by tidlc are changed.
Requires:
- https://review.tizen.org/gerrit/#/c/platform/core/appfw/tidl/+/263601/
Change-Id: If1d4053c63534d44c491b52289ad276adc1da893
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
static int _autofill_context_count = 0;
//LCOV_EXCL_START
-static bool fill_response_item_cb(rpc_port_autofill_response_item_h response_items, void *user_data)
+static bool fill_response_item_cb(rpc_port_proxy_autofill_response_item_h response_items, void *user_data)
{
char *id = NULL;
char *presentation_text = NULL;
if (!res_group)
return true;
- rpc_port_autofill_response_item_get_id(response_items, &id);
- rpc_port_autofill_response_item_get_presentation_text(response_items, &presentation_text);
- rpc_port_autofill_response_item_get_value(response_items, &value);
- rpc_port_autofill_response_item_get_autofill_hint(response_items, &autofill_hint);
+ rpc_port_proxy_autofill_response_item_get_id(response_items, &id);
+ rpc_port_proxy_autofill_response_item_get_presentation_text(response_items, &presentation_text);
+ rpc_port_proxy_autofill_response_item_get_value(response_items, &value);
+ rpc_port_proxy_autofill_response_item_get_autofill_hint(response_items, &autofill_hint);
SECURE_LOGD("id : %s, presentation text : %s, value : %s, autofill hint : %d", id, presentation_text, value, autofill_hint);
return true;
}
-static bool fill_response_group_cb(rpc_port_autofill_response_group_h response_groups, void *user_data)
+static bool fill_response_group_cb(rpc_port_proxy_autofill_response_group_h response_groups, void *user_data)
{
autofill_fill_response_h rh = (autofill_fill_response_h)user_data;
autofill_fill_response_group_h res_group;
+ rpc_port_proxy_list_autofill_response_item_h response_items = NULL;
autofill_fill_response_group_create(&res_group);
- rpc_port_autofill_response_group_foreach_response_items(response_groups, fill_response_item_cb, res_group);
+ rpc_port_proxy_autofill_response_group_get_response_items(response_groups, &response_items);
+ rpc_port_proxy_list_autofill_response_item_foreach(response_items, fill_response_item_cb, res_group);
+ rpc_port_proxy_list_autofill_response_item_destroy(response_items);
autofill_fill_response_add_group(rh, res_group);
return true;
}
-static void __fill_response_recv_cb(void *user_data, rpc_port_autofill_fill_response_h response_h)
+static void __fill_response_recv_cb(void *user_data, rpc_port_proxy_autofill_fill_response_h response_h)
{
char *app_id = NULL;
char *view_id = NULL;
autofill_h ah = user_data;
autofill_fill_response_h rh;
+ rpc_port_proxy_list_autofill_response_group_h response_groups = NULL;
autofill_fill_response_create(&rh);
- rpc_port_autofill_fill_response_get_app_id(response_h, &app_id);
- rpc_port_autofill_fill_response_get_view_id(response_h, &view_id);
+ rpc_port_proxy_autofill_fill_response_get_app_id(response_h, &app_id);
+ rpc_port_proxy_autofill_fill_response_get_view_id(response_h, &view_id);
LOGD("app id : %s, view id : %s", app_id, view_id);
free(view_id);
}
- rpc_port_autofill_fill_response_foreach_response_groups(response_h, fill_response_group_cb, rh);
+ rpc_port_proxy_autofill_fill_response_get_response_groups(response_h, &response_groups);
+ rpc_port_proxy_list_autofill_response_group_foreach(response_groups, fill_response_group_cb, rh);
+ rpc_port_proxy_list_autofill_response_group_destroy(response_groups);
if (ah->autofill_fill_response_received_cb)
ah->autofill_fill_response_received_cb(ah, rh, ah->autofill_fill_response_data);
autofill_fill_response_destroy(rh);
}
-static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h auth_info_h)
+static void __auth_info_recv_cb(void *user_data, rpc_port_proxy_autofill_auth_info_h auth_info_h)
{
autofill_auth_info_h aih;
autofill_h ah = user_data;
char *service_logo_image_path = NULL;
char *service_message = NULL;
- rpc_port_autofill_auth_info_get_app_id(auth_info_h, &app_id);
- rpc_port_autofill_auth_info_get_view_id(auth_info_h, &view_id);
- rpc_port_autofill_auth_info_get_exist_autofill_data(auth_info_h, &autofill_data_present);
- rpc_port_autofill_auth_info_get_need_authentication(auth_info_h, &authentication_needed);
- rpc_port_autofill_auth_info_get_service_name(auth_info_h, &service_name);
- rpc_port_autofill_auth_info_get_service_logo_image_path(auth_info_h, &service_logo_image_path);
- rpc_port_autofill_auth_info_get_service_message(auth_info_h, &service_message);
+ rpc_port_proxy_autofill_auth_info_get_app_id(auth_info_h, &app_id);
+ rpc_port_proxy_autofill_auth_info_get_view_id(auth_info_h, &view_id);
+ rpc_port_proxy_autofill_auth_info_get_exist_autofill_data(auth_info_h, &autofill_data_present);
+ rpc_port_proxy_autofill_auth_info_get_need_authentication(auth_info_h, &authentication_needed);
+ rpc_port_proxy_autofill_auth_info_get_service_name(auth_info_h, &service_name);
+ rpc_port_proxy_autofill_auth_info_get_service_logo_image_path(auth_info_h, &service_logo_image_path);
+ rpc_port_proxy_autofill_auth_info_get_service_message(auth_info_h, &service_message);
LOGD("app id : %s, view id : %s, service name : %s", app_id, view_id, service_name);
autofill_auth_info_destroy(aih);
}
-static void __error_info_recv_cb(void *user_data, rpc_port_autofill_error_info_h error_info_h)
+static void __error_info_recv_cb(void *user_data, rpc_port_proxy_autofill_error_info_h error_info_h)
{
autofill_error_info_h eih = NULL;
autofill_h ah = user_data;
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_proxy_autofill_error_info_get_app_id(error_info_h, &app_id);
+ rpc_port_proxy_autofill_error_info_get_error_code(error_info_h, &error_code);
autofill_error_info_set_app_id(eih, app_id);
autofill_error_info_set_error_code(eih, error_code);
ah->connected = true;
LOGI("connected");
- rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_received_cb = rpc_port_AutofillAppPort_autofill_fill_response_received_cb_create(__fill_response_recv_cb, false, ah);
- rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_received_cb = rpc_port_AutofillAppPort_autofill_auth_info_received_cb_create(__auth_info_recv_cb, false, ah);
- rpc_port_AutofillAppPort_autofill_error_info_received_cb_h error_info_received_cb = rpc_port_AutofillAppPort_autofill_error_info_received_cb_create(__error_info_recv_cb, false, ah);
+ rpc_port_proxy_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_received_cb;
+ rpc_port_proxy_AutofillAppPort_autofill_fill_response_received_cb_create(&fill_response_received_cb);
+ rpc_port_proxy_AutofillAppPort_autofill_fill_response_received_cb_set_callback(fill_response_received_cb, __fill_response_recv_cb, ah);
+ rpc_port_proxy_AutofillAppPort_autofill_fill_response_received_cb_set_once(fill_response_received_cb, false);
+
+ rpc_port_proxy_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_received_cb;
+ rpc_port_proxy_AutofillAppPort_autofill_auth_info_received_cb_create(&auth_info_received_cb);
+ rpc_port_proxy_AutofillAppPort_autofill_auth_info_received_cb_set_callback(auth_info_received_cb, __auth_info_recv_cb, ah);
+ rpc_port_proxy_AutofillAppPort_autofill_auth_info_received_cb_set_once(auth_info_received_cb, false);
+
+ rpc_port_proxy_AutofillAppPort_autofill_error_info_received_cb_h error_info_received_cb;
+ rpc_port_proxy_AutofillAppPort_autofill_error_info_received_cb_create(&error_info_received_cb);
+ rpc_port_proxy_AutofillAppPort_autofill_error_info_received_cb_set_callback(error_info_received_cb, __error_info_recv_cb, ah);
+ rpc_port_proxy_AutofillAppPort_autofill_error_info_received_cb_set_once(error_info_received_cb, false);
int r = rpc_port_proxy_AutofillAppPort_invoke_Register(h, ah->context_id, auth_info_received_cb, fill_response_received_cb, error_info_received_cb);
if (r != 0)
EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi)
{
- rpc_port_autofill_save_view_info_h vih;
+ rpc_port_proxy_autofill_save_view_info_h vih;
+ rpc_port_proxy_list_autofill_save_item_h items = NULL;
char *id = NULL;
char *label = NULL;
char *value = NULL;
return AUTOFILL_ERROR_OPERATION_FAILED;
}
- rpc_port_autofill_save_view_info_create(&vih);
- rpc_port_autofill_save_view_info_set_view_id(vih, vi->view_id);
- rpc_port_autofill_save_view_info_set_view_title(vih, vi->view_title);
+ rpc_port_proxy_autofill_save_view_info_create(&vih);
+ rpc_port_proxy_autofill_save_view_info_set_view_id(vih, vi->view_id);
+ rpc_port_proxy_autofill_save_view_info_set_view_title(vih, vi->view_title);
+
+ rpc_port_proxy_list_autofill_save_item_create(&items);
Eina_List *l;
autofill_save_item_h it;
LOGD("it : %p, id : %s, label : %s, hint : %d, sensitive : %d", it, id, label, autofill_hint, sensitive_data);
- rpc_port_autofill_save_item_h aih;
- rpc_port_autofill_save_item_create(&aih);
- rpc_port_autofill_save_item_set_id(aih, id);
- rpc_port_autofill_save_item_set_label(aih, label);
- rpc_port_autofill_save_item_set_value(aih, value);
- rpc_port_autofill_save_item_set_autofill_hint(aih, (int)autofill_hint);
- rpc_port_autofill_save_item_set_is_sensitive_data(aih, sensitive_data);
- rpc_port_autofill_save_view_info_add_items(vih, aih);
+ rpc_port_proxy_autofill_save_item_h aih;
+ rpc_port_proxy_autofill_save_item_create(&aih);
+ rpc_port_proxy_autofill_save_item_set_id(aih, id);
+ rpc_port_proxy_autofill_save_item_set_label(aih, label);
+ rpc_port_proxy_autofill_save_item_set_value(aih, value);
+ rpc_port_proxy_autofill_save_item_set_autofill_hint(aih, (int)autofill_hint);
+ rpc_port_proxy_autofill_save_item_set_is_sensitive_data(aih, sensitive_data);
+ rpc_port_proxy_list_autofill_save_item_add(items, aih);
if (id) {
free(id);
value = NULL;
}
- rpc_port_autofill_save_item_destroy(aih);
+ rpc_port_proxy_autofill_save_item_destroy(aih);
}
+ rpc_port_proxy_autofill_save_view_info_set_items(vih, items);
+ rpc_port_proxy_list_autofill_save_item_destroy(items);
+
LOGD("app id : %s, view id : '%s', view title : '%s'", vi->app_id, vi->view_id, vi->view_title);
int ret = rpc_port_proxy_AutofillAppPort_invoke_commit(ah->rpc_h, ah->context_id, vih);
- rpc_port_autofill_save_view_info_destroy(vih);
+ rpc_port_proxy_autofill_save_view_info_destroy(vih);
if (ret != RPC_PORT_ERROR_NONE) {
LOGW("[ERROR] Failed to commit. rpc err = %d", ret);
EXPORT_API int autofill_auth_info_request(autofill_h ah, autofill_view_info_h vi)
{
int ret = AUTOFILL_ERROR_NONE;
- rpc_port_autofill_view_info_h vih;
+ rpc_port_proxy_autofill_view_info_h vih;
+ rpc_port_proxy_list_autofill_item_h items = NULL;
char *id = NULL;
char *label = NULL;
autofill_hint_e autofill_hint;
LOGD("app id : %s, view id : %s", vi->app_id, vi->view_id);
- rpc_port_autofill_view_info_create(&vih);
+ rpc_port_proxy_autofill_view_info_create(&vih);
if (vi->view_id)
- rpc_port_autofill_view_info_set_view_id(vih, vi->view_id);
+ rpc_port_proxy_autofill_view_info_set_view_id(vih, vi->view_id);
+
+ rpc_port_proxy_list_autofill_item_create(&items);
Eina_List *l;
autofill_item_h it;
LOGD("it : %p, id : %s, label : %s, hint : %d, sensitive : %d, value : %s", it, id, label, autofill_hint, sensitive_data, value);
- rpc_port_autofill_item_h aih;
- rpc_port_autofill_item_create(&aih);
- rpc_port_autofill_item_set_id(aih, id);
- rpc_port_autofill_item_set_label(aih, label);
- rpc_port_autofill_item_set_autofill_hint(aih, (int)autofill_hint);
- rpc_port_autofill_item_set_is_sensitive_data(aih, sensitive_data);
- rpc_port_autofill_item_set_value(aih, value);
- rpc_port_autofill_view_info_add_items(vih, aih);
+ rpc_port_proxy_autofill_item_h aih;
+ rpc_port_proxy_autofill_item_create(&aih);
+ rpc_port_proxy_autofill_item_set_id(aih, id);
+ rpc_port_proxy_autofill_item_set_label(aih, label);
+ rpc_port_proxy_autofill_item_set_autofill_hint(aih, (int)autofill_hint);
+ rpc_port_proxy_autofill_item_set_is_sensitive_data(aih, sensitive_data);
+ rpc_port_proxy_autofill_item_set_value(aih, value);
+ rpc_port_proxy_list_autofill_item_add(items, aih);
if (id) {
free(id);
value = NULL;
}
- rpc_port_autofill_item_destroy(aih);
+ rpc_port_proxy_autofill_item_destroy(aih);
}
+ rpc_port_proxy_autofill_view_info_set_items(vih, items);
+ rpc_port_proxy_list_autofill_item_destroy(items);
+
LOGD("rpc_h : %p, context id : %d", ah->rpc_h, ah->context_id);
ret = rpc_port_proxy_AutofillAppPort_invoke_request_auth_info(ah->rpc_h, ah->context_id, vih);
- rpc_port_autofill_view_info_destroy(vih);
+ rpc_port_proxy_autofill_view_info_destroy(vih);
if (ret != RPC_PORT_ERROR_NONE) {
LOGW("[ERROR] Failed to send auth request. rpc err = %d", ret);
EXPORT_API int autofill_fill_request(autofill_h ah, autofill_view_info_h vi)
{
int ret = AUTOFILL_ERROR_NONE;
- rpc_port_autofill_view_info_h vih;
+ rpc_port_proxy_autofill_view_info_h vih;
+ rpc_port_proxy_list_autofill_item_h items = NULL;
char *id = NULL;
char *label = NULL;
autofill_hint_e autofill_hint;
Eina_List *l;
autofill_item_h it;
- rpc_port_autofill_view_info_create(&vih);
- rpc_port_autofill_view_info_set_view_id(vih, vi->view_id);
+ rpc_port_proxy_autofill_view_info_create(&vih);
+ rpc_port_proxy_autofill_view_info_set_view_id(vih, vi->view_id);
+
+ rpc_port_proxy_list_autofill_item_create(&items);
EINA_LIST_FOREACH(vi->autofill_item_list, l, it)
{
LOGD("it : %p, id : %s, label : %s, hint : %d, sensitive : %d, value : %s", it, id, label, autofill_hint, sensitive_data, value);
- rpc_port_autofill_item_h aih;
- rpc_port_autofill_item_create(&aih);
- rpc_port_autofill_item_set_id(aih, id);
- rpc_port_autofill_item_set_label(aih, label);
- rpc_port_autofill_item_set_autofill_hint(aih, (int)autofill_hint);
- rpc_port_autofill_item_set_is_sensitive_data(aih, sensitive_data);
- rpc_port_autofill_item_set_value(aih, value);
- rpc_port_autofill_view_info_add_items(vih, aih);
+ rpc_port_proxy_autofill_item_h aih;
+ rpc_port_proxy_autofill_item_create(&aih);
+ rpc_port_proxy_autofill_item_set_id(aih, id);
+ rpc_port_proxy_autofill_item_set_label(aih, label);
+ rpc_port_proxy_autofill_item_set_autofill_hint(aih, (int)autofill_hint);
+ rpc_port_proxy_autofill_item_set_is_sensitive_data(aih, sensitive_data);
+ rpc_port_proxy_autofill_item_set_value(aih, value);
+ rpc_port_proxy_list_autofill_item_add(items, aih);
if (id) {
free(id);
value = NULL;
}
- rpc_port_autofill_item_destroy(aih);
+ rpc_port_proxy_autofill_item_destroy(aih);
}
+ rpc_port_proxy_autofill_view_info_set_items(vih, items);
+ rpc_port_proxy_list_autofill_item_destroy(items);
LOGD("app id : %s, view id : %s, context id : %d", vi->app_id, vi->view_id, ah->context_id);
ret = rpc_port_proxy_AutofillAppPort_invoke_send_fill_request(ah->rpc_h, ah->context_id, vih);
- rpc_port_autofill_view_info_destroy(vih);
+ rpc_port_proxy_autofill_view_info_destroy(vih);
if (ret != RPC_PORT_ERROR_NONE) {
LOGW("[ERROR] Failed to send fill request. rpc err = %d", ret);
EXPORT_API int autofill_cancel_fill_request(autofill_h ah, autofill_view_info_h vi)
{
int ret = AUTOFILL_ERROR_NONE;
- rpc_port_autofill_view_info_h vih = NULL;
+ rpc_port_proxy_autofill_view_info_h vih = NULL;
+ rpc_port_proxy_list_autofill_item_h items = NULL;
char *id = NULL;
char *label = NULL;
autofill_hint_e autofill_hint;
return AUTOFILL_ERROR_OPERATION_FAILED;
}
- rpc_port_autofill_view_info_create(&vih);
- rpc_port_autofill_view_info_set_view_id(vih, vi->view_id);
+ rpc_port_proxy_autofill_view_info_create(&vih);
+ rpc_port_proxy_autofill_view_info_set_view_id(vih, vi->view_id);
+
+ rpc_port_proxy_list_autofill_item_create(&items);
EINA_LIST_FOREACH(vi->autofill_item_list, l, it)
{
LOGD("it : %p, id : %s, label : %s, hint : %d, sensitive : %d", it, id, label, autofill_hint, sensitive_data);
- rpc_port_autofill_item_h aih;
- rpc_port_autofill_item_create(&aih);
- rpc_port_autofill_item_set_id(aih, id);
- rpc_port_autofill_item_set_label(aih, label);
- rpc_port_autofill_item_set_autofill_hint(aih, (int)autofill_hint);
- rpc_port_autofill_item_set_is_sensitive_data(aih, sensitive_data);
+ rpc_port_proxy_autofill_item_h aih;
+ rpc_port_proxy_autofill_item_create(&aih);
+ rpc_port_proxy_autofill_item_set_id(aih, id);
+ rpc_port_proxy_autofill_item_set_label(aih, label);
+ rpc_port_proxy_autofill_item_set_autofill_hint(aih, (int)autofill_hint);
+ rpc_port_proxy_autofill_item_set_is_sensitive_data(aih, sensitive_data);
- rpc_port_autofill_view_info_add_items(vih, aih);
+ rpc_port_proxy_list_autofill_item_add(items, aih);
if (id) {
free(id);
label = NULL;
}
- rpc_port_autofill_item_destroy(aih);
+ rpc_port_proxy_autofill_item_destroy(aih);
}
+ rpc_port_proxy_autofill_view_info_set_items(vih, items);
+ rpc_port_proxy_list_autofill_item_destroy(items);
+
LOGD("app id : %s, view id : %s, context id : %d", vi->app_id, vi->view_id, ah->context_id);
ret = rpc_port_proxy_AutofillAppPort_invoke_cancel_fill_request(ah->rpc_h, ah->context_id, vih);
- rpc_port_autofill_view_info_destroy(vih);
+ rpc_port_proxy_autofill_view_info_destroy(vih);
if (ret != RPC_PORT_ERROR_NONE) {
LOGW("[ERROR] Failed to cancel fill request. rpc err = %d", ret);
ah->autofill_fill_response_data = NULL;
return AUTOFILL_ERROR_NONE;
-}
\ No newline at end of file
+}
+++ /dev/null
-/*
- * Generated by tidlc 1.4.9.
- */
-
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <libgen.h>
-#include <glib.h>
-#include <dlog.h>
-#include <rpc-port.h>
-#include <rpc-port-parcel.h>
-
-#include "autofill_proxy.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "RPC_PORT_PROXY"
-
-#ifdef _E
-#undef _E
-#endif
-
-#ifdef _W
-#undef _W
-#endif
-
-#ifdef _I
-#undef _I
-#endif
-
-#ifdef _D
-#undef _D
-#endif
-
-#define _E(fmt, ...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-#define _W(fmt, ...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-#define _I(fmt, ...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-#define _D(fmt, ...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-
-typedef void (*proxy_delegate)(GList **list, rpc_port_parcel_h parcel, int seq_id, int id);
-
-struct autofill_item_s {
- rpc_port_parcelable_t parcelable;
- char *id;
- char *label;
- char *value;
- int autofill_hint;
- bool is_sensitive_data;
-};
-
-static void __autofill_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->id ? h->id : "");
- rpc_port_parcel_write_string(parcel, h->label ? h->label : "");
- rpc_port_parcel_write_string(parcel, h->value ? h->value : "");
- rpc_port_parcel_write_int32(parcel, h->autofill_hint);
- rpc_port_parcel_write_bool(parcel, h->is_sensitive_data);
-}
-
-static void __autofill_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->id);
- rpc_port_parcel_read_string(parcel, &h->label);
- rpc_port_parcel_read_string(parcel, &h->value);
- rpc_port_parcel_read_int32(parcel, &h->autofill_hint);
- rpc_port_parcel_read_bool(parcel, &h->is_sensitive_data);
-}
-
-int rpc_port_autofill_item_create(rpc_port_autofill_item_h *h)
-{
- struct autofill_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_item_to;
- handle->parcelable.from = __autofill_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_item_destroy(rpc_port_autofill_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id)
- free(h->id);
-
- if (h->label)
- free(h->label);
-
- if (h->value)
- free(h->value);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_item_clone(rpc_port_autofill_item_h h, rpc_port_autofill_item_h *clone)
-{
- rpc_port_autofill_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_item_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_item handle");
- return -1;
- }
-
- if (h->id) {
- handle->id = strdup(h->id);
- if (!handle->id) {
- _E("Failed to duplicate h->id");
- rpc_port_autofill_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->label) {
- handle->label = strdup(h->label);
- if (!handle->label) {
- _E("Failed to duplicate h->label");
- rpc_port_autofill_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->value) {
- handle->value = strdup(h->value);
- if (!handle->value) {
- _E("Failed to duplicate h->value");
- rpc_port_autofill_item_destroy(handle);
- return -1;
- }
- }
-
- handle->autofill_hint = h->autofill_hint;
- handle->is_sensitive_data = h->is_sensitive_data;
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_item_set_id(rpc_port_autofill_item_h h, const char *id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id) {
- free(h->id);
- h->id = NULL;
- }
-
- h->id = strdup(id);
- if (!h->id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_item_set_label(rpc_port_autofill_item_h h, const char *label)
-{
- if (!h || !label) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->label) {
- free(h->label);
- h->label = NULL;
- }
-
- h->label = strdup(label);
- if (!h->label) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_item_set_value(rpc_port_autofill_item_h h, const char *value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->value) {
- free(h->value);
- h->value = NULL;
- }
-
- h->value = strdup(value);
- if (!h->value) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_item_set_autofill_hint(rpc_port_autofill_item_h h, int autofill_hint)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->autofill_hint = autofill_hint;
- return 0;
-}
-
-int rpc_port_autofill_item_set_is_sensitive_data(rpc_port_autofill_item_h h, bool is_sensitive_data)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->is_sensitive_data = is_sensitive_data;
- return 0;
-}
-
-int rpc_port_autofill_item_get_id(rpc_port_autofill_item_h h, char **id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->id) {
- _E("Invalid parameter: h->id is NULL");
- return -1;
- }
-
- *id = strdup(h->id);
- if (*id == NULL) {
- _E("Failed to duplicate id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_item_get_label(rpc_port_autofill_item_h h, char **label)
-{
- if (!h || !label) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->label) {
- _E("Invalid parameter: h->label is NULL");
- return -1;
- }
-
- *label = strdup(h->label);
- if (*label == NULL) {
- _E("Failed to duplicate label");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_item_get_value(rpc_port_autofill_item_h h, char **value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->value) {
- _E("Invalid parameter: h->value is NULL");
- return -1;
- }
-
- *value = strdup(h->value);
- if (*value == NULL) {
- _E("Failed to duplicate value");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_item_get_autofill_hint(rpc_port_autofill_item_h h, int *autofill_hint)
-{
- if (!h || !autofill_hint) {
- _E("Invalid parameter");
- return -1;
- }
-
- *autofill_hint = h->autofill_hint;
- return 0;
-}
-
-int rpc_port_autofill_item_get_is_sensitive_data(rpc_port_autofill_item_h h, bool *is_sensitive_data)
-{
- if (!h || !is_sensitive_data) {
- _E("Invalid parameter");
- return -1;
- }
-
- *is_sensitive_data = h->is_sensitive_data;
- return 0;
-}
-
-struct autofill_view_info_s {
- rpc_port_parcelable_t parcelable;
- char *view_id;
- GList *items;
-};
-
-static void __autofill_view_info_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_view_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->items));
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __autofill_view_info_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_view_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->view_id);
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_item_h value = NULL;
-
- rpc_port_autofill_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->items = g_list_append(h->items, value);
- }
- } while (0);
-}
-
-int rpc_port_autofill_view_info_create(rpc_port_autofill_view_info_h *h)
-{
- struct autofill_view_info_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_view_info_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_view_info_to;
- handle->parcelable.from = __autofill_view_info_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_view_info_destroy(rpc_port_autofill_view_info_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_id)
- free(h->view_id);
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_item_h value = iter->data;
- if (value)
- rpc_port_autofill_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_view_info_clone(rpc_port_autofill_view_info_h h, rpc_port_autofill_view_info_h *clone)
-{
- rpc_port_autofill_view_info_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_view_info_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_view_info handle");
- return -1;
- }
-
- if (h->view_id) {
- handle->view_id = strdup(h->view_id);
- if (!handle->view_id) {
- _E("Failed to duplicate h->view_id");
- rpc_port_autofill_view_info_destroy(handle);
- return -1;
- }
- }
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_item_h new_value;
- rpc_port_autofill_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_autofill_view_info_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_autofill_view_info_destroy(handle);
- return -1;
- }
-
- handle->items = g_list_append(handle->items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_view_info_set_view_id(rpc_port_autofill_view_info_h h, const char *view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_id) {
- free(h->view_id);
- h->view_id = NULL;
- }
-
- h->view_id = strdup(view_id);
- if (!h->view_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_view_info_add_items(rpc_port_autofill_view_info_h h, rpc_port_autofill_item_h items)
-{
- if (!h || !items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_item_h value = NULL;
-
- rpc_port_autofill_item_clone(items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->items = g_list_append(h->items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_view_info_get_view_id(rpc_port_autofill_view_info_h h, char **view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->view_id) {
- _E("Invalid parameter: h->view_id is NULL");
- return -1;
- }
-
- *view_id = strdup(h->view_id);
- if (*view_id == NULL) {
- _E("Failed to duplicate view_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_view_info_foreach_items(rpc_port_autofill_view_info_h h,
- bool (*callback)(rpc_port_autofill_item_h items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_view_info_remove_items(rpc_port_autofill_view_info_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_item_h value = iter->data;
- h->items = g_list_remove_link(h->items, iter);
- rpc_port_autofill_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_autofill_view_info_get_items_length(rpc_port_autofill_view_info_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->items);
-
- return 0;
-}
-
-struct autofill_save_item_s {
- rpc_port_parcelable_t parcelable;
- char *id;
- char *label;
- char *value;
- int autofill_hint;
- bool is_sensitive_data;
-};
-
-static void __autofill_save_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_save_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->id ? h->id : "");
- rpc_port_parcel_write_string(parcel, h->label ? h->label : "");
- rpc_port_parcel_write_string(parcel, h->value ? h->value : "");
- rpc_port_parcel_write_int32(parcel, h->autofill_hint);
- rpc_port_parcel_write_bool(parcel, h->is_sensitive_data);
-}
-
-static void __autofill_save_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_save_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->id);
- rpc_port_parcel_read_string(parcel, &h->label);
- rpc_port_parcel_read_string(parcel, &h->value);
- rpc_port_parcel_read_int32(parcel, &h->autofill_hint);
- rpc_port_parcel_read_bool(parcel, &h->is_sensitive_data);
-}
-
-int rpc_port_autofill_save_item_create(rpc_port_autofill_save_item_h *h)
-{
- struct autofill_save_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_save_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_save_item_to;
- handle->parcelable.from = __autofill_save_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_save_item_destroy(rpc_port_autofill_save_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id)
- free(h->id);
-
- if (h->label)
- free(h->label);
-
- if (h->value)
- free(h->value);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_save_item_clone(rpc_port_autofill_save_item_h h, rpc_port_autofill_save_item_h *clone)
-{
- rpc_port_autofill_save_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_save_item_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_save_item handle");
- return -1;
- }
-
- if (h->id) {
- handle->id = strdup(h->id);
- if (!handle->id) {
- _E("Failed to duplicate h->id");
- rpc_port_autofill_save_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->label) {
- handle->label = strdup(h->label);
- if (!handle->label) {
- _E("Failed to duplicate h->label");
- rpc_port_autofill_save_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->value) {
- handle->value = strdup(h->value);
- if (!handle->value) {
- _E("Failed to duplicate h->value");
- rpc_port_autofill_save_item_destroy(handle);
- return -1;
- }
- }
-
- handle->autofill_hint = h->autofill_hint;
- handle->is_sensitive_data = h->is_sensitive_data;
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_save_item_set_id(rpc_port_autofill_save_item_h h, const char *id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id) {
- free(h->id);
- h->id = NULL;
- }
-
- h->id = strdup(id);
- if (!h->id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_save_item_set_label(rpc_port_autofill_save_item_h h, const char *label)
-{
- if (!h || !label) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->label) {
- free(h->label);
- h->label = NULL;
- }
-
- h->label = strdup(label);
- if (!h->label) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_save_item_set_value(rpc_port_autofill_save_item_h h, const char *value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->value) {
- free(h->value);
- h->value = NULL;
- }
-
- h->value = strdup(value);
- if (!h->value) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_save_item_set_autofill_hint(rpc_port_autofill_save_item_h h, int autofill_hint)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->autofill_hint = autofill_hint;
- return 0;
-}
-
-int rpc_port_autofill_save_item_set_is_sensitive_data(rpc_port_autofill_save_item_h h, bool is_sensitive_data)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->is_sensitive_data = is_sensitive_data;
- return 0;
-}
-
-int rpc_port_autofill_save_item_get_id(rpc_port_autofill_save_item_h h, char **id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->id) {
- _E("Invalid parameter: h->id is NULL");
- return -1;
- }
-
- *id = strdup(h->id);
- if (*id == NULL) {
- _E("Failed to duplicate id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_save_item_get_label(rpc_port_autofill_save_item_h h, char **label)
-{
- if (!h || !label) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->label) {
- _E("Invalid parameter: h->label is NULL");
- return -1;
- }
-
- *label = strdup(h->label);
- if (*label == NULL) {
- _E("Failed to duplicate label");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_save_item_get_value(rpc_port_autofill_save_item_h h, char **value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->value) {
- _E("Invalid parameter: h->value is NULL");
- return -1;
- }
-
- *value = strdup(h->value);
- if (*value == NULL) {
- _E("Failed to duplicate value");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_save_item_get_autofill_hint(rpc_port_autofill_save_item_h h, int *autofill_hint)
-{
- if (!h || !autofill_hint) {
- _E("Invalid parameter");
- return -1;
- }
-
- *autofill_hint = h->autofill_hint;
- return 0;
-}
-
-int rpc_port_autofill_save_item_get_is_sensitive_data(rpc_port_autofill_save_item_h h, bool *is_sensitive_data)
-{
- if (!h || !is_sensitive_data) {
- _E("Invalid parameter");
- return -1;
- }
-
- *is_sensitive_data = h->is_sensitive_data;
- return 0;
-}
-
-struct autofill_save_view_info_s {
- rpc_port_parcelable_t parcelable;
- char *view_id;
- char *view_title;
- GList *items;
-};
-
-static void __autofill_save_view_info_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_save_view_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_string(parcel, h->view_title ? h->view_title : "");
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->items));
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_save_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __autofill_save_view_info_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_save_view_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->view_id);
- rpc_port_parcel_read_string(parcel, &h->view_title);
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_save_item_h value = NULL;
-
- rpc_port_autofill_save_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->items = g_list_append(h->items, value);
- }
- } while (0);
-}
-
-int rpc_port_autofill_save_view_info_create(rpc_port_autofill_save_view_info_h *h)
-{
- struct autofill_save_view_info_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_save_view_info_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_save_view_info_to;
- handle->parcelable.from = __autofill_save_view_info_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_save_view_info_destroy(rpc_port_autofill_save_view_info_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_id)
- free(h->view_id);
-
- if (h->view_title)
- free(h->view_title);
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_save_item_h value = iter->data;
- if (value)
- rpc_port_autofill_save_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_save_view_info_clone(rpc_port_autofill_save_view_info_h h, rpc_port_autofill_save_view_info_h *clone)
-{
- rpc_port_autofill_save_view_info_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_save_view_info_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_save_view_info handle");
- return -1;
- }
-
- if (h->view_id) {
- handle->view_id = strdup(h->view_id);
- if (!handle->view_id) {
- _E("Failed to duplicate h->view_id");
- rpc_port_autofill_save_view_info_destroy(handle);
- return -1;
- }
- }
-
- if (h->view_title) {
- handle->view_title = strdup(h->view_title);
- if (!handle->view_title) {
- _E("Failed to duplicate h->view_title");
- rpc_port_autofill_save_view_info_destroy(handle);
- return -1;
- }
- }
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_save_item_h new_value;
- rpc_port_autofill_save_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_autofill_save_view_info_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_save_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_autofill_save_view_info_destroy(handle);
- return -1;
- }
-
- handle->items = g_list_append(handle->items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_save_view_info_set_view_id(rpc_port_autofill_save_view_info_h h, const char *view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_id) {
- free(h->view_id);
- h->view_id = NULL;
- }
-
- h->view_id = strdup(view_id);
- if (!h->view_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_save_view_info_set_view_title(rpc_port_autofill_save_view_info_h h, const char *view_title)
-{
- if (!h || !view_title) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_title) {
- free(h->view_title);
- h->view_title = NULL;
- }
-
- h->view_title = strdup(view_title);
- if (!h->view_title) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_save_view_info_add_items(rpc_port_autofill_save_view_info_h h, rpc_port_autofill_save_item_h items)
-{
- if (!h || !items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_save_item_h value = NULL;
-
- rpc_port_autofill_save_item_clone(items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->items = g_list_append(h->items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_save_view_info_get_view_id(rpc_port_autofill_save_view_info_h h, char **view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->view_id) {
- _E("Invalid parameter: h->view_id is NULL");
- return -1;
- }
-
- *view_id = strdup(h->view_id);
- if (*view_id == NULL) {
- _E("Failed to duplicate view_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_save_view_info_get_view_title(rpc_port_autofill_save_view_info_h h, char **view_title)
-{
- if (!h || !view_title) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->view_title) {
- _E("Invalid parameter: h->view_title is NULL");
- return -1;
- }
-
- *view_title = strdup(h->view_title);
- if (*view_title == NULL) {
- _E("Failed to duplicate view_title");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_save_view_info_foreach_items(rpc_port_autofill_save_view_info_h h,
- bool (*callback)(rpc_port_autofill_save_item_h items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_save_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_save_view_info_remove_items(rpc_port_autofill_save_view_info_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_save_item_h value = iter->data;
- h->items = g_list_remove_link(h->items, iter);
- rpc_port_autofill_save_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_autofill_save_view_info_get_items_length(rpc_port_autofill_save_view_info_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->items);
-
- return 0;
-}
-
-struct autofill_auth_info_s {
- rpc_port_parcelable_t parcelable;
- char *app_id;
- char *view_id;
- bool exist_autofill_data;
- bool need_authentication;
- char *service_name;
- char *service_logo_image_path;
- char *service_message;
-};
-
-static void __autofill_auth_info_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_auth_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->app_id ? h->app_id : "");
- rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_bool(parcel, h->exist_autofill_data);
- rpc_port_parcel_write_bool(parcel, h->need_authentication);
- rpc_port_parcel_write_string(parcel, h->service_name ? h->service_name : "");
- rpc_port_parcel_write_string(parcel, h->service_logo_image_path ? h->service_logo_image_path : "");
- rpc_port_parcel_write_string(parcel, h->service_message ? h->service_message : "");
-}
-
-static void __autofill_auth_info_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_auth_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->app_id);
- rpc_port_parcel_read_string(parcel, &h->view_id);
- rpc_port_parcel_read_bool(parcel, &h->exist_autofill_data);
- rpc_port_parcel_read_bool(parcel, &h->need_authentication);
- rpc_port_parcel_read_string(parcel, &h->service_name);
- rpc_port_parcel_read_string(parcel, &h->service_logo_image_path);
- rpc_port_parcel_read_string(parcel, &h->service_message);
-}
-
-int rpc_port_autofill_auth_info_create(rpc_port_autofill_auth_info_h *h)
-{
- struct autofill_auth_info_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_auth_info_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_auth_info_to;
- handle->parcelable.from = __autofill_auth_info_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_destroy(rpc_port_autofill_auth_info_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id)
- free(h->app_id);
-
- if (h->view_id)
- free(h->view_id);
-
- if (h->service_name)
- free(h->service_name);
-
- if (h->service_logo_image_path)
- free(h->service_logo_image_path);
-
- if (h->service_message)
- free(h->service_message);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_clone(rpc_port_autofill_auth_info_h h, rpc_port_autofill_auth_info_h *clone)
-{
- rpc_port_autofill_auth_info_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_auth_info_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_auth_info handle");
- return -1;
- }
-
- if (h->app_id) {
- handle->app_id = strdup(h->app_id);
- if (!handle->app_id) {
- _E("Failed to duplicate h->app_id");
- rpc_port_autofill_auth_info_destroy(handle);
- return -1;
- }
- }
-
- if (h->view_id) {
- handle->view_id = strdup(h->view_id);
- if (!handle->view_id) {
- _E("Failed to duplicate h->view_id");
- rpc_port_autofill_auth_info_destroy(handle);
- return -1;
- }
- }
-
- handle->exist_autofill_data = h->exist_autofill_data;
- handle->need_authentication = h->need_authentication;
- if (h->service_name) {
- handle->service_name = strdup(h->service_name);
- if (!handle->service_name) {
- _E("Failed to duplicate h->service_name");
- rpc_port_autofill_auth_info_destroy(handle);
- return -1;
- }
- }
-
- if (h->service_logo_image_path) {
- handle->service_logo_image_path = strdup(h->service_logo_image_path);
- if (!handle->service_logo_image_path) {
- _E("Failed to duplicate h->service_logo_image_path");
- rpc_port_autofill_auth_info_destroy(handle);
- return -1;
- }
- }
-
- if (h->service_message) {
- handle->service_message = strdup(h->service_message);
- if (!handle->service_message) {
- _E("Failed to duplicate h->service_message");
- rpc_port_autofill_auth_info_destroy(handle);
- return -1;
- }
- }
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_set_app_id(rpc_port_autofill_auth_info_h h, const char *app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id) {
- free(h->app_id);
- h->app_id = NULL;
- }
-
- h->app_id = strdup(app_id);
- if (!h->app_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_set_view_id(rpc_port_autofill_auth_info_h h, const char *view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_id) {
- free(h->view_id);
- h->view_id = NULL;
- }
-
- h->view_id = strdup(view_id);
- if (!h->view_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_set_exist_autofill_data(rpc_port_autofill_auth_info_h h, bool exist_autofill_data)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->exist_autofill_data = exist_autofill_data;
- return 0;
-}
-
-int rpc_port_autofill_auth_info_set_need_authentication(rpc_port_autofill_auth_info_h h, bool need_authentication)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->need_authentication = need_authentication;
- return 0;
-}
-
-int rpc_port_autofill_auth_info_set_service_name(rpc_port_autofill_auth_info_h h, const char *service_name)
-{
- if (!h || !service_name) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->service_name) {
- free(h->service_name);
- h->service_name = NULL;
- }
-
- h->service_name = strdup(service_name);
- if (!h->service_name) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_set_service_logo_image_path(rpc_port_autofill_auth_info_h h, const char *service_logo_image_path)
-{
- if (!h || !service_logo_image_path) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->service_logo_image_path) {
- free(h->service_logo_image_path);
- h->service_logo_image_path = NULL;
- }
-
- h->service_logo_image_path = strdup(service_logo_image_path);
- if (!h->service_logo_image_path) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_set_service_message(rpc_port_autofill_auth_info_h h, const char *service_message)
-{
- if (!h || !service_message) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->service_message) {
- free(h->service_message);
- h->service_message = NULL;
- }
-
- h->service_message = strdup(service_message);
- if (!h->service_message) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_get_app_id(rpc_port_autofill_auth_info_h h, char **app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->app_id) {
- _E("Invalid parameter: h->app_id is NULL");
- return -1;
- }
-
- *app_id = strdup(h->app_id);
- if (*app_id == NULL) {
- _E("Failed to duplicate app_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_get_view_id(rpc_port_autofill_auth_info_h h, char **view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->view_id) {
- _E("Invalid parameter: h->view_id is NULL");
- return -1;
- }
-
- *view_id = strdup(h->view_id);
- if (*view_id == NULL) {
- _E("Failed to duplicate view_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_get_exist_autofill_data(rpc_port_autofill_auth_info_h h, bool *exist_autofill_data)
-{
- if (!h || !exist_autofill_data) {
- _E("Invalid parameter");
- return -1;
- }
-
- *exist_autofill_data = h->exist_autofill_data;
- return 0;
-}
-
-int rpc_port_autofill_auth_info_get_need_authentication(rpc_port_autofill_auth_info_h h, bool *need_authentication)
-{
- if (!h || !need_authentication) {
- _E("Invalid parameter");
- return -1;
- }
-
- *need_authentication = h->need_authentication;
- return 0;
-}
-
-int rpc_port_autofill_auth_info_get_service_name(rpc_port_autofill_auth_info_h h, char **service_name)
-{
- if (!h || !service_name) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->service_name) {
- _E("Invalid parameter: h->service_name is NULL");
- return -1;
- }
-
- *service_name = strdup(h->service_name);
- if (*service_name == NULL) {
- _E("Failed to duplicate service_name");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_get_service_logo_image_path(rpc_port_autofill_auth_info_h h, char **service_logo_image_path)
-{
- if (!h || !service_logo_image_path) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->service_logo_image_path) {
- _E("Invalid parameter: h->service_logo_image_path is NULL");
- return -1;
- }
-
- *service_logo_image_path = strdup(h->service_logo_image_path);
- if (*service_logo_image_path == NULL) {
- _E("Failed to duplicate service_logo_image_path");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_auth_info_get_service_message(rpc_port_autofill_auth_info_h h, char **service_message)
-{
- if (!h || !service_message) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->service_message) {
- _E("Invalid parameter: h->service_message is NULL");
- return -1;
- }
-
- *service_message = strdup(h->service_message);
- if (*service_message == NULL) {
- _E("Failed to duplicate service_message");
- return -1;
- }
-
- return 0;
-}
-
-struct autofill_response_item_s {
- rpc_port_parcelable_t parcelable;
- char *id;
- char *presentation_text;
- char *value;
- int autofill_hint;
-};
-
-static void __autofill_response_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_response_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->id ? h->id : "");
- rpc_port_parcel_write_string(parcel, h->presentation_text ? h->presentation_text : "");
- rpc_port_parcel_write_string(parcel, h->value ? h->value : "");
- rpc_port_parcel_write_int32(parcel, h->autofill_hint);
-}
-
-static void __autofill_response_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_response_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->id);
- rpc_port_parcel_read_string(parcel, &h->presentation_text);
- rpc_port_parcel_read_string(parcel, &h->value);
- rpc_port_parcel_read_int32(parcel, &h->autofill_hint);
-}
-
-int rpc_port_autofill_response_item_create(rpc_port_autofill_response_item_h *h)
-{
- struct autofill_response_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_response_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_response_item_to;
- handle->parcelable.from = __autofill_response_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_response_item_destroy(rpc_port_autofill_response_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id)
- free(h->id);
-
- if (h->presentation_text)
- free(h->presentation_text);
-
- if (h->value)
- free(h->value);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_response_item_clone(rpc_port_autofill_response_item_h h, rpc_port_autofill_response_item_h *clone)
-{
- rpc_port_autofill_response_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_response_item_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_response_item handle");
- return -1;
- }
-
- if (h->id) {
- handle->id = strdup(h->id);
- if (!handle->id) {
- _E("Failed to duplicate h->id");
- rpc_port_autofill_response_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->presentation_text) {
- handle->presentation_text = strdup(h->presentation_text);
- if (!handle->presentation_text) {
- _E("Failed to duplicate h->presentation_text");
- rpc_port_autofill_response_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->value) {
- handle->value = strdup(h->value);
- if (!handle->value) {
- _E("Failed to duplicate h->value");
- rpc_port_autofill_response_item_destroy(handle);
- return -1;
- }
- }
-
- handle->autofill_hint = h->autofill_hint;
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_response_item_set_id(rpc_port_autofill_response_item_h h, const char *id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id) {
- free(h->id);
- h->id = NULL;
- }
-
- h->id = strdup(id);
- if (!h->id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_response_item_set_presentation_text(rpc_port_autofill_response_item_h h, const char *presentation_text)
-{
- if (!h || !presentation_text) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->presentation_text) {
- free(h->presentation_text);
- h->presentation_text = NULL;
- }
-
- h->presentation_text = strdup(presentation_text);
- if (!h->presentation_text) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_response_item_set_value(rpc_port_autofill_response_item_h h, const char *value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->value) {
- free(h->value);
- h->value = NULL;
- }
-
- h->value = strdup(value);
- if (!h->value) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_response_item_set_autofill_hint(rpc_port_autofill_response_item_h h, int autofill_hint)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->autofill_hint = autofill_hint;
- return 0;
-}
-
-int rpc_port_autofill_response_item_get_id(rpc_port_autofill_response_item_h h, char **id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->id) {
- _E("Invalid parameter: h->id is NULL");
- return -1;
- }
-
- *id = strdup(h->id);
- if (*id == NULL) {
- _E("Failed to duplicate id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_response_item_get_presentation_text(rpc_port_autofill_response_item_h h, char **presentation_text)
-{
- if (!h || !presentation_text) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->presentation_text) {
- _E("Invalid parameter: h->presentation_text is NULL");
- return -1;
- }
-
- *presentation_text = strdup(h->presentation_text);
- if (*presentation_text == NULL) {
- _E("Failed to duplicate presentation_text");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_response_item_get_value(rpc_port_autofill_response_item_h h, char **value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->value) {
- _E("Invalid parameter: h->value is NULL");
- return -1;
- }
-
- *value = strdup(h->value);
- if (*value == NULL) {
- _E("Failed to duplicate value");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_response_item_get_autofill_hint(rpc_port_autofill_response_item_h h, int *autofill_hint)
-{
- if (!h || !autofill_hint) {
- _E("Invalid parameter");
- return -1;
- }
-
- *autofill_hint = h->autofill_hint;
- return 0;
-}
-
-struct autofill_response_group_s {
- rpc_port_parcelable_t parcelable;
- GList *response_items;
-};
-
-static void __autofill_response_group_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_response_group_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_items));
- do {
- GList *iter;
-
- iter = h->response_items;
- while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __autofill_response_group_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_response_group_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_response_item_h value = NULL;
-
- rpc_port_autofill_response_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->response_items = g_list_append(h->response_items, value);
- }
- } while (0);
-}
-
-int rpc_port_autofill_response_group_create(rpc_port_autofill_response_group_h *h)
-{
- struct autofill_response_group_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_response_group_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_response_group_to;
- handle->parcelable.from = __autofill_response_group_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_response_group_destroy(rpc_port_autofill_response_group_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->response_items;
- while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
- if (value)
- rpc_port_autofill_response_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->response_items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_response_group_clone(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_group_h *clone)
-{
- rpc_port_autofill_response_group_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_response_group_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_response_group handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->response_items;
- while (iter) {
- rpc_port_autofill_response_item_h new_value;
- rpc_port_autofill_response_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_autofill_response_group_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_response_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_autofill_response_group_destroy(handle);
- return -1;
- }
-
- handle->response_items = g_list_append(handle->response_items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_response_group_add_response_items(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_item_h response_items)
-{
- if (!h || !response_items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_response_item_h value = NULL;
-
- rpc_port_autofill_response_item_clone(response_items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->response_items = g_list_append(h->response_items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_response_group_foreach_response_items(rpc_port_autofill_response_group_h h,
- bool (*callback)(rpc_port_autofill_response_item_h response_items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->response_items;
- while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_response_group_remove_response_items(rpc_port_autofill_response_group_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->response_items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_response_item_h value = iter->data;
- h->response_items = g_list_remove_link(h->response_items, iter);
- rpc_port_autofill_response_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_autofill_response_group_get_response_items_length(rpc_port_autofill_response_group_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->response_items);
-
- return 0;
-}
-
-struct autofill_fill_response_s {
- rpc_port_parcelable_t parcelable;
- char *app_id;
- char *view_id;
- GList *response_groups;
-};
-
-static void __autofill_fill_response_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_fill_response_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->app_id ? h->app_id : "");
- rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_groups));
- do {
- GList *iter;
-
- iter = h->response_groups;
- while (iter) {
- rpc_port_autofill_response_group_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __autofill_fill_response_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_fill_response_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->app_id);
- rpc_port_parcel_read_string(parcel, &h->view_id);
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_response_group_h value = NULL;
-
- rpc_port_autofill_response_group_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->response_groups = g_list_append(h->response_groups, value);
- }
- } while (0);
-}
-
-int rpc_port_autofill_fill_response_create(rpc_port_autofill_fill_response_h *h)
-{
- struct autofill_fill_response_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_fill_response_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_fill_response_to;
- handle->parcelable.from = __autofill_fill_response_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_fill_response_destroy(rpc_port_autofill_fill_response_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id)
- free(h->app_id);
-
- if (h->view_id)
- free(h->view_id);
-
- do {
- GList *iter;
-
- iter = h->response_groups;
- while (iter) {
- rpc_port_autofill_response_group_h value = iter->data;
- if (value)
- rpc_port_autofill_response_group_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->response_groups);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_fill_response_clone(rpc_port_autofill_fill_response_h h, rpc_port_autofill_fill_response_h *clone)
-{
- rpc_port_autofill_fill_response_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_fill_response_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_fill_response handle");
- return -1;
- }
-
- if (h->app_id) {
- handle->app_id = strdup(h->app_id);
- if (!handle->app_id) {
- _E("Failed to duplicate h->app_id");
- rpc_port_autofill_fill_response_destroy(handle);
- return -1;
- }
- }
-
- if (h->view_id) {
- handle->view_id = strdup(h->view_id);
- if (!handle->view_id) {
- _E("Failed to duplicate h->view_id");
- rpc_port_autofill_fill_response_destroy(handle);
- return -1;
- }
- }
-
- do {
- GList *iter;
-
- iter = h->response_groups;
- while (iter) {
- rpc_port_autofill_response_group_h new_value;
- rpc_port_autofill_response_group_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_autofill_fill_response_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_response_group_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_autofill_fill_response_destroy(handle);
- return -1;
- }
-
- handle->response_groups = g_list_append(handle->response_groups, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_fill_response_set_app_id(rpc_port_autofill_fill_response_h h, const char *app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id) {
- free(h->app_id);
- h->app_id = NULL;
- }
-
- h->app_id = strdup(app_id);
- if (!h->app_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_fill_response_set_view_id(rpc_port_autofill_fill_response_h h, const char *view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_id) {
- free(h->view_id);
- h->view_id = NULL;
- }
-
- h->view_id = strdup(view_id);
- if (!h->view_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_fill_response_add_response_groups(rpc_port_autofill_fill_response_h h, rpc_port_autofill_response_group_h response_groups)
-{
- if (!h || !response_groups) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_response_group_h value = NULL;
-
- rpc_port_autofill_response_group_clone(response_groups, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->response_groups = g_list_append(h->response_groups, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_fill_response_get_app_id(rpc_port_autofill_fill_response_h h, char **app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->app_id) {
- _E("Invalid parameter: h->app_id is NULL");
- return -1;
- }
-
- *app_id = strdup(h->app_id);
- if (*app_id == NULL) {
- _E("Failed to duplicate app_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_fill_response_get_view_id(rpc_port_autofill_fill_response_h h, char **view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->view_id) {
- _E("Invalid parameter: h->view_id is NULL");
- return -1;
- }
-
- *view_id = strdup(h->view_id);
- if (*view_id == NULL) {
- _E("Failed to duplicate view_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_fill_response_foreach_response_groups(rpc_port_autofill_fill_response_h h,
- bool (*callback)(rpc_port_autofill_response_group_h response_groups, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->response_groups;
- while (iter) {
- rpc_port_autofill_response_group_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_fill_response_remove_response_groups(rpc_port_autofill_fill_response_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->response_groups, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_response_group_h value = iter->data;
- h->response_groups = g_list_remove_link(h->response_groups, iter);
- rpc_port_autofill_response_group_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_autofill_fill_response_get_response_groups_length(rpc_port_autofill_fill_response_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->response_groups);
-
- return 0;
-}
-
-struct autofill_error_info_s {
- rpc_port_parcelable_t parcelable;
- char *app_id;
- int error_code;
-};
-
-static void __autofill_error_info_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_error_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->app_id ? h->app_id : "");
- rpc_port_parcel_write_int32(parcel, h->error_code);
-}
-
-static void __autofill_error_info_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_error_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->app_id);
- rpc_port_parcel_read_int32(parcel, &h->error_code);
-}
-
-int rpc_port_autofill_error_info_create(rpc_port_autofill_error_info_h *h)
-{
- struct autofill_error_info_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_error_info_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_error_info_to;
- handle->parcelable.from = __autofill_error_info_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_error_info_destroy(rpc_port_autofill_error_info_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id)
- free(h->app_id);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_error_info_clone(rpc_port_autofill_error_info_h h, rpc_port_autofill_error_info_h *clone)
-{
- rpc_port_autofill_error_info_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_error_info_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_error_info handle");
- return -1;
- }
-
- if (h->app_id) {
- handle->app_id = strdup(h->app_id);
- if (!handle->app_id) {
- _E("Failed to duplicate h->app_id");
- rpc_port_autofill_error_info_destroy(handle);
- return -1;
- }
- }
-
- handle->error_code = h->error_code;
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_error_info_set_app_id(rpc_port_autofill_error_info_h h, const char *app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id) {
- free(h->app_id);
- h->app_id = NULL;
- }
-
- h->app_id = strdup(app_id);
- if (!h->app_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_error_info_set_error_code(rpc_port_autofill_error_info_h h, int error_code)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->error_code = error_code;
- return 0;
-}
-
-int rpc_port_autofill_error_info_get_app_id(rpc_port_autofill_error_info_h h, char **app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->app_id) {
- _E("Invalid parameter: h->app_id is NULL");
- return -1;
- }
-
- *app_id = strdup(h->app_id);
- if (*app_id == NULL) {
- _E("Failed to duplicate app_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_error_info_get_error_code(rpc_port_autofill_error_info_h h, int *error_code)
-{
- if (!h || !error_code) {
- _E("Invalid parameter");
- return -1;
- }
-
- *error_code = h->error_code;
- return 0;
-}
-
-struct list_autofill_item_s {
- rpc_port_parcelable_t parcelable;
- GList *list_autofill_items;
-};
-
-static void __list_autofill_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_items));
- do {
- GList *iter;
-
- iter = h->list_autofill_items;
- while (iter) {
- rpc_port_autofill_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __list_autofill_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_item_h value = NULL;
-
- rpc_port_autofill_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->list_autofill_items = g_list_append(h->list_autofill_items, value);
- }
- } while (0);
-}
-
-int rpc_port_list_autofill_item_create(rpc_port_list_autofill_item_h *h)
-{
- struct list_autofill_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct list_autofill_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __list_autofill_item_to;
- handle->parcelable.from = __list_autofill_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_item_destroy(rpc_port_list_autofill_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_items;
- while (iter) {
- rpc_port_autofill_item_h value = iter->data;
- if (value)
- rpc_port_autofill_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->list_autofill_items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_list_autofill_item_clone(rpc_port_list_autofill_item_h h, rpc_port_list_autofill_item_h *clone)
-{
- rpc_port_list_autofill_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_list_autofill_item_create(&handle);
- if (!handle) {
- _E("Failed to create list_autofill_item handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_items;
- while (iter) {
- rpc_port_autofill_item_h new_value;
- rpc_port_autofill_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_list_autofill_item_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_list_autofill_item_destroy(handle);
- return -1;
- }
-
- handle->list_autofill_items = g_list_append(handle->list_autofill_items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_item_add_list_autofill_items(rpc_port_list_autofill_item_h h, rpc_port_autofill_item_h list_autofill_items)
-{
- if (!h || !list_autofill_items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_item_h value = NULL;
-
- rpc_port_autofill_item_clone(list_autofill_items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->list_autofill_items = g_list_append(h->list_autofill_items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_item_foreach_list_autofill_items(rpc_port_list_autofill_item_h h,
- bool (*callback)(rpc_port_autofill_item_h list_autofill_items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_items;
- while (iter) {
- rpc_port_autofill_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_item_remove_list_autofill_items(rpc_port_list_autofill_item_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->list_autofill_items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_item_h value = iter->data;
- h->list_autofill_items = g_list_remove_link(h->list_autofill_items, iter);
- rpc_port_autofill_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_list_autofill_item_get_list_autofill_items_length(rpc_port_list_autofill_item_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->list_autofill_items);
-
- return 0;
-}
-
-struct list_autofill_response_group_s {
- rpc_port_parcelable_t parcelable;
- GList *list_autofill_response_groups;
-};
-
-static void __list_autofill_response_group_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_response_group_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_response_groups));
- do {
- GList *iter;
-
- iter = h->list_autofill_response_groups;
- while (iter) {
- rpc_port_autofill_response_group_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __list_autofill_response_group_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_response_group_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_response_group_h value = NULL;
-
- rpc_port_autofill_response_group_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->list_autofill_response_groups = g_list_append(h->list_autofill_response_groups, value);
- }
- } while (0);
-}
-
-int rpc_port_list_autofill_response_group_create(rpc_port_list_autofill_response_group_h *h)
-{
- struct list_autofill_response_group_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct list_autofill_response_group_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __list_autofill_response_group_to;
- handle->parcelable.from = __list_autofill_response_group_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_group_destroy(rpc_port_list_autofill_response_group_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_response_groups;
- while (iter) {
- rpc_port_autofill_response_group_h value = iter->data;
- if (value)
- rpc_port_autofill_response_group_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->list_autofill_response_groups);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_group_clone(rpc_port_list_autofill_response_group_h h, rpc_port_list_autofill_response_group_h *clone)
-{
- rpc_port_list_autofill_response_group_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_list_autofill_response_group_create(&handle);
- if (!handle) {
- _E("Failed to create list_autofill_response_group handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_response_groups;
- while (iter) {
- rpc_port_autofill_response_group_h new_value;
- rpc_port_autofill_response_group_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_list_autofill_response_group_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_response_group_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_list_autofill_response_group_destroy(handle);
- return -1;
- }
-
- handle->list_autofill_response_groups = g_list_append(handle->list_autofill_response_groups, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_group_add_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, rpc_port_autofill_response_group_h list_autofill_response_groups)
-{
- if (!h || !list_autofill_response_groups) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_response_group_h value = NULL;
-
- rpc_port_autofill_response_group_clone(list_autofill_response_groups, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->list_autofill_response_groups = g_list_append(h->list_autofill_response_groups, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_group_foreach_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h,
- bool (*callback)(rpc_port_autofill_response_group_h list_autofill_response_groups, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_response_groups;
- while (iter) {
- rpc_port_autofill_response_group_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_group_remove_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->list_autofill_response_groups, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_response_group_h value = iter->data;
- h->list_autofill_response_groups = g_list_remove_link(h->list_autofill_response_groups, iter);
- rpc_port_autofill_response_group_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_group_get_list_autofill_response_groups_length(rpc_port_list_autofill_response_group_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->list_autofill_response_groups);
-
- return 0;
-}
-
-struct list_autofill_response_item_s {
- rpc_port_parcelable_t parcelable;
- GList *list_autofill_response_items;
-};
-
-static void __list_autofill_response_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_response_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_response_items));
- do {
- GList *iter;
-
- iter = h->list_autofill_response_items;
- while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __list_autofill_response_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_response_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_response_item_h value = NULL;
-
- rpc_port_autofill_response_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->list_autofill_response_items = g_list_append(h->list_autofill_response_items, value);
- }
- } while (0);
-}
-
-int rpc_port_list_autofill_response_item_create(rpc_port_list_autofill_response_item_h *h)
-{
- struct list_autofill_response_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct list_autofill_response_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __list_autofill_response_item_to;
- handle->parcelable.from = __list_autofill_response_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_item_destroy(rpc_port_list_autofill_response_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_response_items;
- while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
- if (value)
- rpc_port_autofill_response_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->list_autofill_response_items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_item_clone(rpc_port_list_autofill_response_item_h h, rpc_port_list_autofill_response_item_h *clone)
-{
- rpc_port_list_autofill_response_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_list_autofill_response_item_create(&handle);
- if (!handle) {
- _E("Failed to create list_autofill_response_item handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_response_items;
- while (iter) {
- rpc_port_autofill_response_item_h new_value;
- rpc_port_autofill_response_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_list_autofill_response_item_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_response_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_list_autofill_response_item_destroy(handle);
- return -1;
- }
-
- handle->list_autofill_response_items = g_list_append(handle->list_autofill_response_items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_item_add_list_autofill_response_items(rpc_port_list_autofill_response_item_h h, rpc_port_autofill_response_item_h list_autofill_response_items)
-{
- if (!h || !list_autofill_response_items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_response_item_h value = NULL;
-
- rpc_port_autofill_response_item_clone(list_autofill_response_items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->list_autofill_response_items = g_list_append(h->list_autofill_response_items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_item_foreach_list_autofill_response_items(rpc_port_list_autofill_response_item_h h,
- bool (*callback)(rpc_port_autofill_response_item_h list_autofill_response_items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_response_items;
- while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_item_remove_list_autofill_response_items(rpc_port_list_autofill_response_item_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->list_autofill_response_items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_response_item_h value = iter->data;
- h->list_autofill_response_items = g_list_remove_link(h->list_autofill_response_items, iter);
- rpc_port_autofill_response_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_list_autofill_response_item_get_list_autofill_response_items_length(rpc_port_list_autofill_response_item_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->list_autofill_response_items);
-
- return 0;
-}
-
-struct list_autofill_save_item_s {
- rpc_port_parcelable_t parcelable;
- GList *list_autofill_save_items;
-};
-
-static void __list_autofill_save_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_save_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_save_items));
- do {
- GList *iter;
-
- iter = h->list_autofill_save_items;
- while (iter) {
- rpc_port_autofill_save_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __list_autofill_save_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_save_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_save_item_h value = NULL;
-
- rpc_port_autofill_save_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->list_autofill_save_items = g_list_append(h->list_autofill_save_items, value);
- }
- } while (0);
-}
-
-int rpc_port_list_autofill_save_item_create(rpc_port_list_autofill_save_item_h *h)
-{
- struct list_autofill_save_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct list_autofill_save_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __list_autofill_save_item_to;
- handle->parcelable.from = __list_autofill_save_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_save_item_destroy(rpc_port_list_autofill_save_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_save_items;
- while (iter) {
- rpc_port_autofill_save_item_h value = iter->data;
- if (value)
- rpc_port_autofill_save_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->list_autofill_save_items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_list_autofill_save_item_clone(rpc_port_list_autofill_save_item_h h, rpc_port_list_autofill_save_item_h *clone)
-{
- rpc_port_list_autofill_save_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_list_autofill_save_item_create(&handle);
- if (!handle) {
- _E("Failed to create list_autofill_save_item handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_save_items;
- while (iter) {
- rpc_port_autofill_save_item_h new_value;
- rpc_port_autofill_save_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_list_autofill_save_item_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_save_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_list_autofill_save_item_destroy(handle);
- return -1;
- }
-
- handle->list_autofill_save_items = g_list_append(handle->list_autofill_save_items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_save_item_add_list_autofill_save_items(rpc_port_list_autofill_save_item_h h, rpc_port_autofill_save_item_h list_autofill_save_items)
-{
- if (!h || !list_autofill_save_items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_save_item_h value = NULL;
-
- rpc_port_autofill_save_item_clone(list_autofill_save_items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->list_autofill_save_items = g_list_append(h->list_autofill_save_items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_save_item_foreach_list_autofill_save_items(rpc_port_list_autofill_save_item_h h,
- bool (*callback)(rpc_port_autofill_save_item_h list_autofill_save_items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_save_items;
- while (iter) {
- rpc_port_autofill_save_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_save_item_remove_list_autofill_save_items(rpc_port_list_autofill_save_item_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->list_autofill_save_items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_save_item_h value = iter->data;
- h->list_autofill_save_items = g_list_remove_link(h->list_autofill_save_items, iter);
- rpc_port_autofill_save_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_list_autofill_save_item_get_list_autofill_save_items_length(rpc_port_list_autofill_save_item_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->list_autofill_save_items);
-
- return 0;
-}
-
-enum AutofillAppPort_method_e {
- AutofillAppPort_METHOD_Result,
- AutofillAppPort_METHOD_Callback,
- AutofillAppPort_METHOD_Register,
- AutofillAppPort_METHOD_Unregister,
- AutofillAppPort_METHOD_request_auth_info,
- AutofillAppPort_METHOD_send_fill_request,
- AutofillAppPort_METHOD_commit,
- AutofillAppPort_METHOD_cancel_fill_request,
-};
-
-enum AutofillAppPort_delegate_e {
- AutofillAppPort_DELEGATE_autofill_auth_info_received_cb = 1,
- AutofillAppPort_DELEGATE_autofill_fill_response_received_cb = 2,
- AutofillAppPort_DELEGATE_autofill_error_info_received_cb = 3,
-};
-
-struct AutofillAppPort_s {
- char *stub_appid;
- rpc_port_proxy_h proxy;
- rpc_port_h port;
- rpc_port_h callback_port;
- rpc_port_proxy_AutofillAppPort_callback_s callback;
- void *user_data;
- GList *delegates;
- GRecMutex mutex;
-};
-
-struct AutofillAppPort_autofill_auth_info_received_cb_s {
- rpc_port_parcelable_t parcelable;
- int id;
- int seq_id;
- AutofillAppPort_autofill_auth_info_received_cb callback;
- bool once;
- void *user_data;
-};
-
-static void __AutofillAppPort_autofill_auth_info_received_cb_to(rpc_port_parcel_h parcel, void *data)
-{
- struct AutofillAppPort_autofill_auth_info_received_cb_s *handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_int32(parcel, handle->id);
- rpc_port_parcel_write_int32(parcel, handle->seq_id);
- rpc_port_parcel_write_bool(parcel, handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-static void __AutofillAppPort_autofill_auth_info_received_cb_from(rpc_port_parcel_h parcel, void *data)
-{
- struct AutofillAppPort_autofill_auth_info_received_cb_s *handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_int32(parcel, &handle->id);
- rpc_port_parcel_read_int32(parcel, &handle->seq_id);
- rpc_port_parcel_read_bool(parcel, &handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h rpc_port_AutofillAppPort_autofill_auth_info_received_cb_create(AutofillAppPort_autofill_auth_info_received_cb callback, bool once, void *user_data)
-{
- struct AutofillAppPort_autofill_auth_info_received_cb_s *handle;
- static int seq_num;
-
- handle = calloc(1, sizeof(struct AutofillAppPort_autofill_auth_info_received_cb_s));
- if (!handle) {
- _E("Out of memory");
- return NULL;
- }
-
- handle->parcelable.to = __AutofillAppPort_autofill_auth_info_received_cb_to;
- handle->parcelable.from= __AutofillAppPort_autofill_auth_info_received_cb_from;
- handle->id = AutofillAppPort_DELEGATE_autofill_auth_info_received_cb;
- handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
- handle->callback = callback;
- handle->once = once;
- handle->user_data = user_data;
- _I("id(%d), seq_id(%d)", handle->id, handle->seq_id);
-
- return handle;
-}
-
-int rpc_port_AutofillAppPort_autofill_auth_info_received_cb_destroy(rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h delegate)
-{
- if (!delegate) {
- _E("Invalid parameter");
- return -1;
- }
-
- free(delegate);
-
- return 0;
-}
-
-int rpc_port_proxy_AutofillAppPort_autofill_auth_info_received_cb_dispose(rpc_port_proxy_AutofillAppPort_h proxy, rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h delegate)
-{
- struct AutofillAppPort_autofill_auth_info_received_cb_s *handle;
- GList *iter;
-
- if (!proxy || !delegate) {
- _E("Invalid handle %p %p", proxy, delegate);
- return -1;
- }
-
- iter = proxy->delegates;
- while (iter) {
- handle = (struct AutofillAppPort_autofill_auth_info_received_cb_s *)iter->data;
- if (handle == delegate) {
- _W("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
- proxy->delegates = g_list_remove_link(proxy->delegates, iter);
- free(handle);
- g_list_free(iter);
- return 0;
- }
- iter = g_list_next(iter);
- }
-
- return -1;
-}
-
-static void __AutofillAppPort_delegate_autofill_auth_info_received_cb(GList **list, rpc_port_parcel_h parcel, int seq_id, int id)
-{
- rpc_port_autofill_auth_info_h auth_info = NULL;
-
- rpc_port_autofill_auth_info_create(&auth_info);
- rpc_port_parcel_read(parcel, &auth_info->parcelable, auth_info);
-
- do {
- struct AutofillAppPort_autofill_auth_info_received_cb_s *handle;
- GList *iter;
-
- iter = *list;
- while (iter) {
- handle = (struct AutofillAppPort_autofill_auth_info_received_cb_s *)iter->data;
- if (handle->seq_id == seq_id && handle->id == id) {
- bool once = handle->once;
-
- _W("Invoke id(%d), seq_id(%d)", id, seq_id);
- handle->callback(handle->user_data, auth_info);
-
- if (once) {
- _W("Dispose");
- *list = g_list_remove_link(*list, iter);
- free(handle);
- g_list_free(iter);
- }
- break;
- }
- iter = g_list_next(iter);
- }
- } while (0);
- rpc_port_autofill_auth_info_destroy(auth_info);
-}
-
-struct AutofillAppPort_autofill_fill_response_received_cb_s {
- rpc_port_parcelable_t parcelable;
- int id;
- int seq_id;
- AutofillAppPort_autofill_fill_response_received_cb callback;
- bool once;
- void *user_data;
-};
-
-static void __AutofillAppPort_autofill_fill_response_received_cb_to(rpc_port_parcel_h parcel, void *data)
-{
- struct AutofillAppPort_autofill_fill_response_received_cb_s *handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_int32(parcel, handle->id);
- rpc_port_parcel_write_int32(parcel, handle->seq_id);
- rpc_port_parcel_write_bool(parcel, handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-static void __AutofillAppPort_autofill_fill_response_received_cb_from(rpc_port_parcel_h parcel, void *data)
-{
- struct AutofillAppPort_autofill_fill_response_received_cb_s *handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_int32(parcel, &handle->id);
- rpc_port_parcel_read_int32(parcel, &handle->seq_id);
- rpc_port_parcel_read_bool(parcel, &handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h rpc_port_AutofillAppPort_autofill_fill_response_received_cb_create(AutofillAppPort_autofill_fill_response_received_cb callback, bool once, void *user_data)
-{
- struct AutofillAppPort_autofill_fill_response_received_cb_s *handle;
- static int seq_num;
-
- handle = calloc(1, sizeof(struct AutofillAppPort_autofill_fill_response_received_cb_s));
- if (!handle) {
- _E("Out of memory");
- return NULL;
- }
-
- handle->parcelable.to = __AutofillAppPort_autofill_fill_response_received_cb_to;
- handle->parcelable.from= __AutofillAppPort_autofill_fill_response_received_cb_from;
- handle->id = AutofillAppPort_DELEGATE_autofill_fill_response_received_cb;
- handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
- handle->callback = callback;
- handle->once = once;
- handle->user_data = user_data;
- _I("id(%d), seq_id(%d)", handle->id, handle->seq_id);
-
- return handle;
-}
-
-int rpc_port_AutofillAppPort_autofill_fill_response_received_cb_destroy(rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h delegate)
-{
- if (!delegate) {
- _E("Invalid parameter");
- return -1;
- }
-
- free(delegate);
-
- return 0;
-}
-
-int rpc_port_proxy_AutofillAppPort_autofill_fill_response_received_cb_dispose(rpc_port_proxy_AutofillAppPort_h proxy, rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h delegate)
-{
- struct AutofillAppPort_autofill_fill_response_received_cb_s *handle;
- GList *iter;
-
- if (!proxy || !delegate) {
- _E("Invalid handle %p %p", proxy, delegate);
- return -1;
- }
-
- iter = proxy->delegates;
- while (iter) {
- handle = (struct AutofillAppPort_autofill_fill_response_received_cb_s *)iter->data;
- if (handle == delegate) {
- _W("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
- proxy->delegates = g_list_remove_link(proxy->delegates, iter);
- free(handle);
- g_list_free(iter);
- return 0;
- }
- iter = g_list_next(iter);
- }
-
- return -1;
-}
-
-static void __AutofillAppPort_delegate_autofill_fill_response_received_cb(GList **list, rpc_port_parcel_h parcel, int seq_id, int id)
-{
- rpc_port_autofill_fill_response_h response = NULL;
-
- rpc_port_autofill_fill_response_create(&response);
- rpc_port_parcel_read(parcel, &response->parcelable, response);
-
- do {
- struct AutofillAppPort_autofill_fill_response_received_cb_s *handle;
- GList *iter;
-
- iter = *list;
- while (iter) {
- handle = (struct AutofillAppPort_autofill_fill_response_received_cb_s *)iter->data;
- if (handle->seq_id == seq_id && handle->id == id) {
- bool once = handle->once;
-
- _W("Invoke id(%d), seq_id(%d)", id, seq_id);
- handle->callback(handle->user_data, response);
-
- if (once) {
- _W("Dispose");
- *list = g_list_remove_link(*list, iter);
- free(handle);
- g_list_free(iter);
- }
- break;
- }
- iter = g_list_next(iter);
- }
- } while (0);
- rpc_port_autofill_fill_response_destroy(response);
-}
-
-struct AutofillAppPort_autofill_error_info_received_cb_s {
- rpc_port_parcelable_t parcelable;
- int id;
- int seq_id;
- AutofillAppPort_autofill_error_info_received_cb callback;
- bool once;
- void *user_data;
-};
-
-static void __AutofillAppPort_autofill_error_info_received_cb_to(rpc_port_parcel_h parcel, void *data)
-{
- struct AutofillAppPort_autofill_error_info_received_cb_s *handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_int32(parcel, handle->id);
- rpc_port_parcel_write_int32(parcel, handle->seq_id);
- rpc_port_parcel_write_bool(parcel, handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-static void __AutofillAppPort_autofill_error_info_received_cb_from(rpc_port_parcel_h parcel, void *data)
-{
- struct AutofillAppPort_autofill_error_info_received_cb_s *handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_int32(parcel, &handle->id);
- rpc_port_parcel_read_int32(parcel, &handle->seq_id);
- rpc_port_parcel_read_bool(parcel, &handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-rpc_port_AutofillAppPort_autofill_error_info_received_cb_h rpc_port_AutofillAppPort_autofill_error_info_received_cb_create(AutofillAppPort_autofill_error_info_received_cb callback, bool once, void *user_data)
-{
- struct AutofillAppPort_autofill_error_info_received_cb_s *handle;
- static int seq_num;
-
- handle = calloc(1, sizeof(struct AutofillAppPort_autofill_error_info_received_cb_s));
- if (!handle) {
- _E("Out of memory");
- return NULL;
- }
-
- handle->parcelable.to = __AutofillAppPort_autofill_error_info_received_cb_to;
- handle->parcelable.from= __AutofillAppPort_autofill_error_info_received_cb_from;
- handle->id = AutofillAppPort_DELEGATE_autofill_error_info_received_cb;
- handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
- handle->callback = callback;
- handle->once = once;
- handle->user_data = user_data;
- _I("id(%d), seq_id(%d)", handle->id, handle->seq_id);
-
- return handle;
-}
-
-int rpc_port_AutofillAppPort_autofill_error_info_received_cb_destroy(rpc_port_AutofillAppPort_autofill_error_info_received_cb_h delegate)
-{
- if (!delegate) {
- _E("Invalid parameter");
- return -1;
- }
-
- free(delegate);
-
- return 0;
-}
-
-int rpc_port_proxy_AutofillAppPort_autofill_error_info_received_cb_dispose(rpc_port_proxy_AutofillAppPort_h proxy, rpc_port_AutofillAppPort_autofill_error_info_received_cb_h delegate)
-{
- struct AutofillAppPort_autofill_error_info_received_cb_s *handle;
- GList *iter;
-
- if (!proxy || !delegate) {
- _E("Invalid handle %p %p", proxy, delegate);
- return -1;
- }
-
- iter = proxy->delegates;
- while (iter) {
- handle = (struct AutofillAppPort_autofill_error_info_received_cb_s *)iter->data;
- if (handle == delegate) {
- _W("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
- proxy->delegates = g_list_remove_link(proxy->delegates, iter);
- free(handle);
- g_list_free(iter);
- return 0;
- }
- iter = g_list_next(iter);
- }
-
- return -1;
-}
-
-static void __AutofillAppPort_delegate_autofill_error_info_received_cb(GList **list, rpc_port_parcel_h parcel, int seq_id, int id)
-{
- rpc_port_autofill_error_info_h error_info = NULL;
-
- rpc_port_autofill_error_info_create(&error_info);
- rpc_port_parcel_read(parcel, &error_info->parcelable, error_info);
-
- do {
- struct AutofillAppPort_autofill_error_info_received_cb_s *handle;
- GList *iter;
-
- iter = *list;
- while (iter) {
- handle = (struct AutofillAppPort_autofill_error_info_received_cb_s *)iter->data;
- if (handle->seq_id == seq_id && handle->id == id) {
- bool once = handle->once;
-
- _W("Invoke id(%d), seq_id(%d)", id, seq_id);
- handle->callback(handle->user_data, error_info);
-
- if (once) {
- _W("Dispose");
- *list = g_list_remove_link(*list, iter);
- free(handle);
- g_list_free(iter);
- }
- break;
- }
- iter = g_list_next(iter);
- }
- } while (0);
- rpc_port_autofill_error_info_destroy(error_info);
-}
-
-static proxy_delegate __AutofillAppPort_delegate_table[] = {
- [AutofillAppPort_DELEGATE_autofill_auth_info_received_cb] = __AutofillAppPort_delegate_autofill_auth_info_received_cb,
- [AutofillAppPort_DELEGATE_autofill_fill_response_received_cb] = __AutofillAppPort_delegate_autofill_fill_response_received_cb,
- [AutofillAppPort_DELEGATE_autofill_error_info_received_cb] = __AutofillAppPort_delegate_autofill_error_info_received_cb,
-};
-
-static void __AutofillAppPort_process_received_event(GList **list, rpc_port_parcel_h parcel)
-{
- int id;
- int seq_id;
- bool once;
-
- rpc_port_parcel_read_int32(parcel, &id);
- rpc_port_parcel_read_int32(parcel, &seq_id);
- rpc_port_parcel_read_bool(parcel, &once);
- _W("id(%d), seq_id(%d)", id, seq_id);
-
- if (id > 0 && id < (sizeof(__AutofillAppPort_delegate_table) / sizeof(__AutofillAppPort_delegate_table[0]))) {
- if (__AutofillAppPort_delegate_table[id])
- __AutofillAppPort_delegate_table[id](list, parcel, seq_id, id);
- } else {
- _W("Unknown id(%d)", id);
- }
-}
-
-static rpc_port_parcel_h __AutofillAppPort_consume_command(rpc_port_proxy_AutofillAppPort_h h)
-{
- rpc_port_parcel_h parcel = NULL;
- int cmd = -1;
-
- do {
- rpc_port_parcel_create_from_port(&parcel, h->port);
- if (!parcel)
- break;
-
- rpc_port_parcel_read_int32(parcel, &cmd);
- if (cmd == AutofillAppPort_METHOD_Result)
- return parcel;
-
- rpc_port_parcel_destroy(parcel);
- parcel = NULL;
- } while (true);
-
- return NULL;
-}
-
-static void __AutofillAppPort_on_connected(const char *endpoint, const char *port_name, rpc_port_h port, void *data)
-{
- rpc_port_proxy_AutofillAppPort_h handle = data;
-
- handle->port = port;
- rpc_port_proxy_get_port(handle->proxy, RPC_PORT_PORT_CALLBACK, &handle->callback_port);
- if (handle->callback.connected)
- handle->callback.connected(handle, handle->user_data);
- _I("[__RPC_PORT__] endpoint(%s), port_name(%s)", endpoint, port_name);
-}
-
-static void __AutofillAppPort_on_disconnected(const char *endpoint, const char *port_name, void *data)
-{
- rpc_port_proxy_AutofillAppPort_h handle = data;
-
- handle->port = NULL;
- if (handle->callback.disconnected)
- handle->callback.disconnected(handle, handle->user_data);
- _I("[__RPC_PORT__] endpoint(%s), port_name(%s)", endpoint, port_name);
-}
-
-static void __AutofillAppPort_on_rejected(const char *endpoint, const char *port_name, void *data)
-{
- rpc_port_proxy_AutofillAppPort_h handle = data;
-
- handle->port = NULL;
- if (handle->callback.rejected)
- handle->callback.rejected(handle, handle->user_data);
- _I("[__RPC_PORT__] endpoint(%s), port_name(%s)", endpoint, port_name);
-}
-
-static void __AutofillAppPort_on_received(const char *endpoint, const char *port_name, void *data)
-{
- rpc_port_proxy_AutofillAppPort_h handle = data;
- rpc_port_parcel_h parcel_received = NULL;
- int cmd = -1;
-
- rpc_port_parcel_create_from_port(&parcel_received, handle->callback_port);
- if (!parcel_received) {
- _E("Failed to create parcel from port(%s)", port_name);
- return;
- }
-
- rpc_port_parcel_read_int32(parcel_received, &cmd);
- if (cmd != AutofillAppPort_METHOD_Callback) {
- _E("Invalid protocol");
- rpc_port_parcel_destroy(parcel_received);
- return;
- }
-
- __AutofillAppPort_process_received_event(&handle->delegates, parcel_received);
- rpc_port_parcel_destroy(parcel_received);
- _I("[__RPC_PORT__] endpoint(%s), port_name(%s)", endpoint, port_name);
-}
-
-int rpc_port_proxy_AutofillAppPort_invoke_Register(rpc_port_proxy_AutofillAppPort_h h, int context_id, rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_cb, rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_cb, rpc_port_AutofillAppPort_autofill_error_info_received_cb_h error_info_cb)
-{
- rpc_port_parcel_h parcel;
- int r;
- int ret = -1;
-
- if (!h || !auth_info_cb || !fill_response_cb || !error_info_cb) {
- _E("Invalid parameter");
- return ret;
- }
-
- if (!h->port) {
- _E("Not connected");
- return ret;
- }
-
- rpc_port_parcel_create(&parcel);
- rpc_port_parcel_write_int32(parcel, AutofillAppPort_METHOD_Register);
- rpc_port_parcel_write_int32(parcel, context_id);
-
- do {
- struct AutofillAppPort_autofill_auth_info_received_cb_s *handle = auth_info_cb;
-
- rpc_port_parcel_write(parcel, &handle->parcelable, handle);
- h->delegates = g_list_append(h->delegates, handle);
- } while (0);
-
- do {
- struct AutofillAppPort_autofill_fill_response_received_cb_s *handle = fill_response_cb;
-
- rpc_port_parcel_write(parcel, &handle->parcelable, handle);
- h->delegates = g_list_append(h->delegates, handle);
- } while (0);
-
- do {
- struct AutofillAppPort_autofill_error_info_received_cb_s *handle = error_info_cb;
-
- rpc_port_parcel_write(parcel, &handle->parcelable, handle);
- h->delegates = g_list_append(h->delegates, handle);
- } while (0);
-
- r = rpc_port_parcel_send(parcel, h->port);
- if (r != RPC_PORT_ERROR_NONE) {
- _E("Failed to send parcel. result(%d)", r);
- r = RPC_PORT_ERROR_IO_ERROR;
- }
-
- rpc_port_parcel_destroy(parcel);
-
- g_rec_mutex_lock(&h->mutex);
- do {
- rpc_port_parcel_h parcel_received;
-
- parcel_received = __AutofillAppPort_consume_command(h);
- if (!parcel_received) {
- _E("Invalid protocol");
- r = RPC_PORT_ERROR_IO_ERROR;
- break;
- }
-
- rpc_port_parcel_read_int32(parcel_received, &ret);
-
- rpc_port_parcel_destroy(parcel_received);
- } while (0);
- g_rec_mutex_unlock(&h->mutex);
- set_last_result(r);
-
- return ret;
-}
-
-void rpc_port_proxy_AutofillAppPort_invoke_Unregister(rpc_port_proxy_AutofillAppPort_h h, int context_id)
-{
- rpc_port_parcel_h parcel;
- int r;
-
- if (!h) {
- _E("Invalid parameter");
- return;
- }
-
- if (!h->port) {
- _E("Not connected");
- return;
- }
-
- rpc_port_parcel_create(&parcel);
- rpc_port_parcel_write_int32(parcel, AutofillAppPort_METHOD_Unregister);
- rpc_port_parcel_write_int32(parcel, context_id);
-
- r = rpc_port_parcel_send(parcel, h->port);
- if (r != RPC_PORT_ERROR_NONE) {
- _E("Failed to send parcel. result(%d)", r);
- r = RPC_PORT_ERROR_IO_ERROR;
- }
-
- rpc_port_parcel_destroy(parcel);
- set_last_result(r);
-}
-
-int rpc_port_proxy_AutofillAppPort_invoke_request_auth_info(rpc_port_proxy_AutofillAppPort_h h, int context_id, rpc_port_autofill_view_info_h vi)
-{
- rpc_port_parcel_h parcel;
- int r;
- int ret = -1;
-
- if (!h || !vi) {
- _E("Invalid parameter");
- return ret;
- }
-
- if (!h->port) {
- _E("Not connected");
- return ret;
- }
-
- rpc_port_parcel_create(&parcel);
- rpc_port_parcel_write_int32(parcel, AutofillAppPort_METHOD_request_auth_info);
- rpc_port_parcel_write_int32(parcel, context_id);
- rpc_port_parcel_write(parcel, &vi->parcelable, vi);
-
- r = rpc_port_parcel_send(parcel, h->port);
- if (r != RPC_PORT_ERROR_NONE) {
- _E("Failed to send parcel. result(%d)", r);
- r = RPC_PORT_ERROR_IO_ERROR;
- }
-
- rpc_port_parcel_destroy(parcel);
-
- g_rec_mutex_lock(&h->mutex);
- do {
- rpc_port_parcel_h parcel_received;
-
- parcel_received = __AutofillAppPort_consume_command(h);
- if (!parcel_received) {
- _E("Invalid protocol");
- r = RPC_PORT_ERROR_IO_ERROR;
- break;
- }
-
- rpc_port_parcel_read_int32(parcel_received, &ret);
-
- rpc_port_parcel_destroy(parcel_received);
- } while (0);
- g_rec_mutex_unlock(&h->mutex);
- set_last_result(r);
-
- return ret;
-}
-
-int rpc_port_proxy_AutofillAppPort_invoke_send_fill_request(rpc_port_proxy_AutofillAppPort_h h, int context_id, rpc_port_autofill_view_info_h vi)
-{
- rpc_port_parcel_h parcel;
- int r;
- int ret = -1;
-
- if (!h || !vi) {
- _E("Invalid parameter");
- return ret;
- }
-
- if (!h->port) {
- _E("Not connected");
- return ret;
- }
-
- rpc_port_parcel_create(&parcel);
- rpc_port_parcel_write_int32(parcel, AutofillAppPort_METHOD_send_fill_request);
- rpc_port_parcel_write_int32(parcel, context_id);
- rpc_port_parcel_write(parcel, &vi->parcelable, vi);
-
- r = rpc_port_parcel_send(parcel, h->port);
- if (r != RPC_PORT_ERROR_NONE) {
- _E("Failed to send parcel. result(%d)", r);
- r = RPC_PORT_ERROR_IO_ERROR;
- }
-
- rpc_port_parcel_destroy(parcel);
-
- g_rec_mutex_lock(&h->mutex);
- do {
- rpc_port_parcel_h parcel_received;
-
- parcel_received = __AutofillAppPort_consume_command(h);
- if (!parcel_received) {
- _E("Invalid protocol");
- r = RPC_PORT_ERROR_IO_ERROR;
- break;
- }
-
- rpc_port_parcel_read_int32(parcel_received, &ret);
-
- rpc_port_parcel_destroy(parcel_received);
- } while (0);
- g_rec_mutex_unlock(&h->mutex);
- set_last_result(r);
-
- return ret;
-}
-
-int rpc_port_proxy_AutofillAppPort_invoke_commit(rpc_port_proxy_AutofillAppPort_h h, int context_id, rpc_port_autofill_save_view_info_h vi)
-{
- rpc_port_parcel_h parcel;
- int r;
- int ret = -1;
-
- if (!h || !vi) {
- _E("Invalid parameter");
- return ret;
- }
-
- if (!h->port) {
- _E("Not connected");
- return ret;
- }
-
- rpc_port_parcel_create(&parcel);
- rpc_port_parcel_write_int32(parcel, AutofillAppPort_METHOD_commit);
- rpc_port_parcel_write_int32(parcel, context_id);
- rpc_port_parcel_write(parcel, &vi->parcelable, vi);
-
- r = rpc_port_parcel_send(parcel, h->port);
- if (r != RPC_PORT_ERROR_NONE) {
- _E("Failed to send parcel. result(%d)", r);
- r = RPC_PORT_ERROR_IO_ERROR;
- }
-
- rpc_port_parcel_destroy(parcel);
-
- g_rec_mutex_lock(&h->mutex);
- do {
- rpc_port_parcel_h parcel_received;
-
- parcel_received = __AutofillAppPort_consume_command(h);
- if (!parcel_received) {
- _E("Invalid protocol");
- r = RPC_PORT_ERROR_IO_ERROR;
- break;
- }
-
- rpc_port_parcel_read_int32(parcel_received, &ret);
-
- rpc_port_parcel_destroy(parcel_received);
- } while (0);
- g_rec_mutex_unlock(&h->mutex);
- set_last_result(r);
-
- return ret;
-}
-
-int rpc_port_proxy_AutofillAppPort_invoke_cancel_fill_request(rpc_port_proxy_AutofillAppPort_h h, int context_id, rpc_port_autofill_view_info_h vi)
-{
- rpc_port_parcel_h parcel;
- int r;
- int ret = -1;
-
- if (!h || !vi) {
- _E("Invalid parameter");
- return ret;
- }
-
- if (!h->port) {
- _E("Not connected");
- return ret;
- }
-
- rpc_port_parcel_create(&parcel);
- rpc_port_parcel_write_int32(parcel, AutofillAppPort_METHOD_cancel_fill_request);
- rpc_port_parcel_write_int32(parcel, context_id);
- rpc_port_parcel_write(parcel, &vi->parcelable, vi);
-
- r = rpc_port_parcel_send(parcel, h->port);
- if (r != RPC_PORT_ERROR_NONE) {
- _E("Failed to send parcel. result(%d)", r);
- r = RPC_PORT_ERROR_IO_ERROR;
- }
-
- rpc_port_parcel_destroy(parcel);
-
- g_rec_mutex_lock(&h->mutex);
- do {
- rpc_port_parcel_h parcel_received;
-
- parcel_received = __AutofillAppPort_consume_command(h);
- if (!parcel_received) {
- _E("Invalid protocol");
- r = RPC_PORT_ERROR_IO_ERROR;
- break;
- }
-
- rpc_port_parcel_read_int32(parcel_received, &ret);
-
- rpc_port_parcel_destroy(parcel_received);
- } while (0);
- g_rec_mutex_unlock(&h->mutex);
- set_last_result(r);
-
- return ret;
-}
-
-static struct AutofillAppPort_s *__create_AutofillAppPort(const char *stub_appid, rpc_port_proxy_AutofillAppPort_callback_s *callback, void *user_data)
-{
- struct AutofillAppPort_s *handle;
-
- handle = calloc(1, sizeof(struct AutofillAppPort_s));
- if (!handle) {
- _E("Out of memory");
- return NULL;
- }
-
- handle->stub_appid = strdup(stub_appid);
- if (!handle->stub_appid) {
- _E("Out of memory");
- free(handle);
- return NULL;
- }
-
- rpc_port_proxy_create(&handle->proxy);
- if (!handle->proxy) {
- _E("Failed to create proxy");
- free(handle->stub_appid);
- free(handle);
- return NULL;
- }
-
- g_rec_mutex_init(&handle->mutex);
-
- handle->callback = *callback;
- handle->user_data = user_data;
-
- return handle;
-}
-
-static void __destroy_AutofillAppPort(struct AutofillAppPort_s *h)
-{
- if (!h)
- return;
-
- g_rec_mutex_clear(&h->mutex);
-
- if (h->delegates)
- g_list_free_full(h->delegates, free);
-
- if (h->proxy)
- rpc_port_proxy_destroy(h->proxy);
-
- if (h->stub_appid)
- free(h->stub_appid);
-
- free(h);
-}
-
-int rpc_port_proxy_AutofillAppPort_create(const char *stub_appid, rpc_port_proxy_AutofillAppPort_callback_s *callback, void *user_data, rpc_port_proxy_AutofillAppPort_h *h)
-{
- struct AutofillAppPort_s *handle;
- int r;
-
- if (!stub_appid || !callback || !h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = __create_AutofillAppPort(stub_appid, callback, user_data);
- if (!handle)
- return -1;
-
- r = rpc_port_proxy_add_connected_event_cb(handle->proxy, __AutofillAppPort_on_connected, handle);
- if (r != 0) {
- _E("Failed to add connected event cb. err = %d", r);
- __destroy_AutofillAppPort(handle);
- return r;
- }
-
- r = rpc_port_proxy_add_disconnected_event_cb(handle->proxy, __AutofillAppPort_on_disconnected, handle);
- if (r != 0) {
- _E("Failed to add disconnected event cb. err = %d", r);
- __destroy_AutofillAppPort(handle);
- return r;
- }
-
- r = rpc_port_proxy_add_rejected_event_cb(handle->proxy, __AutofillAppPort_on_rejected, handle);
- if (r != 0) {
- _E("Failed to add rejected event cb. err = %d", r);
- __destroy_AutofillAppPort(handle);
- return r;
- }
-
- r = rpc_port_proxy_add_received_event_cb(handle->proxy, __AutofillAppPort_on_received, handle);
- if (r != 0) {
- _E("Failed to add received event cb. err = %d", r);
- __destroy_AutofillAppPort(handle);
- return r;
- }
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_proxy_AutofillAppPort_connect(rpc_port_proxy_AutofillAppPort_h h)
-{
- int r;
-
- if (!h || !h->proxy) {
- _E("Invalid parameter");
- return -1;
- }
-
- r = rpc_port_proxy_connect(h->proxy, h->stub_appid, "AutofillAppPort");
- if (r != 0) {
- _E("Failed to connect AutofillAppPort(%s)", h->stub_appid);
- return r;
- }
-
- return 0;
-}
-
-int rpc_port_proxy_AutofillAppPort_destroy(rpc_port_proxy_AutofillAppPort_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- __destroy_AutofillAppPort(h);
- return 0;
-}
-
-int rpc_port_proxy_AutofillAppPort_connect_sync(rpc_port_proxy_AutofillAppPort_h h)
-{
- int r;
-
- if (!h || !h->proxy) {
- _E("Invalid parameter");
- return -1;
- }
-
- r = rpc_port_proxy_connect_sync(h->proxy, h->stub_appid, "AutofillAppPort");
- if (r != 0) {
- _E("Failed to connect sync AutofillAppPort(%s)", h->stub_appid);
- return r;
- }
-
- return 0;
-}
+++ /dev/null
-/*
- * Generated by tidlc 1.4.9.
- */
-
-#pragma once
-
-#include <stdbool.h>
-#include <bundle.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct autofill_item_s *rpc_port_autofill_item_h;
-
-int rpc_port_autofill_item_create(rpc_port_autofill_item_h *h);
-
-int rpc_port_autofill_item_destroy(rpc_port_autofill_item_h h);
-
-int rpc_port_autofill_item_clone(rpc_port_autofill_item_h h, rpc_port_autofill_item_h *clone);
-
-int rpc_port_autofill_item_set_id(rpc_port_autofill_item_h h, const char *id);
-
-int rpc_port_autofill_item_set_label(rpc_port_autofill_item_h h, const char *label);
-
-int rpc_port_autofill_item_set_value(rpc_port_autofill_item_h h, const char *value);
-
-int rpc_port_autofill_item_set_autofill_hint(rpc_port_autofill_item_h h, int autofill_hint);
-
-int rpc_port_autofill_item_set_is_sensitive_data(rpc_port_autofill_item_h h, bool is_sensitive_data);
-
-int rpc_port_autofill_item_get_id(rpc_port_autofill_item_h h, char **id);
-
-int rpc_port_autofill_item_get_label(rpc_port_autofill_item_h h, char **label);
-
-int rpc_port_autofill_item_get_value(rpc_port_autofill_item_h h, char **value);
-
-int rpc_port_autofill_item_get_autofill_hint(rpc_port_autofill_item_h h, int *autofill_hint);
-
-int rpc_port_autofill_item_get_is_sensitive_data(rpc_port_autofill_item_h h, bool *is_sensitive_data);
-
-typedef struct autofill_view_info_s *rpc_port_autofill_view_info_h;
-
-int rpc_port_autofill_view_info_create(rpc_port_autofill_view_info_h *h);
-
-int rpc_port_autofill_view_info_destroy(rpc_port_autofill_view_info_h h);
-
-int rpc_port_autofill_view_info_clone(rpc_port_autofill_view_info_h h, rpc_port_autofill_view_info_h *clone);
-
-int rpc_port_autofill_view_info_set_view_id(rpc_port_autofill_view_info_h h, const char *view_id);
-
-int rpc_port_autofill_view_info_add_items(rpc_port_autofill_view_info_h h, rpc_port_autofill_item_h items);
-
-int rpc_port_autofill_view_info_get_view_id(rpc_port_autofill_view_info_h h, char **view_id);
-
-int rpc_port_autofill_view_info_foreach_items(rpc_port_autofill_view_info_h h,
- bool (*callback)(rpc_port_autofill_item_h items, void *user_data), void *user_data);
-
-int rpc_port_autofill_view_info_remove_items(rpc_port_autofill_view_info_h h, unsigned int nth);
-
-int rpc_port_autofill_view_info_get_items_length(rpc_port_autofill_view_info_h h, unsigned int *length);
-
-typedef struct autofill_save_item_s *rpc_port_autofill_save_item_h;
-
-int rpc_port_autofill_save_item_create(rpc_port_autofill_save_item_h *h);
-
-int rpc_port_autofill_save_item_destroy(rpc_port_autofill_save_item_h h);
-
-int rpc_port_autofill_save_item_clone(rpc_port_autofill_save_item_h h, rpc_port_autofill_save_item_h *clone);
-
-int rpc_port_autofill_save_item_set_id(rpc_port_autofill_save_item_h h, const char *id);
-
-int rpc_port_autofill_save_item_set_label(rpc_port_autofill_save_item_h h, const char *label);
-
-int rpc_port_autofill_save_item_set_value(rpc_port_autofill_save_item_h h, const char *value);
-
-int rpc_port_autofill_save_item_set_autofill_hint(rpc_port_autofill_save_item_h h, int autofill_hint);
-
-int rpc_port_autofill_save_item_set_is_sensitive_data(rpc_port_autofill_save_item_h h, bool is_sensitive_data);
-
-int rpc_port_autofill_save_item_get_id(rpc_port_autofill_save_item_h h, char **id);
-
-int rpc_port_autofill_save_item_get_label(rpc_port_autofill_save_item_h h, char **label);
-
-int rpc_port_autofill_save_item_get_value(rpc_port_autofill_save_item_h h, char **value);
-
-int rpc_port_autofill_save_item_get_autofill_hint(rpc_port_autofill_save_item_h h, int *autofill_hint);
-
-int rpc_port_autofill_save_item_get_is_sensitive_data(rpc_port_autofill_save_item_h h, bool *is_sensitive_data);
-
-typedef struct autofill_save_view_info_s *rpc_port_autofill_save_view_info_h;
-
-int rpc_port_autofill_save_view_info_create(rpc_port_autofill_save_view_info_h *h);
-
-int rpc_port_autofill_save_view_info_destroy(rpc_port_autofill_save_view_info_h h);
-
-int rpc_port_autofill_save_view_info_clone(rpc_port_autofill_save_view_info_h h, rpc_port_autofill_save_view_info_h *clone);
-
-int rpc_port_autofill_save_view_info_set_view_id(rpc_port_autofill_save_view_info_h h, const char *view_id);
-
-int rpc_port_autofill_save_view_info_set_view_title(rpc_port_autofill_save_view_info_h h, const char *view_title);
-
-int rpc_port_autofill_save_view_info_add_items(rpc_port_autofill_save_view_info_h h, rpc_port_autofill_save_item_h items);
-
-int rpc_port_autofill_save_view_info_get_view_id(rpc_port_autofill_save_view_info_h h, char **view_id);
-
-int rpc_port_autofill_save_view_info_get_view_title(rpc_port_autofill_save_view_info_h h, char **view_title);
-
-int rpc_port_autofill_save_view_info_foreach_items(rpc_port_autofill_save_view_info_h h,
- bool (*callback)(rpc_port_autofill_save_item_h items, void *user_data), void *user_data);
-
-int rpc_port_autofill_save_view_info_remove_items(rpc_port_autofill_save_view_info_h h, unsigned int nth);
-
-int rpc_port_autofill_save_view_info_get_items_length(rpc_port_autofill_save_view_info_h h, unsigned int *length);
-
-typedef struct autofill_auth_info_s *rpc_port_autofill_auth_info_h;
-
-int rpc_port_autofill_auth_info_create(rpc_port_autofill_auth_info_h *h);
-
-int rpc_port_autofill_auth_info_destroy(rpc_port_autofill_auth_info_h h);
-
-int rpc_port_autofill_auth_info_clone(rpc_port_autofill_auth_info_h h, rpc_port_autofill_auth_info_h *clone);
-
-int rpc_port_autofill_auth_info_set_app_id(rpc_port_autofill_auth_info_h h, const char *app_id);
-
-int rpc_port_autofill_auth_info_set_view_id(rpc_port_autofill_auth_info_h h, const char *view_id);
-
-int rpc_port_autofill_auth_info_set_exist_autofill_data(rpc_port_autofill_auth_info_h h, bool exist_autofill_data);
-
-int rpc_port_autofill_auth_info_set_need_authentication(rpc_port_autofill_auth_info_h h, bool need_authentication);
-
-int rpc_port_autofill_auth_info_set_service_name(rpc_port_autofill_auth_info_h h, const char *service_name);
-
-int rpc_port_autofill_auth_info_set_service_logo_image_path(rpc_port_autofill_auth_info_h h, const char *service_logo_image_path);
-
-int rpc_port_autofill_auth_info_set_service_message(rpc_port_autofill_auth_info_h h, const char *service_message);
-
-int rpc_port_autofill_auth_info_get_app_id(rpc_port_autofill_auth_info_h h, char **app_id);
-
-int rpc_port_autofill_auth_info_get_view_id(rpc_port_autofill_auth_info_h h, char **view_id);
-
-int rpc_port_autofill_auth_info_get_exist_autofill_data(rpc_port_autofill_auth_info_h h, bool *exist_autofill_data);
-
-int rpc_port_autofill_auth_info_get_need_authentication(rpc_port_autofill_auth_info_h h, bool *need_authentication);
-
-int rpc_port_autofill_auth_info_get_service_name(rpc_port_autofill_auth_info_h h, char **service_name);
-
-int rpc_port_autofill_auth_info_get_service_logo_image_path(rpc_port_autofill_auth_info_h h, char **service_logo_image_path);
-
-int rpc_port_autofill_auth_info_get_service_message(rpc_port_autofill_auth_info_h h, char **service_message);
-
-typedef struct autofill_response_item_s *rpc_port_autofill_response_item_h;
-
-int rpc_port_autofill_response_item_create(rpc_port_autofill_response_item_h *h);
-
-int rpc_port_autofill_response_item_destroy(rpc_port_autofill_response_item_h h);
-
-int rpc_port_autofill_response_item_clone(rpc_port_autofill_response_item_h h, rpc_port_autofill_response_item_h *clone);
-
-int rpc_port_autofill_response_item_set_id(rpc_port_autofill_response_item_h h, const char *id);
-
-int rpc_port_autofill_response_item_set_presentation_text(rpc_port_autofill_response_item_h h, const char *presentation_text);
-
-int rpc_port_autofill_response_item_set_value(rpc_port_autofill_response_item_h h, const char *value);
-
-int rpc_port_autofill_response_item_set_autofill_hint(rpc_port_autofill_response_item_h h, int autofill_hint);
-
-int rpc_port_autofill_response_item_get_id(rpc_port_autofill_response_item_h h, char **id);
-
-int rpc_port_autofill_response_item_get_presentation_text(rpc_port_autofill_response_item_h h, char **presentation_text);
-
-int rpc_port_autofill_response_item_get_value(rpc_port_autofill_response_item_h h, char **value);
-
-int rpc_port_autofill_response_item_get_autofill_hint(rpc_port_autofill_response_item_h h, int *autofill_hint);
-
-typedef struct autofill_response_group_s *rpc_port_autofill_response_group_h;
-
-int rpc_port_autofill_response_group_create(rpc_port_autofill_response_group_h *h);
-
-int rpc_port_autofill_response_group_destroy(rpc_port_autofill_response_group_h h);
-
-int rpc_port_autofill_response_group_clone(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_group_h *clone);
-
-int rpc_port_autofill_response_group_add_response_items(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_item_h response_items);
-
-int rpc_port_autofill_response_group_foreach_response_items(rpc_port_autofill_response_group_h h,
- bool (*callback)(rpc_port_autofill_response_item_h response_items, void *user_data), void *user_data);
-
-int rpc_port_autofill_response_group_remove_response_items(rpc_port_autofill_response_group_h h, unsigned int nth);
-
-int rpc_port_autofill_response_group_get_response_items_length(rpc_port_autofill_response_group_h h, unsigned int *length);
-
-typedef struct autofill_fill_response_s *rpc_port_autofill_fill_response_h;
-
-int rpc_port_autofill_fill_response_create(rpc_port_autofill_fill_response_h *h);
-
-int rpc_port_autofill_fill_response_destroy(rpc_port_autofill_fill_response_h h);
-
-int rpc_port_autofill_fill_response_clone(rpc_port_autofill_fill_response_h h, rpc_port_autofill_fill_response_h *clone);
-
-int rpc_port_autofill_fill_response_set_app_id(rpc_port_autofill_fill_response_h h, const char *app_id);
-
-int rpc_port_autofill_fill_response_set_view_id(rpc_port_autofill_fill_response_h h, const char *view_id);
-
-int rpc_port_autofill_fill_response_add_response_groups(rpc_port_autofill_fill_response_h h, rpc_port_autofill_response_group_h response_groups);
-
-int rpc_port_autofill_fill_response_get_app_id(rpc_port_autofill_fill_response_h h, char **app_id);
-
-int rpc_port_autofill_fill_response_get_view_id(rpc_port_autofill_fill_response_h h, char **view_id);
-
-int rpc_port_autofill_fill_response_foreach_response_groups(rpc_port_autofill_fill_response_h h,
- bool (*callback)(rpc_port_autofill_response_group_h response_groups, void *user_data), void *user_data);
-
-int rpc_port_autofill_fill_response_remove_response_groups(rpc_port_autofill_fill_response_h h, unsigned int nth);
-
-int rpc_port_autofill_fill_response_get_response_groups_length(rpc_port_autofill_fill_response_h h, unsigned int *length);
-
-typedef struct autofill_error_info_s *rpc_port_autofill_error_info_h;
-
-int rpc_port_autofill_error_info_create(rpc_port_autofill_error_info_h *h);
-
-int rpc_port_autofill_error_info_destroy(rpc_port_autofill_error_info_h h);
-
-int rpc_port_autofill_error_info_clone(rpc_port_autofill_error_info_h h, rpc_port_autofill_error_info_h *clone);
-
-int rpc_port_autofill_error_info_set_app_id(rpc_port_autofill_error_info_h h, const char *app_id);
-
-int rpc_port_autofill_error_info_set_error_code(rpc_port_autofill_error_info_h h, int error_code);
-
-int rpc_port_autofill_error_info_get_app_id(rpc_port_autofill_error_info_h h, char **app_id);
-
-int rpc_port_autofill_error_info_get_error_code(rpc_port_autofill_error_info_h h, int *error_code);
-
-typedef struct list_autofill_item_s *rpc_port_list_autofill_item_h;
-
-int rpc_port_list_autofill_item_create(rpc_port_list_autofill_item_h *h);
-
-int rpc_port_list_autofill_item_destroy(rpc_port_list_autofill_item_h h);
-
-int rpc_port_list_autofill_item_clone(rpc_port_list_autofill_item_h h, rpc_port_list_autofill_item_h *clone);
-
-int rpc_port_list_autofill_item_add_list_autofill_items(rpc_port_list_autofill_item_h h, rpc_port_autofill_item_h list_autofill_items);
-
-int rpc_port_list_autofill_item_foreach_list_autofill_items(rpc_port_list_autofill_item_h h,
- bool (*callback)(rpc_port_autofill_item_h list_autofill_items, void *user_data), void *user_data);
-
-int rpc_port_list_autofill_item_remove_list_autofill_items(rpc_port_list_autofill_item_h h, unsigned int nth);
-
-int rpc_port_list_autofill_item_get_list_autofill_items_length(rpc_port_list_autofill_item_h h, unsigned int *length);
-
-typedef struct list_autofill_response_group_s *rpc_port_list_autofill_response_group_h;
-
-int rpc_port_list_autofill_response_group_create(rpc_port_list_autofill_response_group_h *h);
-
-int rpc_port_list_autofill_response_group_destroy(rpc_port_list_autofill_response_group_h h);
-
-int rpc_port_list_autofill_response_group_clone(rpc_port_list_autofill_response_group_h h, rpc_port_list_autofill_response_group_h *clone);
-
-int rpc_port_list_autofill_response_group_add_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, rpc_port_autofill_response_group_h list_autofill_response_groups);
-
-int rpc_port_list_autofill_response_group_foreach_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h,
- bool (*callback)(rpc_port_autofill_response_group_h list_autofill_response_groups, void *user_data), void *user_data);
-
-int rpc_port_list_autofill_response_group_remove_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, unsigned int nth);
-
-int rpc_port_list_autofill_response_group_get_list_autofill_response_groups_length(rpc_port_list_autofill_response_group_h h, unsigned int *length);
-
-typedef struct list_autofill_response_item_s *rpc_port_list_autofill_response_item_h;
-
-int rpc_port_list_autofill_response_item_create(rpc_port_list_autofill_response_item_h *h);
-
-int rpc_port_list_autofill_response_item_destroy(rpc_port_list_autofill_response_item_h h);
-
-int rpc_port_list_autofill_response_item_clone(rpc_port_list_autofill_response_item_h h, rpc_port_list_autofill_response_item_h *clone);
-
-int rpc_port_list_autofill_response_item_add_list_autofill_response_items(rpc_port_list_autofill_response_item_h h, rpc_port_autofill_response_item_h list_autofill_response_items);
-
-int rpc_port_list_autofill_response_item_foreach_list_autofill_response_items(rpc_port_list_autofill_response_item_h h,
- bool (*callback)(rpc_port_autofill_response_item_h list_autofill_response_items, void *user_data), void *user_data);
-
-int rpc_port_list_autofill_response_item_remove_list_autofill_response_items(rpc_port_list_autofill_response_item_h h, unsigned int nth);
-
-int rpc_port_list_autofill_response_item_get_list_autofill_response_items_length(rpc_port_list_autofill_response_item_h h, unsigned int *length);
-
-typedef struct list_autofill_save_item_s *rpc_port_list_autofill_save_item_h;
-
-int rpc_port_list_autofill_save_item_create(rpc_port_list_autofill_save_item_h *h);
-
-int rpc_port_list_autofill_save_item_destroy(rpc_port_list_autofill_save_item_h h);
-
-int rpc_port_list_autofill_save_item_clone(rpc_port_list_autofill_save_item_h h, rpc_port_list_autofill_save_item_h *clone);
-
-int rpc_port_list_autofill_save_item_add_list_autofill_save_items(rpc_port_list_autofill_save_item_h h, rpc_port_autofill_save_item_h list_autofill_save_items);
-
-int rpc_port_list_autofill_save_item_foreach_list_autofill_save_items(rpc_port_list_autofill_save_item_h h,
- bool (*callback)(rpc_port_autofill_save_item_h list_autofill_save_items, void *user_data), void *user_data);
-
-int rpc_port_list_autofill_save_item_remove_list_autofill_save_items(rpc_port_list_autofill_save_item_h h, unsigned int nth);
-
-int rpc_port_list_autofill_save_item_get_list_autofill_save_items_length(rpc_port_list_autofill_save_item_h h, unsigned int *length);
-
-typedef struct AutofillAppPort_s *rpc_port_proxy_AutofillAppPort_h;
-
-typedef struct {
- void (*connected)(rpc_port_proxy_AutofillAppPort_h h, void *user_data);
- void (*disconnected)(rpc_port_proxy_AutofillAppPort_h h, void *user_data);
- void (*rejected)(rpc_port_proxy_AutofillAppPort_h h, void *user_data);
-} rpc_port_proxy_AutofillAppPort_callback_s;
-
-typedef struct AutofillAppPort_autofill_auth_info_received_cb_s *rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h;
-
-typedef void (*AutofillAppPort_autofill_auth_info_received_cb)(void *user_data, rpc_port_autofill_auth_info_h auth_info);
-
-rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h rpc_port_AutofillAppPort_autofill_auth_info_received_cb_create(AutofillAppPort_autofill_auth_info_received_cb callback, bool once, void *user_data);
-
-int rpc_port_AutofillAppPort_autofill_auth_info_received_cb_destroy(rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h delegate);
-
-int rpc_port_proxy_AutofillAppPort_autofill_auth_info_received_cb_dispose(rpc_port_proxy_AutofillAppPort_h proxy, rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h delegate);
-
-typedef struct AutofillAppPort_autofill_fill_response_received_cb_s *rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h;
-
-typedef void (*AutofillAppPort_autofill_fill_response_received_cb)(void *user_data, rpc_port_autofill_fill_response_h response);
-
-rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h rpc_port_AutofillAppPort_autofill_fill_response_received_cb_create(AutofillAppPort_autofill_fill_response_received_cb callback, bool once, void *user_data);
-
-int rpc_port_AutofillAppPort_autofill_fill_response_received_cb_destroy(rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h delegate);
-
-int rpc_port_proxy_AutofillAppPort_autofill_fill_response_received_cb_dispose(rpc_port_proxy_AutofillAppPort_h proxy, rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h delegate);
-
-typedef struct AutofillAppPort_autofill_error_info_received_cb_s *rpc_port_AutofillAppPort_autofill_error_info_received_cb_h;
-
-typedef void (*AutofillAppPort_autofill_error_info_received_cb)(void *user_data, rpc_port_autofill_error_info_h error_info);
-
-rpc_port_AutofillAppPort_autofill_error_info_received_cb_h rpc_port_AutofillAppPort_autofill_error_info_received_cb_create(AutofillAppPort_autofill_error_info_received_cb callback, bool once, void *user_data);
-
-int rpc_port_AutofillAppPort_autofill_error_info_received_cb_destroy(rpc_port_AutofillAppPort_autofill_error_info_received_cb_h delegate);
-
-int rpc_port_proxy_AutofillAppPort_autofill_error_info_received_cb_dispose(rpc_port_proxy_AutofillAppPort_h proxy, rpc_port_AutofillAppPort_autofill_error_info_received_cb_h delegate);
-
-int rpc_port_proxy_AutofillAppPort_create(const char *stub_appid,
- rpc_port_proxy_AutofillAppPort_callback_s *callback, void *user_data,
- rpc_port_proxy_AutofillAppPort_h *h);
-
-int rpc_port_proxy_AutofillAppPort_connect(rpc_port_proxy_AutofillAppPort_h h);
-
-int rpc_port_proxy_AutofillAppPort_destroy(rpc_port_proxy_AutofillAppPort_h h);
-
-int rpc_port_proxy_AutofillAppPort_invoke_Register(rpc_port_proxy_AutofillAppPort_h h, int context_id, rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_cb, rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_cb, rpc_port_AutofillAppPort_autofill_error_info_received_cb_h error_info_cb);
-
-void rpc_port_proxy_AutofillAppPort_invoke_Unregister(rpc_port_proxy_AutofillAppPort_h h, int context_id);
-
-int rpc_port_proxy_AutofillAppPort_invoke_request_auth_info(rpc_port_proxy_AutofillAppPort_h h, int context_id, rpc_port_autofill_view_info_h vi);
-
-int rpc_port_proxy_AutofillAppPort_invoke_send_fill_request(rpc_port_proxy_AutofillAppPort_h h, int context_id, rpc_port_autofill_view_info_h vi);
-
-int rpc_port_proxy_AutofillAppPort_invoke_commit(rpc_port_proxy_AutofillAppPort_h h, int context_id, rpc_port_autofill_save_view_info_h vi);
-
-int rpc_port_proxy_AutofillAppPort_invoke_cancel_fill_request(rpc_port_proxy_AutofillAppPort_h h, int context_id, rpc_port_autofill_view_info_h vi);
-
-int rpc_port_proxy_AutofillAppPort_connect_sync(rpc_port_proxy_AutofillAppPort_h h);
-
-#ifdef __cplusplus
-}
-#endif
SET(description "Autofill Common APIs")
SET(service "ui")
SET(submodule "autofill-common")
-SET(dependents "capi-base-common dlog eina")
+SET(dependents "capi-base-common dlog eina rpc-port")
SET(LIBDIR ${LIB_INSTALL_DIR})
SET(Services
return AUTOFILL_ERROR_OPERATION_FAILED;
}
- rpc_port_list_string_h app_id_list;
- rpc_port_list_string_create(&app_id_list);
+ rpc_port_proxy_list_string_h app_id_list;
+ rpc_port_proxy_list_string_create(&app_id_list);
ret = rpc_port_proxy_AutofillManagerPort_invoke_get_autofill_service_list(amh->rpc_h, &app_id_list);
if (ret == false) {
LOGW("[ERROR] Failed to send rpc port. err = %d", ret);
- rpc_port_list_string_destroy(app_id_list);
+ rpc_port_proxy_list_string_destroy(app_id_list);
return AUTOFILL_ERROR_OPERATION_FAILED;
}
- rpc_port_list_string_foreach_list_strings(app_id_list, callback, user_data);
+ rpc_port_proxy_list_string_foreach(app_id_list, callback, user_data);
- rpc_port_list_string_destroy(app_id_list);
+ rpc_port_proxy_list_string_destroy(app_id_list);
return AUTOFILL_ERROR_NONE;
}
+++ /dev/null
-/*
- * Generated by tidlc 1.4.9.
- */
-
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <libgen.h>
-#include <glib.h>
-#include <dlog.h>
-#include <rpc-port.h>
-#include <rpc-port-parcel.h>
-
-#include "autofill_manager_proxy.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "RPC_PORT_PROXY"
-
-#ifdef _E
-#undef _E
-#endif
-
-#ifdef _W
-#undef _W
-#endif
-
-#ifdef _I
-#undef _I
-#endif
-
-#ifdef _D
-#undef _D
-#endif
-
-#define _E(fmt, ...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-#define _W(fmt, ...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-#define _I(fmt, ...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-#define _D(fmt, ...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-
-typedef void (*proxy_delegate)(GList **list, rpc_port_parcel_h parcel, int seq_id, int id);
-
-struct list_string_s {
- rpc_port_parcelable_t parcelable;
- GList *list_strings;
-};
-
-static void __list_string_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_string_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_strings));
- do {
- GList *iter;
-
- iter = h->list_strings;
- while (iter) {
- char *value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write_string(parcel, value ? value : "");
- }
- } while (0);
-}
-
-static void __list_string_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_string_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- char *value = NULL;
-
- rpc_port_parcel_read_string(parcel, &value);
- h->list_strings = g_list_append(h->list_strings, value);
- }
- } while (0);
-}
-
-int rpc_port_list_string_create(rpc_port_list_string_h *h)
-{
- struct list_string_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct list_string_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __list_string_to;
- handle->parcelable.from = __list_string_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_list_string_destroy(rpc_port_list_string_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_strings;
- while (iter) {
- char *value = iter->data;
- if (value)
- free(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->list_strings);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_list_string_clone(rpc_port_list_string_h h, rpc_port_list_string_h *clone)
-{
- rpc_port_list_string_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_list_string_create(&handle);
- if (!handle) {
- _E("Failed to create list_string handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_strings;
- while (iter) {
- char *new_value;
- char *value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_list_string_destroy(handle);
- return -1;
- }
-
- new_value = strdup(value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_list_string_destroy(handle);
- return -1;
- }
-
- handle->list_strings = g_list_append(handle->list_strings, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_list_string_add_list_strings(rpc_port_list_string_h h, const char *list_strings)
-{
- if (!h || !list_strings) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- char *value = NULL;
-
- value = strdup(list_strings);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->list_strings = g_list_append(h->list_strings, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_string_foreach_list_strings(rpc_port_list_string_h h,
- bool (*callback)(const char *list_strings, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_strings;
- while (iter) {
- char *value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_string_remove_list_strings(rpc_port_list_string_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->list_strings, nth);
- if (iter == NULL)
- return -1;
-
- char *value = iter->data;
- h->list_strings = g_list_remove_link(h->list_strings, iter);
- if (value)
- free(value);
-
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_list_string_get_list_strings_length(rpc_port_list_string_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->list_strings);
-
- return 0;
-}
-
-enum AutofillManagerPort_method_e {
- AutofillManagerPort_METHOD_Result,
- AutofillManagerPort_METHOD_Callback,
- AutofillManagerPort_METHOD_set_autofill_service,
- AutofillManagerPort_METHOD_get_autofill_service,
- AutofillManagerPort_METHOD_get_autofill_service_list,
-};
-
-struct AutofillManagerPort_s {
- char *stub_appid;
- rpc_port_proxy_h proxy;
- rpc_port_h port;
- rpc_port_h callback_port;
- rpc_port_proxy_AutofillManagerPort_callback_s callback;
- void *user_data;
- GList *delegates;
- GRecMutex mutex;
-};
-
-static void __AutofillManagerPort_process_received_event(GList **list, rpc_port_parcel_h parcel)
-{
-}
-
-static rpc_port_parcel_h __AutofillManagerPort_consume_command(rpc_port_proxy_AutofillManagerPort_h h)
-{
- rpc_port_parcel_h parcel = NULL;
- int cmd = -1;
-
- do {
- rpc_port_parcel_create_from_port(&parcel, h->port);
- if (!parcel)
- break;
-
- rpc_port_parcel_read_int32(parcel, &cmd);
- if (cmd == AutofillManagerPort_METHOD_Result)
- return parcel;
-
- rpc_port_parcel_destroy(parcel);
- parcel = NULL;
- } while (true);
-
- return NULL;
-}
-
-static void __AutofillManagerPort_on_connected(const char *endpoint, const char *port_name, rpc_port_h port, void *data)
-{
- rpc_port_proxy_AutofillManagerPort_h handle = data;
-
- handle->port = port;
- rpc_port_proxy_get_port(handle->proxy, RPC_PORT_PORT_CALLBACK, &handle->callback_port);
- if (handle->callback.connected)
- handle->callback.connected(handle, handle->user_data);
- _I("[__RPC_PORT__] endpoint(%s), port_name(%s)", endpoint, port_name);
-}
-
-static void __AutofillManagerPort_on_disconnected(const char *endpoint, const char *port_name, void *data)
-{
- rpc_port_proxy_AutofillManagerPort_h handle = data;
-
- handle->port = NULL;
- if (handle->callback.disconnected)
- handle->callback.disconnected(handle, handle->user_data);
- _I("[__RPC_PORT__] endpoint(%s), port_name(%s)", endpoint, port_name);
-}
-
-static void __AutofillManagerPort_on_rejected(const char *endpoint, const char *port_name, void *data)
-{
- rpc_port_proxy_AutofillManagerPort_h handle = data;
-
- handle->port = NULL;
- if (handle->callback.rejected)
- handle->callback.rejected(handle, handle->user_data);
- _I("[__RPC_PORT__] endpoint(%s), port_name(%s)", endpoint, port_name);
-}
-
-static void __AutofillManagerPort_on_received(const char *endpoint, const char *port_name, void *data)
-{
- rpc_port_proxy_AutofillManagerPort_h handle = data;
- rpc_port_parcel_h parcel_received = NULL;
- int cmd = -1;
-
- rpc_port_parcel_create_from_port(&parcel_received, handle->callback_port);
- if (!parcel_received) {
- _E("Failed to create parcel from port(%s)", port_name);
- return;
- }
-
- rpc_port_parcel_read_int32(parcel_received, &cmd);
- if (cmd != AutofillManagerPort_METHOD_Callback) {
- _E("Invalid protocol");
- rpc_port_parcel_destroy(parcel_received);
- return;
- }
-
- __AutofillManagerPort_process_received_event(&handle->delegates, parcel_received);
- rpc_port_parcel_destroy(parcel_received);
- _I("[__RPC_PORT__] endpoint(%s), port_name(%s)", endpoint, port_name);
-}
-
-bool rpc_port_proxy_AutofillManagerPort_invoke_set_autofill_service(rpc_port_proxy_AutofillManagerPort_h h, const char *app_id)
-{
- rpc_port_parcel_h parcel;
- int r;
- bool ret = false;
-
- if (!h) {
- _E("Invalid parameter");
- return ret;
- }
-
- if (!h->port) {
- _E("Not connected");
- return ret;
- }
-
- rpc_port_parcel_create(&parcel);
- rpc_port_parcel_write_int32(parcel, AutofillManagerPort_METHOD_set_autofill_service);
- rpc_port_parcel_write_string(parcel, app_id ? app_id : "");
-
- r = rpc_port_parcel_send(parcel, h->port);
- if (r != RPC_PORT_ERROR_NONE) {
- _E("Failed to send parcel. result(%d)", r);
- r = RPC_PORT_ERROR_IO_ERROR;
- }
-
- rpc_port_parcel_destroy(parcel);
-
- g_rec_mutex_lock(&h->mutex);
- do {
- rpc_port_parcel_h parcel_received;
-
- parcel_received = __AutofillManagerPort_consume_command(h);
- if (!parcel_received) {
- _E("Invalid protocol");
- r = RPC_PORT_ERROR_IO_ERROR;
- break;
- }
-
- rpc_port_parcel_read_bool(parcel_received, &ret);
-
- rpc_port_parcel_destroy(parcel_received);
- } while (0);
- g_rec_mutex_unlock(&h->mutex);
- set_last_result(r);
-
- return ret;
-}
-
-char *rpc_port_proxy_AutofillManagerPort_invoke_get_autofill_service(rpc_port_proxy_AutofillManagerPort_h h)
-{
- rpc_port_parcel_h parcel;
- int r;
- char *ret = NULL;
-
- if (!h) {
- _E("Invalid parameter");
- return ret;
- }
-
- if (!h->port) {
- _E("Not connected");
- return ret;
- }
-
- rpc_port_parcel_create(&parcel);
- rpc_port_parcel_write_int32(parcel, AutofillManagerPort_METHOD_get_autofill_service);
-
- r = rpc_port_parcel_send(parcel, h->port);
- if (r != RPC_PORT_ERROR_NONE) {
- _E("Failed to send parcel. result(%d)", r);
- r = RPC_PORT_ERROR_IO_ERROR;
- }
-
- rpc_port_parcel_destroy(parcel);
-
- g_rec_mutex_lock(&h->mutex);
- do {
- rpc_port_parcel_h parcel_received;
-
- parcel_received = __AutofillManagerPort_consume_command(h);
- if (!parcel_received) {
- _E("Invalid protocol");
- r = RPC_PORT_ERROR_IO_ERROR;
- break;
- }
-
- rpc_port_parcel_read_string(parcel_received, &ret);
-
- rpc_port_parcel_destroy(parcel_received);
- } while (0);
- g_rec_mutex_unlock(&h->mutex);
- set_last_result(r);
-
- return ret;
-}
-
-bool rpc_port_proxy_AutofillManagerPort_invoke_get_autofill_service_list(rpc_port_proxy_AutofillManagerPort_h h, rpc_port_list_string_h *service_info_list)
-{
- rpc_port_parcel_h parcel;
- int r;
- bool ret = false;
-
- if (!h || !service_info_list) {
- _E("Invalid parameter");
- return ret;
- }
-
- if (!h->port) {
- _E("Not connected");
- return ret;
- }
-
- rpc_port_parcel_create(&parcel);
- rpc_port_parcel_write_int32(parcel, AutofillManagerPort_METHOD_get_autofill_service_list);
-
- r = rpc_port_parcel_send(parcel, h->port);
- if (r != RPC_PORT_ERROR_NONE) {
- _E("Failed to send parcel. result(%d)", r);
- r = RPC_PORT_ERROR_IO_ERROR;
- }
-
- rpc_port_parcel_destroy(parcel);
-
- g_rec_mutex_lock(&h->mutex);
- do {
- rpc_port_parcel_h parcel_received;
- rpc_port_list_string_h out_service_info_list;
-
- parcel_received = __AutofillManagerPort_consume_command(h);
- if (!parcel_received) {
- _E("Invalid protocol");
- r = RPC_PORT_ERROR_IO_ERROR;
- break;
- }
-
- rpc_port_list_string_create(&out_service_info_list);
- rpc_port_parcel_read(parcel_received, &out_service_info_list->parcelable, out_service_info_list);
- *service_info_list = out_service_info_list;
- rpc_port_parcel_read_bool(parcel_received, &ret);
-
- rpc_port_parcel_destroy(parcel_received);
- } while (0);
- g_rec_mutex_unlock(&h->mutex);
- set_last_result(r);
-
- return ret;
-}
-
-static struct AutofillManagerPort_s *__create_AutofillManagerPort(const char *stub_appid, rpc_port_proxy_AutofillManagerPort_callback_s *callback, void *user_data)
-{
- struct AutofillManagerPort_s *handle;
-
- handle = calloc(1, sizeof(struct AutofillManagerPort_s));
- if (!handle) {
- _E("Out of memory");
- return NULL;
- }
-
- handle->stub_appid = strdup(stub_appid);
- if (!handle->stub_appid) {
- _E("Out of memory");
- free(handle);
- return NULL;
- }
-
- rpc_port_proxy_create(&handle->proxy);
- if (!handle->proxy) {
- _E("Failed to create proxy");
- free(handle->stub_appid);
- free(handle);
- return NULL;
- }
-
- g_rec_mutex_init(&handle->mutex);
-
- handle->callback = *callback;
- handle->user_data = user_data;
-
- return handle;
-}
-
-static void __destroy_AutofillManagerPort(struct AutofillManagerPort_s *h)
-{
- if (!h)
- return;
-
- g_rec_mutex_clear(&h->mutex);
-
- if (h->delegates)
- g_list_free_full(h->delegates, free);
-
- if (h->proxy)
- rpc_port_proxy_destroy(h->proxy);
-
- if (h->stub_appid)
- free(h->stub_appid);
-
- free(h);
-}
-
-int rpc_port_proxy_AutofillManagerPort_create(const char *stub_appid, rpc_port_proxy_AutofillManagerPort_callback_s *callback, void *user_data, rpc_port_proxy_AutofillManagerPort_h *h)
-{
- struct AutofillManagerPort_s *handle;
- int r;
-
- if (!stub_appid || !callback || !h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = __create_AutofillManagerPort(stub_appid, callback, user_data);
- if (!handle)
- return -1;
-
- r = rpc_port_proxy_add_connected_event_cb(handle->proxy, __AutofillManagerPort_on_connected, handle);
- if (r != 0) {
- _E("Failed to add connected event cb. err = %d", r);
- __destroy_AutofillManagerPort(handle);
- return r;
- }
-
- r = rpc_port_proxy_add_disconnected_event_cb(handle->proxy, __AutofillManagerPort_on_disconnected, handle);
- if (r != 0) {
- _E("Failed to add disconnected event cb. err = %d", r);
- __destroy_AutofillManagerPort(handle);
- return r;
- }
-
- r = rpc_port_proxy_add_rejected_event_cb(handle->proxy, __AutofillManagerPort_on_rejected, handle);
- if (r != 0) {
- _E("Failed to add rejected event cb. err = %d", r);
- __destroy_AutofillManagerPort(handle);
- return r;
- }
-
- r = rpc_port_proxy_add_received_event_cb(handle->proxy, __AutofillManagerPort_on_received, handle);
- if (r != 0) {
- _E("Failed to add received event cb. err = %d", r);
- __destroy_AutofillManagerPort(handle);
- return r;
- }
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_proxy_AutofillManagerPort_connect(rpc_port_proxy_AutofillManagerPort_h h)
-{
- int r;
-
- if (!h || !h->proxy) {
- _E("Invalid parameter");
- return -1;
- }
-
- r = rpc_port_proxy_connect(h->proxy, h->stub_appid, "AutofillManagerPort");
- if (r != 0) {
- _E("Failed to connect AutofillManagerPort(%s)", h->stub_appid);
- return r;
- }
-
- return 0;
-}
-
-int rpc_port_proxy_AutofillManagerPort_destroy(rpc_port_proxy_AutofillManagerPort_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- __destroy_AutofillManagerPort(h);
- return 0;
-}
-
-int rpc_port_proxy_AutofillManagerPort_connect_sync(rpc_port_proxy_AutofillManagerPort_h h)
-{
- int r;
-
- if (!h || !h->proxy) {
- _E("Invalid parameter");
- return -1;
- }
-
- r = rpc_port_proxy_connect_sync(h->proxy, h->stub_appid, "AutofillManagerPort");
- if (r != 0) {
- _E("Failed to connect sync AutofillManagerPort(%s)", h->stub_appid);
- return r;
- }
-
- return 0;
-}
+++ /dev/null
-/*
- * Generated by tidlc 1.4.9.
- */
-
-#pragma once
-
-#include <stdbool.h>
-#include <bundle.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct list_string_s *rpc_port_list_string_h;
-
-int rpc_port_list_string_create(rpc_port_list_string_h *h);
-
-int rpc_port_list_string_destroy(rpc_port_list_string_h h);
-
-int rpc_port_list_string_clone(rpc_port_list_string_h h, rpc_port_list_string_h *clone);
-
-int rpc_port_list_string_add_list_strings(rpc_port_list_string_h h, const char *list_strings);
-
-int rpc_port_list_string_foreach_list_strings(rpc_port_list_string_h h,
- bool (*callback)(const char *list_strings, void *user_data), void *user_data);
-
-int rpc_port_list_string_remove_list_strings(rpc_port_list_string_h h, unsigned int nth);
-
-int rpc_port_list_string_get_list_strings_length(rpc_port_list_string_h h, unsigned int *length);
-
-typedef struct AutofillManagerPort_s *rpc_port_proxy_AutofillManagerPort_h;
-
-typedef struct {
- void (*connected)(rpc_port_proxy_AutofillManagerPort_h h, void *user_data);
- void (*disconnected)(rpc_port_proxy_AutofillManagerPort_h h, void *user_data);
- void (*rejected)(rpc_port_proxy_AutofillManagerPort_h h, void *user_data);
-} rpc_port_proxy_AutofillManagerPort_callback_s;
-
-int rpc_port_proxy_AutofillManagerPort_create(const char *stub_appid,
- rpc_port_proxy_AutofillManagerPort_callback_s *callback, void *user_data,
- rpc_port_proxy_AutofillManagerPort_h *h);
-
-int rpc_port_proxy_AutofillManagerPort_connect(rpc_port_proxy_AutofillManagerPort_h h);
-
-int rpc_port_proxy_AutofillManagerPort_destroy(rpc_port_proxy_AutofillManagerPort_h h);
-
-bool rpc_port_proxy_AutofillManagerPort_invoke_set_autofill_service(rpc_port_proxy_AutofillManagerPort_h h, const char *app_id);
-
-char *rpc_port_proxy_AutofillManagerPort_invoke_get_autofill_service(rpc_port_proxy_AutofillManagerPort_h h);
-
-bool rpc_port_proxy_AutofillManagerPort_invoke_get_autofill_service_list(rpc_port_proxy_AutofillManagerPort_h h, rpc_port_list_string_h *service_info_list);
-
-int rpc_port_proxy_AutofillManagerPort_connect_sync(rpc_port_proxy_AutofillManagerPort_h h);
-
-#ifdef __cplusplus
-}
-#endif
%prep
%setup -q
-%if 0%{?tidlc:1}
tidlc -p -l C -i tidl/autofill.tidl -o autofill_proxy
mv autofill_proxy.h ./client/
mv autofill_proxy.c ./client/
tidlc -p -l C -i tidl/autofill_manager.tidl -o autofill_manager_proxy
mv autofill_manager_proxy.h ./manager/
mv autofill_manager_proxy.c ./manager/
-%endif
%build
%if 0%{?gcov:1}
static autofill_service_terminate_received_cb g_autofill_service_terminate_received_cb = NULL;
static void *g_autofill_service_terminate_received_data = NULL;
-static rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h g_auth_info_cb = NULL;
-static rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h g_fill_response_received_cb = NULL;
-static rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h g_send_error_cb = NULL;
+static rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_h g_auth_info_cb = NULL;
+static rpc_port_stub_AutofillSvcPort_autofill_svc_fill_response_cb_h g_fill_response_received_cb = NULL;
+static rpc_port_stub_AutofillSvcPort_autofill_svc_send_error_cb_h g_send_error_cb = NULL;
typedef struct {
char *app_id;
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb;
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb;
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb;
+ rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb;
+ rpc_port_stub_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb;
+ rpc_port_stub_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb;
} autofill_svc_s;
static GList *__client_list = NULL;
//LCOV_EXCL_START
-static bool __autofill_item_cb(rpc_port_autofill_svc_item_h items, void *user_data)
+static bool __autofill_item_cb(rpc_port_stub_autofill_svc_item_h items, void *user_data)
{
char *id = NULL;
char *label = NULL;
autofill_item_h ai;
autofill_item_create(&ai);
- rpc_port_autofill_svc_item_get_id(items, &id);
+ rpc_port_stub_autofill_svc_item_get_id(items, &id);
autofill_item_set_id(ai, id);
if (id) {
LOGD("id : %s", id);
free(id);
}
- rpc_port_autofill_svc_item_get_label(items, &label);
+ rpc_port_stub_autofill_svc_item_get_label(items, &label);
autofill_item_set_label(ai, label);
if (label) {
LOGD("label : %s", label);
free(label);
}
- rpc_port_autofill_svc_item_get_value(items, &value);
+ rpc_port_stub_autofill_svc_item_get_value(items, &value);
autofill_item_set_value(ai, value);
if (value) {
SECURE_LOGD("value : %s", value);
free(value);
}
- rpc_port_autofill_svc_item_get_autofill_hint(items, &autofill_hint);
+ rpc_port_stub_autofill_svc_item_get_autofill_hint(items, &autofill_hint);
autofill_item_set_autofill_hint(ai, autofill_hint);
LOGD("autofill hint : %d", autofill_hint);
- rpc_port_autofill_svc_item_get_is_sensitive_data(items, &sensitive_data);
+ rpc_port_stub_autofill_svc_item_get_is_sensitive_data(items, &sensitive_data);
autofill_item_set_sensitive_data(ai, sensitive_data);
LOGD("sensitive data : %d", sensitive_data);
return true;
}
-static bool __save_item_cb(rpc_port_autofill_svc_save_item_h items, void *user_data)
+static bool __save_item_cb(rpc_port_stub_autofill_svc_save_item_h items, void *user_data)
{
char *id = NULL;
char *label = NULL;
autofill_save_item_h ai;
autofill_save_item_create(&ai);
- rpc_port_autofill_svc_save_item_get_id(items, &id);
+ rpc_port_stub_autofill_svc_save_item_get_id(items, &id);
autofill_save_item_set_id(ai, id);
if (id) {
LOGD("id : %s", id);
free(id);
}
- rpc_port_autofill_svc_save_item_get_label(items, &label);
+ rpc_port_stub_autofill_svc_save_item_get_label(items, &label);
autofill_save_item_set_label(ai, label);
if (label) {
LOGD("label : %s", label);
free(label);
}
- rpc_port_autofill_svc_save_item_get_value(items, &value);
+ rpc_port_stub_autofill_svc_save_item_get_value(items, &value);
autofill_save_item_set_value(ai, value);
if (value) {
SECURE_LOGD("value : %s", value);
free(value);
}
- rpc_port_autofill_svc_save_item_get_autofill_hint(items, &autofill_hint);
+ rpc_port_stub_autofill_svc_save_item_get_autofill_hint(items, &autofill_hint);
autofill_save_item_set_autofill_hint(ai, autofill_hint);
LOGD("autofill hint : %d", autofill_hint);
- rpc_port_autofill_svc_save_item_get_is_sensitive_data(items, &sensitive_data);
+ rpc_port_stub_autofill_svc_save_item_get_is_sensitive_data(items, &sensitive_data);
autofill_save_item_set_sensitive_data(ai, sensitive_data);
LOGD("sensitive data : %d", sensitive_data);
return true;
}
-static void __auth_info_request_cb(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_autofill_svc_view_info_h vi, void *user_data)
+static void __auth_info_request_cb(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_stub_autofill_svc_view_info_h vi, void *user_data)
{
char *sender = NULL;
char *app_id = NULL;
char *view_id = NULL;
- rpc_port_autofill_svc_view_info_get_app_id(vi, &app_id);
- rpc_port_autofill_svc_view_info_get_view_id(vi, &view_id);
+ rpc_port_stub_autofill_svc_view_info_get_app_id(vi, &app_id);
+ rpc_port_stub_autofill_svc_view_info_get_view_id(vi, &view_id);
LOGD("app id : %s, view id : %s", app_id, view_id);
autofill_view_info_h view_info;
autofill_view_info_set_app_id(view_info, app_id);
autofill_view_info_set_view_id(view_info, view_id);
- rpc_port_autofill_svc_view_info_foreach_items(vi, __autofill_item_cb, view_info);
+ rpc_port_stub_list_autofill_svc_item_h items = NULL;
+ rpc_port_stub_autofill_svc_view_info_get_items(vi, &items);
+ rpc_port_stub_list_autofill_svc_item_foreach(items,__autofill_item_cb, view_info);
+ rpc_port_stub_list_autofill_svc_item_destroy(items);
if (g_autofill_service_auth_info_requested_cb)
g_autofill_service_auth_info_requested_cb(context_id, view_info, g_autofill_service_auth_info_request_data);
free(app_id);
}
-static void __autofill_fill_request_cb(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_autofill_svc_view_info_h vi, void *user_data)
+static void __autofill_fill_request_cb(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_stub_autofill_svc_view_info_h vi, void *user_data)
{
char *app_id = NULL;
char *view_id = NULL;
- rpc_port_autofill_svc_view_info_get_app_id(vi, &app_id);
- rpc_port_autofill_svc_view_info_get_view_id(vi, &view_id);
+ rpc_port_stub_autofill_svc_view_info_get_app_id(vi, &app_id);
+ rpc_port_stub_autofill_svc_view_info_get_view_id(vi, &view_id);
LOGD("app id : %s, view id : %s", app_id, view_id);
autofill_view_info_set_app_id(view_info, app_id);
autofill_view_info_set_view_id(view_info, view_id);
- rpc_port_autofill_svc_view_info_foreach_items(vi, __autofill_item_cb, view_info);
+ rpc_port_stub_list_autofill_svc_item_h items = NULL;
+ rpc_port_stub_autofill_svc_view_info_get_items(vi, &items);
+ rpc_port_stub_list_autofill_svc_item_foreach(items, __autofill_item_cb, view_info);
+ rpc_port_stub_list_autofill_svc_item_destroy(items);
if (g_autofill_service_fill_requested_cb)
g_autofill_service_fill_requested_cb(context_id, view_info, g_autofill_service_fill_request_data);
free(view_id);
}
-static void __autofill_cancel_fill_request_cb(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_autofill_svc_view_info_h vi, void *user_data)
+static void __autofill_cancel_fill_request_cb(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_stub_autofill_svc_view_info_h vi, void *user_data)
{
char *app_id = NULL;
char *view_id = NULL;
- rpc_port_autofill_svc_view_info_get_app_id(vi, &app_id);
- rpc_port_autofill_svc_view_info_get_view_id(vi, &view_id);
+ rpc_port_stub_autofill_svc_view_info_get_app_id(vi, &app_id);
+ rpc_port_stub_autofill_svc_view_info_get_view_id(vi, &view_id);
LOGD("app id : %s, view id : %s", app_id, view_id);
autofill_view_info_set_app_id(view_info, app_id);
autofill_view_info_set_view_id(view_info, view_id);
- rpc_port_autofill_svc_view_info_foreach_items(vi, __autofill_item_cb, view_info);
+ rpc_port_stub_list_autofill_svc_item_h items = NULL;
+ rpc_port_stub_autofill_svc_view_info_get_items(vi, &items);
+ rpc_port_stub_list_autofill_svc_item_foreach(items, __autofill_item_cb, view_info);
+ rpc_port_stub_list_autofill_svc_item_destroy(items);
if (g_autofill_service_cancel_fill_requested_cb)
g_autofill_service_cancel_fill_requested_cb(context_id, view_info, g_autofill_service_cancel_fill_request_data);
free(view_id);
}
-static void __autofill_commit_cb(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_autofill_svc_save_view_info_h vi, void *user_data)
+static void __autofill_commit_cb(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_stub_autofill_svc_save_view_info_h vi, void *user_data)
{
char *app_id = NULL;
char *view_id = NULL;
char *view_title = NULL;
- rpc_port_autofill_svc_save_view_info_get_app_id(vi, &app_id);
- rpc_port_autofill_svc_save_view_info_get_view_id(vi, &view_id);
- rpc_port_autofill_svc_save_view_info_get_view_title(vi, &view_title);
+ rpc_port_stub_autofill_svc_save_view_info_get_app_id(vi, &app_id);
+ rpc_port_stub_autofill_svc_save_view_info_get_view_id(vi, &view_id);
+ rpc_port_stub_autofill_svc_save_view_info_get_view_title(vi, &view_title);
LOGD("app id : %s, view id : %s", app_id, view_id);
autofill_save_view_info_set_view_id(view_info, view_id);
autofill_save_view_info_set_view_title(view_info, view_title);
- rpc_port_autofill_svc_save_view_info_foreach_items(vi, __save_item_cb, view_info);
+ rpc_port_stub_list_autofill_svc_save_item_h items = NULL;
+ rpc_port_stub_autofill_svc_save_view_info_get_items(vi, &items);
+ rpc_port_stub_list_autofill_svc_save_item_foreach(items, __save_item_cb, view_info);
+ rpc_port_stub_list_autofill_svc_save_item_destroy(items);
if (g_autofill_service_committed_cb)
g_autofill_service_committed_cb(context_id, view_info, g_autofill_service_commit_data);
}
static autofill_svc_s *__create_client(const char *app_id,
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb,
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb,
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb)
+ rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb,
+ rpc_port_stub_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb,
+ rpc_port_stub_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb)
{
LOGD("");
autofill_svc_s *handle;
return NULL;
}
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_clone(auth_info_cb, &handle->auth_info_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_clone(auth_info_cb, &handle->auth_info_cb);
if (!handle->auth_info_cb) {
LOGE("Out of memory");
free(handle->app_id);
return NULL;
}
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_clone(fill_response_received_cb, &handle->fill_response_received_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_fill_response_cb_clone(fill_response_received_cb, &handle->fill_response_received_cb);
if (!handle->fill_response_received_cb) {
LOGE("Out of memory");
free(handle->app_id);
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(handle->auth_info_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(handle->auth_info_cb);
free(handle);
return NULL;
}
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_clone(send_error_cb, &handle->send_error_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_send_error_cb_clone(send_error_cb, &handle->send_error_cb);
if (!handle->send_error_cb) {
LOGE("Out of memory");
free(handle->app_id);
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(handle->auth_info_cb);
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(handle->fill_response_received_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(handle->auth_info_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(handle->fill_response_received_cb);
free(handle);
return NULL;
}
return;
if (handle->auth_info_cb) {
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(handle->auth_info_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(handle->auth_info_cb);
handle->auth_info_cb = NULL;
}
if (handle->fill_response_received_cb) {
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(handle->fill_response_received_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(handle->fill_response_received_cb);
handle->fill_response_received_cb = NULL;
}
if (handle->send_error_cb) {
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_destroy(handle->send_error_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_send_error_cb_destroy(handle->send_error_cb);
handle->send_error_cb = NULL;
}
}
static int __message_register(rpc_port_stub_AutofillSvcPort_context_h context,
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb,
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb,
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb,
+ rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb,
+ rpc_port_stub_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb,
+ rpc_port_stub_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb,
void *user_data)
{
LOGD("");
if (!client)
return -1;
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_clone(auth_info_cb, &g_auth_info_cb);
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_clone(fill_response_received_cb, &g_fill_response_received_cb);
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_clone(send_error_cb, &g_send_error_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_clone(auth_info_cb, &g_auth_info_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_fill_response_cb_clone(fill_response_received_cb, &g_fill_response_received_cb);
+ rpc_port_stub_AutofillSvcPort_autofill_svc_send_error_cb_clone(send_error_cb, &g_send_error_cb);
__client_list = g_list_append(__client_list, client);
LOGD("app_id : %s", app_id);
/* create auth info */
- rpc_port_autofill_svc_auth_info_h auth_info_h;
- rpc_port_autofill_svc_auth_info_create(&auth_info_h);
- rpc_port_autofill_svc_auth_info_set_app_id(auth_info_h, app_id);
- rpc_port_autofill_svc_auth_info_set_view_id(auth_info_h, view_id);
- rpc_port_autofill_svc_auth_info_set_exist_autofill_data(auth_info_h, autofill_data_present);
- rpc_port_autofill_svc_auth_info_set_need_authentication(auth_info_h, authentication_needed);
- rpc_port_autofill_svc_auth_info_set_service_name(auth_info_h, service_name);
- rpc_port_autofill_svc_auth_info_set_service_message(auth_info_h, service_message);
- rpc_port_autofill_svc_auth_info_set_service_logo_image_path(auth_info_h, service_logo_image_path);
-
- ret = rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_invoke(g_auth_info_cb, context_id, auth_info_h);
+ rpc_port_stub_autofill_svc_auth_info_h auth_info_h;
+ rpc_port_stub_autofill_svc_auth_info_create(&auth_info_h);
+ rpc_port_stub_autofill_svc_auth_info_set_app_id(auth_info_h, app_id);
+ rpc_port_stub_autofill_svc_auth_info_set_view_id(auth_info_h, view_id);
+ rpc_port_stub_autofill_svc_auth_info_set_exist_autofill_data(auth_info_h, autofill_data_present);
+ rpc_port_stub_autofill_svc_auth_info_set_need_authentication(auth_info_h, authentication_needed);
+ rpc_port_stub_autofill_svc_auth_info_set_service_name(auth_info_h, service_name);
+ rpc_port_stub_autofill_svc_auth_info_set_service_message(auth_info_h, service_message);
+ rpc_port_stub_autofill_svc_auth_info_set_service_logo_image_path(auth_info_h, service_logo_image_path);
+
+ ret = rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_invoke(g_auth_info_cb, context_id, auth_info_h);
if (app_id)
free(app_id);
if (service_message)
free(service_message);
- rpc_port_autofill_svc_auth_info_destroy(auth_info_h);
+ rpc_port_stub_autofill_svc_auth_info_destroy(auth_info_h);
//LCOV_EXCL_STOP
return ret;
char *value = NULL;
char *presentation_text = NULL;
autofill_hint_e autofill_hint;
-
- rpc_port_autofill_svc_response_group_h res_group_h = (rpc_port_autofill_svc_response_group_h)user_data;
-
- rpc_port_autofill_svc_response_item_h ritem_h;
+ rpc_port_stub_list_autofill_svc_response_item_h items = user_data;
+ rpc_port_stub_autofill_svc_response_item_h ritem_h;
autofill_fill_response_item_get_id(it, &id);
autofill_fill_response_item_get_value(it, &value);
SECURE_LOGD("it : %p, id : %s, value : %s, presentation text : %s, autofill hint : %d", it, id, value, presentation_text, autofill_hint);
- rpc_port_autofill_svc_response_item_create(&ritem_h);
- rpc_port_autofill_svc_response_item_set_id(ritem_h, id);
- rpc_port_autofill_svc_response_item_set_presentation_text(ritem_h, presentation_text);
- rpc_port_autofill_svc_response_item_set_value(ritem_h, value);
- rpc_port_autofill_svc_response_item_set_autofill_hint(ritem_h, autofill_hint);
+ rpc_port_stub_autofill_svc_response_item_create(&ritem_h);
+ rpc_port_stub_autofill_svc_response_item_set_id(ritem_h, id);
+ rpc_port_stub_autofill_svc_response_item_set_presentation_text(ritem_h, presentation_text);
+ rpc_port_stub_autofill_svc_response_item_set_value(ritem_h, value);
+ rpc_port_stub_autofill_svc_response_item_set_autofill_hint(ritem_h, autofill_hint);
- rpc_port_autofill_svc_response_group_add_response_items(res_group_h, ritem_h);
+ rpc_port_stub_list_autofill_svc_response_item_add(items, ritem_h);
if (id) {
free(id);
presentation_text= NULL;
}
- rpc_port_autofill_svc_response_item_destroy(ritem_h);
+ rpc_port_stub_autofill_svc_response_item_destroy(ritem_h);
return true;
}
EXPORT_API int autofill_service_send_fill_response(int context_id, autofill_fill_response_h h)
{
/* create autofill response */
- rpc_port_autofill_svc_fill_response_h fill_response_h;
+ rpc_port_stub_autofill_svc_fill_response_h fill_response_h = NULL;
+ rpc_port_stub_list_autofill_svc_response_group_h response_groups = NULL;
+ rpc_port_stub_autofill_svc_response_group_h group = NULL;
+ rpc_port_stub_list_autofill_svc_response_item_h items = NULL;
int ret = AUTOFILL_ERROR_NONE;
Eina_List *l;
}
//LCOV_EXCL_START
- rpc_port_autofill_svc_fill_response_create(&fill_response_h);
+ rpc_port_stub_autofill_svc_fill_response_create(&fill_response_h);
if (h->app_id)
- rpc_port_autofill_svc_fill_response_set_app_id(fill_response_h, h->app_id);
+ rpc_port_stub_autofill_svc_fill_response_set_app_id(fill_response_h, h->app_id);
if (h->view_id)
- rpc_port_autofill_svc_fill_response_set_view_id(fill_response_h, h->view_id);
+ rpc_port_stub_autofill_svc_fill_response_set_view_id(fill_response_h, h->view_id);
- rpc_port_autofill_svc_response_group_h res_group_h;
+ rpc_port_stub_list_autofill_svc_response_group_create(&response_groups);
+ rpc_port_stub_autofill_svc_response_group_create(&group);
+ rpc_port_stub_list_autofill_svc_response_item_create(&items);
EINA_LIST_FOREACH(h->autofill_fill_response_group_list, l, it)
{
- res_group_h = NULL;
- rpc_port_autofill_svc_response_group_create(&res_group_h);
-
- autofill_fill_response_group_foreach_item(it, __fill_response_item_cb, res_group_h);
-
- rpc_port_autofill_svc_fill_response_add_response_groups(fill_response_h, res_group_h);
-
- rpc_port_autofill_svc_response_group_destroy(res_group_h);
+ autofill_fill_response_group_foreach_item(it, __fill_response_item_cb, items);
}
- ret = rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_invoke(g_fill_response_received_cb, context_id, fill_response_h);
+ rpc_port_stub_autofill_svc_response_group_set_response_items(group, items);
+ rpc_port_stub_list_autofill_svc_response_group_add(response_groups, group);
+ rpc_port_stub_autofill_svc_fill_response_set_response_groups(fill_response_h, response_groups);
+ rpc_port_stub_list_autofill_svc_response_group_destroy(response_groups);
+ rpc_port_stub_autofill_svc_response_group_destroy(group);
+ rpc_port_stub_list_autofill_svc_response_item_destroy(items);
+
+ ret = rpc_port_stub_AutofillSvcPort_autofill_svc_fill_response_cb_invoke(g_fill_response_received_cb, context_id, fill_response_h);
- rpc_port_autofill_svc_fill_response_destroy(fill_response_h);
+ rpc_port_stub_autofill_svc_fill_response_destroy(fill_response_h);
//LCOV_EXCL_STOP
return ret;
{
char *app_id = NULL;
autofill_error_e error_code;
- rpc_port_autofill_svc_error_info_h error_info_h = NULL;
+ rpc_port_stub_autofill_svc_error_info_h error_info_h = NULL;
if (!h) {
LOGW("[ERROR] Invalid parameter");
autofill_error_info_get_error_code(h, &error_code);
/* 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_stub_autofill_svc_error_info_create(&error_info_h);
+ rpc_port_stub_autofill_svc_error_info_set_app_id(error_info_h, app_id);
+ rpc_port_stub_autofill_svc_error_info_set_error_code(error_info_h, error_code);
- int ret = rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_invoke(g_send_error_cb, context_id, error_info_h);
+ int ret = rpc_port_stub_AutofillSvcPort_autofill_svc_send_error_cb_invoke(g_send_error_cb, context_id, error_info_h);
if (app_id)
free(app_id);
- rpc_port_autofill_svc_error_info_destroy(error_info_h);
+ rpc_port_stub_autofill_svc_error_info_destroy(error_info_h);
//LCOV_EXCL_STOP
return ret;
+++ /dev/null
-/*
- * Generated by tidlc 1.4.9.
- */
-
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <libgen.h>
-#include <glib.h>
-#include <dlog.h>
-#include <rpc-port.h>
-#include <rpc-port-parcel.h>
-
-#include "autofill_service_stub.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "RPC_PORT_STUB"
-
-#ifdef _E
-#undef _E
-#endif
-
-#ifdef _W
-#undef _W
-#endif
-
-#ifdef _I
-#undef _I
-#endif
-
-#ifdef _D
-#undef _D
-#endif
-
-#define _E(fmt, ...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-#define _W(fmt, ...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-#define _I(fmt, ...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-#define _D(fmt, ...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
-
-typedef int (*stub_method)(rpc_port_h, rpc_port_parcel_h, void *data);
-
-struct autofill_svc_item_s {
- rpc_port_parcelable_t parcelable;
- char *id;
- char *label;
- char *value;
- int autofill_hint;
- bool is_sensitive_data;
-};
-
-static void __autofill_svc_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->id ? h->id : "");
- rpc_port_parcel_write_string(parcel, h->label ? h->label : "");
- rpc_port_parcel_write_string(parcel, h->value ? h->value : "");
- rpc_port_parcel_write_int32(parcel, h->autofill_hint);
- rpc_port_parcel_write_bool(parcel, h->is_sensitive_data);
-}
-
-static void __autofill_svc_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->id);
- rpc_port_parcel_read_string(parcel, &h->label);
- rpc_port_parcel_read_string(parcel, &h->value);
- rpc_port_parcel_read_int32(parcel, &h->autofill_hint);
- rpc_port_parcel_read_bool(parcel, &h->is_sensitive_data);
-}
-
-int rpc_port_autofill_svc_item_create(rpc_port_autofill_svc_item_h *h)
-{
- struct autofill_svc_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_svc_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_svc_item_to;
- handle->parcelable.from = __autofill_svc_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_item_destroy(rpc_port_autofill_svc_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id)
- free(h->id);
-
- if (h->label)
- free(h->label);
-
- if (h->value)
- free(h->value);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_item_clone(rpc_port_autofill_svc_item_h h, rpc_port_autofill_svc_item_h *clone)
-{
- rpc_port_autofill_svc_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_svc_item_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_svc_item handle");
- return -1;
- }
-
- if (h->id) {
- handle->id = strdup(h->id);
- if (!handle->id) {
- _E("Failed to duplicate h->id");
- rpc_port_autofill_svc_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->label) {
- handle->label = strdup(h->label);
- if (!handle->label) {
- _E("Failed to duplicate h->label");
- rpc_port_autofill_svc_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->value) {
- handle->value = strdup(h->value);
- if (!handle->value) {
- _E("Failed to duplicate h->value");
- rpc_port_autofill_svc_item_destroy(handle);
- return -1;
- }
- }
-
- handle->autofill_hint = h->autofill_hint;
- handle->is_sensitive_data = h->is_sensitive_data;
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_item_set_id(rpc_port_autofill_svc_item_h h, const char *id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id) {
- free(h->id);
- h->id = NULL;
- }
-
- h->id = strdup(id);
- if (!h->id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_item_set_label(rpc_port_autofill_svc_item_h h, const char *label)
-{
- if (!h || !label) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->label) {
- free(h->label);
- h->label = NULL;
- }
-
- h->label = strdup(label);
- if (!h->label) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_item_set_value(rpc_port_autofill_svc_item_h h, const char *value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->value) {
- free(h->value);
- h->value = NULL;
- }
-
- h->value = strdup(value);
- if (!h->value) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_item_set_autofill_hint(rpc_port_autofill_svc_item_h h, int autofill_hint)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->autofill_hint = autofill_hint;
- return 0;
-}
-
-int rpc_port_autofill_svc_item_set_is_sensitive_data(rpc_port_autofill_svc_item_h h, bool is_sensitive_data)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->is_sensitive_data = is_sensitive_data;
- return 0;
-}
-
-int rpc_port_autofill_svc_item_get_id(rpc_port_autofill_svc_item_h h, char **id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->id) {
- _E("Invalid parameter: h->id is NULL");
- return -1;
- }
-
- *id = strdup(h->id);
- if (*id == NULL) {
- _E("Failed to duplicate id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_item_get_label(rpc_port_autofill_svc_item_h h, char **label)
-{
- if (!h || !label) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->label) {
- _E("Invalid parameter: h->label is NULL");
- return -1;
- }
-
- *label = strdup(h->label);
- if (*label == NULL) {
- _E("Failed to duplicate label");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_item_get_value(rpc_port_autofill_svc_item_h h, char **value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->value) {
- _E("Invalid parameter: h->value is NULL");
- return -1;
- }
-
- *value = strdup(h->value);
- if (*value == NULL) {
- _E("Failed to duplicate value");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_item_get_autofill_hint(rpc_port_autofill_svc_item_h h, int *autofill_hint)
-{
- if (!h || !autofill_hint) {
- _E("Invalid parameter");
- return -1;
- }
-
- *autofill_hint = h->autofill_hint;
- return 0;
-}
-
-int rpc_port_autofill_svc_item_get_is_sensitive_data(rpc_port_autofill_svc_item_h h, bool *is_sensitive_data)
-{
- if (!h || !is_sensitive_data) {
- _E("Invalid parameter");
- return -1;
- }
-
- *is_sensitive_data = h->is_sensitive_data;
- return 0;
-}
-
-struct autofill_svc_view_info_s {
- rpc_port_parcelable_t parcelable;
- char *app_id;
- char *view_id;
- GList *items;
-};
-
-static void __autofill_svc_view_info_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_view_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->app_id ? h->app_id : "");
- rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->items));
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_svc_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __autofill_svc_view_info_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_view_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->app_id);
- rpc_port_parcel_read_string(parcel, &h->view_id);
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_svc_item_h value = NULL;
-
- rpc_port_autofill_svc_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->items = g_list_append(h->items, value);
- }
- } while (0);
-}
-
-int rpc_port_autofill_svc_view_info_create(rpc_port_autofill_svc_view_info_h *h)
-{
- struct autofill_svc_view_info_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_svc_view_info_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_svc_view_info_to;
- handle->parcelable.from = __autofill_svc_view_info_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_view_info_destroy(rpc_port_autofill_svc_view_info_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id)
- free(h->app_id);
-
- if (h->view_id)
- free(h->view_id);
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_svc_item_h value = iter->data;
- if (value)
- rpc_port_autofill_svc_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_view_info_clone(rpc_port_autofill_svc_view_info_h h, rpc_port_autofill_svc_view_info_h *clone)
-{
- rpc_port_autofill_svc_view_info_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_svc_view_info_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_svc_view_info handle");
- return -1;
- }
-
- if (h->app_id) {
- handle->app_id = strdup(h->app_id);
- if (!handle->app_id) {
- _E("Failed to duplicate h->app_id");
- rpc_port_autofill_svc_view_info_destroy(handle);
- return -1;
- }
- }
-
- if (h->view_id) {
- handle->view_id = strdup(h->view_id);
- if (!handle->view_id) {
- _E("Failed to duplicate h->view_id");
- rpc_port_autofill_svc_view_info_destroy(handle);
- return -1;
- }
- }
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_svc_item_h new_value;
- rpc_port_autofill_svc_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_autofill_svc_view_info_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_svc_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_autofill_svc_view_info_destroy(handle);
- return -1;
- }
-
- handle->items = g_list_append(handle->items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_view_info_set_app_id(rpc_port_autofill_svc_view_info_h h, const char *app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id) {
- free(h->app_id);
- h->app_id = NULL;
- }
-
- h->app_id = strdup(app_id);
- if (!h->app_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_view_info_set_view_id(rpc_port_autofill_svc_view_info_h h, const char *view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_id) {
- free(h->view_id);
- h->view_id = NULL;
- }
-
- h->view_id = strdup(view_id);
- if (!h->view_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_view_info_add_items(rpc_port_autofill_svc_view_info_h h, rpc_port_autofill_svc_item_h items)
-{
- if (!h || !items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_svc_item_h value = NULL;
-
- rpc_port_autofill_svc_item_clone(items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->items = g_list_append(h->items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_view_info_get_app_id(rpc_port_autofill_svc_view_info_h h, char **app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->app_id) {
- _E("Invalid parameter: h->app_id is NULL");
- return -1;
- }
-
- *app_id = strdup(h->app_id);
- if (*app_id == NULL) {
- _E("Failed to duplicate app_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_view_info_get_view_id(rpc_port_autofill_svc_view_info_h h, char **view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->view_id) {
- _E("Invalid parameter: h->view_id is NULL");
- return -1;
- }
-
- *view_id = strdup(h->view_id);
- if (*view_id == NULL) {
- _E("Failed to duplicate view_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_view_info_foreach_items(rpc_port_autofill_svc_view_info_h h,
- bool (*callback)(rpc_port_autofill_svc_item_h items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_svc_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_view_info_remove_items(rpc_port_autofill_svc_view_info_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_svc_item_h value = iter->data;
- h->items = g_list_remove_link(h->items, iter);
- rpc_port_autofill_svc_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_view_info_get_items_length(rpc_port_autofill_svc_view_info_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->items);
-
- return 0;
-}
-
-struct autofill_svc_save_item_s {
- rpc_port_parcelable_t parcelable;
- char *id;
- char *label;
- char *value;
- int autofill_hint;
- bool is_sensitive_data;
-};
-
-static void __autofill_svc_save_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_save_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->id ? h->id : "");
- rpc_port_parcel_write_string(parcel, h->label ? h->label : "");
- rpc_port_parcel_write_string(parcel, h->value ? h->value : "");
- rpc_port_parcel_write_int32(parcel, h->autofill_hint);
- rpc_port_parcel_write_bool(parcel, h->is_sensitive_data);
-}
-
-static void __autofill_svc_save_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_save_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->id);
- rpc_port_parcel_read_string(parcel, &h->label);
- rpc_port_parcel_read_string(parcel, &h->value);
- rpc_port_parcel_read_int32(parcel, &h->autofill_hint);
- rpc_port_parcel_read_bool(parcel, &h->is_sensitive_data);
-}
-
-int rpc_port_autofill_svc_save_item_create(rpc_port_autofill_svc_save_item_h *h)
-{
- struct autofill_svc_save_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_svc_save_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_svc_save_item_to;
- handle->parcelable.from = __autofill_svc_save_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_destroy(rpc_port_autofill_svc_save_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id)
- free(h->id);
-
- if (h->label)
- free(h->label);
-
- if (h->value)
- free(h->value);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_clone(rpc_port_autofill_svc_save_item_h h, rpc_port_autofill_svc_save_item_h *clone)
-{
- rpc_port_autofill_svc_save_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_svc_save_item_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_svc_save_item handle");
- return -1;
- }
-
- if (h->id) {
- handle->id = strdup(h->id);
- if (!handle->id) {
- _E("Failed to duplicate h->id");
- rpc_port_autofill_svc_save_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->label) {
- handle->label = strdup(h->label);
- if (!handle->label) {
- _E("Failed to duplicate h->label");
- rpc_port_autofill_svc_save_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->value) {
- handle->value = strdup(h->value);
- if (!handle->value) {
- _E("Failed to duplicate h->value");
- rpc_port_autofill_svc_save_item_destroy(handle);
- return -1;
- }
- }
-
- handle->autofill_hint = h->autofill_hint;
- handle->is_sensitive_data = h->is_sensitive_data;
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_set_id(rpc_port_autofill_svc_save_item_h h, const char *id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id) {
- free(h->id);
- h->id = NULL;
- }
-
- h->id = strdup(id);
- if (!h->id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_set_label(rpc_port_autofill_svc_save_item_h h, const char *label)
-{
- if (!h || !label) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->label) {
- free(h->label);
- h->label = NULL;
- }
-
- h->label = strdup(label);
- if (!h->label) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_set_value(rpc_port_autofill_svc_save_item_h h, const char *value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->value) {
- free(h->value);
- h->value = NULL;
- }
-
- h->value = strdup(value);
- if (!h->value) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_set_autofill_hint(rpc_port_autofill_svc_save_item_h h, int autofill_hint)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->autofill_hint = autofill_hint;
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_set_is_sensitive_data(rpc_port_autofill_svc_save_item_h h, bool is_sensitive_data)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->is_sensitive_data = is_sensitive_data;
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_get_id(rpc_port_autofill_svc_save_item_h h, char **id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->id) {
- _E("Invalid parameter: h->id is NULL");
- return -1;
- }
-
- *id = strdup(h->id);
- if (*id == NULL) {
- _E("Failed to duplicate id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_get_label(rpc_port_autofill_svc_save_item_h h, char **label)
-{
- if (!h || !label) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->label) {
- _E("Invalid parameter: h->label is NULL");
- return -1;
- }
-
- *label = strdup(h->label);
- if (*label == NULL) {
- _E("Failed to duplicate label");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_get_value(rpc_port_autofill_svc_save_item_h h, char **value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->value) {
- _E("Invalid parameter: h->value is NULL");
- return -1;
- }
-
- *value = strdup(h->value);
- if (*value == NULL) {
- _E("Failed to duplicate value");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_get_autofill_hint(rpc_port_autofill_svc_save_item_h h, int *autofill_hint)
-{
- if (!h || !autofill_hint) {
- _E("Invalid parameter");
- return -1;
- }
-
- *autofill_hint = h->autofill_hint;
- return 0;
-}
-
-int rpc_port_autofill_svc_save_item_get_is_sensitive_data(rpc_port_autofill_svc_save_item_h h, bool *is_sensitive_data)
-{
- if (!h || !is_sensitive_data) {
- _E("Invalid parameter");
- return -1;
- }
-
- *is_sensitive_data = h->is_sensitive_data;
- return 0;
-}
-
-struct autofill_svc_save_view_info_s {
- rpc_port_parcelable_t parcelable;
- char *app_id;
- char *view_id;
- char *view_title;
- GList *items;
-};
-
-static void __autofill_svc_save_view_info_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_save_view_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->app_id ? h->app_id : "");
- rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_string(parcel, h->view_title ? h->view_title : "");
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->items));
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_svc_save_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __autofill_svc_save_view_info_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_save_view_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->app_id);
- rpc_port_parcel_read_string(parcel, &h->view_id);
- rpc_port_parcel_read_string(parcel, &h->view_title);
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_svc_save_item_h value = NULL;
-
- rpc_port_autofill_svc_save_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->items = g_list_append(h->items, value);
- }
- } while (0);
-}
-
-int rpc_port_autofill_svc_save_view_info_create(rpc_port_autofill_svc_save_view_info_h *h)
-{
- struct autofill_svc_save_view_info_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_svc_save_view_info_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_svc_save_view_info_to;
- handle->parcelable.from = __autofill_svc_save_view_info_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_destroy(rpc_port_autofill_svc_save_view_info_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id)
- free(h->app_id);
-
- if (h->view_id)
- free(h->view_id);
-
- if (h->view_title)
- free(h->view_title);
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_svc_save_item_h value = iter->data;
- if (value)
- rpc_port_autofill_svc_save_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_clone(rpc_port_autofill_svc_save_view_info_h h, rpc_port_autofill_svc_save_view_info_h *clone)
-{
- rpc_port_autofill_svc_save_view_info_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_svc_save_view_info_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_svc_save_view_info handle");
- return -1;
- }
-
- if (h->app_id) {
- handle->app_id = strdup(h->app_id);
- if (!handle->app_id) {
- _E("Failed to duplicate h->app_id");
- rpc_port_autofill_svc_save_view_info_destroy(handle);
- return -1;
- }
- }
-
- if (h->view_id) {
- handle->view_id = strdup(h->view_id);
- if (!handle->view_id) {
- _E("Failed to duplicate h->view_id");
- rpc_port_autofill_svc_save_view_info_destroy(handle);
- return -1;
- }
- }
-
- if (h->view_title) {
- handle->view_title = strdup(h->view_title);
- if (!handle->view_title) {
- _E("Failed to duplicate h->view_title");
- rpc_port_autofill_svc_save_view_info_destroy(handle);
- return -1;
- }
- }
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_svc_save_item_h new_value;
- rpc_port_autofill_svc_save_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_autofill_svc_save_view_info_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_svc_save_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_autofill_svc_save_view_info_destroy(handle);
- return -1;
- }
-
- handle->items = g_list_append(handle->items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_set_app_id(rpc_port_autofill_svc_save_view_info_h h, const char *app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id) {
- free(h->app_id);
- h->app_id = NULL;
- }
-
- h->app_id = strdup(app_id);
- if (!h->app_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_set_view_id(rpc_port_autofill_svc_save_view_info_h h, const char *view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_id) {
- free(h->view_id);
- h->view_id = NULL;
- }
-
- h->view_id = strdup(view_id);
- if (!h->view_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_set_view_title(rpc_port_autofill_svc_save_view_info_h h, const char *view_title)
-{
- if (!h || !view_title) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_title) {
- free(h->view_title);
- h->view_title = NULL;
- }
-
- h->view_title = strdup(view_title);
- if (!h->view_title) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_add_items(rpc_port_autofill_svc_save_view_info_h h, rpc_port_autofill_svc_save_item_h items)
-{
- if (!h || !items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_svc_save_item_h value = NULL;
-
- rpc_port_autofill_svc_save_item_clone(items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->items = g_list_append(h->items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_get_app_id(rpc_port_autofill_svc_save_view_info_h h, char **app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->app_id) {
- _E("Invalid parameter: h->app_id is NULL");
- return -1;
- }
-
- *app_id = strdup(h->app_id);
- if (*app_id == NULL) {
- _E("Failed to duplicate app_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_get_view_id(rpc_port_autofill_svc_save_view_info_h h, char **view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->view_id) {
- _E("Invalid parameter: h->view_id is NULL");
- return -1;
- }
-
- *view_id = strdup(h->view_id);
- if (*view_id == NULL) {
- _E("Failed to duplicate view_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_get_view_title(rpc_port_autofill_svc_save_view_info_h h, char **view_title)
-{
- if (!h || !view_title) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->view_title) {
- _E("Invalid parameter: h->view_title is NULL");
- return -1;
- }
-
- *view_title = strdup(h->view_title);
- if (*view_title == NULL) {
- _E("Failed to duplicate view_title");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_foreach_items(rpc_port_autofill_svc_save_view_info_h h,
- bool (*callback)(rpc_port_autofill_svc_save_item_h items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->items;
- while (iter) {
- rpc_port_autofill_svc_save_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_remove_items(rpc_port_autofill_svc_save_view_info_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_svc_save_item_h value = iter->data;
- h->items = g_list_remove_link(h->items, iter);
- rpc_port_autofill_svc_save_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_save_view_info_get_items_length(rpc_port_autofill_svc_save_view_info_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->items);
-
- return 0;
-}
-
-struct autofill_svc_auth_info_s {
- rpc_port_parcelable_t parcelable;
- char *app_id;
- char *view_id;
- bool exist_autofill_data;
- bool need_authentication;
- char *service_name;
- char *service_logo_image_path;
- char *service_message;
-};
-
-static void __autofill_svc_auth_info_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_auth_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->app_id ? h->app_id : "");
- rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_bool(parcel, h->exist_autofill_data);
- rpc_port_parcel_write_bool(parcel, h->need_authentication);
- rpc_port_parcel_write_string(parcel, h->service_name ? h->service_name : "");
- rpc_port_parcel_write_string(parcel, h->service_logo_image_path ? h->service_logo_image_path : "");
- rpc_port_parcel_write_string(parcel, h->service_message ? h->service_message : "");
-}
-
-static void __autofill_svc_auth_info_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_auth_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->app_id);
- rpc_port_parcel_read_string(parcel, &h->view_id);
- rpc_port_parcel_read_bool(parcel, &h->exist_autofill_data);
- rpc_port_parcel_read_bool(parcel, &h->need_authentication);
- rpc_port_parcel_read_string(parcel, &h->service_name);
- rpc_port_parcel_read_string(parcel, &h->service_logo_image_path);
- rpc_port_parcel_read_string(parcel, &h->service_message);
-}
-
-int rpc_port_autofill_svc_auth_info_create(rpc_port_autofill_svc_auth_info_h *h)
-{
- struct autofill_svc_auth_info_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_svc_auth_info_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_svc_auth_info_to;
- handle->parcelable.from = __autofill_svc_auth_info_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_destroy(rpc_port_autofill_svc_auth_info_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id)
- free(h->app_id);
-
- if (h->view_id)
- free(h->view_id);
-
- if (h->service_name)
- free(h->service_name);
-
- if (h->service_logo_image_path)
- free(h->service_logo_image_path);
-
- if (h->service_message)
- free(h->service_message);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_clone(rpc_port_autofill_svc_auth_info_h h, rpc_port_autofill_svc_auth_info_h *clone)
-{
- rpc_port_autofill_svc_auth_info_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_svc_auth_info_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_svc_auth_info handle");
- return -1;
- }
-
- if (h->app_id) {
- handle->app_id = strdup(h->app_id);
- if (!handle->app_id) {
- _E("Failed to duplicate h->app_id");
- rpc_port_autofill_svc_auth_info_destroy(handle);
- return -1;
- }
- }
-
- if (h->view_id) {
- handle->view_id = strdup(h->view_id);
- if (!handle->view_id) {
- _E("Failed to duplicate h->view_id");
- rpc_port_autofill_svc_auth_info_destroy(handle);
- return -1;
- }
- }
-
- handle->exist_autofill_data = h->exist_autofill_data;
- handle->need_authentication = h->need_authentication;
- if (h->service_name) {
- handle->service_name = strdup(h->service_name);
- if (!handle->service_name) {
- _E("Failed to duplicate h->service_name");
- rpc_port_autofill_svc_auth_info_destroy(handle);
- return -1;
- }
- }
-
- if (h->service_logo_image_path) {
- handle->service_logo_image_path = strdup(h->service_logo_image_path);
- if (!handle->service_logo_image_path) {
- _E("Failed to duplicate h->service_logo_image_path");
- rpc_port_autofill_svc_auth_info_destroy(handle);
- return -1;
- }
- }
-
- if (h->service_message) {
- handle->service_message = strdup(h->service_message);
- if (!handle->service_message) {
- _E("Failed to duplicate h->service_message");
- rpc_port_autofill_svc_auth_info_destroy(handle);
- return -1;
- }
- }
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_set_app_id(rpc_port_autofill_svc_auth_info_h h, const char *app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id) {
- free(h->app_id);
- h->app_id = NULL;
- }
-
- h->app_id = strdup(app_id);
- if (!h->app_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_set_view_id(rpc_port_autofill_svc_auth_info_h h, const char *view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_id) {
- free(h->view_id);
- h->view_id = NULL;
- }
-
- h->view_id = strdup(view_id);
- if (!h->view_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_set_exist_autofill_data(rpc_port_autofill_svc_auth_info_h h, bool exist_autofill_data)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->exist_autofill_data = exist_autofill_data;
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_set_need_authentication(rpc_port_autofill_svc_auth_info_h h, bool need_authentication)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->need_authentication = need_authentication;
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_set_service_name(rpc_port_autofill_svc_auth_info_h h, const char *service_name)
-{
- if (!h || !service_name) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->service_name) {
- free(h->service_name);
- h->service_name = NULL;
- }
-
- h->service_name = strdup(service_name);
- if (!h->service_name) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_set_service_logo_image_path(rpc_port_autofill_svc_auth_info_h h, const char *service_logo_image_path)
-{
- if (!h || !service_logo_image_path) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->service_logo_image_path) {
- free(h->service_logo_image_path);
- h->service_logo_image_path = NULL;
- }
-
- h->service_logo_image_path = strdup(service_logo_image_path);
- if (!h->service_logo_image_path) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_set_service_message(rpc_port_autofill_svc_auth_info_h h, const char *service_message)
-{
- if (!h || !service_message) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->service_message) {
- free(h->service_message);
- h->service_message = NULL;
- }
-
- h->service_message = strdup(service_message);
- if (!h->service_message) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_get_app_id(rpc_port_autofill_svc_auth_info_h h, char **app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->app_id) {
- _E("Invalid parameter: h->app_id is NULL");
- return -1;
- }
-
- *app_id = strdup(h->app_id);
- if (*app_id == NULL) {
- _E("Failed to duplicate app_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_get_view_id(rpc_port_autofill_svc_auth_info_h h, char **view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->view_id) {
- _E("Invalid parameter: h->view_id is NULL");
- return -1;
- }
-
- *view_id = strdup(h->view_id);
- if (*view_id == NULL) {
- _E("Failed to duplicate view_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_get_exist_autofill_data(rpc_port_autofill_svc_auth_info_h h, bool *exist_autofill_data)
-{
- if (!h || !exist_autofill_data) {
- _E("Invalid parameter");
- return -1;
- }
-
- *exist_autofill_data = h->exist_autofill_data;
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_get_need_authentication(rpc_port_autofill_svc_auth_info_h h, bool *need_authentication)
-{
- if (!h || !need_authentication) {
- _E("Invalid parameter");
- return -1;
- }
-
- *need_authentication = h->need_authentication;
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_get_service_name(rpc_port_autofill_svc_auth_info_h h, char **service_name)
-{
- if (!h || !service_name) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->service_name) {
- _E("Invalid parameter: h->service_name is NULL");
- return -1;
- }
-
- *service_name = strdup(h->service_name);
- if (*service_name == NULL) {
- _E("Failed to duplicate service_name");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_get_service_logo_image_path(rpc_port_autofill_svc_auth_info_h h, char **service_logo_image_path)
-{
- if (!h || !service_logo_image_path) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->service_logo_image_path) {
- _E("Invalid parameter: h->service_logo_image_path is NULL");
- return -1;
- }
-
- *service_logo_image_path = strdup(h->service_logo_image_path);
- if (*service_logo_image_path == NULL) {
- _E("Failed to duplicate service_logo_image_path");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_auth_info_get_service_message(rpc_port_autofill_svc_auth_info_h h, char **service_message)
-{
- if (!h || !service_message) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->service_message) {
- _E("Invalid parameter: h->service_message is NULL");
- return -1;
- }
-
- *service_message = strdup(h->service_message);
- if (*service_message == NULL) {
- _E("Failed to duplicate service_message");
- return -1;
- }
-
- return 0;
-}
-
-struct autofill_svc_response_item_s {
- rpc_port_parcelable_t parcelable;
- char *id;
- char *presentation_text;
- char *value;
- int autofill_hint;
-};
-
-static void __autofill_svc_response_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_response_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->id ? h->id : "");
- rpc_port_parcel_write_string(parcel, h->presentation_text ? h->presentation_text : "");
- rpc_port_parcel_write_string(parcel, h->value ? h->value : "");
- rpc_port_parcel_write_int32(parcel, h->autofill_hint);
-}
-
-static void __autofill_svc_response_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_response_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->id);
- rpc_port_parcel_read_string(parcel, &h->presentation_text);
- rpc_port_parcel_read_string(parcel, &h->value);
- rpc_port_parcel_read_int32(parcel, &h->autofill_hint);
-}
-
-int rpc_port_autofill_svc_response_item_create(rpc_port_autofill_svc_response_item_h *h)
-{
- struct autofill_svc_response_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_svc_response_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_svc_response_item_to;
- handle->parcelable.from = __autofill_svc_response_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_item_destroy(rpc_port_autofill_svc_response_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id)
- free(h->id);
-
- if (h->presentation_text)
- free(h->presentation_text);
-
- if (h->value)
- free(h->value);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_item_clone(rpc_port_autofill_svc_response_item_h h, rpc_port_autofill_svc_response_item_h *clone)
-{
- rpc_port_autofill_svc_response_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_svc_response_item_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_svc_response_item handle");
- return -1;
- }
-
- if (h->id) {
- handle->id = strdup(h->id);
- if (!handle->id) {
- _E("Failed to duplicate h->id");
- rpc_port_autofill_svc_response_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->presentation_text) {
- handle->presentation_text = strdup(h->presentation_text);
- if (!handle->presentation_text) {
- _E("Failed to duplicate h->presentation_text");
- rpc_port_autofill_svc_response_item_destroy(handle);
- return -1;
- }
- }
-
- if (h->value) {
- handle->value = strdup(h->value);
- if (!handle->value) {
- _E("Failed to duplicate h->value");
- rpc_port_autofill_svc_response_item_destroy(handle);
- return -1;
- }
- }
-
- handle->autofill_hint = h->autofill_hint;
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_item_set_id(rpc_port_autofill_svc_response_item_h h, const char *id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->id) {
- free(h->id);
- h->id = NULL;
- }
-
- h->id = strdup(id);
- if (!h->id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_item_set_presentation_text(rpc_port_autofill_svc_response_item_h h, const char *presentation_text)
-{
- if (!h || !presentation_text) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->presentation_text) {
- free(h->presentation_text);
- h->presentation_text = NULL;
- }
-
- h->presentation_text = strdup(presentation_text);
- if (!h->presentation_text) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_item_set_value(rpc_port_autofill_svc_response_item_h h, const char *value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->value) {
- free(h->value);
- h->value = NULL;
- }
-
- h->value = strdup(value);
- if (!h->value) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_item_set_autofill_hint(rpc_port_autofill_svc_response_item_h h, int autofill_hint)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->autofill_hint = autofill_hint;
- return 0;
-}
-
-int rpc_port_autofill_svc_response_item_get_id(rpc_port_autofill_svc_response_item_h h, char **id)
-{
- if (!h || !id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->id) {
- _E("Invalid parameter: h->id is NULL");
- return -1;
- }
-
- *id = strdup(h->id);
- if (*id == NULL) {
- _E("Failed to duplicate id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_item_get_presentation_text(rpc_port_autofill_svc_response_item_h h, char **presentation_text)
-{
- if (!h || !presentation_text) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->presentation_text) {
- _E("Invalid parameter: h->presentation_text is NULL");
- return -1;
- }
-
- *presentation_text = strdup(h->presentation_text);
- if (*presentation_text == NULL) {
- _E("Failed to duplicate presentation_text");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_item_get_value(rpc_port_autofill_svc_response_item_h h, char **value)
-{
- if (!h || !value) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->value) {
- _E("Invalid parameter: h->value is NULL");
- return -1;
- }
-
- *value = strdup(h->value);
- if (*value == NULL) {
- _E("Failed to duplicate value");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_item_get_autofill_hint(rpc_port_autofill_svc_response_item_h h, int *autofill_hint)
-{
- if (!h || !autofill_hint) {
- _E("Invalid parameter");
- return -1;
- }
-
- *autofill_hint = h->autofill_hint;
- return 0;
-}
-
-struct autofill_svc_response_group_s {
- rpc_port_parcelable_t parcelable;
- GList *response_items;
-};
-
-static void __autofill_svc_response_group_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_response_group_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_items));
- do {
- GList *iter;
-
- iter = h->response_items;
- while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __autofill_svc_response_group_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_response_group_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_svc_response_item_h value = NULL;
-
- rpc_port_autofill_svc_response_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->response_items = g_list_append(h->response_items, value);
- }
- } while (0);
-}
-
-int rpc_port_autofill_svc_response_group_create(rpc_port_autofill_svc_response_group_h *h)
-{
- struct autofill_svc_response_group_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_svc_response_group_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_svc_response_group_to;
- handle->parcelable.from = __autofill_svc_response_group_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_group_destroy(rpc_port_autofill_svc_response_group_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->response_items;
- while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
- if (value)
- rpc_port_autofill_svc_response_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->response_items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_group_clone(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h *clone)
-{
- rpc_port_autofill_svc_response_group_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_svc_response_group_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_svc_response_group handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->response_items;
- while (iter) {
- rpc_port_autofill_svc_response_item_h new_value;
- rpc_port_autofill_svc_response_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_autofill_svc_response_group_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_svc_response_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_autofill_svc_response_group_destroy(handle);
- return -1;
- }
-
- handle->response_items = g_list_append(handle->response_items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_group_add_response_items(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_item_h response_items)
-{
- if (!h || !response_items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_svc_response_item_h value = NULL;
-
- rpc_port_autofill_svc_response_item_clone(response_items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->response_items = g_list_append(h->response_items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_group_foreach_response_items(rpc_port_autofill_svc_response_group_h h,
- bool (*callback)(rpc_port_autofill_svc_response_item_h response_items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->response_items;
- while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_group_remove_response_items(rpc_port_autofill_svc_response_group_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->response_items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_svc_response_item_h value = iter->data;
- h->response_items = g_list_remove_link(h->response_items, iter);
- rpc_port_autofill_svc_response_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_response_group_get_response_items_length(rpc_port_autofill_svc_response_group_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->response_items);
-
- return 0;
-}
-
-struct autofill_svc_fill_response_s {
- rpc_port_parcelable_t parcelable;
- char *app_id;
- char *view_id;
- GList *response_groups;
-};
-
-static void __autofill_svc_fill_response_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_fill_response_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->app_id ? h->app_id : "");
- rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_groups));
- do {
- GList *iter;
-
- iter = h->response_groups;
- while (iter) {
- rpc_port_autofill_svc_response_group_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __autofill_svc_fill_response_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_fill_response_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->app_id);
- rpc_port_parcel_read_string(parcel, &h->view_id);
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_svc_response_group_h value = NULL;
-
- rpc_port_autofill_svc_response_group_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->response_groups = g_list_append(h->response_groups, value);
- }
- } while (0);
-}
-
-int rpc_port_autofill_svc_fill_response_create(rpc_port_autofill_svc_fill_response_h *h)
-{
- struct autofill_svc_fill_response_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_svc_fill_response_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_svc_fill_response_to;
- handle->parcelable.from = __autofill_svc_fill_response_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_fill_response_destroy(rpc_port_autofill_svc_fill_response_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id)
- free(h->app_id);
-
- if (h->view_id)
- free(h->view_id);
-
- do {
- GList *iter;
-
- iter = h->response_groups;
- while (iter) {
- rpc_port_autofill_svc_response_group_h value = iter->data;
- if (value)
- rpc_port_autofill_svc_response_group_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->response_groups);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_fill_response_clone(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_fill_response_h *clone)
-{
- rpc_port_autofill_svc_fill_response_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_svc_fill_response_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_svc_fill_response handle");
- return -1;
- }
-
- if (h->app_id) {
- handle->app_id = strdup(h->app_id);
- if (!handle->app_id) {
- _E("Failed to duplicate h->app_id");
- rpc_port_autofill_svc_fill_response_destroy(handle);
- return -1;
- }
- }
-
- if (h->view_id) {
- handle->view_id = strdup(h->view_id);
- if (!handle->view_id) {
- _E("Failed to duplicate h->view_id");
- rpc_port_autofill_svc_fill_response_destroy(handle);
- return -1;
- }
- }
-
- do {
- GList *iter;
-
- iter = h->response_groups;
- while (iter) {
- rpc_port_autofill_svc_response_group_h new_value;
- rpc_port_autofill_svc_response_group_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_autofill_svc_fill_response_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_svc_response_group_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_autofill_svc_fill_response_destroy(handle);
- return -1;
- }
-
- handle->response_groups = g_list_append(handle->response_groups, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_fill_response_set_app_id(rpc_port_autofill_svc_fill_response_h h, const char *app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id) {
- free(h->app_id);
- h->app_id = NULL;
- }
-
- h->app_id = strdup(app_id);
- if (!h->app_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_fill_response_set_view_id(rpc_port_autofill_svc_fill_response_h h, const char *view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->view_id) {
- free(h->view_id);
- h->view_id = NULL;
- }
-
- h->view_id = strdup(view_id);
- if (!h->view_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_fill_response_add_response_groups(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_response_group_h response_groups)
-{
- if (!h || !response_groups) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_svc_response_group_h value = NULL;
-
- rpc_port_autofill_svc_response_group_clone(response_groups, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->response_groups = g_list_append(h->response_groups, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_fill_response_get_app_id(rpc_port_autofill_svc_fill_response_h h, char **app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->app_id) {
- _E("Invalid parameter: h->app_id is NULL");
- return -1;
- }
-
- *app_id = strdup(h->app_id);
- if (*app_id == NULL) {
- _E("Failed to duplicate app_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_fill_response_get_view_id(rpc_port_autofill_svc_fill_response_h h, char **view_id)
-{
- if (!h || !view_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->view_id) {
- _E("Invalid parameter: h->view_id is NULL");
- return -1;
- }
-
- *view_id = strdup(h->view_id);
- if (*view_id == NULL) {
- _E("Failed to duplicate view_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_fill_response_foreach_response_groups(rpc_port_autofill_svc_fill_response_h h,
- bool (*callback)(rpc_port_autofill_svc_response_group_h response_groups, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->response_groups;
- while (iter) {
- rpc_port_autofill_svc_response_group_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_fill_response_remove_response_groups(rpc_port_autofill_svc_fill_response_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->response_groups, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_svc_response_group_h value = iter->data;
- h->response_groups = g_list_remove_link(h->response_groups, iter);
- rpc_port_autofill_svc_response_group_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_fill_response_get_response_groups_length(rpc_port_autofill_svc_fill_response_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->response_groups);
-
- return 0;
-}
-
-struct autofill_svc_error_info_s {
- rpc_port_parcelable_t parcelable;
- char *app_id;
- int error_code;
-};
-
-static void __autofill_svc_error_info_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_error_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_string(parcel, h->app_id ? h->app_id : "");
- rpc_port_parcel_write_int32(parcel, h->error_code);
-}
-
-static void __autofill_svc_error_info_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_autofill_svc_error_info_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_string(parcel, &h->app_id);
- rpc_port_parcel_read_int32(parcel, &h->error_code);
-}
-
-int rpc_port_autofill_svc_error_info_create(rpc_port_autofill_svc_error_info_h *h)
-{
- struct autofill_svc_error_info_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct autofill_svc_error_info_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __autofill_svc_error_info_to;
- handle->parcelable.from = __autofill_svc_error_info_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_error_info_destroy(rpc_port_autofill_svc_error_info_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id)
- free(h->app_id);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_autofill_svc_error_info_clone(rpc_port_autofill_svc_error_info_h h, rpc_port_autofill_svc_error_info_h *clone)
-{
- rpc_port_autofill_svc_error_info_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_autofill_svc_error_info_create(&handle);
- if (!handle) {
- _E("Failed to create autofill_svc_error_info handle");
- return -1;
- }
-
- if (h->app_id) {
- handle->app_id = strdup(h->app_id);
- if (!handle->app_id) {
- _E("Failed to duplicate h->app_id");
- rpc_port_autofill_svc_error_info_destroy(handle);
- return -1;
- }
- }
-
- handle->error_code = h->error_code;
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_autofill_svc_error_info_set_app_id(rpc_port_autofill_svc_error_info_h h, const char *app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->app_id) {
- free(h->app_id);
- h->app_id = NULL;
- }
-
- h->app_id = strdup(app_id);
- if (!h->app_id) {
- _E("Failed to duplicate data");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_error_info_set_error_code(rpc_port_autofill_svc_error_info_h h, int error_code)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->error_code = error_code;
- return 0;
-}
-
-int rpc_port_autofill_svc_error_info_get_app_id(rpc_port_autofill_svc_error_info_h h, char **app_id)
-{
- if (!h || !app_id) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!h->app_id) {
- _E("Invalid parameter: h->app_id is NULL");
- return -1;
- }
-
- *app_id = strdup(h->app_id);
- if (*app_id == NULL) {
- _E("Failed to duplicate app_id");
- return -1;
- }
-
- return 0;
-}
-
-int rpc_port_autofill_svc_error_info_get_error_code(rpc_port_autofill_svc_error_info_h h, int *error_code)
-{
- if (!h || !error_code) {
- _E("Invalid parameter");
- return -1;
- }
-
- *error_code = h->error_code;
- return 0;
-}
-
-struct list_autofill_svc_item_s {
- rpc_port_parcelable_t parcelable;
- GList *list_autofill_svc_items;
-};
-
-static void __list_autofill_svc_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_svc_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_svc_items));
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_items;
- while (iter) {
- rpc_port_autofill_svc_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __list_autofill_svc_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_svc_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_svc_item_h value = NULL;
-
- rpc_port_autofill_svc_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->list_autofill_svc_items = g_list_append(h->list_autofill_svc_items, value);
- }
- } while (0);
-}
-
-int rpc_port_list_autofill_svc_item_create(rpc_port_list_autofill_svc_item_h *h)
-{
- struct list_autofill_svc_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct list_autofill_svc_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __list_autofill_svc_item_to;
- handle->parcelable.from = __list_autofill_svc_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_item_destroy(rpc_port_list_autofill_svc_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_items;
- while (iter) {
- rpc_port_autofill_svc_item_h value = iter->data;
- if (value)
- rpc_port_autofill_svc_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->list_autofill_svc_items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_item_clone(rpc_port_list_autofill_svc_item_h h, rpc_port_list_autofill_svc_item_h *clone)
-{
- rpc_port_list_autofill_svc_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_list_autofill_svc_item_create(&handle);
- if (!handle) {
- _E("Failed to create list_autofill_svc_item handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_items;
- while (iter) {
- rpc_port_autofill_svc_item_h new_value;
- rpc_port_autofill_svc_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_list_autofill_svc_item_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_svc_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_list_autofill_svc_item_destroy(handle);
- return -1;
- }
-
- handle->list_autofill_svc_items = g_list_append(handle->list_autofill_svc_items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_item_add_list_autofill_svc_items(rpc_port_list_autofill_svc_item_h h, rpc_port_autofill_svc_item_h list_autofill_svc_items)
-{
- if (!h || !list_autofill_svc_items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_svc_item_h value = NULL;
-
- rpc_port_autofill_svc_item_clone(list_autofill_svc_items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->list_autofill_svc_items = g_list_append(h->list_autofill_svc_items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_item_foreach_list_autofill_svc_items(rpc_port_list_autofill_svc_item_h h,
- bool (*callback)(rpc_port_autofill_svc_item_h list_autofill_svc_items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_items;
- while (iter) {
- rpc_port_autofill_svc_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_item_remove_list_autofill_svc_items(rpc_port_list_autofill_svc_item_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->list_autofill_svc_items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_svc_item_h value = iter->data;
- h->list_autofill_svc_items = g_list_remove_link(h->list_autofill_svc_items, iter);
- rpc_port_autofill_svc_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_item_get_list_autofill_svc_items_length(rpc_port_list_autofill_svc_item_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->list_autofill_svc_items);
-
- return 0;
-}
-
-struct list_autofill_svc_response_group_s {
- rpc_port_parcelable_t parcelable;
- GList *list_autofill_svc_response_groups;
-};
-
-static void __list_autofill_svc_response_group_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_svc_response_group_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_svc_response_groups));
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_response_groups;
- while (iter) {
- rpc_port_autofill_svc_response_group_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __list_autofill_svc_response_group_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_svc_response_group_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_svc_response_group_h value = NULL;
-
- rpc_port_autofill_svc_response_group_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->list_autofill_svc_response_groups = g_list_append(h->list_autofill_svc_response_groups, value);
- }
- } while (0);
-}
-
-int rpc_port_list_autofill_svc_response_group_create(rpc_port_list_autofill_svc_response_group_h *h)
-{
- struct list_autofill_svc_response_group_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct list_autofill_svc_response_group_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __list_autofill_svc_response_group_to;
- handle->parcelable.from = __list_autofill_svc_response_group_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_group_destroy(rpc_port_list_autofill_svc_response_group_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_response_groups;
- while (iter) {
- rpc_port_autofill_svc_response_group_h value = iter->data;
- if (value)
- rpc_port_autofill_svc_response_group_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->list_autofill_svc_response_groups);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_group_clone(rpc_port_list_autofill_svc_response_group_h h, rpc_port_list_autofill_svc_response_group_h *clone)
-{
- rpc_port_list_autofill_svc_response_group_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_list_autofill_svc_response_group_create(&handle);
- if (!handle) {
- _E("Failed to create list_autofill_svc_response_group handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_response_groups;
- while (iter) {
- rpc_port_autofill_svc_response_group_h new_value;
- rpc_port_autofill_svc_response_group_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_list_autofill_svc_response_group_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_svc_response_group_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_list_autofill_svc_response_group_destroy(handle);
- return -1;
- }
-
- handle->list_autofill_svc_response_groups = g_list_append(handle->list_autofill_svc_response_groups, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_group_add_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups)
-{
- if (!h || !list_autofill_svc_response_groups) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_svc_response_group_h value = NULL;
-
- rpc_port_autofill_svc_response_group_clone(list_autofill_svc_response_groups, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->list_autofill_svc_response_groups = g_list_append(h->list_autofill_svc_response_groups, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_group_foreach_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h,
- bool (*callback)(rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_response_groups;
- while (iter) {
- rpc_port_autofill_svc_response_group_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_group_remove_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->list_autofill_svc_response_groups, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_svc_response_group_h value = iter->data;
- h->list_autofill_svc_response_groups = g_list_remove_link(h->list_autofill_svc_response_groups, iter);
- rpc_port_autofill_svc_response_group_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_group_get_list_autofill_svc_response_groups_length(rpc_port_list_autofill_svc_response_group_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->list_autofill_svc_response_groups);
-
- return 0;
-}
-
-struct list_autofill_svc_response_item_s {
- rpc_port_parcelable_t parcelable;
- GList *list_autofill_svc_response_items;
-};
-
-static void __list_autofill_svc_response_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_svc_response_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_svc_response_items));
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_response_items;
- while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __list_autofill_svc_response_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_svc_response_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_svc_response_item_h value = NULL;
-
- rpc_port_autofill_svc_response_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->list_autofill_svc_response_items = g_list_append(h->list_autofill_svc_response_items, value);
- }
- } while (0);
-}
-
-int rpc_port_list_autofill_svc_response_item_create(rpc_port_list_autofill_svc_response_item_h *h)
-{
- struct list_autofill_svc_response_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct list_autofill_svc_response_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __list_autofill_svc_response_item_to;
- handle->parcelable.from = __list_autofill_svc_response_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_item_destroy(rpc_port_list_autofill_svc_response_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_response_items;
- while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
- if (value)
- rpc_port_autofill_svc_response_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->list_autofill_svc_response_items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_item_clone(rpc_port_list_autofill_svc_response_item_h h, rpc_port_list_autofill_svc_response_item_h *clone)
-{
- rpc_port_list_autofill_svc_response_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_list_autofill_svc_response_item_create(&handle);
- if (!handle) {
- _E("Failed to create list_autofill_svc_response_item handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_response_items;
- while (iter) {
- rpc_port_autofill_svc_response_item_h new_value;
- rpc_port_autofill_svc_response_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_list_autofill_svc_response_item_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_svc_response_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_list_autofill_svc_response_item_destroy(handle);
- return -1;
- }
-
- handle->list_autofill_svc_response_items = g_list_append(handle->list_autofill_svc_response_items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_item_add_list_autofill_svc_response_items(rpc_port_list_autofill_svc_response_item_h h, rpc_port_autofill_svc_response_item_h list_autofill_svc_response_items)
-{
- if (!h || !list_autofill_svc_response_items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_svc_response_item_h value = NULL;
-
- rpc_port_autofill_svc_response_item_clone(list_autofill_svc_response_items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->list_autofill_svc_response_items = g_list_append(h->list_autofill_svc_response_items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_item_foreach_list_autofill_svc_response_items(rpc_port_list_autofill_svc_response_item_h h,
- bool (*callback)(rpc_port_autofill_svc_response_item_h list_autofill_svc_response_items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_response_items;
- while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_item_remove_list_autofill_svc_response_items(rpc_port_list_autofill_svc_response_item_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->list_autofill_svc_response_items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_svc_response_item_h value = iter->data;
- h->list_autofill_svc_response_items = g_list_remove_link(h->list_autofill_svc_response_items, iter);
- rpc_port_autofill_svc_response_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_response_item_get_list_autofill_svc_response_items_length(rpc_port_list_autofill_svc_response_item_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->list_autofill_svc_response_items);
-
- return 0;
-}
-
-struct list_autofill_svc_save_item_s {
- rpc_port_parcelable_t parcelable;
- GList *list_autofill_svc_save_items;
-};
-
-static void __list_autofill_svc_save_item_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_svc_save_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_svc_save_items));
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_save_items;
- while (iter) {
- rpc_port_autofill_svc_save_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
- rpc_port_parcel_write(parcel, &value->parcelable, value);
- }
- } while (0);
-}
-
-static void __list_autofill_svc_save_item_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_list_autofill_svc_save_item_h h = data;
-
- if (!parcel || !h) {
- _E("Invalid parameter");
- return;
- }
-
- do {
- int len = 0;
-
- rpc_port_parcel_read_array_count(parcel, &len);
- for (int i = 0; i < len; i++) {
- rpc_port_autofill_svc_save_item_h value = NULL;
-
- rpc_port_autofill_svc_save_item_create(&value);
- if (!value) {
- _E("Failed to create handle");
- return;
- }
-
- rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->list_autofill_svc_save_items = g_list_append(h->list_autofill_svc_save_items, value);
- }
- } while (0);
-}
-
-int rpc_port_list_autofill_svc_save_item_create(rpc_port_list_autofill_svc_save_item_h *h)
-{
- struct list_autofill_svc_save_item_s *handle;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct list_autofill_svc_save_item_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __list_autofill_svc_save_item_to;
- handle->parcelable.from = __list_autofill_svc_save_item_from;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_save_item_destroy(rpc_port_list_autofill_svc_save_item_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_save_items;
- while (iter) {
- rpc_port_autofill_svc_save_item_h value = iter->data;
- if (value)
- rpc_port_autofill_svc_save_item_destroy(value);
-
- iter = g_list_next(iter);
- }
- g_list_free(h->list_autofill_svc_save_items);
- } while (0);
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_save_item_clone(rpc_port_list_autofill_svc_save_item_h h, rpc_port_list_autofill_svc_save_item_h *clone)
-{
- rpc_port_list_autofill_svc_save_item_h handle = NULL;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- rpc_port_list_autofill_svc_save_item_create(&handle);
- if (!handle) {
- _E("Failed to create list_autofill_svc_save_item handle");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_save_items;
- while (iter) {
- rpc_port_autofill_svc_save_item_h new_value;
- rpc_port_autofill_svc_save_item_h value = iter->data;
-
- if (!value) {
- _E("Error: value is NULL");
- rpc_port_list_autofill_svc_save_item_destroy(handle);
- return -1;
- }
-
- rpc_port_autofill_svc_save_item_clone(value, &new_value);
- if (!new_value) {
- _E("Failed to duplicate value");
- rpc_port_list_autofill_svc_save_item_destroy(handle);
- return -1;
- }
-
- handle->list_autofill_svc_save_items = g_list_append(handle->list_autofill_svc_save_items, new_value);
- iter = g_list_next(iter);
- }
- } while (0);
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_save_item_add_list_autofill_svc_save_items(rpc_port_list_autofill_svc_save_item_h h, rpc_port_autofill_svc_save_item_h list_autofill_svc_save_items)
-{
- if (!h || !list_autofill_svc_save_items) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- rpc_port_autofill_svc_save_item_h value = NULL;
-
- rpc_port_autofill_svc_save_item_clone(list_autofill_svc_save_items, &value);
- if (!value) {
- _E("Out of memory");
- return -1;
- }
-
- h->list_autofill_svc_save_items = g_list_append(h->list_autofill_svc_save_items, value);
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_save_item_foreach_list_autofill_svc_save_items(rpc_port_list_autofill_svc_save_item_h h,
- bool (*callback)(rpc_port_autofill_svc_save_item_h list_autofill_svc_save_items, void *user_data), void *user_data)
-{
- if (!h || !callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- do {
- GList *iter;
-
- iter = h->list_autofill_svc_save_items;
- while (iter) {
- rpc_port_autofill_svc_save_item_h value = iter->data;
-
- iter = g_list_next(iter);
- if (!value) {
- _W("Warning: value is NULL");
- continue;
- }
-
- bool ret = callback(value, user_data);
- if (!ret)
- break;
- }
- } while (0);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_save_item_remove_list_autofill_svc_save_items(rpc_port_list_autofill_svc_save_item_h h, unsigned int nth)
-{
- GList *iter;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- iter = g_list_nth(h->list_autofill_svc_save_items, nth);
- if (iter == NULL)
- return -1;
-
- rpc_port_autofill_svc_save_item_h value = iter->data;
- h->list_autofill_svc_save_items = g_list_remove_link(h->list_autofill_svc_save_items, iter);
- rpc_port_autofill_svc_save_item_destroy(value);
- g_list_free(iter);
-
- return 0;
-}
-
-int rpc_port_list_autofill_svc_save_item_get_list_autofill_svc_save_items_length(rpc_port_list_autofill_svc_save_item_h h, unsigned int *length)
-{
- if (!h || !length) {
- _E("Invalid parameter");
- return -1;
- }
-
- *length = g_list_length(h->list_autofill_svc_save_items);
-
- return 0;
-}
-
-enum AutofillSvcPort_method_e {
- AutofillSvcPort_METHOD_Result,
- AutofillSvcPort_METHOD_Callback,
- AutofillSvcPort_METHOD_Register,
- AutofillSvcPort_METHOD_Unregister,
- AutofillSvcPort_METHOD_request_auth_info,
- AutofillSvcPort_METHOD_send_fill_request,
- AutofillSvcPort_METHOD_commit,
- AutofillSvcPort_METHOD_request_terminate,
- AutofillSvcPort_METHOD_cancel_fill_request,
-};
-
-enum AutofillSvcPort_delegate_e {
- AutofillSvcPort_DELEGATE_autofill_svc_auth_info_cb = 1,
- AutofillSvcPort_DELEGATE_autofill_svc_fill_response_cb = 2,
- AutofillSvcPort_DELEGATE_autofill_svc_send_error_cb = 3,
-};
-
-static rpc_port_stub_h __AutofillSvcPort_stub;
-static rpc_port_stub_AutofillSvcPort_callback_s __AutofillSvcPort_callback;
-static void *__AutofillSvcPort_user_data;
-static GList *__AutofillSvcPort_contexts;
-
-struct AutofillSvcPort_context_s {
- char *sender;
- char *instance;
- rpc_port_h port;
- void *tag;
- rpc_port_stub_AutofillSvcPort_callback_s callback;
- void *user_data;
-};
-
-static struct AutofillSvcPort_context_s *__create_AutofillSvcPort_context(const char *sender, const char *instance)
-{
- struct AutofillSvcPort_context_s *handle;
-
- handle = calloc(1, sizeof(struct AutofillSvcPort_context_s));
- if (!handle) {
- _E("Out of memory");
- return NULL;
- }
-
- handle->sender = strdup(sender);
- if (!handle->sender) {
- _E("Out of memory");
- free(handle);
- return NULL;
- }
-
- handle->instance = strdup(instance);
- if (!handle->instance) {
- _E("Out of memory");
- free(handle->sender);
- free(handle);
- return NULL;
- }
-
- handle->callback = __AutofillSvcPort_callback;
- handle->user_data = __AutofillSvcPort_user_data;
-
- return handle;
-}
-
-static void __destroy_AutofillSvcPort_context(gpointer data)
-{
- struct AutofillSvcPort_context_s *handle = data;
-
- if (!handle) {
- _E("Critical error!");
- return;
- }
-
- free(handle->instance);
- free(handle->sender);
-
- free(handle);
-}
-
-static struct AutofillSvcPort_context_s *__find_AutofillSvcPort_context(const char *instance)
-{
- struct AutofillSvcPort_context_s *handle;
- GList *iter;
-
- iter = __AutofillSvcPort_contexts;
- while (iter) {
- handle = (struct AutofillSvcPort_context_s *)iter->data;
- if (!strcmp(handle->instance, instance))
- return handle;
- iter = g_list_next(iter);
- }
-
- return NULL;
-}
-
-int rpc_port_stub_AutofillSvcPort_context_set_tag(rpc_port_stub_AutofillSvcPort_context_h ctx, void *tag)
-{
- if (!ctx) {
- _E("Invalid parameter");
- return -1;
- }
-
- ctx->tag = tag;
-
- return 0;
-}
-
-int rpc_port_stub_AutofillSvcPort_context_get_tag(rpc_port_stub_AutofillSvcPort_context_h ctx, void **tag)
-{
- if (!ctx || !tag) {
- _E("Invalid parameter");
- return -1;
- }
-
- *tag = ctx->tag;
-
- return 0;
-}
-
-int rpc_port_stub_AutofillSvcPort_context_get_sender(rpc_port_stub_AutofillSvcPort_context_h ctx, char **sender)
-{
- if (!ctx || !sender) {
- _E("Invalid parameter");
- return -1;
- }
-
- *sender = strdup(ctx->sender);
- if (*sender == NULL) {
- _E("Out of memory");
- return -1;
- }
-
- return 0;
-}
-
-struct AutofillSvcPort_autofill_svc_auth_info_cb_s {
- rpc_port_parcelable_t parcelable;
- rpc_port_h port;
- int id;
- int seq_id;
- bool once;
- bool valid;
-};
-
-static void __AutofillSvcPort_autofill_svc_auth_info_cb_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_int32(parcel, handle->id);
- rpc_port_parcel_write_int32(parcel, handle->seq_id);
- rpc_port_parcel_write_bool(parcel, handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-static void __AutofillSvcPort_autofill_svc_auth_info_cb_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_int32(parcel, &handle->id);
- rpc_port_parcel_read_int32(parcel, &handle->seq_id);
- rpc_port_parcel_read_bool(parcel, &handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-static int rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_create(rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h *h)
-{
- struct AutofillSvcPort_autofill_svc_auth_info_cb_s *handle;
- static int seq_num;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct AutofillSvcPort_autofill_svc_auth_info_cb_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __AutofillSvcPort_autofill_svc_auth_info_cb_to;
- handle->parcelable.from = __AutofillSvcPort_autofill_svc_auth_info_cb_from;
- handle->id = AutofillSvcPort_DELEGATE_autofill_svc_auth_info_cb;
- handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
- handle->once = false;
- handle->valid = true;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_clone(rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h h, rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h *clone)
-{
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h handle;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct AutofillSvcPort_autofill_svc_auth_info_cb_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable = h->parcelable;
- handle->port = h->port;
- handle->id = h->id;
- handle->seq_id = h->seq_id;
- handle->once = h->once;
- handle->valid = h->valid;
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_invoke(rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h h, int context_id, rpc_port_autofill_svc_auth_info_h auth_info)
-{
- rpc_port_parcel_h parcel = NULL;
- int r;
-
- if (!h || !h->port) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->once && !h->valid) {
- _E("Invalid callback");
- return -1;
- }
-
- rpc_port_parcel_create(&parcel);
- if (!parcel) {
- _E("Failed to create parcel");
- return -1;
- }
-
- rpc_port_parcel_write_int32(parcel, AutofillSvcPort_METHOD_Callback);
- rpc_port_parcel_write(parcel, &h->parcelable, h);
- rpc_port_parcel_write_int32(parcel, context_id);
- rpc_port_parcel_write(parcel, &auth_info->parcelable, auth_info);
-
- r = rpc_port_parcel_send(parcel, h->port);
- rpc_port_parcel_destroy(parcel);
- h->valid = false;
-
- return r;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_set_port(rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h h, rpc_port_h port)
-{
- if (!h || !port) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->port = port;
-
- return 0;
-}
-
-struct AutofillSvcPort_autofill_svc_fill_response_cb_s {
- rpc_port_parcelable_t parcelable;
- rpc_port_h port;
- int id;
- int seq_id;
- bool once;
- bool valid;
-};
-
-static void __AutofillSvcPort_autofill_svc_fill_response_cb_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_int32(parcel, handle->id);
- rpc_port_parcel_write_int32(parcel, handle->seq_id);
- rpc_port_parcel_write_bool(parcel, handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-static void __AutofillSvcPort_autofill_svc_fill_response_cb_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_int32(parcel, &handle->id);
- rpc_port_parcel_read_int32(parcel, &handle->seq_id);
- rpc_port_parcel_read_bool(parcel, &handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-static int rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_create(rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h *h)
-{
- struct AutofillSvcPort_autofill_svc_fill_response_cb_s *handle;
- static int seq_num;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct AutofillSvcPort_autofill_svc_fill_response_cb_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __AutofillSvcPort_autofill_svc_fill_response_cb_to;
- handle->parcelable.from = __AutofillSvcPort_autofill_svc_fill_response_cb_from;
- handle->id = AutofillSvcPort_DELEGATE_autofill_svc_fill_response_cb;
- handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
- handle->once = false;
- handle->valid = true;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_clone(rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h h, rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h *clone)
-{
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h handle;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct AutofillSvcPort_autofill_svc_fill_response_cb_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable = h->parcelable;
- handle->port = h->port;
- handle->id = h->id;
- handle->seq_id = h->seq_id;
- handle->once = h->once;
- handle->valid = h->valid;
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_invoke(rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h h, int context_id, rpc_port_autofill_svc_fill_response_h response)
-{
- rpc_port_parcel_h parcel = NULL;
- int r;
-
- if (!h || !h->port) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->once && !h->valid) {
- _E("Invalid callback");
- return -1;
- }
-
- rpc_port_parcel_create(&parcel);
- if (!parcel) {
- _E("Failed to create parcel");
- return -1;
- }
-
- rpc_port_parcel_write_int32(parcel, AutofillSvcPort_METHOD_Callback);
- rpc_port_parcel_write(parcel, &h->parcelable, h);
- rpc_port_parcel_write_int32(parcel, context_id);
- rpc_port_parcel_write(parcel, &response->parcelable, response);
-
- r = rpc_port_parcel_send(parcel, h->port);
- rpc_port_parcel_destroy(parcel);
- h->valid = false;
-
- return r;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_set_port(rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h h, rpc_port_h port)
-{
- if (!h || !port) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->port = port;
-
- return 0;
-}
-
-struct AutofillSvcPort_autofill_svc_send_error_cb_s {
- rpc_port_parcelable_t parcelable;
- rpc_port_h port;
- int id;
- int seq_id;
- bool once;
- bool valid;
-};
-
-static void __AutofillSvcPort_autofill_svc_send_error_cb_to(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_write_int32(parcel, handle->id);
- rpc_port_parcel_write_int32(parcel, handle->seq_id);
- rpc_port_parcel_write_bool(parcel, handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-static void __AutofillSvcPort_autofill_svc_send_error_cb_from(rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h handle = data;
-
- if (!handle) {
- _E("Invalid parameter");
- return;
- }
-
- rpc_port_parcel_read_int32(parcel, &handle->id);
- rpc_port_parcel_read_int32(parcel, &handle->seq_id);
- rpc_port_parcel_read_bool(parcel, &handle->once);
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-}
-
-static int rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_create(rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h *h)
-{
- struct AutofillSvcPort_autofill_svc_send_error_cb_s *handle;
- static int seq_num;
-
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct AutofillSvcPort_autofill_svc_send_error_cb_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable.to = __AutofillSvcPort_autofill_svc_send_error_cb_to;
- handle->parcelable.from = __AutofillSvcPort_autofill_svc_send_error_cb_from;
- handle->id = AutofillSvcPort_DELEGATE_autofill_svc_send_error_cb;
- handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
- handle->once = false;
- handle->valid = true;
-
- *h = handle;
-
- return 0;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_destroy(rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h h)
-{
- if (!h) {
- _E("Invalid parameter");
- return -1;
- }
-
- free(h);
-
- return 0;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_clone(rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h h, rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h *clone)
-{
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h handle;
-
- if (!h || !clone) {
- _E("Invalid parameter");
- return -1;
- }
-
- handle = calloc(1, sizeof(struct AutofillSvcPort_autofill_svc_send_error_cb_s));
- if (!handle) {
- _E("Out of memory");
- return -1;
- }
-
- handle->parcelable = h->parcelable;
- handle->port = h->port;
- handle->id = h->id;
- handle->seq_id = h->seq_id;
- handle->once = h->once;
- handle->valid = h->valid;
- _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
-
- *clone = handle;
-
- return 0;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_invoke(rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h h, int context_id, rpc_port_autofill_svc_error_info_h error_info)
-{
- rpc_port_parcel_h parcel = NULL;
- int r;
-
- if (!h || !h->port) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (h->once && !h->valid) {
- _E("Invalid callback");
- return -1;
- }
-
- rpc_port_parcel_create(&parcel);
- if (!parcel) {
- _E("Failed to create parcel");
- return -1;
- }
-
- rpc_port_parcel_write_int32(parcel, AutofillSvcPort_METHOD_Callback);
- rpc_port_parcel_write(parcel, &h->parcelable, h);
- rpc_port_parcel_write_int32(parcel, context_id);
- rpc_port_parcel_write(parcel, &error_info->parcelable, error_info);
-
- r = rpc_port_parcel_send(parcel, h->port);
- rpc_port_parcel_destroy(parcel);
- h->valid = false;
-
- return r;
-}
-
-int rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_set_port(rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h h, rpc_port_h port)
-{
- if (!h || !port) {
- _E("Invalid parameter");
- return -1;
- }
-
- h->port = port;
-
- return 0;
-}
-
-static int __AutofillSvcPort_method_Register(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_stub_AutofillSvcPort_context_h context = data;
- rpc_port_h callback_port;
- int r;
-
- r = rpc_port_stub_get_port(__AutofillSvcPort_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
- if (r != 0) {
- _E("Failed to get callback port");
- return -1;
- }
-
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb = NULL;
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_cb = NULL;
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb = NULL;
-
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_create(&auth_info_cb);
-
- if (!auth_info_cb) {
- _E("Failed to create handle");
- return -1;
- }
-
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_set_port(auth_info_cb, callback_port);
- rpc_port_parcel_read(parcel, &auth_info_cb->parcelable, auth_info_cb);
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_create(&fill_response_cb);
-
- if (!fill_response_cb) {
- _E("Failed to create handle");
- return -1;
- }
-
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_set_port(fill_response_cb, callback_port);
- rpc_port_parcel_read(parcel, &fill_response_cb->parcelable, fill_response_cb);
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_create(&send_error_cb);
-
- if (!send_error_cb) {
- _E("Failed to create handle");
- return -1;
- }
-
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_set_port(send_error_cb, callback_port);
- rpc_port_parcel_read(parcel, &send_error_cb->parcelable, send_error_cb);
-
- int ret = context->callback.Register(context, auth_info_cb, fill_response_cb, send_error_cb, context->user_data);
- do {
- rpc_port_parcel_h result;
-
- rpc_port_parcel_create(&result);
- rpc_port_parcel_write_int32(result, AutofillSvcPort_METHOD_Result);
- rpc_port_parcel_write_int32(result, ret);
- r = rpc_port_parcel_send(result, port);
- rpc_port_parcel_destroy(result);
- } while (0);
-
- rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(auth_info_cb);
- rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(fill_response_cb);
- rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_destroy(send_error_cb);
- return r;
-}
-
-static int __AutofillSvcPort_method_Unregister(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_stub_AutofillSvcPort_context_h context = data;
- rpc_port_h callback_port;
- int r;
-
- r = rpc_port_stub_get_port(__AutofillSvcPort_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
- if (r != 0) {
- _E("Failed to get callback port");
- return -1;
- }
-
- context->callback.Unregister(context, context->user_data);
-
- return r;
-}
-
-static int __AutofillSvcPort_method_request_auth_info(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_stub_AutofillSvcPort_context_h context = data;
- rpc_port_h callback_port;
- int r;
-
- r = rpc_port_stub_get_port(__AutofillSvcPort_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
- if (r != 0) {
- _E("Failed to get callback port");
- return -1;
- }
-
- int context_id;
- rpc_port_autofill_svc_view_info_h vi = NULL;
-
- rpc_port_parcel_read_int32(parcel, &context_id);
- rpc_port_autofill_svc_view_info_create(&vi);
- rpc_port_parcel_read(parcel, &vi->parcelable, vi);
-
- context->callback.request_auth_info(context, context_id, vi, context->user_data);
-
- rpc_port_autofill_svc_view_info_destroy(vi);
- return r;
-}
-
-static int __AutofillSvcPort_method_send_fill_request(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_stub_AutofillSvcPort_context_h context = data;
- rpc_port_h callback_port;
- int r;
-
- r = rpc_port_stub_get_port(__AutofillSvcPort_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
- if (r != 0) {
- _E("Failed to get callback port");
- return -1;
- }
-
- int context_id;
- rpc_port_autofill_svc_view_info_h vi = NULL;
-
- rpc_port_parcel_read_int32(parcel, &context_id);
- rpc_port_autofill_svc_view_info_create(&vi);
- rpc_port_parcel_read(parcel, &vi->parcelable, vi);
-
- context->callback.send_fill_request(context, context_id, vi, context->user_data);
-
- rpc_port_autofill_svc_view_info_destroy(vi);
- return r;
-}
-
-static int __AutofillSvcPort_method_commit(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_stub_AutofillSvcPort_context_h context = data;
- rpc_port_h callback_port;
- int r;
-
- r = rpc_port_stub_get_port(__AutofillSvcPort_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
- if (r != 0) {
- _E("Failed to get callback port");
- return -1;
- }
-
- int context_id;
- rpc_port_autofill_svc_save_view_info_h si = NULL;
-
- rpc_port_parcel_read_int32(parcel, &context_id);
- rpc_port_autofill_svc_save_view_info_create(&si);
- rpc_port_parcel_read(parcel, &si->parcelable, si);
-
- context->callback.commit(context, context_id, si, context->user_data);
-
- rpc_port_autofill_svc_save_view_info_destroy(si);
- return r;
-}
-
-static int __AutofillSvcPort_method_request_terminate(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_stub_AutofillSvcPort_context_h context = data;
- rpc_port_h callback_port;
- int r;
-
- r = rpc_port_stub_get_port(__AutofillSvcPort_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
- if (r != 0) {
- _E("Failed to get callback port");
- return -1;
- }
-
- context->callback.request_terminate(context, context->user_data);
-
- return r;
-}
-
-static int __AutofillSvcPort_method_cancel_fill_request(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
-{
- rpc_port_stub_AutofillSvcPort_context_h context = data;
- rpc_port_h callback_port;
- int r;
-
- r = rpc_port_stub_get_port(__AutofillSvcPort_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
- if (r != 0) {
- _E("Failed to get callback port");
- return -1;
- }
-
- int context_id;
- rpc_port_autofill_svc_view_info_h vi = NULL;
-
- rpc_port_parcel_read_int32(parcel, &context_id);
- rpc_port_autofill_svc_view_info_create(&vi);
- rpc_port_parcel_read(parcel, &vi->parcelable, vi);
-
- context->callback.cancel_fill_request(context, context_id, vi, context->user_data);
-
- rpc_port_autofill_svc_view_info_destroy(vi);
- return r;
-}
-
-static stub_method __AutofillSvcPort_method_table[] = {
- [AutofillSvcPort_METHOD_Register] = __AutofillSvcPort_method_Register,
- [AutofillSvcPort_METHOD_Unregister] = __AutofillSvcPort_method_Unregister,
- [AutofillSvcPort_METHOD_request_auth_info] = __AutofillSvcPort_method_request_auth_info,
- [AutofillSvcPort_METHOD_send_fill_request] = __AutofillSvcPort_method_send_fill_request,
- [AutofillSvcPort_METHOD_commit] = __AutofillSvcPort_method_commit,
- [AutofillSvcPort_METHOD_request_terminate] = __AutofillSvcPort_method_request_terminate,
- [AutofillSvcPort_METHOD_cancel_fill_request] = __AutofillSvcPort_method_cancel_fill_request,
-};
-
-static void __AutofillSvcPort_on_connected(const char *sender, const char *instance, void *data)
-{
- rpc_port_stub_AutofillSvcPort_context_h context;
-
- _I("[__RPC_PORT__] sender(%s), instance(%s)", sender, instance);
- context = __create_AutofillSvcPort_context(sender, instance);
- if (!context)
- return;
-
- if (context->callback.create)
- context->callback.create(context, context->user_data);
- __AutofillSvcPort_contexts = g_list_append(__AutofillSvcPort_contexts, context);
-}
-
-static void __AutofillSvcPort_on_disconnected(const char *sender, const char *instance, void *data)
-{
- rpc_port_stub_AutofillSvcPort_context_h context;
-
- _I("[__RPC_PORT__] sender(%s), instance(%s)", sender, instance);
- context = __find_AutofillSvcPort_context(instance);
- if (!context)
- return;
-
- if (context->callback.terminate)
- context->callback.terminate(context, context->user_data);
- __AutofillSvcPort_contexts = g_list_remove(__AutofillSvcPort_contexts, context);
- __destroy_AutofillSvcPort_context(context);
-}
-
-static int __AutofillSvcPort_on_received(const char *sender, const char *instance, rpc_port_h port, void *data)
-{
- rpc_port_stub_AutofillSvcPort_context_h context;
- rpc_port_parcel_h parcel;
- int cmd = -1;
- int r;
-
- _I("[__RPC_PORT__] sender(%s), instance(%s)", sender, instance);
- context = __find_AutofillSvcPort_context(instance);
- if (!context) {
- _E("Failed to find AutofillSvcPort context(%s)", instance);
- return -1;
- }
-
- context->port = port;
- r = rpc_port_parcel_create_from_port(&parcel, port);
- if (r != 0) {
- _E("Failed to create parcel from port");
- return r;
- }
-
- rpc_port_parcel_read_int32(parcel, &cmd);
- if (cmd > 1 && cmd < (sizeof(__AutofillSvcPort_method_table) / sizeof(__AutofillSvcPort_method_table[0]))) {
- if (__AutofillSvcPort_method_table[cmd])
- r = __AutofillSvcPort_method_table[cmd](port, parcel, context);
- } else {
- _E("Unknown Command(%d)", cmd);
- r = -1;
- }
-
- rpc_port_parcel_destroy(parcel);
-
- return r;
-}
-
-static int __AutofillSvcPort_add_privileges(void)
-{
-
- return 0;
-}
-
-int rpc_port_stub_AutofillSvcPort_register(rpc_port_stub_AutofillSvcPort_callback_s *callback, void *user_data)
-{
- int r;
-
- if (__AutofillSvcPort_stub) {
- _W("Already exists");
- return -1;
- }
-
- if (!callback) {
- _E("Invalid parameter");
- return -1;
- }
-
- __AutofillSvcPort_callback = *callback;
- __AutofillSvcPort_user_data = user_data;
- r = rpc_port_stub_create(&__AutofillSvcPort_stub, "AutofillSvcPort");
- if (r != 0) {
- _E("Failed to create stub handle");
- return r;
- }
-
- r = rpc_port_stub_add_received_event_cb(__AutofillSvcPort_stub, __AutofillSvcPort_on_received, NULL);
- if (r != 0) {
- _E("Failed to add received event callback");
- rpc_port_stub_destroy(__AutofillSvcPort_stub);
- __AutofillSvcPort_stub = NULL;
- return r;
- }
-
- r = rpc_port_stub_add_connected_event_cb(__AutofillSvcPort_stub, __AutofillSvcPort_on_connected, NULL);
- if (r != 0) {
- _E("Failed to add connected event callback");
- rpc_port_stub_destroy(__AutofillSvcPort_stub);
- __AutofillSvcPort_stub = NULL;
- return r;
- }
-
- r = rpc_port_stub_add_disconnected_event_cb(__AutofillSvcPort_stub, __AutofillSvcPort_on_disconnected, NULL);
- if (r != 0) {
- _E("Failed to add disconnected event callback");
- rpc_port_stub_destroy(__AutofillSvcPort_stub);
- __AutofillSvcPort_stub = NULL;
- return r;
- }
-
- r = __AutofillSvcPort_add_privileges();
- if (r != 0) {
- _E("Failed to add privileges");
- rpc_port_stub_destroy(__AutofillSvcPort_stub);
- __AutofillSvcPort_stub = NULL;
- return r;
- }
-
- r = rpc_port_stub_listen(__AutofillSvcPort_stub);
- if (r != 0) {
- _E("Failed to listen stub");
- rpc_port_stub_destroy(__AutofillSvcPort_stub);
- __AutofillSvcPort_stub = NULL;
- return r;
- }
-
- return 0;
-}
-
-int rpc_port_stub_AutofillSvcPort_unregister(void)
-{
- int r;
-
- if (!__AutofillSvcPort_stub)
- return -1;
-
- if (__AutofillSvcPort_contexts) {
- g_list_free_full(__AutofillSvcPort_contexts, __destroy_AutofillSvcPort_context);
- __AutofillSvcPort_contexts = NULL;
- }
-
- r = rpc_port_stub_destroy(__AutofillSvcPort_stub);
- __AutofillSvcPort_stub = NULL;
-
- return r;
-}
-
-int rpc_port_stub_AutofillSvcPort_get_client_number(unsigned int *n)
-{
- if (!n) {
- _E("Invalid parameter");
- return -1;
- }
-
- if (!__AutofillSvcPort_stub) {
- _E("AutofillSvcPort Stub is not ready");
- return -1;
- }
-
- *n = g_list_length(__AutofillSvcPort_contexts);
-
- return 0;
-}
+++ /dev/null
-/*
- * Generated by tidlc 1.4.9.
- */
-
-#pragma once
-
-#include <stdbool.h>
-#include <bundle.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct autofill_svc_item_s *rpc_port_autofill_svc_item_h;
-
-int rpc_port_autofill_svc_item_create(rpc_port_autofill_svc_item_h *h);
-
-int rpc_port_autofill_svc_item_destroy(rpc_port_autofill_svc_item_h h);
-
-int rpc_port_autofill_svc_item_clone(rpc_port_autofill_svc_item_h h, rpc_port_autofill_svc_item_h *clone);
-
-int rpc_port_autofill_svc_item_set_id(rpc_port_autofill_svc_item_h h, const char *id);
-
-int rpc_port_autofill_svc_item_set_label(rpc_port_autofill_svc_item_h h, const char *label);
-
-int rpc_port_autofill_svc_item_set_value(rpc_port_autofill_svc_item_h h, const char *value);
-
-int rpc_port_autofill_svc_item_set_autofill_hint(rpc_port_autofill_svc_item_h h, int autofill_hint);
-
-int rpc_port_autofill_svc_item_set_is_sensitive_data(rpc_port_autofill_svc_item_h h, bool is_sensitive_data);
-
-int rpc_port_autofill_svc_item_get_id(rpc_port_autofill_svc_item_h h, char **id);
-
-int rpc_port_autofill_svc_item_get_label(rpc_port_autofill_svc_item_h h, char **label);
-
-int rpc_port_autofill_svc_item_get_value(rpc_port_autofill_svc_item_h h, char **value);
-
-int rpc_port_autofill_svc_item_get_autofill_hint(rpc_port_autofill_svc_item_h h, int *autofill_hint);
-
-int rpc_port_autofill_svc_item_get_is_sensitive_data(rpc_port_autofill_svc_item_h h, bool *is_sensitive_data);
-
-typedef struct autofill_svc_view_info_s *rpc_port_autofill_svc_view_info_h;
-
-int rpc_port_autofill_svc_view_info_create(rpc_port_autofill_svc_view_info_h *h);
-
-int rpc_port_autofill_svc_view_info_destroy(rpc_port_autofill_svc_view_info_h h);
-
-int rpc_port_autofill_svc_view_info_clone(rpc_port_autofill_svc_view_info_h h, rpc_port_autofill_svc_view_info_h *clone);
-
-int rpc_port_autofill_svc_view_info_set_app_id(rpc_port_autofill_svc_view_info_h h, const char *app_id);
-
-int rpc_port_autofill_svc_view_info_set_view_id(rpc_port_autofill_svc_view_info_h h, const char *view_id);
-
-int rpc_port_autofill_svc_view_info_add_items(rpc_port_autofill_svc_view_info_h h, rpc_port_autofill_svc_item_h items);
-
-int rpc_port_autofill_svc_view_info_get_app_id(rpc_port_autofill_svc_view_info_h h, char **app_id);
-
-int rpc_port_autofill_svc_view_info_get_view_id(rpc_port_autofill_svc_view_info_h h, char **view_id);
-
-int rpc_port_autofill_svc_view_info_foreach_items(rpc_port_autofill_svc_view_info_h h,
- bool (*callback)(rpc_port_autofill_svc_item_h items, void *user_data), void *user_data);
-
-int rpc_port_autofill_svc_view_info_remove_items(rpc_port_autofill_svc_view_info_h h, unsigned int nth);
-
-int rpc_port_autofill_svc_view_info_get_items_length(rpc_port_autofill_svc_view_info_h h, unsigned int *length);
-
-typedef struct autofill_svc_save_item_s *rpc_port_autofill_svc_save_item_h;
-
-int rpc_port_autofill_svc_save_item_create(rpc_port_autofill_svc_save_item_h *h);
-
-int rpc_port_autofill_svc_save_item_destroy(rpc_port_autofill_svc_save_item_h h);
-
-int rpc_port_autofill_svc_save_item_clone(rpc_port_autofill_svc_save_item_h h, rpc_port_autofill_svc_save_item_h *clone);
-
-int rpc_port_autofill_svc_save_item_set_id(rpc_port_autofill_svc_save_item_h h, const char *id);
-
-int rpc_port_autofill_svc_save_item_set_label(rpc_port_autofill_svc_save_item_h h, const char *label);
-
-int rpc_port_autofill_svc_save_item_set_value(rpc_port_autofill_svc_save_item_h h, const char *value);
-
-int rpc_port_autofill_svc_save_item_set_autofill_hint(rpc_port_autofill_svc_save_item_h h, int autofill_hint);
-
-int rpc_port_autofill_svc_save_item_set_is_sensitive_data(rpc_port_autofill_svc_save_item_h h, bool is_sensitive_data);
-
-int rpc_port_autofill_svc_save_item_get_id(rpc_port_autofill_svc_save_item_h h, char **id);
-
-int rpc_port_autofill_svc_save_item_get_label(rpc_port_autofill_svc_save_item_h h, char **label);
-
-int rpc_port_autofill_svc_save_item_get_value(rpc_port_autofill_svc_save_item_h h, char **value);
-
-int rpc_port_autofill_svc_save_item_get_autofill_hint(rpc_port_autofill_svc_save_item_h h, int *autofill_hint);
-
-int rpc_port_autofill_svc_save_item_get_is_sensitive_data(rpc_port_autofill_svc_save_item_h h, bool *is_sensitive_data);
-
-typedef struct autofill_svc_save_view_info_s *rpc_port_autofill_svc_save_view_info_h;
-
-int rpc_port_autofill_svc_save_view_info_create(rpc_port_autofill_svc_save_view_info_h *h);
-
-int rpc_port_autofill_svc_save_view_info_destroy(rpc_port_autofill_svc_save_view_info_h h);
-
-int rpc_port_autofill_svc_save_view_info_clone(rpc_port_autofill_svc_save_view_info_h h, rpc_port_autofill_svc_save_view_info_h *clone);
-
-int rpc_port_autofill_svc_save_view_info_set_app_id(rpc_port_autofill_svc_save_view_info_h h, const char *app_id);
-
-int rpc_port_autofill_svc_save_view_info_set_view_id(rpc_port_autofill_svc_save_view_info_h h, const char *view_id);
-
-int rpc_port_autofill_svc_save_view_info_set_view_title(rpc_port_autofill_svc_save_view_info_h h, const char *view_title);
-
-int rpc_port_autofill_svc_save_view_info_add_items(rpc_port_autofill_svc_save_view_info_h h, rpc_port_autofill_svc_save_item_h items);
-
-int rpc_port_autofill_svc_save_view_info_get_app_id(rpc_port_autofill_svc_save_view_info_h h, char **app_id);
-
-int rpc_port_autofill_svc_save_view_info_get_view_id(rpc_port_autofill_svc_save_view_info_h h, char **view_id);
-
-int rpc_port_autofill_svc_save_view_info_get_view_title(rpc_port_autofill_svc_save_view_info_h h, char **view_title);
-
-int rpc_port_autofill_svc_save_view_info_foreach_items(rpc_port_autofill_svc_save_view_info_h h,
- bool (*callback)(rpc_port_autofill_svc_save_item_h items, void *user_data), void *user_data);
-
-int rpc_port_autofill_svc_save_view_info_remove_items(rpc_port_autofill_svc_save_view_info_h h, unsigned int nth);
-
-int rpc_port_autofill_svc_save_view_info_get_items_length(rpc_port_autofill_svc_save_view_info_h h, unsigned int *length);
-
-typedef struct autofill_svc_auth_info_s *rpc_port_autofill_svc_auth_info_h;
-
-int rpc_port_autofill_svc_auth_info_create(rpc_port_autofill_svc_auth_info_h *h);
-
-int rpc_port_autofill_svc_auth_info_destroy(rpc_port_autofill_svc_auth_info_h h);
-
-int rpc_port_autofill_svc_auth_info_clone(rpc_port_autofill_svc_auth_info_h h, rpc_port_autofill_svc_auth_info_h *clone);
-
-int rpc_port_autofill_svc_auth_info_set_app_id(rpc_port_autofill_svc_auth_info_h h, const char *app_id);
-
-int rpc_port_autofill_svc_auth_info_set_view_id(rpc_port_autofill_svc_auth_info_h h, const char *view_id);
-
-int rpc_port_autofill_svc_auth_info_set_exist_autofill_data(rpc_port_autofill_svc_auth_info_h h, bool exist_autofill_data);
-
-int rpc_port_autofill_svc_auth_info_set_need_authentication(rpc_port_autofill_svc_auth_info_h h, bool need_authentication);
-
-int rpc_port_autofill_svc_auth_info_set_service_name(rpc_port_autofill_svc_auth_info_h h, const char *service_name);
-
-int rpc_port_autofill_svc_auth_info_set_service_logo_image_path(rpc_port_autofill_svc_auth_info_h h, const char *service_logo_image_path);
-
-int rpc_port_autofill_svc_auth_info_set_service_message(rpc_port_autofill_svc_auth_info_h h, const char *service_message);
-
-int rpc_port_autofill_svc_auth_info_get_app_id(rpc_port_autofill_svc_auth_info_h h, char **app_id);
-
-int rpc_port_autofill_svc_auth_info_get_view_id(rpc_port_autofill_svc_auth_info_h h, char **view_id);
-
-int rpc_port_autofill_svc_auth_info_get_exist_autofill_data(rpc_port_autofill_svc_auth_info_h h, bool *exist_autofill_data);
-
-int rpc_port_autofill_svc_auth_info_get_need_authentication(rpc_port_autofill_svc_auth_info_h h, bool *need_authentication);
-
-int rpc_port_autofill_svc_auth_info_get_service_name(rpc_port_autofill_svc_auth_info_h h, char **service_name);
-
-int rpc_port_autofill_svc_auth_info_get_service_logo_image_path(rpc_port_autofill_svc_auth_info_h h, char **service_logo_image_path);
-
-int rpc_port_autofill_svc_auth_info_get_service_message(rpc_port_autofill_svc_auth_info_h h, char **service_message);
-
-typedef struct autofill_svc_response_item_s *rpc_port_autofill_svc_response_item_h;
-
-int rpc_port_autofill_svc_response_item_create(rpc_port_autofill_svc_response_item_h *h);
-
-int rpc_port_autofill_svc_response_item_destroy(rpc_port_autofill_svc_response_item_h h);
-
-int rpc_port_autofill_svc_response_item_clone(rpc_port_autofill_svc_response_item_h h, rpc_port_autofill_svc_response_item_h *clone);
-
-int rpc_port_autofill_svc_response_item_set_id(rpc_port_autofill_svc_response_item_h h, const char *id);
-
-int rpc_port_autofill_svc_response_item_set_presentation_text(rpc_port_autofill_svc_response_item_h h, const char *presentation_text);
-
-int rpc_port_autofill_svc_response_item_set_value(rpc_port_autofill_svc_response_item_h h, const char *value);
-
-int rpc_port_autofill_svc_response_item_set_autofill_hint(rpc_port_autofill_svc_response_item_h h, int autofill_hint);
-
-int rpc_port_autofill_svc_response_item_get_id(rpc_port_autofill_svc_response_item_h h, char **id);
-
-int rpc_port_autofill_svc_response_item_get_presentation_text(rpc_port_autofill_svc_response_item_h h, char **presentation_text);
-
-int rpc_port_autofill_svc_response_item_get_value(rpc_port_autofill_svc_response_item_h h, char **value);
-
-int rpc_port_autofill_svc_response_item_get_autofill_hint(rpc_port_autofill_svc_response_item_h h, int *autofill_hint);
-
-typedef struct autofill_svc_response_group_s *rpc_port_autofill_svc_response_group_h;
-
-int rpc_port_autofill_svc_response_group_create(rpc_port_autofill_svc_response_group_h *h);
-
-int rpc_port_autofill_svc_response_group_destroy(rpc_port_autofill_svc_response_group_h h);
-
-int rpc_port_autofill_svc_response_group_clone(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h *clone);
-
-int rpc_port_autofill_svc_response_group_add_response_items(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_item_h response_items);
-
-int rpc_port_autofill_svc_response_group_foreach_response_items(rpc_port_autofill_svc_response_group_h h,
- bool (*callback)(rpc_port_autofill_svc_response_item_h response_items, void *user_data), void *user_data);
-
-int rpc_port_autofill_svc_response_group_remove_response_items(rpc_port_autofill_svc_response_group_h h, unsigned int nth);
-
-int rpc_port_autofill_svc_response_group_get_response_items_length(rpc_port_autofill_svc_response_group_h h, unsigned int *length);
-
-typedef struct autofill_svc_fill_response_s *rpc_port_autofill_svc_fill_response_h;
-
-int rpc_port_autofill_svc_fill_response_create(rpc_port_autofill_svc_fill_response_h *h);
-
-int rpc_port_autofill_svc_fill_response_destroy(rpc_port_autofill_svc_fill_response_h h);
-
-int rpc_port_autofill_svc_fill_response_clone(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_fill_response_h *clone);
-
-int rpc_port_autofill_svc_fill_response_set_app_id(rpc_port_autofill_svc_fill_response_h h, const char *app_id);
-
-int rpc_port_autofill_svc_fill_response_set_view_id(rpc_port_autofill_svc_fill_response_h h, const char *view_id);
-
-int rpc_port_autofill_svc_fill_response_add_response_groups(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_response_group_h response_groups);
-
-int rpc_port_autofill_svc_fill_response_get_app_id(rpc_port_autofill_svc_fill_response_h h, char **app_id);
-
-int rpc_port_autofill_svc_fill_response_get_view_id(rpc_port_autofill_svc_fill_response_h h, char **view_id);
-
-int rpc_port_autofill_svc_fill_response_foreach_response_groups(rpc_port_autofill_svc_fill_response_h h,
- bool (*callback)(rpc_port_autofill_svc_response_group_h response_groups, void *user_data), void *user_data);
-
-int rpc_port_autofill_svc_fill_response_remove_response_groups(rpc_port_autofill_svc_fill_response_h h, unsigned int nth);
-
-int rpc_port_autofill_svc_fill_response_get_response_groups_length(rpc_port_autofill_svc_fill_response_h h, unsigned int *length);
-
-typedef struct autofill_svc_error_info_s *rpc_port_autofill_svc_error_info_h;
-
-int rpc_port_autofill_svc_error_info_create(rpc_port_autofill_svc_error_info_h *h);
-
-int rpc_port_autofill_svc_error_info_destroy(rpc_port_autofill_svc_error_info_h h);
-
-int rpc_port_autofill_svc_error_info_clone(rpc_port_autofill_svc_error_info_h h, rpc_port_autofill_svc_error_info_h *clone);
-
-int rpc_port_autofill_svc_error_info_set_app_id(rpc_port_autofill_svc_error_info_h h, const char *app_id);
-
-int rpc_port_autofill_svc_error_info_set_error_code(rpc_port_autofill_svc_error_info_h h, int error_code);
-
-int rpc_port_autofill_svc_error_info_get_app_id(rpc_port_autofill_svc_error_info_h h, char **app_id);
-
-int rpc_port_autofill_svc_error_info_get_error_code(rpc_port_autofill_svc_error_info_h h, int *error_code);
-
-typedef struct list_autofill_svc_item_s *rpc_port_list_autofill_svc_item_h;
-
-int rpc_port_list_autofill_svc_item_create(rpc_port_list_autofill_svc_item_h *h);
-
-int rpc_port_list_autofill_svc_item_destroy(rpc_port_list_autofill_svc_item_h h);
-
-int rpc_port_list_autofill_svc_item_clone(rpc_port_list_autofill_svc_item_h h, rpc_port_list_autofill_svc_item_h *clone);
-
-int rpc_port_list_autofill_svc_item_add_list_autofill_svc_items(rpc_port_list_autofill_svc_item_h h, rpc_port_autofill_svc_item_h list_autofill_svc_items);
-
-int rpc_port_list_autofill_svc_item_foreach_list_autofill_svc_items(rpc_port_list_autofill_svc_item_h h,
- bool (*callback)(rpc_port_autofill_svc_item_h list_autofill_svc_items, void *user_data), void *user_data);
-
-int rpc_port_list_autofill_svc_item_remove_list_autofill_svc_items(rpc_port_list_autofill_svc_item_h h, unsigned int nth);
-
-int rpc_port_list_autofill_svc_item_get_list_autofill_svc_items_length(rpc_port_list_autofill_svc_item_h h, unsigned int *length);
-
-typedef struct list_autofill_svc_response_group_s *rpc_port_list_autofill_svc_response_group_h;
-
-int rpc_port_list_autofill_svc_response_group_create(rpc_port_list_autofill_svc_response_group_h *h);
-
-int rpc_port_list_autofill_svc_response_group_destroy(rpc_port_list_autofill_svc_response_group_h h);
-
-int rpc_port_list_autofill_svc_response_group_clone(rpc_port_list_autofill_svc_response_group_h h, rpc_port_list_autofill_svc_response_group_h *clone);
-
-int rpc_port_list_autofill_svc_response_group_add_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups);
-
-int rpc_port_list_autofill_svc_response_group_foreach_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h,
- bool (*callback)(rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups, void *user_data), void *user_data);
-
-int rpc_port_list_autofill_svc_response_group_remove_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, unsigned int nth);
-
-int rpc_port_list_autofill_svc_response_group_get_list_autofill_svc_response_groups_length(rpc_port_list_autofill_svc_response_group_h h, unsigned int *length);
-
-typedef struct list_autofill_svc_response_item_s *rpc_port_list_autofill_svc_response_item_h;
-
-int rpc_port_list_autofill_svc_response_item_create(rpc_port_list_autofill_svc_response_item_h *h);
-
-int rpc_port_list_autofill_svc_response_item_destroy(rpc_port_list_autofill_svc_response_item_h h);
-
-int rpc_port_list_autofill_svc_response_item_clone(rpc_port_list_autofill_svc_response_item_h h, rpc_port_list_autofill_svc_response_item_h *clone);
-
-int rpc_port_list_autofill_svc_response_item_add_list_autofill_svc_response_items(rpc_port_list_autofill_svc_response_item_h h, rpc_port_autofill_svc_response_item_h list_autofill_svc_response_items);
-
-int rpc_port_list_autofill_svc_response_item_foreach_list_autofill_svc_response_items(rpc_port_list_autofill_svc_response_item_h h,
- bool (*callback)(rpc_port_autofill_svc_response_item_h list_autofill_svc_response_items, void *user_data), void *user_data);
-
-int rpc_port_list_autofill_svc_response_item_remove_list_autofill_svc_response_items(rpc_port_list_autofill_svc_response_item_h h, unsigned int nth);
-
-int rpc_port_list_autofill_svc_response_item_get_list_autofill_svc_response_items_length(rpc_port_list_autofill_svc_response_item_h h, unsigned int *length);
-
-typedef struct list_autofill_svc_save_item_s *rpc_port_list_autofill_svc_save_item_h;
-
-int rpc_port_list_autofill_svc_save_item_create(rpc_port_list_autofill_svc_save_item_h *h);
-
-int rpc_port_list_autofill_svc_save_item_destroy(rpc_port_list_autofill_svc_save_item_h h);
-
-int rpc_port_list_autofill_svc_save_item_clone(rpc_port_list_autofill_svc_save_item_h h, rpc_port_list_autofill_svc_save_item_h *clone);
-
-int rpc_port_list_autofill_svc_save_item_add_list_autofill_svc_save_items(rpc_port_list_autofill_svc_save_item_h h, rpc_port_autofill_svc_save_item_h list_autofill_svc_save_items);
-
-int rpc_port_list_autofill_svc_save_item_foreach_list_autofill_svc_save_items(rpc_port_list_autofill_svc_save_item_h h,
- bool (*callback)(rpc_port_autofill_svc_save_item_h list_autofill_svc_save_items, void *user_data), void *user_data);
-
-int rpc_port_list_autofill_svc_save_item_remove_list_autofill_svc_save_items(rpc_port_list_autofill_svc_save_item_h h, unsigned int nth);
-
-int rpc_port_list_autofill_svc_save_item_get_list_autofill_svc_save_items_length(rpc_port_list_autofill_svc_save_item_h h, unsigned int *length);
-
-typedef struct AutofillSvcPort_context_s* rpc_port_stub_AutofillSvcPort_context_h;
-
-int rpc_port_stub_AutofillSvcPort_context_set_tag(rpc_port_stub_AutofillSvcPort_context_h ctx, void *tag);
-
-int rpc_port_stub_AutofillSvcPort_context_get_tag(rpc_port_stub_AutofillSvcPort_context_h ctx, void **tag);
-
-int rpc_port_stub_AutofillSvcPort_context_get_sender(rpc_port_stub_AutofillSvcPort_context_h ctx, char **sender);
-
-typedef struct AutofillSvcPort_autofill_svc_auth_info_cb_s *rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h;
-
-int rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h h);
-
-int rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_clone(rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h h, rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h *clone);
-
-int rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_invoke(rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h h, int context_id, rpc_port_autofill_svc_auth_info_h auth_info);
-
-typedef struct AutofillSvcPort_autofill_svc_fill_response_cb_s *rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h;
-
-int rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h h);
-
-int rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_clone(rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h h, rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h *clone);
-
-int rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_invoke(rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h h, int context_id, rpc_port_autofill_svc_fill_response_h response);
-
-typedef struct AutofillSvcPort_autofill_svc_send_error_cb_s *rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h;
-
-int rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_destroy(rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h h);
-
-int rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_clone(rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h h, rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h *clone);
-
-int rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_invoke(rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h h, int context_id, rpc_port_autofill_svc_error_info_h error_info);
-
-typedef struct {
- void (*create)(rpc_port_stub_AutofillSvcPort_context_h context, void *user_data);
- void (*terminate)(rpc_port_stub_AutofillSvcPort_context_h context, void *user_data);
-
- int (*Register)(rpc_port_stub_AutofillSvcPort_context_h context, rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb, rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_cb, rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb, void *user_data);
- void (*Unregister)(rpc_port_stub_AutofillSvcPort_context_h context, void *user_data);
- void (*request_auth_info)(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_autofill_svc_view_info_h vi, void *user_data);
- void (*send_fill_request)(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_autofill_svc_view_info_h vi, void *user_data);
- void (*commit)(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_autofill_svc_save_view_info_h si, void *user_data);
- void (*request_terminate)(rpc_port_stub_AutofillSvcPort_context_h context, void *user_data);
- void (*cancel_fill_request)(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_autofill_svc_view_info_h vi, void *user_data);
-} rpc_port_stub_AutofillSvcPort_callback_s;
-
-int rpc_port_stub_AutofillSvcPort_register(rpc_port_stub_AutofillSvcPort_callback_s *callback, void *user_data);
-
-int rpc_port_stub_AutofillSvcPort_unregister(void);
-
-int rpc_port_stub_AutofillSvcPort_get_client_number(unsigned int *n);
-
-#ifdef __cplusplus
-}
-#endif