handle the correct use of <array>,<string-array>,<integer-array>. Fixes FC with Contacts,Camera,T9Map with some APKs

This commit is contained in:
Connor Tumbleson 2012-08-27 14:39:53 -05:00
parent e716c0a972
commit ebb2f6d623

View File

@ -65,11 +65,15 @@ public class ResArrayValue extends ResBagValue implements ResValuesXmlSerializab
return null; return null;
} }
String type = mItems[0].getType(); String type = mItems[0].getType();
if (!"string".equals(type) && !"integer".equals(type)) {
return null;
}
for (int i = 1; i < mItems.length; i++) { for (int i = 1; i < mItems.length; i++) {
if (! type.equals(mItems[i].getType())) {
if (mItems[i].encodeAsResXmlItemValue().startsWith("@string")) {
return "string";
} else if (mItems[i].encodeAsResXmlItemValue().startsWith("@drawable")) {
return null;
} else if (!"string".equals(type) && !"integer".equals(type)) {
return null;
} else if (!type.equals(mItems[i].getType())) {
return null; return null;
} }
} }