return -EINVAL;
*device_flags = NORMAL_MODE;
- bool stay_touchscreen_off = false;
- display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
-
- if (stay_touchscreen_off) {
- *device_flags |= TOUCH_SCREEN_OFF_MODE;
- }
return 0;
}
* After that, module would be changed to suspend(execute(STATUS_STOP)).
* The opposite case, the module should be enabled first.
*/
+
+ /**
+ * FIXME: Fix it using resource-manager controlling touchscreen resource
+ * that has not been implemented yet.
+ */
+#if 0
if (swimmode_status) {
touchscreen_ops->stop(TOUCH_SCREEN_OFF_MODE);
touchscreen_ops->execute((void *)DEVICE_OPS_STATUS_STOP);
touchscreen_ops->execute((void *)DEVICE_OPS_STATUS_START);
touchscreen_ops->start(NORMAL_MODE);
}
+#endif
+
return 0;
}
return g_variant_new("(i)", ret);
}
+/**
+ * FIXME: Deprecated and will be removed.
+ * It has no effect. Use "Disable" dbus method of touchscreen module instead.
+ */
static GVariant *dbus_staytouchscreenoff(GDBusConnection *conn,
const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
{ "CustomLCDOn", "i", "i", dbus_customlcdon },
{ "CustomLCDOff", "s", "i", dbus_customlcdoff },
{ "ChangeStateByReason", "isi", "i", dbus_changestatebyreason },
+ /* deprecated. Instead, use one at touchscreen module, "Disable" */
{ "StayTouchScreenOff", "i", "i", dbus_staytouchscreenoff },
{ "LCDPanelOffMode", "i", "i", dbus_lcdpaneloffmode },
{ "ActorControl", "sii", "i", dbus_actorcontrol },
int display_util_get_device_flags(unsigned long *device_flags)
{
- bool stay_touchscreen_off = false;
if (!device_flags)
return -EINVAL;
return display_plugin_get_device_flags(device_flags);
*device_flags = NORMAL_MODE;
- display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
-
- if (stay_touchscreen_off)
- *device_flags |= TOUCH_SCREEN_OFF_MODE;
return 0;
}
enum device_flags {
NORMAL_MODE = 0x00000001,
- TOUCH_SCREEN_OFF_MODE = 0x00002000,
LCD_ON_BY_GESTURE = 0x00010000,
LCD_ON_BY_POWER_KEY = 0x00020000,
LCD_ON_BY_BACK_KEY = 0x00040000,
static int touchscreen_start(enum device_flags flags);
static int touchscreen_stop(enum device_flags flags);
+static int touchscreen_powersaving(enum ps_mode mode);
+static int touchscreen_set_state(enum touchscreen_state state);
static int delayed_init_done(void *data);
g_display_plugin.config->touch_wakeup = vconf_keynode_get_bool(key);
if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON) {
- if (g_display_plugin.config->touch_wakeup)
+ if (g_display_plugin.config->touch_wakeup) {
touchscreen_start(NORMAL_MODE);
- else
- touchscreen_stop(TOUCH_SCREEN_OFF_MODE);
+ } else {
+ touchscreen_powersaving(POWERSAVING_OFF);
+ touchscreen_set_state(TOUCHSCREEN_OFF);
+ }
}
}
if (touchscreen_enable != DEVICE_OPS_STATUS_START)
return 0;
- if (flags & TOUCH_SCREEN_OFF_MODE) {
- touchscreen_powersaving(POWERSAVING_OFF);
- return touchscreen_set_state(TOUCHSCREEN_OFF);
- }
-
if (battery && battery->charger_connected == 1) {
_I("Battery charging one %d %d.", battery->charger_connected, battery->online_type);
return touchscreen_powersaving(POWERSAVING_ON);
GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
{
int ret;
- ret = touchscreen_stop(TOUCH_SCREEN_OFF_MODE);
+
+ touchscreen_powersaving(POWERSAVING_OFF);
+ ret = touchscreen_set_state(TOUCHSCREEN_OFF);
return g_variant_new("(i)", ret);
}