Add display config for foldable

Bug: 178780644

Test: run foldable emulator
Change-Id: I1a212247260a49af5c2ce64d3912e0a76eabd292
diff --git a/64bitonly/product/vendor.mk b/64bitonly/product/vendor.mk
index ebbfe8f..968949d 100644
--- a/64bitonly/product/vendor.mk
+++ b/64bitonly/product/vendor.mk
@@ -304,4 +304,5 @@
 
 # Windowing settings config files
 PRODUCT_COPY_FILES += \
-    device/generic/goldfish/display_settings_freeform.xml:$(TARGET_COPY_OUT_DATA)/system/display_settings_freeform.xml
+    device/generic/goldfish/display_settings_freeform.xml:$(TARGET_COPY_OUT_DATA)/system/display_settings_freeform.xml \
+    device/generic/goldfish/device_state_configuration.xml:$(TARGET_COPY_OUT_DATA)/system/devicestate/device_state_configuration.xml
diff --git a/device_state_configuration.xml b/device_state_configuration.xml
new file mode 100644
index 0000000..17a09c4
--- /dev/null
+++ b/device_state_configuration.xml
@@ -0,0 +1,18 @@
+<device-state-config>
+  <device-state>
+    <identifier>0</identifier>
+    <conditions>
+      <lid-switch>
+        <open>false</open>
+      </lid-switch>
+    </conditions>
+  </device-state>
+  <device-state>
+    <identifier>1</identifier>
+    <conditions>
+      <lid-switch>
+        <open>true</open>
+      </lid-switch>
+    </conditions>
+  </device-state>
+</device-state-config>
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index b9f0bab..aacd353 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -54,4 +54,10 @@
         <item>0:2:15</item> <!-- ID0:Fingerprint:Strong -->
     </string-array>
 
+    <!-- The device states (supplied by DeviceStateManager) that should be treated as folded by the
+         display fold controller. -->
+    <integer-array name="config_foldedDeviceStates" translatable="false">
+      <item>0</item> <!-- CLOSED -->
+    </integer-array>
+
 </resources>
diff --git a/vendor.mk b/vendor.mk
index 87ed7d3..fcea51c 100644
--- a/vendor.mk
+++ b/vendor.mk
@@ -309,4 +309,5 @@
 
 # Windowing settings config files
 PRODUCT_COPY_FILES += \
-    device/generic/goldfish/display_settings_freeform.xml:$(TARGET_COPY_OUT_DATA)/system/display_settings_freeform.xml
+    device/generic/goldfish/display_settings_freeform.xml:$(TARGET_COPY_OUT_DATA)/system/display_settings_freeform.xml \
+    device/generic/goldfish/device_state_configuration.xml:$(TARGET_COPY_OUT_DATA)/system/devicestate/device_state_configuration.xml