docs: void enableCCCD(@NonNull final BluetoothGattCharacteristic characteristic, final int type)
              throws DeviceDisconnectedException, DfuException, UploadAbortedException {
  		final BluetoothGatt gatt = mGatt;
  		final String debugString = type == NOTIFICATIONS ? "notifications" : "indications";
  		if (!mConnected)
  			throw new DeviceDisconnectedException("Unable to set " + debugString + " state: device disconnected");
  		if (mAborted)
  			throw new UploadAbortedException();
  
  		mReceivedData = null;
  		mError = 0;
  		final BluetoothGattDescriptor descriptor = characteristic.getDescriptor(CLIENT_CHARACTERISTIC_CONFIG);
  		boolean cccdEnabled = descriptor.getValue() != null && descriptor.getValue().length == 2 && descriptor.getValue()[0] > 0 && descriptor.getValue()[1] == 0;
  		if (cccdEnabled)
  			return;
  
  		logi("Enabling " + debugString + "...");
  		mService.sendLogBroadcast(DfuBaseService.LOG_LEVEL_VERBOSE,
                  "Enabling " + debugString + " for " + characteristic.getUuid());
  
  		// enable notifications locally
  		mService.sendLogBroadcast(DfuBaseService.LOG_LEVEL_DEBUG,
                  "gatt.setCharacteristicNotification(" + characteristic.getUuid() + ", true)");
  		gatt.setCharacteristicNotification(characteristic, true);
  
  		// enable notifications on the device
  		descriptor.setValue(type == NOTIFICATIONS ? BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE : BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
  		mService.sendLogBroadcast(DfuBaseService.LOG_LEVEL_DEBUG,
                  "gatt.writeDescriptor(" + descriptor.getUuid() + (type == NOTIFICATIONS ? ", value=0x01-00)" : ", value=0x02-00)"));
  		gatt.writeDescriptor(descriptor);
  
  		// We have to wait until device receives a response or an error occur
  		try {
  			synchronized (mLock) {
  				while ((!cccdEnabled && mConnected && mError == 0) || mPaused) {
  					mLock.wait();
  					// Check the value of the CCCD
  					cccdEnabled = descriptor.getValue() != null && descriptor.getValue().length == 2 && descriptor.getValue()[0] > 0 && descriptor.getValue()[1] == 0;
  				}
  			}
  		} catch (final InterruptedException e) {
  			loge("Sleeping interrupted", e);
  		}
  		if (!mConnected)
  			throw new DeviceDisconnectedException("Unable to set " + debugString + " state: device disconnected");
  		if (mError != 0)
  			throw new DfuException("Unable to set " + debugString + " state", mError);
  	}