summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Xie <mattx@google.com>2014-05-23 17:03:44 -0700
committerMatthew Xie <mattx@google.com>2014-05-23 17:03:44 -0700
commitb0b958e9d0bc6b67777e9f3660c3b4e28180f480 (patch)
treef38b325798a43fad1ddfab2dea2df26d38a773d2
parenta03d2e10a067bdd87b608e73af2c3cfc02d5dd50 (diff)
downloadandroid_packages_apps_Bluetooth-b0b958e9d0bc6b67777e9f3660c3b4e28180f480.tar.gz
android_packages_apps_Bluetooth-b0b958e9d0bc6b67777e9f3660c3b4e28180f480.tar.bz2
android_packages_apps_Bluetooth-b0b958e9d0bc6b67777e9f3660c3b4e28180f480.zip
Revert "Provide bluedroid with wakelock access as a temporary fix"
This reverts commit cfba316c529471af6072d836957d06496cc1b554.
-rw-r--r--jni/Android.mk4
-rw-r--r--jni/com_android_bluetooth_btservice_AdapterService.cpp40
2 files changed, 2 insertions, 42 deletions
diff --git a/jni/Android.mk b/jni/Android.mk
index 939231e17..6488ead01 100644
--- a/jni/Android.mk
+++ b/jni/Android.mk
@@ -21,9 +21,7 @@ LOCAL_SHARED_LIBRARIES := \
libcutils \
libutils \
liblog \
- libhardware \
- libpowermanager \
- libbinder
+ libhardware
LOCAL_MULTILIB := 32
diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp
index 4fd69447b..28de5eafc 100644
--- a/jni/com_android_bluetooth_btservice_AdapterService.cpp
+++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp
@@ -22,10 +22,6 @@
#include "cutils/properties.h"
#include "android_runtime/AndroidRuntime.h"
#include "android_runtime/Log.h"
-#include <powermanager/PowerManager.h>
-#include <powermanager/IPowerManager.h>
-#include <binder/IServiceManager.h>
-#include <utils/RefBase.h>
#include <string.h>
#include <pthread.h>
@@ -443,39 +439,6 @@ static void le_test_mode_recv_callback (bt_status_t status, uint16_t packet_coun
ALOGV("%s: status:%d packet_count:%d ", __FUNCTION__, status, packet_count);
}
-
-static void bt_wakelock_control_callback(int acquire) {
- static sp<IPowerManager> sPm = NULL;
- static sp<IBinder> sWakelock = NULL;
-
- if (sPm == NULL) {
- sp<IBinder> binder = defaultServiceManager()->checkService(String16("power"));
- sPm = interface_cast<IPowerManager>(binder);
-
- if (sPm == NULL) {
- ALOGE("Unable to get a hold of PowerManager. Bluetooth wakelocks will not function");
- return;
- }
- }
- if (acquire) {
- if (sWakelock != NULL)
- ALOGE("Double wakelock-acquire in BT");
- else {
- sp<IBinder> binder = new BBinder();
- if (NO_ERROR == sPm->acquireWakeLock(POWERMANAGER_PARTIAL_WAKE_LOCK, binder,
- String16("TimerWakelock"), String16("Bluetooth")))
- sWakelock = binder;
- }
- } else {
- if (sWakelock == NULL)
- ALOGE("Double wakelock-release in BT");
- else {
- sPm->releaseWakeLock(sWakelock, 0);
- sWakelock.clear();
- }
- }
-}
-
bt_callbacks_t sBluetoothCallbacks = {
sizeof(sBluetoothCallbacks),
adapter_state_change_callback,
@@ -490,8 +453,7 @@ bt_callbacks_t sBluetoothCallbacks = {
callback_thread_event,
dut_mode_recv_callback,
- le_test_mode_recv_callback,
- bt_wakelock_control_callback
+ le_test_mode_recv_callback
};
static void classInitNative(JNIEnv* env, jclass clazz) {