Skip to content

Commit

Permalink
#25 fixed again: second blood
Browse files Browse the repository at this point in the history
  • Loading branch information
philips77 committed Nov 6, 2018
1 parent d91d6b8 commit 9319e8d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ble/src/main/java/no/nordicsemi/android/ble/BleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,17 @@ public void onReceive(final Context context, final Intent intent) {

// The connection is killed by the system, no need to disconnect gently.
mUserDisconnected = true;
// Allow new requests when Bluetooth is enabled again. close() doesn't do it.
// See: https://github.com/NordicSemiconductor/Android-BLE-Library/issues/25
// and: https://github.com/NordicSemiconductor/Android-BLE-Library/issues/41
mGattCallback.mOperationInProgress = false;
// This will call close()
mGattCallback.notifyDeviceDisconnected(mBluetoothDevice);
} else {
// Calling close() will prevent the STATE_OFF event from being logged
// (this receiver will be unregistered). But it doesn't matter.
close();
}
// Calling close() will prevent the STATE_OFF event from being logged
// (this receiver will be unregistered). But it doesn't matter.
close();
break;
}
}
Expand Down

0 comments on commit 9319e8d

Please sign in to comment.