camera_metadata: Add supportedHardwareLevel field

Bug: 9111852
Change-Id: I6a01cb2678c8cd824eb2eb84d69d47a524c20750
diff --git a/camera/docs/docs.html b/camera/docs/docs.html
index 5cac284..210e9d8 100644
--- a/camera/docs/docs.html
+++ b/camera/docs/docs.html
@@ -349,6 +349,11 @@
         <li><a href="#static_android.led.availableLeds">android.led.availableLeds</a> (static)</li>
     </ul>
     </li> <!-- toc_section -->
+    <li><p class="toc_section"><a href="#section_info">info</a></p>
+    <ul class="toc_section">
+        <li><a href="#static_android.info.supportedHardwareLevel">android.info.supportedHardwareLevel</a> (static)</li>
+    </ul>
+    </li> <!-- toc_section -->
   </ul>
 
   <h1>Properties</h1>
@@ -10143,6 +10148,86 @@
       </tbody>
 
   <!-- end of section -->
+  <tr><td colspan="7" id="section_info" class="section">info</td></tr>
+
+
+      <tr><td colspan="7" class="kind">static</td></tr>
+
+      <thead>
+        <tr>
+          <th class="th_name">Property Name</th>
+          <th class="th_type">Type</th>
+          <th class="th_description">Description</th>
+          <th class="th_units">Units</th>
+          <th class="th_range">Range</th>
+          <th class="th_notes">Notes</th>
+          <th class="th_tags">Tags</th>
+        </tr>
+      </thead>
+
+      <tbody>
+
+        
+
+        
+
+        
+
+        
+
+                
+          <tr class="entry" id="static_android.info.supportedHardwareLevel">
+            <td class="entry_name">android.<wbr>info.<wbr>supported<wbr>Hardware<wbr>Level</td>
+            <td class="entry_type">
+                <span class="entry_type_name entry_type_name_enum">byte</span>
+
+
+
+                <ul class="entry_type_enum">
+                  <li>
+                    <span class="entry_type_enum_name">LIMITED</span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">FULL</span>
+                  </li>
+                </ul>
+
+            </td> <!-- entry_type -->
+
+            <td class="entry_description">
+              
+          The camera 3 HAL device can implement one of two possible operational modes;
+          limited and full.<wbr> Full support is expected from new higher-end
+          devices.<wbr> Limited mode has hardware requirements roughly in line with those
+          for a camera HAL device v1 implementation,<wbr> and is expected from older or
+          inexpensive devices.<wbr> Full is a strict superset of limited,<wbr> and they share the
+          same essential operational flow.<wbr>
+<br>
+<br>          For full details refer to "S3.<wbr> Operational Modes" in camera3.<wbr>h
+          
+            </td>
+
+            <td class="entry_units">
+            </td>
+
+            <td class="entry_range">
+              Optional.<wbr> Default value is LIMITED.<wbr>
+            </td>
+
+            <td class="entry_notes">
+            </td>
+
+            <td class="entry_tags">
+            </td>
+
+          </tr> <!-- end of entry -->
+        
+        
+
+      <!-- end of kind -->
+      </tbody>
+
+  <!-- end of section -->
 <!-- </namespace> -->
   </table>
 
diff --git a/camera/docs/metadata_properties.xml b/camera/docs/metadata_properties.xml
index 41ae504..2980c8d 100644
--- a/camera/docs/metadata_properties.xml
+++ b/camera/docs/metadata_properties.xml
@@ -2280,5 +2280,26 @@
         </entry>
       </static>
     </section>
+    <section name="info">
+      <static>
+        <entry name="supportedHardwareLevel" type="byte" enum="true">
+          <enum>
+            <value>LIMITED</value>
+            <value>FULL</value>
+          </enum>
+          <description>
+          The camera 3 HAL device can implement one of two possible operational modes;
+          limited and full. Full support is expected from new higher-end
+          devices. Limited mode has hardware requirements roughly in line with those
+          for a camera HAL device v1 implementation, and is expected from older or
+          inexpensive devices. Full is a strict superset of limited, and they share the
+          same essential operational flow.
+
+          For full details refer to "S3. Operational Modes" in camera3.h
+          </description>
+          <range>Optional. Default value is LIMITED.</range>
+        </entry>
+      </static>
+    </section>
   </namespace>
 </metadata>
diff --git a/camera/include/system/camera_metadata_tags.h b/camera/include/system/camera_metadata_tags.h
index 6ff3f5f..646c7ec 100644
--- a/camera/include/system/camera_metadata_tags.h
+++ b/camera/include/system/camera_metadata_tags.h
@@ -58,6 +58,7 @@
     ANDROID_STATISTICS_INFO,
     ANDROID_TONEMAP,
     ANDROID_LED,
+    ANDROID_INFO,
     ANDROID_SECTION_COUNT,
 
     VENDOR_SECTION = 0x8000
@@ -91,6 +92,7 @@
     ANDROID_STATISTICS_INFO_START  = ANDROID_STATISTICS_INFO   << 16,
     ANDROID_TONEMAP_START          = ANDROID_TONEMAP           << 16,
     ANDROID_LED_START              = ANDROID_LED               << 16,
+    ANDROID_INFO_START             = ANDROID_INFO              << 16,
     VENDOR_SECTION_START           = VENDOR_SECTION            << 16
 } camera_metadata_section_start_t;
 
@@ -306,6 +308,10 @@
     ANDROID_LED_AVAILABLE_LEDS,
     ANDROID_LED_END,
 
+    ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL
+                                   = ANDROID_INFO_START,
+    ANDROID_INFO_END,
+
 } camera_metadata_tag_t;
 
 /**
@@ -656,3 +662,10 @@
 } camera_metadata_enum_android_led_available_leds_t;
 
 
+// ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL
+typedef enum camera_metadata_enum_android_info_supported_hardware_level {
+    ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
+    ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL,
+} camera_metadata_enum_android_info_supported_hardware_level_t;
+
+
diff --git a/camera/src/camera_metadata_tag_info.c b/camera/src/camera_metadata_tag_info.c
index 5b1d424..65ffe67 100644
--- a/camera/src/camera_metadata_tag_info.c
+++ b/camera/src/camera_metadata_tag_info.c
@@ -54,6 +54,7 @@
     [ANDROID_STATISTICS_INFO]      = "android.statistics.info",
     [ANDROID_TONEMAP]              = "android.tonemap",
     [ANDROID_LED]                  = "android.led",
+    [ANDROID_INFO]                 = "android.info",
 };
 
 unsigned int camera_metadata_section_bounds[ANDROID_SECTION_COUNT][2] = {
@@ -103,6 +104,8 @@
                                        ANDROID_TONEMAP_END },
     [ANDROID_LED]                  = { ANDROID_LED_START,
                                        ANDROID_LED_END },
+    [ANDROID_INFO]                 = { ANDROID_INFO_START,
+                                       ANDROID_INFO_END },
 };
 
 static tag_info_t android_color_correction[ANDROID_COLOR_CORRECTION_END -
@@ -513,6 +516,12 @@
     { "availableLeds",                 TYPE_BYTE   },
 };
 
+static tag_info_t android_info[ANDROID_INFO_END -
+        ANDROID_INFO_START] = {
+    [ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL - ANDROID_INFO_START ] =
+    { "supportedHardwareLevel",        TYPE_BYTE   },
+};
+
 
 tag_info_t *tag_info[ANDROID_SECTION_COUNT] = {
     android_color_correction,
@@ -538,6 +547,7 @@
     android_statistics_info,
     android_tonemap,
     android_led,
+    android_info,
 };
 
 int camera_metadata_enum_snprint(uint32_t tag,
@@ -1846,6 +1856,22 @@
             break;
         }
 
+        case ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL: {
+            switch (value) {
+                case ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED:
+                    msg = "LIMITED";
+                    ret = 0;
+                    break;
+                case ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL:
+                    msg = "FULL";
+                    ret = 0;
+                    break;
+                default:
+                    msg = "error: enum value out of range";
+            }
+            break;
+        }
+
     }
 
     strncpy(dst, msg, size - 1);