camera2: Add crop region support and some other AE tags to legacy

Change-Id: If7a87b210a57ea13d6329bb363b1c7ecdadc52e8
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index cc8503b..cf462cd 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -1842,6 +1842,27 @@
     }
 
     /**
+     * Returns a copied {@link Parameters}; for shim use only.
+     *
+     * @param parameters a non-{@code null} parameters
+     * @return a Parameter object, with all the parameters copied from {@code parameters}.
+     *
+     * @throws NullPointerException if {@code parameters} was {@code null}
+     * @hide
+     */
+    public static Parameters getParametersCopy(Camera.Parameters parameters) {
+        if (parameters == null) {
+            throw new NullPointerException("parameters must not be null");
+        }
+
+        Camera camera = parameters.getOuter();
+        Parameters p = camera.new Parameters();
+        p.copyFrom(parameters);
+
+        return p;
+    }
+
+    /**
      * Image size (width and height dimensions).
      */
     public class Size {
@@ -2332,6 +2353,25 @@
         }
 
         /**
+         * Overwrite existing parameters with a copy of the ones from {@code other}.
+         *
+         * <b>For use by the legacy shim only.</b>
+         *
+         * @hide
+         */
+        public void copyFrom(Parameters other) {
+            if (other == null) {
+                throw new NullPointerException("other must not be null");
+            }
+
+            mMap.putAll(other.mMap);
+        }
+
+        private Camera getOuter() {
+            return Camera.this;
+        }
+
+        /**
          * Writes the current Parameters to the log.
          * @hide
          * @deprecated