summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoModule.java
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2016-04-20 17:02:20 -0700
committerEthan Chen <intervigil@gmail.com>2016-04-20 17:42:59 -0700
commit1f7404e8d825878afef2b4c38e30470ac95e9ba5 (patch)
treebc4a712e28bf463486c071d1c53bd69eff597a31 /src/com/android/camera/PhotoModule.java
parentf9739a380ecfb39a9c601c8dd47dbda89b21a470 (diff)
downloadandroid_packages_apps_Snap-1f7404e8d825878afef2b4c38e30470ac95e9ba5.tar.gz
android_packages_apps_Snap-1f7404e8d825878afef2b4c38e30470ac95e9ba5.tar.bz2
android_packages_apps_Snap-1f7404e8d825878afef2b4c38e30470ac95e9ba5.zip
Snap: Add support for focus distance
* Hook up available metadata to the new focus manager. Change-Id: I793df67a2682d8bb2dee994193111227dd8c8d5a
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-rw-r--r--src/com/android/camera/PhotoModule.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index dc372a303..859f42f48 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -141,6 +141,7 @@ public class PhotoModule
private static final int SWITCH_TO_GCAM_MODULE = 12;
private static final int ON_PREVIEW_STARTED = 13;
private static final int UPDATE_GESTURES_UI = 14;
+ private static final int SET_FOCUS_RATIO = 15;
// The subset of parameters we need to update in setCameraParameters().
private static final int UPDATE_PARAM_INITIALIZE = 1;
@@ -490,6 +491,11 @@ public class PhotoModule
updateGesturesUI();
break;
}
+
+ case SET_FOCUS_RATIO: {
+ mUI.getFocusRing().setRadiusRatio((Float)msg.obj);
+ break;
+ }
}
}
}
@@ -935,6 +941,14 @@ public class PhotoModule
}
}
+ @Override
+ public void setFocusRatio(float ratio) {
+ mHandler.removeMessages(SET_FOCUS_RATIO);
+ Message m = mHandler.obtainMessage(SET_FOCUS_RATIO);
+ m.obj = ratio;
+ mHandler.sendMessage(m);
+ }
+
// TODO: need to check cached background apps memory and longshot ION memory
private boolean isLongshotNeedCancel() {
if (SECONDARY_SERVER_MEM == 0) {
@@ -1440,6 +1454,8 @@ public class PhotoModule
setCameraState(IDLE);
break;
}
+ mCameraDevice.refreshParameters();
+ mFocusManager.setParameters(mCameraDevice.getParameters());
mFocusManager.onAutoFocus(focused, mUI.isShutterPressed());
}
}
@@ -1450,6 +1466,8 @@ public class PhotoModule
@Override
public void onAutoFocusMoving(
boolean moving, CameraProxy camera) {
+ mCameraDevice.refreshParameters();
+ mFocusManager.setParameters(mCameraDevice.getParameters());
mFocusManager.onAutoFocusMoving(moving);
}
}
@@ -3693,6 +3711,7 @@ public class PhotoModule
CameraUtil.dumpParameters(mParameters);
mCameraDevice.setParameters(mParameters);
+ mFocusManager.setParameters(mParameters);
// Switch to gcam module if HDR+ was selected
if (doModeSwitch && !mIsImageCaptureIntent) {