public boolean getIsBarcodeDetectorOperational(Activity activity) {
    final AuthenticatorApplication application =
        (AuthenticatorApplication) activity.getApplicationContext();
    return application.getBarcodeDetector() != null
        && application.getBarcodeDetector().isOperational();
  }
Returns whether the barcode detector is operational or not.
java/com/google/android/apps/authenticator/barcode/BarcodeConditionChecker.java