diff options
author | Emerson Pinter <dev@pinter.com.br> | 2012-11-27 09:40:35 -0200 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-12-23 23:23:07 -0800 |
commit | 15113bdda27fbb75f7f1b40a48af7451910ad605 (patch) | |
tree | eec6178bff4030cc4a9ba1a2cc697db92633373f | |
parent | 208288646859076fcf9dfda8e64598150bf4fc6a (diff) | |
download | frameworks_base-15113bdda27fbb75f7f1b40a48af7451910ad605.zip frameworks_base-15113bdda27fbb75f7f1b40a48af7451910ad605.tar.gz frameworks_base-15113bdda27fbb75f7f1b40a48af7451910ad605.tar.bz2 |
camera: add power mode support
Based on commit 7036d66bec7697160ba1b2e255f1e7fae0c8c435 from CAF,
branch ics_chocolate.
Change-Id: I8a60668b18980fd5e6f9dd341db5a8a63deb99d0
-rw-r--r-- | api/current.txt | 5 | ||||
-rw-r--r-- | core/java/android/hardware/Camera.java | 37 |
2 files changed, 42 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index 6b893d5..c57a541 100644 --- a/api/current.txt +++ b/api/current.txt @@ -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"; diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java index c60d838..2e2d9a6 100644 --- a/core/java/android/hardware/Camera.java +++ b/core/java/android/hardware/Camera.java @@ -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. @@ -2961,6 +2968,28 @@ public class Camera { } /** + * 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. * * @return current focus mode. This method will always return a non-null @@ -3577,6 +3606,14 @@ public class Camera { } /** + * @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 * method is valid.</p> |