summaryrefslogtreecommitdiffstats
path: root/camera2
diff options
context:
space:
mode:
authorSol Boucher <solb@google.com>2014-08-22 16:23:29 -0700
committerSol Boucher <solb@google.com>2014-08-22 16:45:04 -0700
commitf2b5a976bb1c30f83682a996ce9289a973c88784 (patch)
tree32e3be9b9d6649ef606dc889f62762fb0e490d1d /camera2
parent8aa57d57fb5c153aa317f46c0d5e44365ebbef80 (diff)
downloadandroid_frameworks_ex-f2b5a976bb1c30f83682a996ce9289a973c88784.tar.gz
android_frameworks_ex-f2b5a976bb1c30f83682a996ce9289a973c88784.tar.bz2
android_frameworks_ex-f2b5a976bb1c30f83682a996ce9289a973c88784.zip
camera2-api: Work around invalid camera2 API focus modes
The validation routine now changes the focus mode to FIXED if the requested one is unsupported. This is to work around devices whose templates erroneously specify unsupported focus modes. Bug: 17177436 Change-Id: If9b679510e0c232453dd0a77dbdd2e0ec713ac12
Diffstat (limited to 'camera2')
-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;
}