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

Commit 28963f58 authored by Matthew Xie's avatar Matthew Xie Committed by Android (Google) Code Review
Browse files

Merge "Make GKI_TIMER_INTERVAL_FOR_WAKELOCK configurable for different target" into lmp-mr1-dev

parents ca26aeae d72fb540
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
**              settop projects that already use pthreads and not pth.
**
*****************************************************************************/
#include "bt_target.h"

#include <assert.h>
#include <sys/times.h>
@@ -95,11 +96,6 @@ static timer_t posix_timer;
static bool timer_created;


// If the next wakeup time is less than this threshold, we should acquire
// a wakelock instead of setting a wake alarm so we're not bouncing in
// and out of suspend frequently.
static const uint32_t TIMER_INTERVAL_FOR_WAKELOCK_IN_MS = 100;

/*****************************************************************************
**  Externs
******************************************************************************/
@@ -217,7 +213,7 @@ void alarm_service_reschedule()
    }

    UINT64 ticks_in_millis = GKI_TICKS_TO_MS(ticks_till_next_exp);
    if (ticks_in_millis <= TIMER_INTERVAL_FOR_WAKELOCK_IN_MS)
    if (ticks_in_millis <= GKI_TIMER_INTERVAL_FOR_WAKELOCK)
    {
        // The next deadline is close, just take a wakelock and set a regular (non-wake) timer.
        int rc = bt_os_callouts->acquire_wake_lock(WAKE_LOCK_ID);
+8 −0
Original line number Diff line number Diff line
@@ -191,6 +191,14 @@
#define LINUX_GKI_INCLUDED  TRUE
#endif

// If the next wakeup time is less than this threshold, we should acquire
// a wakelock instead of setting a wake alarm so we're not bouncing in
// and out of suspend frequently.
// in millisecond
#ifndef GKI_TIMER_INTERVAL_FOR_WAKELOCK
#define GKI_TIMER_INTERVAL_FOR_WAKELOCK 3000
#endif

#ifndef BTA_SYS_TIMER_PERIOD
#define BTA_SYS_TIMER_PERIOD  100
#endif