diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2014-12-05 11:45:27 -0800 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2015-01-07 17:50:04 +0000 |
commit | c5effbd8ffed05f6c5142c1c8d491c398194bf5b (patch) | |
tree | 2d91f113363e1d04bd31935b091580b69859c9a7 /camera2/portability/src/com/android/ex/camera2/portability | |
parent | d6e77bd2255ee1b48d3e45ead10a8b2b5d975fc5 (diff) | |
download | android_frameworks_ex-c5effbd8ffed05f6c5142c1c8d491c398194bf5b.tar.gz android_frameworks_ex-c5effbd8ffed05f6c5142c1c8d491c398194bf5b.tar.bz2 android_frameworks_ex-c5effbd8ffed05f6c5142c1c8d491c398194bf5b.zip |
Camera2: Portability: Remove HDR hack.
Bug: 18640480
Change-Id: I8f0b42cbb05c6881fbc32664ce9e2b97a0ef5db3
Diffstat (limited to 'camera2/portability/src/com/android/ex/camera2/portability')
3 files changed, 3 insertions, 60 deletions
diff --git a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2Capabilities.java b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2Capabilities.java index 8001a37..9601d03 100644 --- a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2Capabilities.java +++ b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2Capabilities.java @@ -223,13 +223,11 @@ public class AndroidCamera2Capabilities extends CameraCapabilities { return SceneMode.SUNSET; case CONTROL_SCENE_MODE_THEATRE: return SceneMode.THEATRE; + case CONTROL_SCENE_MODE_HDR: + return SceneMode.HDR; // TODO: We cannot expose FACE_PRIORITY, or HIGH_SPEED_VIDEO } - if (sm == LegacyVendorTags.CONTROL_SCENE_MODE_HDR) { - return SceneMode.HDR; - } - Log.w(TAG, "Unable to convert from API 2 scene mode: " + sm); return null; } diff --git a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2Settings.java b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2Settings.java index 0062097..cf17072 100644 --- a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2Settings.java +++ b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2Settings.java @@ -429,7 +429,7 @@ public class AndroidCamera2Settings extends CameraSettings { break; } case HDR: { - mode = LegacyVendorTags.CONTROL_SCENE_MODE_HDR; + mode = CONTROL_SCENE_MODE_HDR; break; } case LANDSCAPE: { diff --git a/camera2/portability/src/com/android/ex/camera2/portability/LegacyVendorTags.java b/camera2/portability/src/com/android/ex/camera2/portability/LegacyVendorTags.java deleted file mode 100644 index 7eb5c33..0000000 --- a/camera2/portability/src/com/android/ex/camera2/portability/LegacyVendorTags.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.ex.camera2.portability; - -import android.hardware.camera2.CameraCharacteristics; -import android.util.Log; - -import java.lang.ExceptionInInitializerError; -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -/** - * Vendor tag declarations for the Legacy Camera2 API implementation. - */ -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 { - 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; - } - } - - private LegacyVendorTags() { - throw new AssertionError(); - } -}
\ No newline at end of file |