diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2014-09-04 18:12:41 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-04 18:12:41 +0000 |
commit | 320ae7b7410342eedb7b689bb5a84323f3c125d8 (patch) | |
tree | 241c46f6c48638d7f5c25c16542676cfb15c39f3 | |
parent | 0497ec6e0b24e5153dda7dcd7ff82cfabfcfdf18 (diff) | |
parent | 3b7da912d573f358fd217f6d9b569cca648efe02 (diff) | |
download | android_frameworks_ex-320ae7b7410342eedb7b689bb5a84323f3c125d8.tar.gz android_frameworks_ex-320ae7b7410342eedb7b689bb5a84323f3c125d8.tar.bz2 android_frameworks_ex-320ae7b7410342eedb7b689bb5a84323f3c125d8.zip |
am 3b7da912: ex: Avoid exception if HDR_SCENE_MODE name changes.
* commit '3b7da912d573f358fd217f6d9b569cca648efe02':
ex: Avoid exception if HDR_SCENE_MODE name changes.
-rw-r--r-- | camera2/portability/src/com/android/ex/camera2/portability/LegacyVendorTags.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/camera2/portability/src/com/android/ex/camera2/portability/LegacyVendorTags.java b/camera2/portability/src/com/android/ex/camera2/portability/LegacyVendorTags.java index e55748d..7eb5c33 100644 --- a/camera2/portability/src/com/android/ex/camera2/portability/LegacyVendorTags.java +++ b/camera2/portability/src/com/android/ex/camera2/portability/LegacyVendorTags.java @@ -17,6 +17,7 @@ package com.android.ex.camera2.portability; import android.hardware.camera2.CameraCharacteristics; +import android.util.Log; import java.lang.ExceptionInInitializerError; import java.lang.reflect.Field; @@ -27,19 +28,24 @@ import java.lang.reflect.Method; */ public class LegacyVendorTags { + private static final String TAG = "LegacyVendorTags"; + /** * Hidden enum for scene modes supported only by the Camera1 API. */ public static final int CONTROL_SCENE_MODE_HDR; static { + int tempSceneMode = -1; try { - CONTROL_SCENE_MODE_HDR = + tempSceneMode = Class.forName("android.hardware.camera2.CameraCharacteristics"). getField("CONTROL_SCENE_MODE_HDR").getInt(null); } catch (Exception e) { - throw new ExceptionInInitializerError( - "Error while reflecting on LegacyVendorTags: " + e); + Log.e(TAG, "Error while reflecting on SCENE_MODE_HDR enum, HDR will not be available: " + + e); + } finally { + CONTROL_SCENE_MODE_HDR = tempSceneMode; } } |