MCPcopy Create free account
hub / github.com/CyanogenMod/android_frameworks_base / getIntegerAttribute

Function getIntegerAttribute

tools/aapt/Command.cpp:278–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278static int32_t getIntegerAttribute(const ResXMLTree& tree, uint32_t attrRes,
279 String8* outError, int32_t defValue = -1)
280{
281 ssize_t idx = indexOfAttribute(tree, attrRes);
282 if (idx < 0) {
283 return defValue;
284 }
285 Res_value value;
286 if (tree.getAttributeValue(idx, &value) != NO_ERROR) {
287 if (value.dataType < Res_value::TYPE_FIRST_INT
288 || value.dataType > Res_value::TYPE_LAST_INT) {
289 if (outError != NULL) *outError = "attribute is not an integer value";
290 return defValue;
291 }
292 }
293 return value.data;
294}
295
296static int32_t getResolvedIntegerAttribute(const ResTable* resTable, const ResXMLTree& tree,
297 uint32_t attrRes, String8* outError, int32_t defValue = -1)

Callers 2

printCompatibleScreensFunction · 0.85
doDumpFunction · 0.85

Calls 2

indexOfAttributeFunction · 0.85
getAttributeValueMethod · 0.65

Tested by

no test coverage detected