Skip to content

Commit

Permalink
[fingerprint] Suspend proof timer and idle callbacks. JB#42135
Browse files Browse the repository at this point in the history
The sailfish-fpd has been developed under assumption that it must block
suspend while acquiring fingerprints. This assumption has leaked also
in related code which has not needed to be suspend proofed.

Suspend proof fingerprint related timers and idle callbacks as an enabler
for allowing sailfish-fpd to release wakelocks during fingerprint
acquisition in devices where it is possible.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Sep 18, 2018
1 parent 2b2b247 commit c529743
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .depend
Expand Up @@ -737,6 +737,7 @@ modules/fingerprint.o:\
builtin-gconf.h\
datapipe.h\
mce-dbus.h\
mce-lib.h\
mce-log.h\
mce-setting.h\
mce.h\
Expand All @@ -746,6 +747,7 @@ modules/fingerprint.pic.o:\
builtin-gconf.h\
datapipe.h\
mce-dbus.h\
mce-lib.h\
mce-log.h\
mce-setting.h\
mce.h\
Expand Down
11 changes: 6 additions & 5 deletions modules/fingerprint.c
Expand Up @@ -21,6 +21,7 @@
*/

#include "../mce.h"
#include "../mce-lib.h"
#include "../mce-log.h"
#include "../mce-dbus.h"
#include "../mce-setting.h"
Expand Down Expand Up @@ -664,7 +665,7 @@ static void
fpoperation_attach_timeout(fpoperation_t *self, int delay, GSourceFunc cb)
{
fpoperation_cancel_timout(self);
self->fpo_timer = g_timeout_add(delay, cb, self);
self->fpo_timer = mce_wakelocked_timeout_add(delay, cb, self);
}

/** Timer callback for triggering fpwakeup
Expand Down Expand Up @@ -1238,7 +1239,7 @@ fingerprint_led_acquired_trigger(void)
if( fingerprint_led_acquired_timer_id )
g_source_remove(fingerprint_led_acquired_timer_id);
fingerprint_led_acquired_timer_id =
g_timeout_add(200, fingerprint_led_acquired_timer_cb, 0);
mce_wakelocked_timeout_add(200, fingerprint_led_acquired_timer_cb, 0);
fingerprint_led_acquired_activate(true);
}

Expand Down Expand Up @@ -2397,8 +2398,8 @@ static void
fpwakeup_schedule_allow(void)
{
if( !fpwakeup_allow_id ) {
fpwakeup_allow_id = g_timeout_add(fingerprint_allow_delay,
fpwakeup_allow_cb, 0);
fpwakeup_allow_id = mce_wakelocked_timeout_add(fingerprint_allow_delay,
fpwakeup_allow_cb, 0);
}
}

Expand Down Expand Up @@ -2539,7 +2540,7 @@ static void
fpwakeup_schedule_rethink(void)
{
if( !fpwakeup_rethink_id ) {
fpwakeup_rethink_id = g_idle_add(fpwakeup_rethink_cb, 0);
fpwakeup_rethink_id = mce_wakelocked_idle_add(fpwakeup_rethink_cb, 0);
}
}

Expand Down

0 comments on commit c529743

Please sign in to comment.