Fix 2083478: Camera needs an auto-focus cancel API

Change-Id: I13bda991b32aee47e82b5cf9d43b3021c416a9a2
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 04daa1c..9991600 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -383,6 +383,20 @@
     private native final void native_autoFocus();
 
     /**
+     * Cancels auto-focus function. If the auto-focus is still in progress,
+     * this function will cancel it. Whether the auto-focus is in progress
+     * or not, this function will return the focus position to the default.
+     * If the camera does not support auto-focus, this is a no-op.
+     * @hide
+     */
+    public final void cancelAutoFocus()
+    {
+        mAutoFocusCallback = null;
+        native_cancelAutoFocus();
+    }
+    private native final void native_cancelAutoFocus();
+
+    /**
      * An interface which contains a callback for the shutter closing after taking a picture.
      */
     public interface ShutterCallback
@@ -1338,5 +1352,3 @@
         }
     };
 }
-
-