summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/opp/BluetoothOppRfcommListener.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/bluetooth/opp/BluetoothOppRfcommListener.java')
-rwxr-xr-xsrc/com/android/bluetooth/opp/BluetoothOppRfcommListener.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppRfcommListener.java b/src/com/android/bluetooth/opp/BluetoothOppRfcommListener.java
index b5506f07f..6109b5a61 100755
--- a/src/com/android/bluetooth/opp/BluetoothOppRfcommListener.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppRfcommListener.java
@@ -53,10 +53,8 @@ public class BluetoothOppRfcommListener {
private static final boolean V = Constants.VERBOSE;
public static final int MSG_INCOMING_BTOPP_CONNECTION = 100;
- private static final int JOIN_TIMEOUT_MS=2000;
private volatile boolean mInterrupted;
- private volatile boolean mFinish;
private Thread mSocketAcceptThread;
@@ -123,11 +121,12 @@ public class BluetoothOppRfcommListener {
Log.e(TAG, "Error create RfcommServerSocket " + e1);
serverOK = false;
}
+
if (!serverOK) {
synchronized (this) {
try {
- if (V) Log.v(TAG, "Wait 3 seconds");
- Thread.sleep(3000);
+ if (V) Log.v(TAG, "Wait 300 ms");
+ Thread.sleep(300);
} catch (InterruptedException e) {
Log.e(TAG, "socketAcceptThread thread was interrupted (3)");
mInterrupted = true;
@@ -169,6 +168,9 @@ public class BluetoothOppRfcommListener {
}
} catch (IOException e) {
Log.e(TAG, "Error accept connection " + e);
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ie) {}
}
}
Log.i(TAG, "BluetoothSocket listen thread finished");