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

Method remapStringValue

tools/aapt/ResourceTable.cpp:3369–3390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3367}
3368
3369status_t ResourceTable::Entry::remapStringValue(StringPool* strings)
3370{
3371 if (mType == TYPE_ITEM) {
3372 Item& it = mItem;
3373 if (it.parsedValue.dataType == Res_value::TYPE_STRING) {
3374 it.parsedValue.data = strings->mapOriginalPosToNewPos(it.parsedValue.data);
3375 }
3376 } else if (mType == TYPE_BAG) {
3377 const size_t N = mBag.size();
3378 for (size_t i=0; i<N; i++) {
3379 Item& it = mBag.editValueAt(i);
3380 if (it.parsedValue.dataType == Res_value::TYPE_STRING) {
3381 it.parsedValue.data = strings->mapOriginalPosToNewPos(it.parsedValue.data);
3382 }
3383 }
3384 } else {
3385 mPos.error("Error: entry %s is not a single item or a bag.\n",
3386 String8(mName).string());
3387 return UNKNOWN_ERROR;
3388 }
3389 return NO_ERROR;
3390}
3391
3392ssize_t ResourceTable::Entry::flatten(Bundle* bundle, const sp<AaptFile>& data, bool isPublic)
3393{

Callers 1

flattenMethod · 0.80

Calls 4

stringMethod · 0.80
sizeMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected