This reverts commit
2606541de1a91657c0001c0ea573d537069e2332.
The usb-device tag is defined by Android and putting hexadecimal
values into it breaks compatibility which means that the XML can
not be used as a device filter in AndroidManifest.xml as intended.
for (int i = 0; i < count; i++) {
String name = parser.getAttributeName(i);
// All attribute values are ints
for (int i = 0; i < count; i++) {
String name = parser.getAttributeName(i);
// All attribute values are ints
- int value = parseAttribute(name, parser.getAttributeValue(i));
+ int value = Integer.parseInt(parser.getAttributeValue(i));
if ("vendor-id".equals(name)) {
vendorId = value;
if ("vendor-id".equals(name)) {
vendorId = value;
deviceClass, deviceSubclass, deviceProtocol);
}
deviceClass, deviceSubclass, deviceProtocol);
}
- private static int parseAttribute(String name, String value) {
- // vendor-id and product-id are in hexadecimal format.
- if ("vendor-id".equals(name) || "product-id".equals(name))
- return Integer.parseInt(value, 16);
- else
- return Integer.parseInt(value);
- }
-
private boolean matches(int clasz, int subclass, int protocol) {
return ((mClass == -1 || clasz == mClass) &&
(mSubclass == -1 || subclass == mSubclass) &&
private boolean matches(int clasz, int subclass, int protocol) {
return ((mClass == -1 || clasz == mClass) &&
(mSubclass == -1 || subclass == mSubclass) &&