display: plugin: Add display_plugin_get_device_flags()
[platform/core/system/deviced.git] / src / display / display-plugin.c
index dd5e0fb..4561f79 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include <errno.h>
+#include "display-misc.h"
 #include "display-plugin.h"
 #include "shared/log-macro.h"
 
@@ -240,4 +241,27 @@ int display_plugin_set_dim_state(bool on)
        }
 
        return -EOPNOTSUPP;
+}
+
+int display_plugin_get_device_flags(unsigned long *device_flags)
+{
+       if (!device_flags)
+               return -EINVAL;
+
+       if (g_display_plugin.get_device_flags)
+               return g_display_plugin.get_device_flags(device_flags);
+
+       *device_flags = NORMAL_MODE;
+       bool lcd_paneloff_mode = false;
+       bool stay_touchscreen_off = false;
+       display_panel_get_lcd_paneloff_mode(&lcd_paneloff_mode);
+       display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
+
+       if (lcd_paneloff_mode)
+               *device_flags |= LCD_PANEL_OFF_MODE;
+
+       if (stay_touchscreen_off)
+               *device_flags |= TOUCH_SCREEN_OFF_MODE;
+
+       return 0;
 }
\ No newline at end of file