+static GVariant *dbus_setwhitebalance(GDBusConnection *conn,
+ const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
+ GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ int white_balance_type, value;
+ int ret = 0, ret_val;
+ pid_t pid;
+
+ g_variant_get(param, "(ii)", &white_balance_type, &value);
+
+ ret_val = display_white_balance_ops->set_white_balance(white_balance_type, value);
+ if (ret_val < 0) {
+ _E("Failed to set white balance");
+ ret = -EPERM;
+ }
+
+ pid = gdbus_connection_get_sender_pid(conn, sender);
+ _I("Set white balance pid=%d white balance type=%d value=%d", pid, white_balance_type, value);
+
+ return g_variant_new("(i)", ret);
+}
+
+static GVariant *dbus_getwhitebalance(GDBusConnection *conn,
+ const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
+ GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ int white_balance_type;
+ int ret = 0, ret_val;
+ pid_t pid;
+
+ g_variant_get(param, "(i)", &white_balance_type);
+
+ ret = display_white_balance_ops->get_white_balance(white_balance_type, &ret_val);
+ if (ret < 0) {
+ _E("Failed to get white balance");
+ ret = -EPERM;
+ }
+ else
+ ret = ret_val;
+
+ pid = gdbus_connection_get_sender_pid(conn, sender);
+ _I("Get white balance pid=%d white balance type=%d", pid, white_balance_type);
+
+ return g_variant_new("(i)", ret);
+}
+