summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSol Boucher <solb@google.com>2014-08-23 06:19:13 (GMT)
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-23 06:19:13 (GMT)
commitd90959c9fcf4ec6d6f332ab534993913538bfe38 (patch)
tree19a03ae31ca197e3511978d1e93651f42fde751f
parent18aa7840e17473544a80205367435e9c2e8b7527 (diff)
parentd6a52ce7b43f15fc931038133b4fea821e9f3b9f (diff)
downloadandroid_frameworks_ex-d90959c9fcf4ec6d6f332ab534993913538bfe38.zip
android_frameworks_ex-d90959c9fcf4ec6d6f332ab534993913538bfe38.tar.gz
android_frameworks_ex-d90959c9fcf4ec6d6f332ab534993913538bfe38.tar.bz2
am d6a52ce7: Merge "camera2-api: Work around invalid camera2 API focus modes" into lmp-dev
* commit 'd6a52ce7b43f15fc931038133b4fea821e9f3b9f': camera2-api: Work around invalid camera2 API focus modes
-rw-r--r--camera2/portability/src/com/android/ex/camera2/portability/CameraCapabilities.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/camera2/portability/src/com/android/ex/camera2/portability/CameraCapabilities.java b/camera2/portability/src/com/android/ex/camera2/portability/CameraCapabilities.java
index 6a4c72c..3dc19f7 100644
--- a/camera2/portability/src/com/android/ex/camera2/portability/CameraCapabilities.java
+++ b/camera2/portability/src/com/android/ex/camera2/portability/CameraCapabilities.java
@@ -720,9 +720,16 @@ public class CameraCapabilities {
private boolean focusCheck(final CameraSettings settings) {
FocusMode focusMode = settings.getCurrentFocusMode();
if (!supports(focusMode)) {
- Log.v(TAG,
- "Focus mode not supported:" + (focusMode != null ? focusMode.name() : "null"));
- return false;
+ if (supports(FocusMode.FIXED)) {
+ // Workaround for devices whose templates define defaults they don't really support
+ // TODO: Remove workaround (b/17177436)
+ Log.w(TAG, "Focus mode not supported... trying FIXED");
+ settings.setFocusMode(FocusMode.FIXED);
+ } else {
+ Log.v(TAG, "Focus mode not supported:" +
+ (focusMode != null ? focusMode.name() : "null"));
+ return false;
+ }
}
return true;
}