summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/hardware/Camera.java9
-rw-r--r--core/jni/android_hardware_Camera.cpp24
2 files changed, 30 insertions, 3 deletions
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 4574d06..218f7f1 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -2093,6 +2093,15 @@ public class Camera {
}
private native final void native_setLongshot(boolean enable);
+ /** @hide
+ * Stop longshot. Available only in ZSL.
+ */
+ public final void stopLongshot()
+ {
+ native_stopLongshot();
+ }
+ private native final void native_stopLongshot();
+
/** @hide
* Handles the Touch Co-ordinate.
*/
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index e375804..4cf317e 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -488,6 +488,21 @@ static void android_hardware_Camera_setLongshot(JNIEnv *env, jobject thiz, jbool
}
}
+static void android_hardware_Camera_stopLongshot(JNIEnv *env, jobject thiz)
+{
+ ALOGV("stopLongshot");
+ JNICameraContext* context;
+ status_t rc;
+ sp<Camera> camera = get_native_camera(env, thiz, &context);
+ if (camera == 0) return;
+
+ rc = camera->sendCommand(CAMERA_CMD_STOP_LONGSHOT, 0, 0);
+
+ if (rc != NO_ERROR) {
+ jniThrowException(env, "java/lang/RuntimeException", "enabling longshot mode failed");
+ }
+}
+
static void android_hardware_Camera_sendHistogramData(JNIEnv *env, jobject thiz)
{
ALOGV("sendHistogramData" );
@@ -1119,9 +1134,12 @@ static JNINativeMethod camMethods[] = {
{ "native_sendHistogramData",
"()V",
(void *)android_hardware_Camera_sendHistogramData },
- { "native_setLongshot",
- "(Z)V",
- (void *)android_hardware_Camera_setLongshot },
+ { "native_setLongshot",
+ "(Z)V",
+ (void *)android_hardware_Camera_setLongshot },
+ { "native_stopLongshot",
+ "()V",
+ (void *)android_hardware_Camera_stopLongshot },
{ "native_setParameters",
"(Ljava/lang/String;)V",
(void *)android_hardware_Camera_setParameters },