synchronized connectifnotconnected
This commit is contained in:
parent
a10a819a9d
commit
b818027b02
|
@ -68,6 +68,8 @@ public class DanaConnection {
|
|||
PowerManager.WakeLock mWakeLock;
|
||||
private Treatment bolusingTreatment = null;
|
||||
|
||||
private static Object connectionInProgress = new Object();
|
||||
|
||||
private DanaRFragment danaRFragment;
|
||||
private DanaRPump danaRPump;
|
||||
|
||||
|
@ -159,6 +161,7 @@ public class DanaConnection {
|
|||
}
|
||||
|
||||
public synchronized void connectIfNotConnected(String callerName) {
|
||||
synchronized (connectionInProgress) {
|
||||
mWakeLock.acquire();
|
||||
long startTime = System.currentTimeMillis();
|
||||
short connectionAttemptCount = 0;
|
||||
|
@ -191,6 +194,7 @@ public class DanaConnection {
|
|||
}
|
||||
mWakeLock.release();
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void connectBT() {
|
||||
if (mDevice == null) {
|
||||
|
|
Loading…
Reference in a new issue