summaryrefslogtreecommitdiffstats
path: root/core/java/android/bluetooth
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2009-09-29 13:00:30 -0700
committerJaikumar Ganesh <jaikumar@google.com>2009-09-30 17:46:17 -0700
commit54172d92afec5d7d18c830d7428a3230a39d4c02 (patch)
tree101993c906e08d4dcfe550093a8f9d68aeda7dab /core/java/android/bluetooth
parent4c9a29efdbf58034c1d90eb001dc7299f1f012ea (diff)
downloadframeworks_base-54172d92afec5d7d18c830d7428a3230a39d4c02.zip
frameworks_base-54172d92afec5d7d18c830d7428a3230a39d4c02.tar.gz
frameworks_base-54172d92afec5d7d18c830d7428a3230a39d4c02.tar.bz2
Try to reconnect twice when the rfcomm error code is Connection Refused.
This happens when the the remote headset is in a bad state or is not accepting connections. Try twice before giving up. Change-Id: I55e15bad6b72904b8e4ccbca89e17e9bd3ddb61e
Diffstat (limited to 'core/java/android/bluetooth')
-rw-r--r--core/java/android/bluetooth/HeadsetBase.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/bluetooth/HeadsetBase.java b/core/java/android/bluetooth/HeadsetBase.java
index 29cf41d..e2935c9 100644
--- a/core/java/android/bluetooth/HeadsetBase.java
+++ b/core/java/android/bluetooth/HeadsetBase.java
@@ -211,9 +211,10 @@ public final class HeadsetBase {
*/
public boolean connectAsync() {
- return connectAsyncNative();
+ int ret = connectAsyncNative();
+ return (ret == 0) ? true : false;
}
- private native boolean connectAsyncNative();
+ private native int connectAsyncNative();
public int getRemainingAsyncConnectWaitingTimeMs() {
return mTimeoutRemainingMs;