display: Move force_brightness getter and setter from plugin to core display module
[platform/core/system/deviced.git] / src / display / display-backlight.c
index 9b226ec..a8215bc 100644 (file)
@@ -33,6 +33,7 @@ static struct _backlight_ops *backlight_ops;
 static int default_brightness;
 static int custom_brightness;
 static bool g_custom_status;
+static int force_brightness;
 static guint release_timer;
 
 /* FIXME: This function is for temporary use, should be fixed after plugin refactoring */
@@ -273,6 +274,23 @@ void display_backlight_unset_blink(void)
        release_timer = g_timeout_add(DUMP_MODE_WAITING_TIME, release_blink_cb, NULL);
 }
 
+/* FIXME: This function is only used for wearable plugin */
+int display_backlight_set_force_brightness(int brightness)
+{
+       if (brightness < PM_DIM_BRIGHTNESS ||  brightness > PM_MAX_BRIGHTNESS)
+               return -EINVAL;
+
+       force_brightness = brightness;
+
+       return 0;
+}
+
+/* FIXME: This function is only used for wearable plugin */
+void display_backlight_get_force_brightness(int *brightness)
+{
+       *brightness = force_brightness;
+}
+
 /* FIXME: This code structure should be changed to plugin api call, after plugin refactoting*/
 static void __CONSTRUCTOR__ initialize(void)
 {