Camera: Add torch brightness control keys.

1.FLASH_INFO_STRENGTH_MAXIMUM_LEVEL : Number of brightness levels.
2.FLASH_INFO_STRENGTH_DEFAULT_LEVEL : Default brightness level for device in
TORCH mode.

The API to actually control the torch strength level and tests will be
added in the next series of changes.

bug: 200174275
Change-Id: I674885a237d734a2a45f40fa0e336b07fa649859
This commit is contained in:
Rucha Katakwar
2021-10-12 10:10:44 -07:00
parent 073f23ece5
commit 85e89f2eaa
3 changed files with 39 additions and 2 deletions

View File

@@ -18016,6 +18016,8 @@ package android.hardware.camera2 {
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> DISTORTION_CORRECTION_AVAILABLE_MODES;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> EDGE_AVAILABLE_EDGE_MODES;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Boolean> FLASH_INFO_AVAILABLE;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> FLASH_INFO_STRENGTH_DEFAULT_LEVEL;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> FLASH_INFO_STRENGTH_MAXIMUM_LEVEL;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.DeviceStateSensorOrientationMap> INFO_DEVICE_STATE_SENSOR_ORIENTATION_MAP;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> INFO_SUPPORTED_HARDWARE_LEVEL;

View File

@@ -1319,6 +1319,42 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
public static final Key<Boolean> FLASH_INFO_AVAILABLE =
new Key<Boolean>("android.flash.info.available", boolean.class);
/**
* <p>Maximum flashlight brightness level.</p>
* <p>If this value is greater than 1, then the device supports controlling the
* flashlight brightness level via
* {android.hardware.camera2.CameraManager#setTorchStrengthLevel}.
* If this value is equal to 1, flashlight brightness control is not supported.
* This value will be -1 if the flash unit is not available.</p>
* <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
*/
@PublicKey
@NonNull
public static final Key<Integer> FLASH_INFO_STRENGTH_MAXIMUM_LEVEL =
new Key<Integer>("android.flash.info.strengthMaximumLevel", int.class);
/**
* <p>Default flashlight brightness level to be set via
* {android.hardware.camera2.CameraManager#setTorchStrengthLevel}.</p>
* <p>If flash unit is available this will be greater than or equal to 1 and less
* or equal to <code>{@link CameraCharacteristics#FLASH_INFO_STRENGTH_MAXIMUM_LEVEL android.flash.info.strengthMaximumLevel}</code>.
* If flash unit is not available this will be set to -1.</p>
* <p>Setting flashlight brightness above the default level
* (i.e.<code>{@link CameraCharacteristics#FLASH_INFO_STRENGTH_DEFAULT_LEVEL android.flash.info.strengthDefaultLevel}</code>) may make the device more
* likely to reach thermal throttling conditions and slow down, or drain the
* battery quicker than normal. To minimize such issues, it is recommended to
* start the flashlight at this default brightness until a user explicitly requests
* a brighter level.</p>
* <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
*
* @see CameraCharacteristics#FLASH_INFO_STRENGTH_DEFAULT_LEVEL
* @see CameraCharacteristics#FLASH_INFO_STRENGTH_MAXIMUM_LEVEL
*/
@PublicKey
@NonNull
public static final Key<Integer> FLASH_INFO_STRENGTH_DEFAULT_LEVEL =
new Key<Integer>("android.flash.info.strengthDefaultLevel", int.class);
/**
* <p>List of hot pixel correction modes for {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode} that are supported by this
* camera device.</p>

View File

@@ -1022,8 +1022,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
* to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
* <p>with colors as follows:</p>
* <pre><code>
* r' = I0r + I1g + I2b
* <pre><code>r' = I0r + I1g + I2b
* g' = I3r + I4g + I5b
* b' = I6r + I7g + I8b
* </code></pre>