Camera: Add PASSIVE_UNFOCUSED AF state

Bug: 10860639
Change-Id: I967b207f8e0473d590fecab942b39dbbb04d0186
diff --git a/camera/docs/docs.html b/camera/docs/docs.html
index 9b2725e..2e04969 100644
--- a/camera/docs/docs.html
+++ b/camera/docs/docs.html
@@ -2962,34 +2962,40 @@
                   </li>
                   <li>
                     <span class="entry_type_enum_name">PASSIVE_SCAN</span>
-                    <span class="entry_type_enum_notes">if CONTINUOUS_<wbr>* modes are supported AF is
+                    <span class="entry_type_enum_notes">if CONTINUOUS_<wbr>* modes are supported.<wbr> AF is
             currently doing an AF scan initiated by a continuous
             autofocus mode</span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">PASSIVE_FOCUSED</span>
-                    <span class="entry_type_enum_notes">if CONTINUOUS_<wbr>* modes are supported AF currently
+                    <span class="entry_type_enum_notes">if CONTINUOUS_<wbr>* modes are supported.<wbr> AF currently
             believes it is in focus,<wbr> but may restart scanning at
             any time.<wbr></span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">ACTIVE_SCAN</span>
-                    <span class="entry_type_enum_notes">if AUTO or MACRO modes are supported AF is doing
+                    <span class="entry_type_enum_notes">if AUTO or MACRO modes are supported.<wbr> AF is doing
             an AF scan because it was triggered by AF
             trigger</span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">FOCUSED_LOCKED</span>
-                    <span class="entry_type_enum_notes">if any AF mode besides OFF is supported AF
+                    <span class="entry_type_enum_notes">if any AF mode besides OFF is supported.<wbr> AF
             believes it is focused correctly and is
             locked</span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">NOT_FOCUSED_LOCKED</span>
-                    <span class="entry_type_enum_notes">if any AF mode besides OFF is supported AF has
+                    <span class="entry_type_enum_notes">if any AF mode besides OFF is supported.<wbr> AF has
             failed to focus successfully and is
             locked</span>
                   </li>
+                  <li>
+                    <span class="entry_type_enum_name">PASSIVE_UNFOCUSED</span>
+                    <span class="entry_type_enum_notes">if CONTINUOUS_<wbr>* modes are supported.<wbr> AF finished a
+            passive scan without finding focus,<wbr> and may restart
+            scanning at any time.<wbr></span>
+                  </li>
                 </ul>
 
             </td> <!-- entry_type -->
diff --git a/camera/docs/metadata_properties.xml b/camera/docs/metadata_properties.xml
index 6a7c694..49ef0ee 100644
--- a/camera/docs/metadata_properties.xml
+++ b/camera/docs/metadata_properties.xml
@@ -781,25 +781,29 @@
             to scan.  When a camera device is opened, it starts in
             this state.</notes></value>
             <value>PASSIVE_SCAN
-            <notes>if CONTINUOUS_* modes are supported AF is
+            <notes>if CONTINUOUS_* modes are supported. AF is
             currently doing an AF scan initiated by a continuous
             autofocus mode</notes></value>
             <value>PASSIVE_FOCUSED
-            <notes>if CONTINUOUS_* modes are supported AF currently
+            <notes>if CONTINUOUS_* modes are supported. AF currently
             believes it is in focus, but may restart scanning at
             any time.</notes></value>
             <value>ACTIVE_SCAN
-            <notes>if AUTO or MACRO modes are supported AF is doing
+            <notes>if AUTO or MACRO modes are supported. AF is doing
             an AF scan because it was triggered by AF
             trigger</notes></value>
             <value>FOCUSED_LOCKED
-            <notes>if any AF mode besides OFF is supported AF
+            <notes>if any AF mode besides OFF is supported. AF
             believes it is focused correctly and is
             locked</notes></value>
             <value>NOT_FOCUSED_LOCKED
-            <notes>if any AF mode besides OFF is supported AF has
+            <notes>if any AF mode besides OFF is supported. AF has
             failed to focus successfully and is
             locked</notes></value>
+            <value>PASSIVE_UNFOCUSED
+            <notes>if CONTINUOUS_* modes are supported. AF finished a
+            passive scan without finding focus, and may restart
+            scanning at any time.</notes></value>
           </enum>
           <description>Current state of AF algorithm</description>
           <notes>Whenever the AF algorithm state changes, a
diff --git a/camera/include/system/camera_metadata_tags.h b/camera/include/system/camera_metadata_tags.h
index df53878..742cd0b 100644
--- a/camera/include/system/camera_metadata_tags.h
+++ b/camera/include/system/camera_metadata_tags.h
@@ -497,6 +497,7 @@
     ANDROID_CONTROL_AF_STATE_ACTIVE_SCAN,
     ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED,
     ANDROID_CONTROL_AF_STATE_NOT_FOCUSED_LOCKED,
+    ANDROID_CONTROL_AF_STATE_PASSIVE_UNFOCUSED,
 } camera_metadata_enum_android_control_af_state_t;
 
 // ANDROID_CONTROL_AWB_STATE
diff --git a/camera/src/camera_metadata_tag_info.c b/camera/src/camera_metadata_tag_info.c
index a84ec09..1a0dc11 100644
--- a/camera/src/camera_metadata_tag_info.c
+++ b/camera/src/camera_metadata_tag_info.c
@@ -1090,6 +1090,10 @@
                     msg = "NOT_FOCUSED_LOCKED";
                     ret = 0;
                     break;
+                case ANDROID_CONTROL_AF_STATE_PASSIVE_UNFOCUSED:
+                    msg = "PASSIVE_UNFOCUSED";
+                    ret = 0;
+                    break;
                 default:
                     msg = "error: enum value out of range";
             }