From e2982ad5a15f604218a7cfb37ab1aaed544667d3 Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Thu, 20 Aug 2015 15:40:31 -0700 Subject: [PATCH] service: Don't lie about supporting wake locks Changed the code to return error rather than success from the native bt_os_callout_t hooks. Bug: 23390297 Change-Id: I0a4e2678ace88072294b82e57cf1e1bd3edd08cd --- service/hal/bluetooth_interface.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/service/hal/bluetooth_interface.cpp b/service/hal/bluetooth_interface.cpp index b89abf22e..647f328c8 100644 --- a/service/hal/bluetooth_interface.cpp +++ b/service/hal/bluetooth_interface.cpp @@ -90,27 +90,24 @@ bool SetWakeAlarmCallout(uint64_t /* delay_millis */, bool /* should_wake */, alarm_cb /* cb */, void* /* data */) { - // TODO(armansito): Figure out what to do with this callback. It's not being - // used by us right now but the code crashes without setting it. The stack - // should be refactored to make things optional and definitely not crash. - // (See http://b/23315739) - return true; + // TODO(armansito): According to sharvil@, this interface doesn't even need to + // exist and can be done entirely from within osi by interfacing directly with + // the kernel. Remove these stubs once that's fixed. (See http://b/23390297) + return false; } int AcquireWakeLockCallout(const char* /* lock_name */) { - // TODO(armansito): Figure out what to do with this callback. It's not being - // used by us right now but the code crashes without setting it. The stack - // should be refactored to make things optional and definitely not crash. - // (See http://b/23315739) - return BT_STATUS_SUCCESS; + // TODO(armansito): According to sharvil@, this interface doesn't even need to + // exist and can be done entirely from within osi by interfacing directly with + // the kernel. Remove these stubs once that's fixed. (See http://b/23390297) + return BT_STATUS_UNSUPPORTED; } int ReleaseWakeLockCallout(const char* /* lock_name */) { - // TODO(armansito): Figure out what to do with this callback. It's not being - // used by us right now but the code crashes without setting it. The stack - // should be refactored to make things optional and definitely not crash. - // (See http://b/23315739) - return BT_STATUS_SUCCESS; + // TODO(armansito): According to sharvil@, this interface doesn't even need to + // exist and can be done entirely from within osi by interfacing directly with + // the kernel. Remove these stubs once that's fixed. (See http://b/23390297) + return BT_STATUS_UNSUPPORTED; } // The HAL Bluetooth DM callbacks. -- 2.11.0