Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reimplementation of touch screen and keypad locking subsystem
Legacy automatic locking is replaced with two state machines. One
deals with time based delayed locking after display off and another
one that deals with proximity based locking after display off.

Exceptional ui states - where the display is turned on to handle
things like calls, alarms and notifications - have a state machine of
their own. Each exception type can also utilize display on linger,
i.e. the display can be kept on a while after the exceptional state
has already ended.

The keypad, touchscreen and doubletap event enable / disable logic for
legacy devices is also implemented as a single state machine. The
basic logic was smoketested on a old nemomobile image with N9 and N950
devices, but there might still be rough edges at corners.

The two separate ON -> DIM -> OFF engines in tklock and display
modules have been joined to a single engine at display module.

Mere activity is no longer used to unblank the display. This requires
explicit display on request. The power key and double tap handling has
been modified to handle this.

The pocket mode is removed. It needs to be re-implemented when/if low
power mode display can be supported again.

The N9 specific display on statistics gathering was removed as it
requires Nokia specific libcal and we are unlikely to have that
available in nemomobile.

The late suspend is delayed for one second after reaching display off
state. This should give UI side time to handle display off actions
before suspend rather than after resume.

If setUpdatesEnabled D-Bus method calls take unexpectedly long time, a
led pattern is activated. This should allow us to tell apart black
screens that result from ui / dbus freeze from other causes.

[mce] Reimplementation of touch screen and keypad locking subsystem
  • Loading branch information
spiiroin committed Jan 14, 2014
1 parent 8b6351a commit 7f89363
Show file tree
Hide file tree
Showing 10 changed files with 7,848 additions and 7,947 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -492,6 +492,7 @@ install:: build
$(INSTALL_DTA) inifiles/mce.ini $(DESTDIR)$(CONFDIR)/$(CONFFILE)
$(INSTALL_DTA) inifiles/mce-radio-states.ini $(DESTDIR)$(CONFDIR)/$(RADIOSTATESCONFFILE)
$(INSTALL_DTA) inifiles/hybris-led.ini $(DESTDIR)$(CONFDIR)/20hybris-led.ini
$(INSTALL_DTA) inifiles/debug-led.ini $(DESTDIR)$(CONFDIR)/20debug-led.ini
$(INSTALL_DTA) inifiles/als-defaults.ini $(DESTDIR)$(CONFDIR)/20als-defaults.ini

ifneq ($(strip $(ENABLE_BUILTIN_GCONF)),y)
Expand Down
12 changes: 12 additions & 0 deletions builtin-gconf.c
Expand Up @@ -1433,6 +1433,18 @@ static const setting_t gconf_defaults[] =
.type = "b",
.def = "true",
},
{
// no define; used by mce display module
.key = "/system/osso/dsm/leds/PatternBatteryDisplayBlank",
.type = "b",
.def = "true",
},
{
// no define; used by mce display module
.key = "/system/osso/dsm/leds/PatternBatteryDisplayUnblank",
.type = "b",
.def = "true",
},
{
// MCE_GCONF_PROXIMITY_PS_ENABLED_PATH @ proximity.h
.key = "/system/osso/dsm/proximity/ps_enabled",
Expand Down
24 changes: 24 additions & 0 deletions inifiles/debug-led.ini
@@ -0,0 +1,24 @@
[LEDPatternHybris]

# Patterns used for the hybris hardware;
# Please prefix pattern names with Pattern to avoid name space clashes
#
# [0] Priority (0 - highest, 255 - lowest)
# [1] ScreenOn
# 0 only show pattern when the display is off
# 1 show pattern even when the display is on
# 2 only show pattern when the display is off, including acting dead
# 3 show pattern even when the display is on, including acting dead
# 4 only show pattern if the display is off, or if in acting dead
# 5 always show pattern, even if LED disabled
# 6 Like 0, but automatically disable after display on
# [2] Timeout in seconds before pattern is disabled, 0 for infinite
# [3] OnPeriod in milliseconds
# [4] OffPeriod in milliseconds
# [5] RGB24 as hexadecimal number
#
# Note: If blinking is enabled, only full intensity colors are applicable
# i.e. red, green, yellow, blue, magenta, cyan or white should be used.

PatternBatteryDisplayBlank=0;5;0;100;100;ff0000
PatternBatteryDisplayUnblank=0;5;0;100;100;00ff00
8 changes: 8 additions & 0 deletions mce.c
Expand Up @@ -924,6 +924,8 @@ int main(int argc, char **argv)
0, GINT_TO_POINTER(MCE_DISPLAY_UNDEF));
setup_datapipe(&display_state_req_pipe, READ_WRITE, DONT_FREE_CACHE,
0, GINT_TO_POINTER(MCE_DISPLAY_UNDEF));
setup_datapipe(&exception_state_pipe, READ_WRITE, DONT_FREE_CACHE,
0, GINT_TO_POINTER(UIEXC_NONE));
setup_datapipe(&display_brightness_pipe, READ_WRITE, DONT_FREE_CACHE,
0, GINT_TO_POINTER(3));
setup_datapipe(&led_brightness_pipe, READ_WRITE, DONT_FREE_CACHE,
Expand Down Expand Up @@ -980,6 +982,9 @@ int main(int argc, char **argv)
0, GINT_TO_POINTER(THERMAL_STATE_UNDEF));
setup_datapipe(&heartbeat_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(0));
setup_datapipe(&lipstick_available_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(FALSE));


/* Initialise mode management
* pre-requisite: mce_gconf_init()
Expand Down Expand Up @@ -1097,13 +1102,16 @@ int main(int argc, char **argv)
free_datapipe(&led_brightness_pipe);
free_datapipe(&display_brightness_pipe);
free_datapipe(&display_state_pipe);
free_datapipe(&display_state_req_pipe);
free_datapipe(&exception_state_pipe);
free_datapipe(&submode_pipe);
free_datapipe(&alarm_ui_state_pipe);
free_datapipe(&call_type_pipe);
free_datapipe(&call_state_pipe);
free_datapipe(&master_radio_pipe);
free_datapipe(&system_state_pipe);
free_datapipe(&heartbeat_pipe);
free_datapipe(&lipstick_available_pipe);

/* Call the exit function for all subsystems */
mce_gconf_exit();
Expand Down
16 changes: 15 additions & 1 deletion mce.h
Expand Up @@ -262,6 +262,15 @@ typedef enum {
THERMAL_STATE_OVERHEATED = 1,
} thermal_state_t;

/** Exceptional UI status */
typedef enum {
UIEXC_NONE = 0,
UIEXC_LINGER = 1<<0,
UIEXC_CALL = 1<<1,
UIEXC_ALARM = 1<<2,
UIEXC_NOTIF = 1<<3,
} uiexctype_t;

/** LED brightness */
datapipe_struct led_brightness_pipe;
/** State of device; read only */
Expand All @@ -274,8 +283,10 @@ datapipe_struct led_pattern_deactivate_pipe;
datapipe_struct user_activity_pipe;
/** State of display; read only */
datapipe_struct display_state_pipe;
/** Desired state of display */
/** Desired state of display; write only */
datapipe_struct display_state_req_pipe;
/** exceptional ui state; read write */
datapipe_struct exception_state_pipe;
/**
* Display brightness;
* bits 0-7 is brightness in percent (0-100)
Expand Down Expand Up @@ -339,6 +350,9 @@ datapipe_struct thermal_state_pipe;
/** Heartbeat; read only */
datapipe_struct heartbeat_pipe;

/** lipstick availability; read only */
datapipe_struct lipstick_available_pipe;

/* XXX: use HAL */
/** Does the device have a flicker key? */
extern gboolean has_flicker_key;
Expand Down

0 comments on commit 7f89363

Please sign in to comment.