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

Commit af16b9d4 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov Committed by android-build-merger
Browse files

A workaround for kernels missing CLOCK_BOOTTIME_ALARM

am: 562f044b

* commit '562f044b':
  A workaround for kernels missing CLOCK_BOOTTIME_ALARM
parents e8b031f9 562f044b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -73,9 +73,11 @@ btosiCommonTestSrc := \

btosiCommonIncludes := \
    $(LOCAL_PATH)/.. \
    $(LOCAL_PATH)/../utils/include
    $(LOCAL_PATH)/../utils/include \
    $(LOCAL_PATH)/../stack/include $(bdroid_C_INCLUDES)

btosiCommonCFlags := -std=c99 -Wall -Werror -UNDEBUG -fvisibility=hidden
btosiCommonCFlags := -std=c99 -Wall -Werror -UNDEBUG -fvisibility=hidden \
    $(bdroid_CFLAGS)

# libosi static library for target
# ========================================================
+7 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
 *
 ******************************************************************************/

#include "include/bt_target.h"

#define LOG_TAG "bt_osi_alarm"

#include "osi/include/alarm.h"
@@ -93,7 +95,12 @@ struct alarm_t {
// unit tests to run faster. It should not be modified by production code.
int64_t TIMER_INTERVAL_FOR_WAKELOCK_IN_MS = 3000;
static const clockid_t CLOCK_ID = CLOCK_BOOTTIME;

#if defined(KERNEL_MISSING_CLOCK_BOOTTIME_ALARM) && (KERNEL_MISSING_CLOCK_BOOTTIME_ALARM == TRUE)
static const clockid_t CLOCK_ID_ALARM = CLOCK_BOOTTIME;
#else
static const clockid_t CLOCK_ID_ALARM = CLOCK_BOOTTIME_ALARM;
#endif

// This mutex ensures that the |alarm_set|, |alarm_cancel|, and alarm callback
// functions execute serially and not concurrently. As a result, this mutex