public BarcodeDetector getBarcodeDetector() {
    try {
      return barcodeDetectorFutureTask.get(GET_BARCODE_DETECTOR_TIMEOUT_MS,
          TimeUnit.MILLISECONDS);
    } catch (InterruptedException | ExecutionException | TimeoutException e) {
      e.printStackTrace();
      return null;
    }
  }
Get the cached barcode detector. If the barcode detector is not available yet, we build and
catch it, the building takes about ~1000ms.
java/com/google/android/apps/authenticator/AuthenticatorApplication.java