Introduce new UI_MODE_TYPE_VR_HEADSET and qualifier.

Bug: 30989383
Test: Unit test for aapt2
Change-Id: I66dc65af6327b94fed74538bee08cada0b8be4fa
diff --git a/tools/aapt/AaptConfig.cpp b/tools/aapt/AaptConfig.cpp
index b12867a..565d2f0 100644
--- a/tools/aapt/AaptConfig.cpp
+++ b/tools/aapt/AaptConfig.cpp
@@ -249,7 +249,10 @@
     }
 
     uint16_t minSdk = 0;
-    if (config->screenLayout2 & ResTable_config::MASK_SCREENROUND) {
+    if ((config->uiMode & ResTable_config::MASK_UI_MODE_TYPE)
+                == ResTable_config::UI_MODE_TYPE_VR_HEADSET) {
+        minSdk = SDK_O;
+    } else if (config->screenLayout2 & ResTable_config::MASK_SCREENROUND) {
         minSdk = SDK_MNC;
     } else if (config->density == ResTable_config::DENSITY_ANY) {
         minSdk = SDK_LOLLIPOP;
@@ -477,6 +480,11 @@
               (out->uiMode&~ResTable_config::MASK_UI_MODE_TYPE)
               | ResTable_config::UI_MODE_TYPE_WATCH;
         return true;
+    } else if (strcmp(name, "vrheadset") == 0) {
+      if (out) out->uiMode =
+              (out->uiMode&~ResTable_config::MASK_UI_MODE_TYPE)
+              | ResTable_config::UI_MODE_TYPE_VR_HEADSET;
+        return true;
     }
 
     return false;
diff --git a/tools/aapt/SdkConstants.h b/tools/aapt/SdkConstants.h
index 16e622a..d92de06 100644
--- a/tools/aapt/SdkConstants.h
+++ b/tools/aapt/SdkConstants.h
@@ -39,6 +39,9 @@
     SDK_LOLLIPOP = 21,
     SDK_LOLLIPOP_MR1 = 22,
     SDK_MNC = 23,
+    SDK_NOUGAT = 24,
+    SDK_NOUGAT_MR1 = 25,
+    SDK_O = 26, // STOPSHIP replace with real version
 };
 
 #endif // H_AAPT_SDK_CONSTANTS