diff options
author | Michael Wright <michaelwr@google.com> | 2012-06-07 20:46:44 -0700 |
---|---|---|
committer | Michael Wright <michaelwr@google.com> | 2012-06-13 17:46:05 -0700 |
commit | 6ebc2c45b01705c2619f11d3bd308ffe51f69758 (patch) | |
tree | 4273c92c81450d36aaf569b8ece3220d12ce3db4 /device_validator | |
parent | bdf93e9fe3ae8317e721d775e948b5c09ebc2f36 (diff) | |
download | sdk-6ebc2c45b01705c2619f11d3bd308ffe51f69758.zip sdk-6ebc2c45b01705c2619f11d3bd308ffe51f69758.tar.gz sdk-6ebc2c45b01705c2619f11d3bd308ffe51f69758.tar.bz2 |
Added parser for new devices schema
Change-Id: Ib8a4a750b56f9ea94abd21c445958726343e760c
Diffstat (limited to 'device_validator')
9 files changed, 18 insertions, 23 deletions
diff --git a/device_validator/dvlib/src/com/android/dvlib/DeviceSchema.java b/device_validator/dvlib/src/com/android/dvlib/DeviceSchema.java index 101baf4..6c45401 100644 --- a/device_validator/dvlib/src/com/android/dvlib/DeviceSchema.java +++ b/device_validator/dvlib/src/com/android/dvlib/DeviceSchema.java @@ -102,7 +102,7 @@ public class DeviceSchema { public static final String NODE_YDPI = "ydpi"; - public static final String NODE_PLUGGED_IN = "plugged-in"; + public static final String NODE_POWER_TYPE= "power-type"; public static final String NODE_Y_DIMENSION = "y-dimension"; @@ -110,7 +110,7 @@ public class DeviceSchema { public static final String NODE_NAV_STATE = "nav-state"; - public static final String NODE_HAS_MIC = "has-mic"; + public static final String NODE_MIC = "mic"; public static final String NODE_RAM = "ram"; @@ -184,6 +184,8 @@ public class DeviceSchema { public static final String ATTR_UNIT = "unit"; + public static final String ATTR_NAME = "name"; + /** * Validates the input stream. * diff --git a/device_validator/dvlib/src/com/android/dvlib/devices.xsd b/device_validator/dvlib/src/com/android/dvlib/devices.xsd index c3fa482..7e93fd5 100644 --- a/device_validator/dvlib/src/com/android/dvlib/devices.xsd +++ b/device_validator/dvlib/src/com/android/dvlib/devices.xsd @@ -87,7 +87,7 @@ <xsd:element name="gpu" type= "c:gpuType" /> <xsd:element name="abi" type= "c:abiType" /> <xsd:element name="dock" type= "c:dockType" /> - <xsd:element name="plugged-in" type= "c:pluggedInType" /> + <xsd:element name="power-type" type= "c:powerType" /> </xsd:sequence> </xsd:complexType> @@ -298,7 +298,7 @@ <xsd:element name="gpu" type="c:gpuType" minOccurs="0" /> <xsd:element name="abi" type="c:abiType" minOccurs="0" /> <xsd:element name="dock" type="c:dockType" minOccurs="0" /> - <xsd:element name="plugged-in" type="c:pluggedInType" + <xsd:element name="power-type" type="c:powerType" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:token" /> @@ -853,16 +853,15 @@ </xsd:list> </xsd:simpleType> - <xsd:simpleType name="pluggedInType"> + <xsd:simpleType name="powerType"> <xsd:annotation> <xsd:documentation xml:lang="en"> - Specifies when the device is plugged in. + Specifies whether the device is plugged in. </xsd:documentation> </xsd:annotation> <xsd:restriction base="xsd:token"> - <xsd:enumeration value="always" /> - <xsd:enumeration value="charge" /> - <xsd:enumeration value="never" /> + <xsd:enumeration value="plugged-in" /> + <xsd:enumeration value="battery" /> </xsd:restriction> </xsd:simpleType> diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java b/device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java index e1a242d..de70ef3 100644 --- a/device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java +++ b/device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java @@ -18,11 +18,8 @@ package com.android.dvlib; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; import java.io.InputStream; import java.io.StringWriter; -import java.net.URL; import java.util.HashMap; import java.util.Map; import java.util.Stack; diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices.xml index 96c42ee..6920e97 100644 --- a/device_validator/dvlib/tests/src/com/android/dvlib/devices.xml +++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices.xml @@ -68,7 +68,7 @@ <d:dock> </d:dock> <!-- plugged in (never, charge, always) --> - <d:plugged-in>charge</d:plugged-in> + <d:power-type>battery</d:power-type> </d:hardware> <d:software> <d:api-level>14-</d:api-level> @@ -193,7 +193,7 @@ car desk </d:dock> - <d:plugged-in>charge</d:plugged-in> + <d:power-type>battery</d:power-type> </d:hardware> <d:software> <d:api-level>5-8</d:api-level> diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml index 79b6806..e50f636 100644 --- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml +++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml @@ -65,10 +65,8 @@ armeabi-v7a </d:abi> <!--dock (car, desk, tv, none)--> - <d:dock> - </d:dock> - <!-- plugged in (never, charge, always) --> - <d:plugged-in>charge</d:plugged-in> + <d:dock></d:dock> + <d:power-type>battery</d:power-type> </d:hardware> <d:software> <d:api-level>15</d:api-level> diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml index 3ebcedb..f6d9bcd 100644 --- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml +++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml @@ -67,8 +67,7 @@ <!--dock (car, desk, tv, none)--> <d:dock> </d:dock> - <!-- plugged in (never, charge, always) --> - <d:plugged-in>charge</d:plugged-in> + <d:power-type>battery</d:power-type> </d:hardware> <d:software> <d:api-level>14</d:api-level> diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml index 899110a..9c3764e 100644 --- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml +++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml @@ -68,7 +68,7 @@ <d:dock> </d:dock> <!-- plugged in (never, charge, always) --> - <d:plugged-in>charge</d:plugged-in> + <d:power-type>battery</d:power-type> </d:hardware> <d:state name="Portrait" default="true"> <d:description>The phone in portrait view</d:description> diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml index c4955b4..89519cf 100644 --- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml +++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml @@ -68,7 +68,7 @@ <d:dock> </d:dock> <!-- plugged in (never, charge, always) --> - <d:plugged-in>charge</d:plugged-in> + <d:power-type>battery</d:power-type> </d:hardware> <d:software> <d:api-level>14</d:api-level> diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml index a4e464c..adf544a 100644 --- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml +++ b/device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml @@ -68,7 +68,7 @@ <d:dock> </d:dock> <!-- plugged in (never, charge, always) --> - <d:plugged-in>charge</d:plugged-in> + <d:power-type>battery</d:power-type> </d:hardware> <d:software> <d:api-level>14</d:api-level> |