int tempSceneMode = -1;
try {
tempSceneMode =
Class.forName("android.hardware.camera2.CameraCharacteristics").
getField("CONTROL_SCENE_MODE_HDR").getInt(null);
} catch (Exception e) {
Log.e(TAG, "Error while reflecting on SCENE_MODE_HDR enum, HDR will not be available: "
+ e);
} finally {
CONTROL_SCENE_MODE_HDR = tempSceneMode;
}
throw new AssertionError();