camera: Add external flash mode key
Test: CTS
Bug: 64847201
Change-Id: Id7d4d1e5a7ce8f3793f36a0a24a2c5118a367fef
diff --git a/camera/docs/docs.html b/camera/docs/docs.html
index f187945..d6921de 100644
--- a/camera/docs/docs.html
+++ b/camera/docs/docs.html
@@ -2448,6 +2448,18 @@
reduction flash will fire during the precapture
sequence.<wbr/></p></span>
</li>
+ <li>
+ <span class="entry_type_enum_name">ON_EXTERNAL_FLASH (v3.3)</span>
+ <span class="entry_type_enum_notes"><p>An external flash has been turned on.<wbr/></p>
+<p>It informs the camera device that an external flash has been turned on,<wbr/> and that
+metering (and continuous focus if active) should be quickly recaculated to account
+for the external flash.<wbr/> Otherwise,<wbr/> this mode acts like ON.<wbr/></p>
+<p>When the external flash is turned off,<wbr/> AE mode should be changed to one of the
+other available AE modes.<wbr/></p>
+<p>If the camera device supports AE external flash mode,<wbr/> aeState must be
+FLASH_<wbr/>REQUIRED after the camera device finishes AE scan and it's too dark without
+flash.<wbr/></p></span>
+ </li>
</ul>
</td> <!-- entry_type -->
@@ -6334,6 +6346,18 @@
reduction flash will fire during the precapture
sequence.<wbr/></p></span>
</li>
+ <li>
+ <span class="entry_type_enum_name">ON_EXTERNAL_FLASH (v3.3)</span>
+ <span class="entry_type_enum_notes"><p>An external flash has been turned on.<wbr/></p>
+<p>It informs the camera device that an external flash has been turned on,<wbr/> and that
+metering (and continuous focus if active) should be quickly recaculated to account
+for the external flash.<wbr/> Otherwise,<wbr/> this mode acts like ON.<wbr/></p>
+<p>When the external flash is turned off,<wbr/> AE mode should be changed to one of the
+other available AE modes.<wbr/></p>
+<p>If the camera device supports AE external flash mode,<wbr/> aeState must be
+FLASH_<wbr/>REQUIRED after the camera device finishes AE scan and it's too dark without
+flash.<wbr/></p></span>
+ </li>
</ul>
</td> <!-- entry_type -->
@@ -6795,7 +6819,7 @@
</tr>
</tbody>
</table>
-<p>When <a href="#controls_android.control.aeMode">android.<wbr/>control.<wbr/>ae<wbr/>Mode</a> is AE_<wbr/>MODE_<wbr/>ON_<wbr/>*:</p>
+<p>When <a href="#controls_android.control.aeMode">android.<wbr/>control.<wbr/>ae<wbr/>Mode</a> is AE_<wbr/>MODE_<wbr/>ON*:</p>
<table>
<thead>
<tr>
@@ -6916,10 +6940,13 @@
</tr>
</tbody>
</table>
+<p>If the camera device supports AE external flash mode (ON_<wbr/>EXTERNAL_<wbr/>FLASH is included in
+<a href="#static_android.control.aeAvailableModes">android.<wbr/>control.<wbr/>ae<wbr/>Available<wbr/>Modes</a>),<wbr/> aeState must be FLASH_<wbr/>REQUIRED after the camera device
+finishes AE scan and it's too dark without flash.<wbr/></p>
<p>For the above table,<wbr/> the camera device may skip reporting any state changes that happen
without application intervention (i.<wbr/>e.<wbr/> mode switch,<wbr/> trigger,<wbr/> locking).<wbr/> Any state that
can be skipped in that manner is called a transient state.<wbr/></p>
-<p>For example,<wbr/> for above AE modes (AE_<wbr/>MODE_<wbr/>ON_<wbr/>*),<wbr/> in addition to the state transitions
+<p>For example,<wbr/> for above AE modes (AE_<wbr/>MODE_<wbr/>ON*),<wbr/> in addition to the state transitions
listed in above table,<wbr/> it is also legal for the camera device to skip one or more
transient states between two results.<wbr/> See below table for examples:</p>
<table>
@@ -17222,7 +17249,7 @@
lifetime.<wbr/> Typical examples include parameters that require a
time-consuming hardware re-configuration or internal camera pipeline
change.<wbr/> For performance reasons we advise clients to pass their initial
-values as part of
+values as part of
<a href="https://developer.android.com/reference/SessionConfiguration.html#setSessionParameters">SessionConfiguration#setSessionParameters</a>.<wbr/>
Once the camera capture session is enabled it is also recommended to avoid
changing them from their initial values set in
diff --git a/camera/docs/metadata_definitions.xml b/camera/docs/metadata_definitions.xml
index 230ef05..4c3ed71 100644
--- a/camera/docs/metadata_definitions.xml
+++ b/camera/docs/metadata_definitions.xml
@@ -627,6 +627,22 @@
sequence.
</notes>
</value>
+ <value hal_version="3.3">ON_EXTERNAL_FLASH
+ <notes>
+ An external flash has been turned on.
+
+ It informs the camera device that an external flash has been turned on, and that
+ metering (and continuous focus if active) should be quickly recaculated to account
+ for the external flash. Otherwise, this mode acts like ON.
+
+ When the external flash is turned off, AE mode should be changed to one of the
+ other available AE modes.
+
+ If the camera device supports AE external flash mode, aeState must be
+ FLASH_REQUIRED after the camera device finishes AE scan and it's too dark without
+ flash.
+ </notes>
+ </value>
</enum>
<description>The desired mode for the camera device's
auto-exposure routine.</description>
@@ -2323,7 +2339,7 @@
:------------:|:----------------:|:---------:|:-----------------------:
INACTIVE | | INACTIVE | Camera device auto exposure algorithm is disabled
- When android.control.aeMode is AE_MODE_ON_*:
+ When android.control.aeMode is AE_MODE_ON*:
State | Transition Cause | New State | Notes
:-------------:|:--------------------------------------------:|:--------------:|:-----------------:
@@ -2346,11 +2362,15 @@
Any state (excluding LOCKED) | android.control.aePrecaptureTrigger is START | PRECAPTURE | Start AE precapture metering sequence
Any state (excluding LOCKED) | android.control.aePrecaptureTrigger is CANCEL| INACTIVE | Currently active precapture metering sequence is canceled
+ If the camera device supports AE external flash mode (ON_EXTERNAL_FLASH is included in
+ android.control.aeAvailableModes), aeState must be FLASH_REQUIRED after the camera device
+ finishes AE scan and it's too dark without flash.
+
For the above table, the camera device may skip reporting any state changes that happen
without application intervention (i.e. mode switch, trigger, locking). Any state that
can be skipped in that manner is called a transient state.
- For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
+ For example, for above AE modes (AE_MODE_ON*), in addition to the state transitions
listed in above table, it is also legal for the camera device to skip one or more
transient states between two results. See below table for examples:
@@ -5305,7 +5325,7 @@
lifetime. Typical examples include parameters that require a
time-consuming hardware re-configuration or internal camera pipeline
change. For performance reasons we advise clients to pass their initial
- values as part of
+ values as part of
{@link SessionConfiguration#setSessionParameters|ACameraDevice_createCaptureSessionWithSessionParameters}.
Once the camera capture session is enabled it is also recommended to avoid
changing them from their initial values set in
diff --git a/camera/include/system/camera_metadata_tags.h b/camera/include/system/camera_metadata_tags.h
index 3e36c7d..6adeeeb 100644
--- a/camera/include/system/camera_metadata_tags.h
+++ b/camera/include/system/camera_metadata_tags.h
@@ -460,6 +460,7 @@
ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH , // HIDL v3.2
ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH , // HIDL v3.2
ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE , // HIDL v3.2
+ ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH , // HIDL v3.3
} camera_metadata_enum_android_control_ae_mode_t;
// ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER
diff --git a/camera/src/camera_metadata_tag_info.c b/camera/src/camera_metadata_tag_info.c
index 506c8c9..fe60b98 100644
--- a/camera/src/camera_metadata_tag_info.c
+++ b/camera/src/camera_metadata_tag_info.c
@@ -832,6 +832,10 @@
msg = "ON_AUTO_FLASH_REDEYE";
ret = 0;
break;
+ case ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH:
+ msg = "ON_EXTERNAL_FLASH";
+ ret = 0;
+ break;
default:
msg = "error: enum value out of range";
}