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

Commit 15113bdd authored by Emerson Pinter's avatar Emerson Pinter Committed by Gerrit Code Review
Browse files

camera: add power mode support

Based on commit 7036d66bec7697160ba1b2e255f1e7fae0c8c435 from CAF,
branch ics_chocolate.

Change-Id: I8a60668b18980fd5e6f9dd341db5a8a63deb99d0
parent 20828864
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -9804,6 +9804,7 @@ package android.hardware {
    method public int getJpegQuality();
    method public int getJpegThumbnailQuality();
    method public android.hardware.Camera.Size getJpegThumbnailSize();
    method public java.lang.String getPowerMode();
    method public int getMaxExposureCompensation();
    method public int getMaxNumDetectedFaces();
    method public int getMaxNumFocusAreas();
@@ -9840,6 +9841,7 @@ package android.hardware {
    method public java.util.List<java.lang.Integer> getZoomRatios();
    method public boolean isAutoExposureLockSupported();
    method public boolean isAutoWhiteBalanceLockSupported();
    method public boolean isPowerModeSupported();
    method public boolean isSmoothZoomSupported();
    method public boolean isVideoSnapshotSupported();
    method public boolean isVideoStabilizationSupported();
@@ -9867,6 +9869,7 @@ package android.hardware {
    method public void setMeteringAreas(java.util.List<android.hardware.Camera.Area>);
    method public void setPictureFormat(int);
    method public void setPictureSize(int, int);
    method public void setPowerMode(java.lang.String);
    method public void setPreviewFormat(int);
    method public void setPreviewFpsRange(int, int);
    method public deprecated void setPreviewFrameRate(int);
@@ -9906,6 +9909,8 @@ package android.hardware {
    field public static final java.lang.String FOCUS_MODE_FIXED = "fixed";
    field public static final java.lang.String FOCUS_MODE_INFINITY = "infinity";
    field public static final java.lang.String FOCUS_MODE_MACRO = "macro";
    field public static final java.lang.String LOW_POWER = "Low_Power";
    field public static final java.lang.String NORMAL_POWER = "Normal_Power";
    field public static final int PREVIEW_FPS_MAX_INDEX = 1; // 0x1
    field public static final int PREVIEW_FPS_MIN_INDEX = 0; // 0x0
    field public static final java.lang.String SCENE_MODE_ACTION = "action";
+37 −0
Original line number Diff line number Diff line
@@ -1716,6 +1716,9 @@ public class Camera {
        private static final String KEY_VIDEO_SNAPSHOT_SUPPORTED = "video-snapshot-supported";
        private static final String KEY_VIDEO_STABILIZATION = "video-stabilization";
        private static final String KEY_VIDEO_STABILIZATION_SUPPORTED = "video-stabilization-supported";
        private static final String KEY_POWER_MODE_SUPPORTED = "power-mode-supported";

        private static final String KEY_POWER_MODE = "power-mode";

        // Parameter key suffix for supported values.
        private static final String SUPPORTED_VALUES_SUFFIX = "-values";
@@ -1750,6 +1753,10 @@ public class Camera {
        public static final String ANTIBANDING_60HZ = "60hz";
        public static final String ANTIBANDING_OFF = "off";

        // Values for POWER MODE
        public static final String LOW_POWER = "Low_Power";
        public static final String NORMAL_POWER = "Normal_Power";

        // Values for flash mode settings.
        /**
         * Flash will not be fired.
@@ -2960,6 +2967,28 @@ public class Camera {
            return split(str);
        }

        /**
         * Sets the Power mode.
         *
         * @param value Power mode.
         * @see #getPowerMode()
         */
        public void setPowerMode(String value) {
            set(KEY_POWER_MODE, value);
        }

        /**
         * Gets the current power mode setting.
         *
         * @return current power mode. null if power mode setting is not
         *         supported.
         * @see #POWER_MODE_LOW
         * @see #POWER_MODE_NORMAL
         */
        public String getPowerMode() {
            return get(KEY_POWER_MODE);
        }

        /**
         * Gets the current focus mode setting.
         *
@@ -3576,6 +3605,14 @@ public class Camera {
            return TRUE.equals(str);
        }

        /**
         * @return true if full size video snapshot is supported.
         */
        public boolean isPowerModeSupported() {
            String str = get(KEY_POWER_MODE_SUPPORTED);
            return TRUE.equals(str);
        }

        /**
         * <p>Enables and disables video stabilization. Use
         * {@link #isVideoStabilizationSupported} to determine if calling this