summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpramod kotreshappa <pramodk@codeaurora.org>2014-03-03 13:04:11 -0800
committerSteve Kondik <shade@chemlab.org>2014-10-11 16:31:43 -0700
commit74e613cb91301c1dff4e817ec66ac3624f059465 (patch)
tree4f89ffe22d74d3f2804e5d73c6f897bfdd5bef1f
parentde42249f9be2f93606ec2e4f3a5b9a3efb888153 (diff)
downloadandroid_packages_apps_Bluetooth-74e613cb91301c1dff4e817ec66ac3624f059465.tar.gz
android_packages_apps_Bluetooth-74e613cb91301c1dff4e817ec66ac3624f059465.tar.bz2
android_packages_apps_Bluetooth-74e613cb91301c1dff4e817ec66ac3624f059465.zip
Bluetooth: Fix for BT fails to turn on in PDT test
Fix for BT fails to turn on after several hours of PDT test Issue is due to disable timeout, host fails to get the wack ACK from the SoC during BT turn of. Adding ssr cleanup routine in disable timout routine CRs-Fixed: 614585 Change-Id: Ia32da9426f976ddc71f0ad740312222b4b646c94
-rw-r--r--jni/com_android_bluetooth_btservice_AdapterService.cpp14
-rw-r--r--src/com/android/bluetooth/btservice/AdapterService.java1
-rw-r--r--src/com/android/bluetooth/btservice/AdapterState.java1
3 files changed, 16 insertions, 0 deletions
diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp
index 6e5e1aa6f..dc6964f9e 100644
--- a/jni/com_android_bluetooth_btservice_AdapterService.cpp
+++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp
@@ -662,6 +662,19 @@ static bool cleanupNative(JNIEnv *env, jobject obj) {
return JNI_TRUE;
}
+static bool ssrcleanupNative(JNIEnv *env, jobject obj) {
+ ALOGV("%s:",__FUNCTION__);
+
+ jboolean result = JNI_FALSE;
+ if (!sBluetoothInterface) return result;
+
+ sBluetoothInterface->ssrcleanup();
+ ALOGI("%s: return from cleanup",__FUNCTION__);
+
+ env->DeleteGlobalRef(sJniCallbacksObj);
+ return JNI_TRUE;
+}
+
static jboolean enableNative(JNIEnv* env, jobject obj) {
ALOGV("%s:",__FUNCTION__);
@@ -1124,6 +1137,7 @@ static JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void *) classInitNative},
{"initNative", "()Z", (void *) initNative},
{"cleanupNative", "()V", (void*) cleanupNative},
+ {"ssrcleanupNative", "()V", (void*) ssrcleanupNative},
{"enableNative", "()Z", (void*) enableNative},
{"disableNative", "()Z", (void*) disableNative},
{"setAdapterPropertyNative", "(I[B)Z", (void*) setAdapterPropertyNative},
diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java
index 181998df4..f45a8c081 100644
--- a/src/com/android/bluetooth/btservice/AdapterService.java
+++ b/src/com/android/bluetooth/btservice/AdapterService.java
@@ -1584,6 +1584,7 @@ public class AdapterService extends Service {
private native static void classInitNative();
private native boolean initNative();
private native void cleanupNative();
+ /*package*/ native void ssrcleanupNative();
/*package*/ native boolean enableNative();
/*package*/ native boolean disableNative();
/*package*/ native boolean setAdapterPropertyNative(int type, byte[] val);
diff --git a/src/com/android/bluetooth/btservice/AdapterState.java b/src/com/android/bluetooth/btservice/AdapterState.java
index b239278ba..a0ec83865 100644
--- a/src/com/android/bluetooth/btservice/AdapterState.java
+++ b/src/com/android/bluetooth/btservice/AdapterState.java
@@ -349,6 +349,7 @@ final class AdapterState extends StateMachine {
if (DBG) Log.d(TAG,"CURRENT_STATE=PENDING, MESSAGE = DISABLE_TIMEOUT, isTurningOn=" + isTurningOn + ", isTurningOff=" + isTurningOff);
errorLog("Error disabling Bluetooth");
mPendingCommandState.setTurningOff(false);
+ adapterService.ssrcleanupNative();
transitionTo(mOffState);
notifyAdapterStateChange(BluetoothAdapter.STATE_OFF);
errorLog("Killing the process to force a restart as part cleanup");