summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Zhang <lukez@codeaurora.org>2016-11-08 09:42:46 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-11-30 15:57:08 -0800
commit8edd1a3a518f3858ba517de3bf010a5054de161f (patch)
treeb41e966d9dab59f5279888adb8426ec968ddebbb
parent09a26e7e5b6d2094919bf592e9c3de796bc90af2 (diff)
downloadandroid_packages_apps_Bluetooth-8edd1a3a518f3858ba517de3bf010a5054de161f.tar.gz
android_packages_apps_Bluetooth-8edd1a3a518f3858ba517de3bf010a5054de161f.tar.bz2
android_packages_apps_Bluetooth-8edd1a3a518f3858ba517de3bf010a5054de161f.zip
Enable the native wake lock in BT stack
In BT stack, we have two options when configuring the wake lock. One is to create it on native side. Another is to create it on Java framework side. We selected the native side to improve the efficiency. CRs-fixed: 1087262 Change-Id: I40b6de481a08e4c4cdeec6f2d1ac6eae1ff96530
-rw-r--r--jni/com_android_bluetooth_btservice_AdapterService.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp
index 30724f4bf..28a0e558c 100644
--- a/jni/com_android_bluetooth_btservice_AdapterService.cpp
+++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp
@@ -754,6 +754,9 @@ static bool initNative(JNIEnv* env, jobject obj) {
sBluetoothInterface = NULL;
return JNI_FALSE;
}
+
+ /*disable these os_callout settings, so that native wake_lock will be enabled*/
+#if 0
ret = sBluetoothInterface->set_os_callouts(&sBluetoothOsCallouts);
if (ret != BT_STATUS_SUCCESS) {
ALOGE("Error while setting Bluetooth callouts: %d\n", ret);
@@ -761,7 +764,7 @@ static bool initNative(JNIEnv* env, jobject obj) {
sBluetoothInterface = NULL;
return JNI_FALSE;
}
-
+#endif
if ( (sBluetoothSocketInterface = (btsock_interface_t *)
sBluetoothInterface->get_profile_interface(BT_PROFILE_SOCKETS_ID)) == NULL) {
ALOGE("Error getting socket interface");