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 /core/java/android/hardware | |
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
Diffstat (limited to 'core/java/android/hardware')
-rw-r--r-- | core/java/android/hardware/Camera.java | 37 |
1 files changed, 37 insertions, 0 deletions
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> |