mConnectionState = BluetoothGatt.STATE_DISCONNECTING; log(Log.VERBOSE, mConnected ? "Disconnecting..." : "Cancelling connection..."); mCallbacks.onDeviceDisconnecting(mBluetoothGatt.getDevice()); final boolean wasConnected = mConnected; log(Log.DEBUG, "gatt.disconnect()");