/** * Returns the connection state of given device. * @param device the target device * @return the connection state, as in {@link BleManager#getConnectionState()}. */ public final int getConnectionState(final BluetoothDevice device) { final BleManager<BleManagerCallbacks> manager = mBleManagers.get(device); return manager != null ? manager.getConnectionState() : BluetoothGatt.STATE_DISCONNECTED; }