Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adjust display linger times after ending a call
When call ends the linger time specifies the length of time during
which the display will turn on / stay on if proximity is uncovered
before previous display state and normal blanking policy is restored.

For incoming calls the linger time should be long enough to allow the
user to select "call again" or similar continuation actions. For now
5 seconds is used.

For outgoing calls the linger time should be long enough to allow the
user to remove the device from ear. For now 2.5 seconds is used.

[mce] Adjust display linger times after ending a call. Fixes JB#20810
  • Loading branch information
spiiroin committed Jun 19, 2014
1 parent 2468e67 commit 5431914
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions tklock.c
Expand Up @@ -66,7 +66,8 @@
/** Duration of exceptional UI states, in milliseconds */
enum
{
EXCEPTION_LENGTH_CALL = 3000, // [ms]
EXCEPTION_LENGTH_CALL_IN = 5000, // [ms]
EXCEPTION_LENGTH_CALL_OUT = 2500, // [ms]
EXCEPTION_LENGTH_ALARM = 2500, // [ms]
EXCEPTION_LENGTH_CHARGER = 3000, // [ms]
EXCEPTION_LENGTH_BATTERY = 1000, // [ms]
Expand Down Expand Up @@ -770,6 +771,9 @@ static call_state_t call_state = CALL_STATE_NONE;
*/
static void tklock_datapipe_call_state_cb(gconstpointer data)
{
/* Default to using shorter outgoing call linger time */
static int64_t linger_time = EXCEPTION_LENGTH_CALL_OUT;

call_state_t prev = call_state;
call_state = GPOINTER_TO_INT(data);

Expand All @@ -783,11 +787,20 @@ static void tklock_datapipe_call_state_cb(gconstpointer data)

switch( call_state ) {
case CALL_STATE_RINGING:
/* Switch to using longer incoming call linger time */
linger_time = EXCEPTION_LENGTH_CALL_IN;

/* Fall through */

case CALL_STATE_ACTIVE:
tklock_uiexcept_begin(UIEXC_CALL, EXCEPTION_LENGTH_CALL);
tklock_uiexcept_begin(UIEXC_CALL, 0);
break;

default:
tklock_uiexcept_end(UIEXC_CALL, EXCEPTION_LENGTH_CALL);
tklock_uiexcept_end(UIEXC_CALL, linger_time);

/* Restore linger time to default again */
linger_time = EXCEPTION_LENGTH_CALL_OUT;
break;
}

Expand Down

0 comments on commit 5431914

Please sign in to comment.