Update on-device AOT compilation to cover all cases.

After the change, odrefresh can properly determine whether to do
compilation when:
1. There is a mainline update (either a normal one or a samegrade one) that updates the ART module.
2. There is a mainline update (either a normal one or a samegrade one) that updates a module other than ART.
3. There is an OTA that updates a boot classpath jar.
4. There is an OTA that updates a system server jar.
5. There is no change since the last run.

Test: manual - 1. Install a mainline module without changing its
contents.
    2. Reboot the device.
    3. See if system_server components are recompiled.
Test: manual - 1. Do nothing and reboot the device.
    2. See if nothing is recompiled.
Test: atest odsign_e2e_tests
Test: atest art_odrefresh_tests
Bug: 189467174

Change-Id: I43dea5380fcd221d5d4e34753d64d46be4dbc27e
diff --git a/odrefresh/CacheInfo.xsd b/odrefresh/CacheInfo.xsd
index 485c6b6..44f733f 100644
--- a/odrefresh/CacheInfo.xsd
+++ b/odrefresh/CacheInfo.xsd
@@ -25,40 +25,36 @@
   <xs:element name="cacheInfo">
     <xs:complexType>
     <xs:sequence>
-      <xs:element name="artModuleInfo" minOccurs="1" maxOccurs="1" type="t:artModuleInfo" />
-      <xs:element name="bootClasspath" type="t:bootClasspath" />
-      <xs:element name="dex2oatBootClasspath" type="t:dex2oatBootClasspath" />
-      <xs:element name="systemServerClasspath" type="t:systemServerClasspath" />
+      <xs:element name="artModuleInfo" minOccurs="1" maxOccurs="1" type="t:moduleInfo" />
+      <xs:element name="moduleInfoList" minOccurs="1" maxOccurs="1" type="t:moduleInfoList" />
+      <xs:element name="bootClasspath" minOccurs="1" maxOccurs="1" type="t:classpath" />
+      <xs:element name="dex2oatBootClasspath" minOccurs="1" maxOccurs="1" type="t:classpath" />
+      <xs:element name="systemServerClasspath" minOccurs="1" maxOccurs="1" type="t:classpath" />
     </xs:sequence>
     </xs:complexType>
   </xs:element>
 
+  <!-- List of modules. -->
+  <xs:complexType name="moduleInfoList">
+    <xs:sequence>
+      <xs:element name="moduleInfo" type="t:moduleInfo" />
+    </xs:sequence>
+  </xs:complexType>
+
   <!-- Data type representing the provenance of the AOT artifacts in the cache. -->
-  <xs:complexType name="artModuleInfo">
-    <!-- Module versionCode for the active ART APEX from `/apex/apex-info-list.xml`. -->
+  <xs:complexType name="moduleInfo">
+    <!-- Module name for the active APEX from `/apex/apex-info-list.xml`. -->
+    <xs:attribute name="name" type="xs:string" use="required" />
+    <!-- Module versionCode for the active APEX from `/apex/apex-info-list.xml`. -->
     <xs:attribute name="versionCode" type="xs:long" use="required" />
-    <!-- Module versionName for the active ART APEX from `/apex/apex-info-list.xml`. -->
+    <!-- Module versionName for the active APEX from `/apex/apex-info-list.xml`. -->
     <xs:attribute name="versionName" type="xs:string" use="required" />
-    <!-- Module lastUpdateMillis for the active ART APEX from `/apex/apex-info-list.xml`. -->
+    <!-- Module lastUpdateMillis for the active APEX from `/apex/apex-info-list.xml`. -->
     <xs:attribute name="lastUpdateMillis" type="xs:long" use="required" />
   </xs:complexType>
 
-  <!-- Components of the `BOOTCLASSPATH`. -->
-  <xs:complexType name="bootClasspath">
-    <xs:sequence>
-      <xs:element name="component" type="t:component" />
-    </xs:sequence>
-  </xs:complexType>
-
-  <!-- Components of the `DEX2OATBOOTCLASSPATH`. -->
-  <xs:complexType name="dex2oatBootClasspath">
-    <xs:sequence>
-      <xs:element name="component" type="t:component" />
-    </xs:sequence>
-  </xs:complexType>
-
-  <!-- Components of the `SYSTEMSERVERCLASSPATH`. -->
-  <xs:complexType name="systemServerClasspath">
+  <!-- Components of a classpath. -->
+  <xs:complexType name="classpath">
     <xs:sequence>
       <xs:element name="component" type="t:component" />
     </xs:sequence>