Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
whilu committed Jan 18, 2016
1 parent a19421e commit 3b0f47e
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public BluetoothService() {
}

/**
* Set the current state of the chat connection
* Set the current state of the connection
* @param state An integer defining the current connection state
*/
private synchronized void setState(int state) {
Expand Down Expand Up @@ -93,11 +93,9 @@ public synchronized void start() {
public synchronized void connect(BluetoothDevice device) {
Log.d(TAG, "connect to: " + device);
// Cancel any thread attempting to make a connection
if (mState == STATE_CONNECTING) {
if (mConnectThread != null) {
mConnectThread.cancel();
mConnectThread = null;
}
if (mState == STATE_CONNECTING && mConnectThread != null) {
mConnectThread.cancel();
mConnectThread = null;
}
// Cancel any thread currently running a connection
if (mConnectedThread != null) {
Expand Down

0 comments on commit 3b0f47e

Please sign in to comment.