summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlokilee73 <changjoo.lee@samsung.com>2018-10-31 18:08:50 +0900
committerHyotaek Shim <hyotaek.shim@samsung.com>2018-10-31 11:02:10 +0000
commitb1622d015fc81e3a283727a4d6d89ac15563c67b (patch)
tree6a7102659c4a7110c60d6714985e9c3c0e61492e
parent0423d159d96909c842b9b0df959901c5f1e9e6f6 (diff)
downloaddeviced-b1622d015fc81e3a283727a4d6d89ac15563c67b.tar.gz
deviced-b1622d015fc81e3a283727a4d6d89ac15563c67b.tar.bz2
deviced-b1622d015fc81e3a283727a4d6d89ac15563c67b.zip
Fix bugs that are related with display for auto_test
Display item in auto test fails. 1. Set/Get brightness 2. Set/Get maxbrightness -> add LCD NORMAL on dbus parameter 3. Set brightness to 0 -> return error because it is the same with DIM Change-Id: Ifb20f923e7a38d9c7b57c57fb0b469915be68b38 Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
-rwxr-xr-xplugins/mobile/display/display-dbus.c11
-rwxr-xr-xplugins/tv/display/display-dbus.c11
-rwxr-xr-xplugins/wearable/display/display-dbus.c11
-rwxr-xr-x[-rw-r--r--]src/auto-test/display.c14
4 files changed, 34 insertions, 13 deletions
diff --git a/plugins/mobile/display/display-dbus.c b/plugins/mobile/display/display-dbus.c
index 335caab0..298bc4dd 100755
--- a/plugins/mobile/display/display-dbus.c
+++ b/plugins/mobile/display/display-dbus.c
@@ -415,6 +415,13 @@ GVariant *dbus_setbrightness(GDBusConnection *conn,
g_variant_get(param, "(ii)", &state, &brt);
+ //Check if brt is same with DIM
+ if (brt == 0) {
+ _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;
@@ -669,10 +676,10 @@ GVariant *dbus_lockscreenbgon(GDBusConnection *conn,
g_variant_get(param, "(s)", &on);
if (!strcmp(on, "true")) {
- if (disp_plgn.update_pm_setting)
+ if (disp_plgn.update_pm_setting)
disp_plgn.update_pm_setting(SETTING_LOCK_SCREEN_BG, true);
} else if (!strcmp(on, "false")) {
- if (disp_plgn.update_pm_setting)
+ if (disp_plgn.update_pm_setting)
disp_plgn.update_pm_setting(SETTING_LOCK_SCREEN_BG, false);
} else {
ret = -EINVAL;
diff --git a/plugins/tv/display/display-dbus.c b/plugins/tv/display/display-dbus.c
index 335caab0..298bc4dd 100755
--- a/plugins/tv/display/display-dbus.c
+++ b/plugins/tv/display/display-dbus.c
@@ -415,6 +415,13 @@ GVariant *dbus_setbrightness(GDBusConnection *conn,
g_variant_get(param, "(ii)", &state, &brt);
+ //Check if brt is same with DIM
+ if (brt == 0) {
+ _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;
@@ -669,10 +676,10 @@ GVariant *dbus_lockscreenbgon(GDBusConnection *conn,
g_variant_get(param, "(s)", &on);
if (!strcmp(on, "true")) {
- if (disp_plgn.update_pm_setting)
+ if (disp_plgn.update_pm_setting)
disp_plgn.update_pm_setting(SETTING_LOCK_SCREEN_BG, true);
} else if (!strcmp(on, "false")) {
- if (disp_plgn.update_pm_setting)
+ if (disp_plgn.update_pm_setting)
disp_plgn.update_pm_setting(SETTING_LOCK_SCREEN_BG, false);
} else {
ret = -EINVAL;
diff --git a/plugins/wearable/display/display-dbus.c b/plugins/wearable/display/display-dbus.c
index 335caab0..298bc4dd 100755
--- a/plugins/wearable/display/display-dbus.c
+++ b/plugins/wearable/display/display-dbus.c
@@ -415,6 +415,13 @@ GVariant *dbus_setbrightness(GDBusConnection *conn,
g_variant_get(param, "(ii)", &state, &brt);
+ //Check if brt is same with DIM
+ if (brt == 0) {
+ _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;
@@ -669,10 +676,10 @@ GVariant *dbus_lockscreenbgon(GDBusConnection *conn,
g_variant_get(param, "(s)", &on);
if (!strcmp(on, "true")) {
- if (disp_plgn.update_pm_setting)
+ if (disp_plgn.update_pm_setting)
disp_plgn.update_pm_setting(SETTING_LOCK_SCREEN_BG, true);
} else if (!strcmp(on, "false")) {
- if (disp_plgn.update_pm_setting)
+ if (disp_plgn.update_pm_setting)
disp_plgn.update_pm_setting(SETTING_LOCK_SCREEN_BG, false);
} else {
ret = -EINVAL;
diff --git a/src/auto-test/display.c b/src/auto-test/display.c
index 72668669..92b2dea5 100644..100755
--- a/src/auto-test/display.c
+++ b/src/auto-test/display.c
@@ -52,7 +52,7 @@
#define PM_STATE_LOG_FILE tzplatform_mkpath(TZ_SYS_ALLLOGS, "pm_state.log")
-static bool get_display_method(const char *method, int *value)
+static bool get_display_method(const char *method, GVariant *param, int *value)
{
GVariant *msg;
int val;
@@ -61,7 +61,7 @@ static bool get_display_method(const char *method, int *value)
msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME,
DEVICED_PATH_DISPLAY,
DEVICED_INTERFACE_DISPLAY,
- method, NULL);
+ method, param);
if (!msg) {
_E("fail (%s): no reply", method);
return ret;
@@ -131,7 +131,7 @@ static bool set_display_method_noreply(const char *method, GVariant *var)
static bool get_display_brightness(int *brightness)
{
- return get_display_method(METHOD_DISPLAY_GETBRIGHTNESS, brightness);
+ return get_display_method(METHOD_DISPLAY_GETBRIGHTNESS, g_variant_new("(i)", 0), brightness);
}
static bool set_display_brightness(int brightness)
@@ -145,7 +145,7 @@ static bool set_display_brightness(int brightness)
DEVICED_PATH_DISPLAY,
DEVICED_INTERFACE_DISPLAY,
METHOD_DISPLAY_SETBRIGHTNESS,
- g_variant_new("(i)", brightness));
+ g_variant_new("(ii)", 0, brightness));
if (!msg) {
_E("fail : no reply");
return ret;
@@ -190,7 +190,7 @@ out:
static bool get_display_maxbrightness()
{
- return get_display_method(METHOD_DISPLAY_GETMAXBRIGHTNESS, NULL);
+ return get_display_method(METHOD_DISPLAY_GETMAXBRIGHTNESS, g_variant_new("(i)", 0), NULL);
}
static bool set_display_maxbrightness(int brightness)
@@ -210,7 +210,7 @@ static bool set_display_releasebrightness()
static bool get_display_custombrightness()
{
- return get_display_method(METHOD_DISPLAY_CUSTOMBRIGHTNESS, NULL);
+ return get_display_method(METHOD_DISPLAY_CUSTOMBRIGHTNESS, NULL, NULL);
}
static bool set_display_autobrightness_min(int min)
@@ -259,7 +259,7 @@ static bool set_display_refreshrate(int app, int rate)
static bool get_display_count()
{
- return get_display_method(METHOD_DISPLAY_GETDISPLAYCOUNT, NULL);
+ return get_display_method(METHOD_DISPLAY_GETDISPLAYCOUNT, NULL, NULL);
}
static bool set_display_changestate(char *state)