Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

camera: add power mode support

Based on commit 7036d66bec7697160ba1b2e255f1e7fae0c8c435 from CAF,
branch ics_chocolate.

Change-Id: I8a60668b18980fd5e6f9dd341db5a8a63deb99d0
  • Loading branch information...
commit b9b9bca8e7724dded2e7e1c4c97d04ac831d6b8b 1 parent 41e71f4
@epinter epinter authored Gerrit Code Review committed
Showing with 42 additions and 0 deletions.
  1. +5 −0 api/current.txt
  2. +37 −0 core/java/android/hardware/Camera.java
View
5 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";
View
37 core/java/android/hardware/Camera.java
@@ -1715,6 +1715,9 @@ public boolean equals(Object obj) {
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";
@@ -1749,6 +1752,10 @@ public boolean equals(Object obj) {
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.
@@ -2944,6 +2951,28 @@ public void setFlashMode(String value) {
}
/**
+ * 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
@@ -3527,6 +3556,14 @@ public boolean isVideoSnapshotSupported() {
}
/**
+ * @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>
Please sign in to comment.
Something went wrong with that request. Please try again.