struct autofill_manager_s {
rpc_port_proxy_AutofillManagerPort_h rpc_h;
autofill_manager_connection_status_changed_cb connection_callback;
+ bool connected;
void *connection_userdata;
};
autofill_manager_h amh = user_data;
LOGI("connected");
+ amh->connected = true;
+
if (amh->connection_callback)
amh->connection_callback(amh, AUTOFILL_MANAGER_CONNECTION_STATUS_CONNECTED, amh->connection_userdata);
}
amh->connection_callback(amh, AUTOFILL_MANAGER_CONNECTION_STATUS_DISCONNECTED, amh->connection_userdata);
amh->rpc_h = NULL;
+ amh->connected = false;
}
static void __on_rejected(rpc_port_proxy_AutofillManagerPort_h h, void *user_data)
return AUTOFILL_ERROR_OPERATION_FAILED;
}
+ if (!amh->connected) {
+ LOGW("[ERROR] Not connected");
+ return AUTOFILL_ERROR_OPERATION_FAILED;
+ }
+
bool ret = rpc_port_proxy_AutofillManagerPort_invoke_set_autofill_service(amh->rpc_h, app_id);
if (ret == false) {
LOGW("[ERROR] Failed to send rpc port. err = %d", ret);
return AUTOFILL_ERROR_OPERATION_FAILED;
}
+ if (!amh->connected) {
+ LOGW("[ERROR] Not connected");
+ return AUTOFILL_ERROR_OPERATION_FAILED;
+ }
+
char *app_id = rpc_port_proxy_AutofillManagerPort_invoke_get_autofill_service(amh->rpc_h);
if (app_id) {
LOGI("service id : %s", app_id);
free(app_id);
return AUTOFILL_ERROR_NONE;
} else {
+ LOGW("[ERROR] Failed to get autofill service app ID");
return AUTOFILL_ERROR_OPERATION_FAILED;
}
}
return AUTOFILL_ERROR_OPERATION_FAILED;
}
+ if (!amh->connected) {
+ LOGW("[ERROR] Not connected");
+ return AUTOFILL_ERROR_OPERATION_FAILED;
+ }
+
rpc_port_list_string_h app_id_list;
rpc_port_list_string_create(&app_id_list);
ret = rpc_port_proxy_AutofillManagerPort_invoke_get_autofill_service_list(amh->rpc_h, &app_id_list);