Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d710d97 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Elimininate unnecessary calls for releasing the wake lock.

Bug: 20884459
Change-Id: Id010cb29cf09b95800dc9f5fd5b660e71e4a47bc
parent 69f1a50a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -256,6 +256,7 @@ static void schedule_next_instance(alarm_t *alarm, bool force_reschedule) {

// NOTE: must be called with monitor lock.
static void reschedule_root_alarm(void) {
  bool timer_was_set = timer_set;
  assert(alarms != NULL);

  // If used in a zeroed state, disarms the timer
@@ -285,7 +286,7 @@ static void reschedule_root_alarm(void) {

done:
  timer_set = wakeup_time.it_value.tv_sec != 0 || wakeup_time.it_value.tv_nsec != 0;
  if (!timer_set) {
  if (timer_was_set && !timer_set) {
    bt_os_callouts->release_wake_lock(WAKE_LOCK_ID);
  }