Loading core/java/android/hardware/Camera.java +165 −0 Original line number Diff line number Diff line Loading @@ -1703,6 +1703,27 @@ public class Camera { return p; } /** @hide * Returns the current cct value of white balance. * * If it's in AWB mode, cct is determined by stats/awb module. * * If it's in Manual WB mode, it actually returns cct value * set by user via {@link #setParameters(Camera.Parameters)}. */ public int getWBCurrentCCT() { Parameters p = new Parameters(); String s = native_getParameters(); p.unflatten(s); int cct = 0; if (p.getWBCurrentCCT() != null) { cct = Integer.parseInt(p.getWBCurrentCCT()); } return cct; } /** * Returns an empty {@link Parameters} for testing purpose. * Loading Loading @@ -1844,6 +1865,27 @@ public class Camera { /** y co-ordinate for the touch event */ public int yCoordinate; }; /** @hide * Returns the current focus position. * * If it's in AF mode, it's the lens position after af is done. * * If it's in Manual Focus mode, it actually returns the value * set by user via {@link #setParameters(Camera.Parameters)}. */ public int getCurrentFocusPosition() { Parameters p = new Parameters(); String s = native_getParameters(); p.unflatten(s); int focus_pos = -1; if (p.getCurrentFocusPosition() != null) { focus_pos = Integer.parseInt(p.getCurrentFocusPosition()); } return focus_pos; } /* ### QC ADD-ONS: END */ /** * Image size (width and height dimensions). Loading Loading @@ -2060,6 +2102,10 @@ public class Camera { public static final String WHITE_BALANCE_CLOUDY_DAYLIGHT = "cloudy-daylight"; public static final String WHITE_BALANCE_TWILIGHT = "twilight"; public static final String WHITE_BALANCE_SHADE = "shade"; /** @hide * wb manual cct mode. */ public static final String WHITE_BALANCE_MANUAL_CCT = "manual-cct"; // Values for color effect settings. public static final String EFFECT_NONE = "none"; Loading Loading @@ -2297,6 +2343,11 @@ public class Camera { */ public static final String FOCUS_MODE_CONTINUOUS_PICTURE = "continuous-picture"; /** @hide * manual focus mode */ public static final String FOCUS_MODE_MANUAL_POSITION = "manual"; // Indices for focus distance array. /** * The array index of near focus distance for use with Loading Loading @@ -4118,8 +4169,14 @@ public class Camera { private static final String KEY_QC_TOUCH_AF_AEC = "touch-af-aec"; private static final String KEY_QC_TOUCH_INDEX_AEC = "touch-index-aec"; private static final String KEY_QC_TOUCH_INDEX_AF = "touch-index-af"; private static final String KEY_QC_MANUAL_FOCUS_POSITION = "manual-focus-position"; private static final String KEY_QC_MANUAL_FOCUS_POS_TYPE = "manual-focus-pos-type"; private static final String KEY_QC_CURRENT_FOCUS_POSITION = "current-focus-position"; private static final String KEY_QC_SCENE_DETECT = "scene-detect"; private static final String KEY_QC_ISO_MODE = "iso"; private static final String KEY_QC_EXPOSURE_TIME = "exposure-time"; private static final String KEY_QC_MIN_EXPOSURE_TIME = "min-exposure-time"; private static final String KEY_QC_MAX_EXPOSURE_TIME = "max-exposure-time"; private static final String KEY_QC_LENSSHADE = "lensshade"; private static final String KEY_QC_HISTOGRAM = "histogram"; private static final String KEY_QC_SKIN_TONE_ENHANCEMENT = "skinToneEnhancement"; Loading @@ -4142,6 +4199,11 @@ public class Camera { private static final String KEY_QC_VIDEO_HDR = "video-hdr"; private static final String KEY_QC_POWER_MODE = "power-mode"; private static final String KEY_QC_POWER_MODE_SUPPORTED = "power-mode-supported"; private static final String KEY_QC_WB_MANUAL_CCT = "wb-manual-cct"; private static final String KEY_QC_WB_CURRENT_CCT = "wb-current-cct"; private static final String KEY_QC_MIN_WB_CCT = "min-wb-cct"; private static final String KEY_QC_MAX_WB_CCT = "max-wb-cct"; /** @hide * KEY_QC_AE_BRACKET_HDR **/ Loading Loading @@ -4203,6 +4265,11 @@ public class Camera { **/ public static final String ISO_1600 = "ISO1600"; /** @hide * ISO_3200 **/ public static final String ISO_3200 = "ISO3200"; //Values for Lens Shading /** @hide * LENSSHADE_ENABLE Loading Loading @@ -4920,6 +4987,42 @@ public class Camera { set(KEY_QC_ISO_MODE, iso); } /** @hide * Sets the exposure time. * * @param value exposure time. */ public void setExposureTime(int value) { set(KEY_QC_EXPOSURE_TIME, Integer.toString(value)); } /** @hide * Gets the current exposure time. * * @return exposure time. */ public String getExposureTime() { return get(KEY_QC_EXPOSURE_TIME); } /** @hide * Gets the min supported exposure time. * * @return min supported exposure time. */ public String getMinExposureTime() { return get(KEY_QC_MIN_EXPOSURE_TIME); } /** @hide * Gets the max supported exposure time. * * @return max supported exposure time. */ public String getMaxExposureTime() { return get(KEY_QC_MAX_EXPOSURE_TIME); } /** @hide * Gets the current LensShade Mode. * Loading Loading @@ -4975,6 +5078,46 @@ public class Camera { set(KEY_QC_MEMORY_COLOR_ENHANCEMENT, mce); } /** @hide * Set white balance manual cct value. * * @param cct user CCT setting. */ public void setWBManualCCT(int cct) { set(KEY_QC_WB_MANUAL_CCT, Integer.toString(cct)); } /** @hide * Gets the WB min supported CCT. * * @return min cct value. */ public String getWBMinCCT() { return get(KEY_QC_MIN_WB_CCT); } /** @hide * Gets the WB max supported CCT. * * @return max cct value. */ public String getMaxWBCCT() { return get(KEY_QC_MAX_WB_CCT); } /** @hide * Gets the current WB CCT. * * Pay attention to KEY_QC_WB_MANUAL_CCT and KEY_QC_WB_CURRENT_CCT. * The former is set by APK. * The latter is updated from HAL, usually in AWB mode. * * @return CCT value */ public String getWBCurrentCCT() { return get(KEY_QC_WB_CURRENT_CCT); } /** @hide * Gets the current ZSL Mode. * Loading Loading @@ -5013,6 +5156,28 @@ public class Camera { set(KEY_QC_CAMERA_MODE, cameraMode); } private static final int MANUAL_FOCUS_POS_TYPE_INDEX = 0; private static final int MANUAL_FOCUS_POS_TYPE_DAC = 1; /** @hide * Set focus position. * * @param pos user setting of focus position. */ public void setFocusPosition(int type, int pos) { set(KEY_QC_MANUAL_FOCUS_POS_TYPE, Integer.toString(type)); set(KEY_QC_MANUAL_FOCUS_POSITION, Integer.toString(pos)); } /** @hide * Gets the current focus position. * * @return current focus position */ public String getCurrentFocusPosition() { return get(KEY_QC_CURRENT_FOCUS_POSITION); } /** @hide * Gets the current HFR Mode. * Loading Loading
core/java/android/hardware/Camera.java +165 −0 Original line number Diff line number Diff line Loading @@ -1703,6 +1703,27 @@ public class Camera { return p; } /** @hide * Returns the current cct value of white balance. * * If it's in AWB mode, cct is determined by stats/awb module. * * If it's in Manual WB mode, it actually returns cct value * set by user via {@link #setParameters(Camera.Parameters)}. */ public int getWBCurrentCCT() { Parameters p = new Parameters(); String s = native_getParameters(); p.unflatten(s); int cct = 0; if (p.getWBCurrentCCT() != null) { cct = Integer.parseInt(p.getWBCurrentCCT()); } return cct; } /** * Returns an empty {@link Parameters} for testing purpose. * Loading Loading @@ -1844,6 +1865,27 @@ public class Camera { /** y co-ordinate for the touch event */ public int yCoordinate; }; /** @hide * Returns the current focus position. * * If it's in AF mode, it's the lens position after af is done. * * If it's in Manual Focus mode, it actually returns the value * set by user via {@link #setParameters(Camera.Parameters)}. */ public int getCurrentFocusPosition() { Parameters p = new Parameters(); String s = native_getParameters(); p.unflatten(s); int focus_pos = -1; if (p.getCurrentFocusPosition() != null) { focus_pos = Integer.parseInt(p.getCurrentFocusPosition()); } return focus_pos; } /* ### QC ADD-ONS: END */ /** * Image size (width and height dimensions). Loading Loading @@ -2060,6 +2102,10 @@ public class Camera { public static final String WHITE_BALANCE_CLOUDY_DAYLIGHT = "cloudy-daylight"; public static final String WHITE_BALANCE_TWILIGHT = "twilight"; public static final String WHITE_BALANCE_SHADE = "shade"; /** @hide * wb manual cct mode. */ public static final String WHITE_BALANCE_MANUAL_CCT = "manual-cct"; // Values for color effect settings. public static final String EFFECT_NONE = "none"; Loading Loading @@ -2297,6 +2343,11 @@ public class Camera { */ public static final String FOCUS_MODE_CONTINUOUS_PICTURE = "continuous-picture"; /** @hide * manual focus mode */ public static final String FOCUS_MODE_MANUAL_POSITION = "manual"; // Indices for focus distance array. /** * The array index of near focus distance for use with Loading Loading @@ -4118,8 +4169,14 @@ public class Camera { private static final String KEY_QC_TOUCH_AF_AEC = "touch-af-aec"; private static final String KEY_QC_TOUCH_INDEX_AEC = "touch-index-aec"; private static final String KEY_QC_TOUCH_INDEX_AF = "touch-index-af"; private static final String KEY_QC_MANUAL_FOCUS_POSITION = "manual-focus-position"; private static final String KEY_QC_MANUAL_FOCUS_POS_TYPE = "manual-focus-pos-type"; private static final String KEY_QC_CURRENT_FOCUS_POSITION = "current-focus-position"; private static final String KEY_QC_SCENE_DETECT = "scene-detect"; private static final String KEY_QC_ISO_MODE = "iso"; private static final String KEY_QC_EXPOSURE_TIME = "exposure-time"; private static final String KEY_QC_MIN_EXPOSURE_TIME = "min-exposure-time"; private static final String KEY_QC_MAX_EXPOSURE_TIME = "max-exposure-time"; private static final String KEY_QC_LENSSHADE = "lensshade"; private static final String KEY_QC_HISTOGRAM = "histogram"; private static final String KEY_QC_SKIN_TONE_ENHANCEMENT = "skinToneEnhancement"; Loading @@ -4142,6 +4199,11 @@ public class Camera { private static final String KEY_QC_VIDEO_HDR = "video-hdr"; private static final String KEY_QC_POWER_MODE = "power-mode"; private static final String KEY_QC_POWER_MODE_SUPPORTED = "power-mode-supported"; private static final String KEY_QC_WB_MANUAL_CCT = "wb-manual-cct"; private static final String KEY_QC_WB_CURRENT_CCT = "wb-current-cct"; private static final String KEY_QC_MIN_WB_CCT = "min-wb-cct"; private static final String KEY_QC_MAX_WB_CCT = "max-wb-cct"; /** @hide * KEY_QC_AE_BRACKET_HDR **/ Loading Loading @@ -4203,6 +4265,11 @@ public class Camera { **/ public static final String ISO_1600 = "ISO1600"; /** @hide * ISO_3200 **/ public static final String ISO_3200 = "ISO3200"; //Values for Lens Shading /** @hide * LENSSHADE_ENABLE Loading Loading @@ -4920,6 +4987,42 @@ public class Camera { set(KEY_QC_ISO_MODE, iso); } /** @hide * Sets the exposure time. * * @param value exposure time. */ public void setExposureTime(int value) { set(KEY_QC_EXPOSURE_TIME, Integer.toString(value)); } /** @hide * Gets the current exposure time. * * @return exposure time. */ public String getExposureTime() { return get(KEY_QC_EXPOSURE_TIME); } /** @hide * Gets the min supported exposure time. * * @return min supported exposure time. */ public String getMinExposureTime() { return get(KEY_QC_MIN_EXPOSURE_TIME); } /** @hide * Gets the max supported exposure time. * * @return max supported exposure time. */ public String getMaxExposureTime() { return get(KEY_QC_MAX_EXPOSURE_TIME); } /** @hide * Gets the current LensShade Mode. * Loading Loading @@ -4975,6 +5078,46 @@ public class Camera { set(KEY_QC_MEMORY_COLOR_ENHANCEMENT, mce); } /** @hide * Set white balance manual cct value. * * @param cct user CCT setting. */ public void setWBManualCCT(int cct) { set(KEY_QC_WB_MANUAL_CCT, Integer.toString(cct)); } /** @hide * Gets the WB min supported CCT. * * @return min cct value. */ public String getWBMinCCT() { return get(KEY_QC_MIN_WB_CCT); } /** @hide * Gets the WB max supported CCT. * * @return max cct value. */ public String getMaxWBCCT() { return get(KEY_QC_MAX_WB_CCT); } /** @hide * Gets the current WB CCT. * * Pay attention to KEY_QC_WB_MANUAL_CCT and KEY_QC_WB_CURRENT_CCT. * The former is set by APK. * The latter is updated from HAL, usually in AWB mode. * * @return CCT value */ public String getWBCurrentCCT() { return get(KEY_QC_WB_CURRENT_CCT); } /** @hide * Gets the current ZSL Mode. * Loading Loading @@ -5013,6 +5156,28 @@ public class Camera { set(KEY_QC_CAMERA_MODE, cameraMode); } private static final int MANUAL_FOCUS_POS_TYPE_INDEX = 0; private static final int MANUAL_FOCUS_POS_TYPE_DAC = 1; /** @hide * Set focus position. * * @param pos user setting of focus position. */ public void setFocusPosition(int type, int pos) { set(KEY_QC_MANUAL_FOCUS_POS_TYPE, Integer.toString(type)); set(KEY_QC_MANUAL_FOCUS_POSITION, Integer.toString(pos)); } /** @hide * Gets the current focus position. * * @return current focus position */ public String getCurrentFocusPosition() { return get(KEY_QC_CURRENT_FOCUS_POSITION); } /** @hide * Gets the current HFR Mode. * Loading