rx-central-ble-sample/src/main/java/com/uber/rxcentralble/sample/MainActivity.java [230:262]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                .retryWhen(errors ->
                        errors.flatMap(
                            error -> {
                              if (error instanceof ConnectionError) {
                                return Observable.just(Irrelevant.INSTANCE);
                              }

                              return Observable.error(error);
                            }))
                .subscribe(
                        peripheral -> {
                          peripheralManager.setPeripheral(peripheral);

                          AndroidSchedulers.mainThread().scheduleDirect(() -> connectButton.setText("Disconnect"));
                          Timber.i("Connected to: " + name);
                          Timber.i("Max Write Length (MTU): " + peripheral.getMaxWriteLength());
                        },
                        error -> {
                          connection.dispose();
                          connection = null;

                          AndroidSchedulers.mainThread().scheduleDirect(() -> connectButton.setText("Connect"));
                          Timber.i("Connection error: " + error.getMessage());
                        }
                );

      }
    } else {
      connection.dispose();
      connection = null;

      connectButton.setText("Connect");
      Timber.i("Disconnected");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



rx-central-ble-sample/src/main/java/com/uber/rxcentralble/sample/MainActivity.java [282:314]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                .retryWhen(errors ->
                        errors.flatMap(
                            error -> {
                              if (error instanceof ConnectionError) {
                                return Observable.just(Irrelevant.INSTANCE);
                              }

                              return Observable.error(error);
                            }))
                .subscribe(
                        peripheral -> {
                          peripheralManager.setPeripheral(peripheral);

                          AndroidSchedulers.mainThread().scheduleDirect(() -> connectButton.setText("Disconnect"));
                          Timber.i("Connected to: " + name);
                          Timber.i("Max Write Length (MTU): " + peripheral.getMaxWriteLength());
                        },
                        error -> {
                          connection.dispose();
                          connection = null;

                          AndroidSchedulers.mainThread().scheduleDirect(() -> connectButton.setText("Connect"));
                          Timber.i("Connection error: " + error.getMessage());
                        }
                );

      }
    } else {
      connection.dispose();
      connection = null;

      connectButton.setText("Connect");
      Timber.i("Disconnected");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



