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

Commit 4270d8dc authored by Pavlin Radoslavov's avatar Pavlin Radoslavov Committed by Andre Eisenbach
Browse files

Elimininate unnecessary calls for releasing the wake lock.

Bug: 20884459
Change-Id: Id010cb29cf09b95800dc9f5fd5b660e71e4a47bc
parent e45d4b7f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -257,6 +257,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
@@ -286,7 +287,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);
  }