Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5fada38 authored by Emilian Peev's avatar Emilian Peev Committed by Steve Kondik
Browse files

Camera: Adds support for longshot configuration

- The Camera API is extended with one additional
  call for longshot mode configuration.

Change-Id: If3bcad003facae22ec2bd690480dc3db63f0b28a
parent e0c114fb
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1665,6 +1665,17 @@ public class Camera {
    }
    private native final void native_sendMetaData();

    /** @hide
     * Configure longshot mode. Available only in ZSL.
     *
     * @param enable enable/disable this mode
     */
    public final void setLongshot(boolean enable)
    {
        native_setLongshot(enable);
    }
    private native final void native_setLongshot(boolean enable);

     /** @hide
     * Handles the Touch Co-ordinate.
     */
+22 −0
Original line number Diff line number Diff line
@@ -455,6 +455,25 @@ void JNICameraContext::setCallbackMode(JNIEnv *env, bool installed, bool manualM
    }
}

static void android_hardware_Camera_setLongshot(JNIEnv *env, jobject thiz, jboolean enable)
{
    ALOGV("setLongshot");
    JNICameraContext* context;
    status_t rc;
    sp<Camera> camera = get_native_camera(env, thiz, &context);
    if (camera == 0) return;

    if ( enable ) {
        rc = camera->sendCommand(CAMERA_CMD_LONGSHOT_ON, 0, 0);
    } else {
        rc = camera->sendCommand(CAMERA_CMD_LONGSHOT_OFF, 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" );
@@ -1052,6 +1071,9 @@ static JNINativeMethod camMethods[] = {
  { "native_sendHistogramData",
    "()V",
     (void *)android_hardware_Camera_sendHistogramData },
 { "native_setLongshot",
     "(Z)V",
      (void *)android_hardware_Camera_setLongshot },
  { "native_setParameters",
    "(Ljava/lang/String;)V",
    (void *)android_hardware_Camera_setParameters },