@SuppressLint("MissingPermission") // We check before this is called
    public void disconnect() {
        if (mBluetoothAdapter == null || mBluetoothGatt == null) {
            Log.w(TAG, "BluetoothAdapter not initialized");
            return;
        }
        mBluetoothGatt.disconnect();

        // Reusing a Gatt after disconnecting can cause problems
        mBluetoothGatt = null;
    }
Disconnects an existing connection or cancel a pending connection. The disconnection result
is reported asynchronously through the
{@code BluetoothGattCallback#onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int)}
callback.
sample_app/src/main/java/uk/co/alt236/btlescan/services/BluetoothLeService.java