Merge "camera_metadata: Add partial flash state"
diff --git a/camera/docs/docs.html b/camera/docs/docs.html
index 3f95a32..eefbe22 100644
--- a/camera/docs/docs.html
+++ b/camera/docs/docs.html
@@ -5932,22 +5932,25 @@
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">UNAVAILABLE</span>
-                    <span class="entry_type_enum_notes"><p>No flash on camera</p></span>
+                    <span class="entry_type_enum_notes"><p>No flash on camera.<wbr/></p></span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">CHARGING</span>
-                    <span class="entry_type_enum_notes"><p>if <a href="#static_android.flash.info.available">android.<wbr/>flash.<wbr/>info.<wbr/>available</a> is true Flash is
-charging and cannot be fired</p></span>
+                    <span class="entry_type_enum_notes"><p>Flash is charging and cannot be fired.<wbr/></p></span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">READY</span>
-                    <span class="entry_type_enum_notes"><p>if <a href="#static_android.flash.info.available">android.<wbr/>flash.<wbr/>info.<wbr/>available</a> is true Flash is
-ready to fire</p></span>
+                    <span class="entry_type_enum_notes"><p>Flash is ready to fire.<wbr/></p></span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">FIRED</span>
-                    <span class="entry_type_enum_notes"><p>if <a href="#static_android.flash.info.available">android.<wbr/>flash.<wbr/>info.<wbr/>available</a> is true Flash fired
-for this capture</p></span>
+                    <span class="entry_type_enum_notes"><p>Flash fired for this capture.<wbr/></p></span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">PARTIAL</span>
+                    <span class="entry_type_enum_notes"><p>Flash partially illuminated this frame.<wbr/> This is usually due to the next
+or previous frame having the flash fire,<wbr/> and the flash spilling into this capture
+due to hardware limitations.<wbr/></p></span>
                   </li>
                 </ul>
 
diff --git a/camera/docs/metadata_properties.xml b/camera/docs/metadata_properties.xml
index 45c6435..ae04384 100644
--- a/camera/docs/metadata_properties.xml
+++ b/camera/docs/metadata_properties.xml
@@ -1820,16 +1820,17 @@
         <entry name="state" type="byte" visibility="public" enum="true">
           <enum>
             <value>UNAVAILABLE
-            <notes>No flash on camera</notes></value>
+            <notes>No flash on camera.</notes></value>
             <value>CHARGING
-            <notes>if android.flash.info.available is true Flash is
-            charging and cannot be fired</notes></value>
+            <notes>Flash is charging and cannot be fired.</notes></value>
             <value>READY
-            <notes>if android.flash.info.available is true Flash is
-            ready to fire</notes></value>
+            <notes>Flash is ready to fire.</notes></value>
             <value>FIRED
-            <notes>if android.flash.info.available is true Flash fired
-            for this capture</notes></value>
+            <notes>Flash fired for this capture.</notes></value>
+            <value>PARTIAL
+            <notes>Flash partially illuminated this frame. This is usually due to the next
+            or previous frame having the flash fire, and the flash spilling into this capture
+            due to hardware limitations.</notes></value>
           </enum>
           <description>Current state of the flash
           unit.</description>
diff --git a/camera/include/system/camera_metadata_tags.h b/camera/include/system/camera_metadata_tags.h
index 3ae0cf6..863a362 100644
--- a/camera/include/system/camera_metadata_tags.h
+++ b/camera/include/system/camera_metadata_tags.h
@@ -557,6 +557,7 @@
     ANDROID_FLASH_STATE_CHARGING,
     ANDROID_FLASH_STATE_READY,
     ANDROID_FLASH_STATE_FIRED,
+    ANDROID_FLASH_STATE_PARTIAL,
 } camera_metadata_enum_android_flash_state_t;
 
 
diff --git a/camera/src/camera_metadata_tag_info.c b/camera/src/camera_metadata_tag_info.c
index 5507443..63b0da4 100644
--- a/camera/src/camera_metadata_tag_info.c
+++ b/camera/src/camera_metadata_tag_info.c
@@ -1256,6 +1256,10 @@
                     msg = "FIRED";
                     ret = 0;
                     break;
+                case ANDROID_FLASH_STATE_PARTIAL:
+                    msg = "PARTIAL";
+                    ret = 0;
+                    break;
                 default:
                     msg = "error: enum value out of range";
             }