#include "core/common.h"
#include "core/devices.h"
+#define DISPLAY_DIM_BRIGHTNESS 0
+
static DBusMessage *e_dbus_start(E_DBus_Object *obj, DBusMessage *msg)
{
display_device_ops.init(NULL);
return reply;
}
+static DBusMessage *e_dbus_getdisplaycount(E_DBus_Object *obj, DBusMessage *msg)
+{
+ DBusMessageIter iter;
+ DBusMessage *reply;
+ int cmd, cnt, ret;
+
+ cmd = DISP_CMD(PROP_DISPLAY_DISPLAY_COUNT, DEFAULT_DISPLAY);
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, cmd, &cnt);
+ if (ret >= 0)
+ ret = cnt;
+
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);
+ return reply;
+}
+
static DBusMessage *e_dbus_getbrightness(E_DBus_Object *obj, DBusMessage *msg)
{
DBusMessageIter iter;
DBusMessage *reply;
- int ret;
- int cmd;
- int brightness = -1;
+ int cmd, brt, ret;
cmd = DISP_CMD(PROP_DISPLAY_BRIGHTNESS, DEFAULT_DISPLAY);
- ret = device_get_property(DEVICE_TYPE_DISPLAY, cmd, &brightness);
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, cmd, &brt);
+ if (ret >= 0)
+ ret = brt;
- _I("get brightness %d, %d", brightness, ret);
+ _I("get brightness %d, %d", brt, ret);
reply = dbus_message_new_method_return(msg);
dbus_message_iter_init_append(reply, &iter);
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &brightness);
-
+ dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &brt);
return reply;
}
{
DBusMessageIter iter;
DBusMessage *reply;
- int ret;
- int cmd;
- int brightness;
+ int cmd, brt, autobrt, ret;
+
+ dbus_message_iter_init(msg, &iter);
+ dbus_message_iter_get_basic(&iter, &brt);
+
+ if (brt == DISPLAY_DIM_BRIGHTNESS) {
+ _E("application can not set this value(DIM VALUE:%d)", brt);
+ ret = -EPERM;
+ goto error;
+ }
+
+ if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &autobrt) != 0) {
+ _E("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value");
+ autobrt = SETTING_BRIGHTNESS_AUTOMATIC_OFF;
+ }
+
+ if (autobrt == SETTING_BRIGHTNESS_AUTOMATIC_ON) {
+ _D("auto_brightness state is ON, can not change the brightness value");
+ ret = 0;
+ goto error;
+ }
+
+ cmd = DISP_CMD(PROP_DISPLAY_BRIGHTNESS, DEFAULT_DISPLAY);
+ ret = device_set_property(DEVICE_TYPE_DISPLAY, cmd, brt);
+ if (ret < 0)
+ goto error;
+
+ if (vconf_set_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, brt) != 0)
+ _E("Failed to set VCONFKEY_SETAPPL_LCD_BRIGHTNESS value");
+
+ if (vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, brt) != 0)
+ _E("Failed to set VCONFKEY_PM_CURRENT_BRIGHTNESS value");
+
+ _I("set brightness %d, %d", brt, ret);
+
+error:
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);
+ return reply;
+}
+
+static DBusMessage *e_dbus_holdbrightness(E_DBus_Object *obj, DBusMessage *msg)
+{
+ DBusMessageIter iter;
+ DBusMessage *reply;
+ int cmd, brt, autobrt, ret;
dbus_message_iter_init(msg, &iter);
- dbus_message_iter_get_basic(&iter, &brightness);
+ dbus_message_iter_get_basic(&iter, &brt);
+
+ if (brt == DISPLAY_DIM_BRIGHTNESS) {
+ _E("application can not set this value(DIM VALUE:%d)", brt);
+ ret = -EPERM;
+ goto error;
+ }
+
+ if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &autobrt) != 0) {
+ _E("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value");
+ autobrt = SETTING_BRIGHTNESS_AUTOMATIC_OFF;
+ }
cmd = DISP_CMD(PROP_DISPLAY_BRIGHTNESS, DEFAULT_DISPLAY);
- ret = device_set_property(DEVICE_TYPE_DISPLAY, cmd, brightness);
+ ret = device_set_property(DEVICE_TYPE_DISPLAY, cmd, brt);
+ if (ret < 0)
+ goto error;
+
+ if (autobrt == SETTING_BRIGHTNESS_AUTOMATIC_ON) {
+ _D("Auto brightness will be paused");
+ vconf_set_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, SETTING_BRIGHTNESS_AUTOMATIC_PAUSE);
+ }
+
+ if (vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, brt) != 0)
+ _E("Failed to set VCONFKEY_PM_CURRENT_BRIGHTNESS value");
- _I("set brightness %d, %d", brightness, ret);
+ _I("hold brightness %d, %d", brt, ret);
+error:
reply = dbus_message_new_method_return(msg);
dbus_message_iter_init_append(reply, &iter);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);
+ return reply;
+}
+
+static DBusMessage *e_dbus_releasebrightness(E_DBus_Object *obj, DBusMessage *msg)
+{
+ DBusMessageIter iter;
+ DBusMessage *reply;
+ int cmd, bat, charger, changed, setting, autobrt, ret = 0;
+
+ if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, &bat) != 0) {
+ _E("Failed to get VCONFKEY_SYSMAN_BATTERY_STATUS_LOW value");
+ ret = -EPERM;
+ goto error;
+ }
+
+ if (vconf_get_int(VCONFKEY_SYSMAN_CHARGER_STATUS, &charger) != 0) {
+ _E("Failed to get VCONFKEY_SYSMAN_CHARGER_STATUS value");
+ ret = -EPERM;
+ goto error;
+ }
+
+ if (vconf_get_bool(VCONFKEY_PM_BRIGHTNESS_CHANGED_IN_LPM, &changed) != 0) {
+ _E("Failed to get VCONFKEY_PM_BRIGHTNESS_CHANGED_IN_LPM value");
+ ret = -EPERM;
+ goto error;
+ }
+
+ if (vconf_get_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, &setting) != 0) {
+ _E("Failed to get VCONFKEY_SETAPPL_LCD_BRIGHTNESS value");
+ ret = -EPERM;
+ goto error;
+ }
+
+ if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &autobrt) != 0) {
+ _E("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value");
+ ret = -EPERM;
+ goto error;
+ }
+
+ vconf_set_int(VCONFKEY_PM_CUSTOM_BRIGHTNESS_STATUS, VCONFKEY_PM_CUSTOM_BRIGHTNESS_OFF);
+
+ // check dim state
+ if (bat <= VCONFKEY_SYSMAN_BAT_CRITICAL_LOW &&
+ charger == VCONFKEY_SYSMAN_CHARGER_DISCONNECTED && !changed) {
+ _D("batt warning low : brightness is not changed!");
+ device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_BRIGHTNESS, 0);
+ goto error;
+ }
+
+ if (autobrt == SETTING_BRIGHTNESS_AUTOMATIC_OFF) {
+ device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_BRIGHTNESS, setting);
+ if (vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, setting) != 0) {
+ _E("Failed to set VCONFKEY_PM_CURRENT_BRIGHTNESS value");
+ }
+ } else if (autobrt == SETTING_BRIGHTNESS_AUTOMATIC_PAUSE) {
+ _D("Auto brightness will be enable");
+ vconf_set_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, SETTING_BRIGHTNESS_AUTOMATIC_ON);
+ }
+
+error:
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);
+ return reply;
+}
+
+static DBusMessage *e_dbus_getaclstatus(E_DBus_Object *obj, DBusMessage *msg)
+{
+ DBusMessageIter iter;
+ DBusMessage *reply;
+ int cmd, st, ret;
+
+ cmd = DISP_CMD(PROP_DISPLAY_ACL_CONTROL, DEFAULT_DISPLAY);
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, cmd, &st);
+ if (ret >= 0)
+ ret = st;
+
+ _I("get acl status %d, %d", st, ret);
+
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);
+ return reply;
+}
+
+static DBusMessage *e_dbus_setaclstatus(E_DBus_Object *ob, DBusMessage *msg)
+{
+ DBusMessageIter iter;
+ DBusMessage *reply;
+ int cmd, st, ret;
+
+ dbus_message_iter_init(msg, &iter);
+ dbus_message_iter_get_basic(&iter, &st);
+
+ cmd = DISP_CMD(PROP_DISPLAY_ACL_CONTROL, DEFAULT_DISPLAY);
+ ret = device_set_property(DEVICE_TYPE_DISPLAY, cmd, st);
+
+ _I("set acl status %d, %d", st, ret);
+
+ reply = dbus_message_new_method_return(msg);
+ dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);
return reply;
}
{ "setautobrightnessinterval", "i", "i", e_dbus_setautobrightnessinterval },
{ "setautobrightnessmin", "i", "i", e_dbus_setautobrightnessmin },
{ "LockScreenBgOn", "s", "i", e_dbus_lockscreenbgon },
+ { "GetDisplayCount", NULL, "i", e_dbus_getdisplaycount },
+ { "GetBrightness", NULL, "i", e_dbus_getbrightness },
+ { "SetBrightness", "i", "i", e_dbus_setbrightness },
+ { "HoldBrightness", "i", "i", e_dbus_holdbrightness },
+ { "ReleaseBrightness", NULL, "i", e_dbus_releasebrightness },
+ { "GetAclStatus", NULL, "i", e_dbus_getaclstatus },
+ { "SetAclStatus", NULL, "i", e_dbus_setaclstatus },
/* Add methods here */
};
#define METHOD_LOCK_STATE "lockstate"
#define METHOD_UNLOCK_STATE "unlockstate"
#define METHOD_CHANGE_STATE "changestate"
+#define METHOD_GET_DISPLAY_COUNT "GetDisplayCount"
+#define METHOD_GET_BRIGHTNESS "GetBrightness"
+#define METHOD_SET_BRIGHTNESS "SetBrightness"
+#define METHOD_HOLD_BRIGHTNESS "HoldBrightness"
+#define METHOD_RELEASE_BRIGHTNESS "ReleaseBrightness"
+#define METHOD_GET_ACL_STATUS "GetAclStatus"
+#define METHOD_SET_ACL_STATUS "SetAclStatus"
#define STR_LCD_OFF "lcdoff"
#define STR_LCD_DIM "lcddim"
API int display_get_count(void)
{
- int val;
- int r;
+ DBusError err;
+ DBusMessage *msg;
+ int ret, ret_val;
+
+ msg = deviced_dbus_method_sync(BUS_NAME, DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
+ METHOD_GET_DISPLAY_COUNT, NULL, NULL);
+ if (!msg)
+ return -EBADMSG;
- r = device_get_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_DISPLAY_COUNT, &val);
- if (r < 0)
- return r;
+ dbus_error_init(&err);
- return val;
+ ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val, DBUS_TYPE_INVALID);
+ if (!ret) {
+ _E("no message : [%s:%s]", err.name, err.message);
+ ret_val = -EBADMSG;
+ }
+
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+ return ret_val;
}
API int display_get_max_brightness(void)
API int display_get_brightness(void)
{
- int val;
- int r;
+ DBusError err;
+ DBusMessage *msg;
+ int ret, ret_val;
- r = device_get_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_BRIGHTNESS, &val);
- if (r < 0)
- return r;
+ msg = deviced_dbus_method_sync(BUS_NAME, DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
+ METHOD_GET_BRIGHTNESS, NULL, NULL);
+ if (!msg)
+ return -EBADMSG;
- return val;
+ dbus_error_init(&err);
+
+ ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val, DBUS_TYPE_INVALID);
+ if (!ret) {
+ _E("no message : [%s:%s]", err.name, err.message);
+ ret_val = -EBADMSG;
+ }
+
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+ return ret_val;
}
API int display_set_brightness_with_setting(int val)
{
- int auto_brt_state;
- int r;
-
- if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &auto_brt_state) != 0) {
- _E("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value");
- errno = EPERM;
- return -errno;
- }
-
- if (val == DISPLAY_DIM_BRIGHTNESS) {
- _E("application can not set this value(DIM VALUE:%d)", val);
- errno = EPERM;
- return -errno;
- }
+ DBusError err;
+ DBusMessage *msg;
+ char str_val[32];
+ char *arr[1];
+ int ret, ret_val;
- if (auto_brt_state == SETTING_BRIGHTNESS_AUTOMATIC_ON) {
- _D("auto_brightness state is ON, can not change the brightness value");
- return 0;
- }
+ snprintf(str_val, sizeof(str_val), "%d", val);
+ arr[0] = str_val;
- r = device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_BRIGHTNESS, val);
- if (r < 0)
- return r;
+ msg = deviced_dbus_method_sync(BUS_NAME, DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
+ METHOD_SET_BRIGHTNESS, "i", arr);
+ if (!msg)
+ return -EBADMSG;
- if (vconf_set_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, val) != 0) {
- _E("Failed to set VCONFKEY_SETAPPL_LCD_BRIGHTNESS value");
- }
+ dbus_error_init(&err);
- if (vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, val) != 0) {
- _E("Failed to set VCONFKEY_PM_CURRENT_BRIGHTNESS value");
+ ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val, DBUS_TYPE_INVALID);
+ if (!ret) {
+ _E("no message : [%s:%s]", err.name, err.message);
+ ret_val = -EBADMSG;
}
- return 0;
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+ return ret_val;
}
API int display_set_brightness(int val)
{
- int auto_brt_state;
- int r;
-
- if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &auto_brt_state) != 0) {
- _E("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value");
- errno = EPERM;
- return -errno;
- }
+ DBusError err;
+ DBusMessage *msg;
+ char str_val[32];
+ char *arr[1];
+ int ret, ret_val;
- if (val == DISPLAY_DIM_BRIGHTNESS) {
- _E("application can not set this value(DIM VALUE:%d)", val);
- errno = EPERM;
- return -errno;
- }
+ snprintf(str_val, sizeof(str_val), "%d", val);
+ arr[0] = str_val;
- vconf_set_int(VCONFKEY_PM_CUSTOM_BRIGHTNESS_STATUS, VCONFKEY_PM_CUSTOM_BRIGHTNESS_ON);
- r = device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_BRIGHTNESS, val);
- if (r < 0)
- return r;
+ msg = deviced_dbus_method_sync(BUS_NAME, DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
+ METHOD_HOLD_BRIGHTNESS, "i", arr);
+ if (!msg)
+ return -EBADMSG;
- if (auto_brt_state == SETTING_BRIGHTNESS_AUTOMATIC_ON) {
- _D("Auto brightness will be paused");
- vconf_set_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, SETTING_BRIGHTNESS_AUTOMATIC_PAUSE);
- }
+ dbus_error_init(&err);
- if (vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, val) != 0) {
- _E("Failed to set VCONFKEY_PM_CURRENT_BRIGHTNESS value");
+ ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val, DBUS_TYPE_INVALID);
+ if (!ret) {
+ _E("no message : [%s:%s]", err.name, err.message);
+ ret_val = -EBADMSG;
}
- return 0;
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+ return ret_val;
}
API int display_release_brightness(void)
{
- int bat_state;
- int setting_val;
- int auto_brt_state;
- int charger_state;
- int brt_changed_state;
- int r;
-
- if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, &bat_state) != 0) {
- _E("Failed to get VCONFKEY_SYSMAN_BATTERY_STATUS_LOW value");
- errno = EPERM;
- return -1;
- }
+ DBusError err;
+ DBusMessage *msg;
+ int ret, ret_val;
- if (vconf_get_int(VCONFKEY_SYSMAN_CHARGER_STATUS, &charger_state) != 0) {
- _E("Failed to get VCONFKEY_SYSMAN_CHARGER_STATUS value");
- errno = EPERM;
- return -1;
- }
+ msg = deviced_dbus_method_sync(BUS_NAME, DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
+ METHOD_RELEASE_BRIGHTNESS, NULL, NULL);
+ if (!msg)
+ return -EBADMSG;
- if (vconf_get_bool(VCONFKEY_PM_BRIGHTNESS_CHANGED_IN_LPM, &brt_changed_state) != 0) {
- _E("Failed to get VCONFKEY_PM_BRIGHTNESS_CHANGED_IN_LPM value");
- errno = EPERM;
- return -1;
- }
+ dbus_error_init(&err);
- if (vconf_get_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, &setting_val) != 0) {
- _E("Failed to get VCONFKEY_SETAPPL_LCD_BRIGHTNESS value");
- errno = EPERM;
- return -1;
+ ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val, DBUS_TYPE_INVALID);
+ if (!ret) {
+ _E("no message : [%s:%s]", err.name, err.message);
+ ret_val = -EBADMSG;
}
- if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &auto_brt_state) != 0) {
- _E("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value");
- errno = EPERM;
- return -1;
- }
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+ return ret_val;
+}
- vconf_set_int(VCONFKEY_PM_CUSTOM_BRIGHTNESS_STATUS, VCONFKEY_PM_CUSTOM_BRIGHTNESS_OFF);
+API int display_get_acl_status(void)
+{
+ DBusError err;
+ DBusMessage *msg;
+ int ret, ret_val;
- // check dim state
- if (bat_state <= VCONFKEY_SYSMAN_BAT_CRITICAL_LOW &&
- charger_state == VCONFKEY_SYSMAN_CHARGER_DISCONNECTED && !brt_changed_state) {
- _D("batt warning low : brightness is not changed!");
- device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_BRIGHTNESS, 0);
- return 0;
- }
+ msg = deviced_dbus_method_sync(BUS_NAME, DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
+ METHOD_GET_ACL_STATUS, NULL, NULL);
+ if (!msg)
+ return -EBADMSG;
+
+ dbus_error_init(&err);
- if (auto_brt_state == SETTING_BRIGHTNESS_AUTOMATIC_OFF) {
- device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_BRIGHTNESS, setting_val);
- if (vconf_set_int(VCONFKEY_PM_CURRENT_BRIGHTNESS, setting_val) != 0) {
- _E("Failed to set VCONFKEY_PM_CURRENT_BRIGHTNESS value");
- }
- } else if (auto_brt_state == SETTING_BRIGHTNESS_AUTOMATIC_PAUSE) {
- _D("Auto brightness will be enable");
- vconf_set_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, SETTING_BRIGHTNESS_AUTOMATIC_ON);
+ ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val, DBUS_TYPE_INVALID);
+ if (!ret) {
+ _E("no message : [%s:%s]", err.name, err.message);
+ ret_val = -EBADMSG;
}
- return 0;
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+ return ret_val;
}
-API int display_get_acl_status(void)
+API int display_set_acl_status(int val)
{
- int val;
- int r;
+ DBusError err;
+ DBusMessage *msg;
+ char str_val[32];
+ char *arr[1];
+ int ret, ret_val;
- r = device_get_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_ACL_CONTROL, &val);
- if (r < 0)
- return r;
+ snprintf(str_val, sizeof(str_val), "%d", val);
+ arr[0] = str_val;
- return val;
-}
+ msg = deviced_dbus_method_sync(BUS_NAME, DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
+ METHOD_SET_ACL_STATUS, "i", arr);
+ if (!msg)
+ return -EBADMSG;
-API int display_set_acl_status(int val)
-{
- int r;
+ dbus_error_init(&err);
- r = device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_ACL_CONTROL, val);
- if (r < 0)
- return r;
+ ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val, DBUS_TYPE_INVALID);
+ if (!ret) {
+ _E("no message : [%s:%s]", err.name, err.message);
+ ret_val = -EBADMSG;
+ }
- return 0;
+ dbus_message_unref(msg);
+ dbus_error_free(&err);
+ return ret_val;
}
API int display_set_frame_rate(int val)
dbus_message_unref(msg);
dbus_error_free(&err);
-
- _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_SET_FRAME_RATE, ret_val);
return ret_val;
}