private boolean hasFlash() {
        return getApplicationContext().getPackageManager()
                .hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);
    }
Check if the device's camera has a Flashlight.
@return true if there is Flashlight, otherwise false.
sample/src/main/java/example/zxing/CustomScannerActivity.java