static guint lock_timeout_id;
static int lock_screen_timeout = LOCK_SCREEN_INPUT_TIMEOUT;
static struct timeval lcdon_tv;
-static int stay_touchscreen_off = false;
/*
* The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
* state because it should be sent from previous state at booting time.
static unsigned long get_lcd_off_flags(void)
{
unsigned long flags = NORMAL_MODE;
+ bool stay_touchscreen_off = false;
+ display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
if (stay_touchscreen_off)
flags |= TOUCH_SCREEN_OFF_MODE;
enter_doze();
}
-void set_stay_touchscreen_off(int val)
-{
- _I("Stay touch screen off: %d", val);
- stay_touchscreen_off = val;
-
- if (disp_plgn->pm_change_internal)
- disp_plgn->pm_change_internal(INTERNAL_LOCK_PM, LCD_NORMAL);
-}
-
static void del_state_cond(void *data, enum state_t state)
{
PmLockNode *tmp = NULL;
static guint lock_timeout_id;
static int lock_screen_timeout = LOCK_SCREEN_INPUT_TIMEOUT;
static struct timeval lcdon_tv;
-static int stay_touchscreen_off = false;
/*
* The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
* state because it should be sent from previous state at booting time.
static unsigned long get_lcd_off_flags(void)
{
unsigned long flags = NORMAL_MODE;
+ bool stay_touchscreen_off = false;
+ display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
if (stay_touchscreen_off)
flags |= TOUCH_SCREEN_OFF_MODE;
enter_doze();
}
-void set_stay_touchscreen_off(int val)
-{
- _I("Stay touch screen off: %d", val);
- stay_touchscreen_off = val;
-
- if (disp_plgn->pm_change_internal)
- disp_plgn->pm_change_internal(INTERNAL_LOCK_PM, LCD_NORMAL);
-}
-
static void del_state_cond(void *data, enum state_t state)
{
PmLockNode *tmp = NULL;
static guint lock_timeout_id;
static int lock_screen_timeout = LOCK_SCREEN_INPUT_TIMEOUT;
static struct timeval lcdon_tv;
-static int stay_touchscreen_off = false;
/*
* The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
* state because it should be sent from previous state at booting time.
static unsigned long get_lcd_off_flags(void)
{
unsigned long flags = NORMAL_MODE;
+ bool stay_touchscreen_off = false;
+ display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
if (stay_touchscreen_off)
flags |= TOUCH_SCREEN_OFF_MODE;
enter_doze();
}
-void set_stay_touchscreen_off(int val)
-{
- _I("Stay touch screen off: %d", val);
- stay_touchscreen_off = val;
-
- if (disp_plgn->pm_change_internal)
- disp_plgn->pm_change_internal(INTERNAL_LOCK_PM, LCD_NORMAL);
-}
-
static void del_state_cond(void *data, enum state_t state)
{
PmLockNode *tmp = NULL;
static guint transit_timer;
static int lock_screen_timeout = LOCK_SCREEN_INPUT_TIMEOUT;
static struct timeval lcdon_tv;
-static int stay_touchscreen_off = false;
/*
* The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
* state because it should be sent from previous state at booting time.
static unsigned long get_lcd_off_flags(void)
{
unsigned long flags = NORMAL_MODE;
+ bool stay_touchscreen_off = false;
if (ambient_get_condition() == true) {
flags |= AMBIENT_MODE;
flags |= LCD_PHASED_TRANSIT_MODE;
}
+ display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
if (stay_touchscreen_off)
flags |= TOUCH_SCREEN_OFF_MODE;
enter_doze();
}
-void set_stay_touchscreen_off(int val)
-{
- _I("Stay touch screen off: %d", val);
- stay_touchscreen_off = val;
-
- if (disp_plgn->pm_change_internal)
- disp_plgn->pm_change_internal(INTERNAL_LOCK_PM, LCD_NORMAL);
-}
-
static void del_state_cond(void *data, enum state_t state)
{
PmLockNode *tmp = NULL;
int set_lcd_timeout(int on, int dim, int holdkey_block, const char *name);
void save_display_log(const char *path);
int custom_lcdon(int timeout);
-void set_stay_touchscreen_off(int val);
void lcd_on_direct(enum device_flags flags);
void lcd_on_procedure(int state, enum device_flags flag);
void lcd_off_procedure(enum device_flags flag);
#include "shared/log.h"
#include "display-misc.h"
+#include "display-plugin.h"
#include "poll.h"
+static bool stay_touchscreen_off = false;
+
/* FIXME: This fucntion should be relocated under the battery module */
bool display_misc_is_low_battery_state(int val)
{
close(cmdline);
}
+
+void display_misc_set_stay_touchscreen_off(bool on)
+{
+ _I("Stay touch screen off: %d", on);
+ stay_touchscreen_off = on;
+
+ display_plugin_pm_change_internal(INTERNAL_LOCK_PM, LCD_NORMAL);
+}
+
+void display_misc_get_stay_touchscreen_off(bool *on)
+{
+ if (!on) {
+ _E("Invalid parameter to get stay touchscreen off");
+ return;
+ }
+
+ *on = stay_touchscreen_off;
+}
\ No newline at end of file
bool display_misc_is_low_battery_state(int val);
void display_misc_get_process_name(pid_t pid, char *pname);
+void display_misc_set_stay_touchscreen_off(bool on);
+void display_misc_get_stay_touchscreen_off(bool *on);
#endif /* __DISPLAY_MISC_H__ */
\ No newline at end of file
g_variant_get(param, "(i)", &val);
- set_stay_touchscreen_off(val);
+ display_misc_set_stay_touchscreen_off((bool)val);
return g_variant_new("(i)", ret);
}