OSDN Git Service

DO NOT MERGE Revert "am b3ca1b37: resolved conflicts for merge of a905eb62 to mnc...
[android-x86/system-bt.git] / osi / src / alarm.c
index f37080a..1fe8a7f 100644 (file)
@@ -30,7 +30,6 @@
 #include <time.h>
 
 #include <hardware/bluetooth.h>
-#include <hardware_legacy/power.h>
 
 #include "osi/include/allocator.h"
 #include "osi/include/list.h"
@@ -308,8 +307,8 @@ static void reschedule_root_alarm(void) {
   int64_t next_expiration = next->deadline - now();
   if (next_expiration < TIMER_INTERVAL_FOR_WAKELOCK_IN_MS) {
     if (!timer_set) {
-      int status = acquire_wake_lock(PARTIAL_WAKE_LOCK, WAKE_LOCK_ID);
-      if (status != (int) strlen(WAKE_LOCK_ID)) {
+      int status = bt_os_callouts->acquire_wake_lock(WAKE_LOCK_ID);
+      if (status != BT_STATUS_SUCCESS) {
         LOG_ERROR(LOG_TAG, "%s unable to acquire wake lock: %d", __func__, status);
         goto done;
       }
@@ -325,7 +324,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_was_set && !timer_set) {
-    release_wake_lock(WAKE_LOCK_ID);
+    bt_os_callouts->release_wake_lock(WAKE_LOCK_ID);
   }
 
   if (timer_settime(timer, TIMER_ABSTIME, &wakeup_time, NULL) == -1)