diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-06-10 12:45:36 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-06-10 12:45:36 -0700 |
commit | 6b592723c9a9fc816a8ab75c935e8cd20ff65a0e (patch) | |
tree | 00b93945a1c8051172316575208f14c355e663c3 /libs/utils | |
parent | 08b992c88e60a95b629a70cd197b3d3b9b27fb8d (diff) | |
parent | f51ded0f8f593d17af82946eb65c05fc04f688b4 (diff) | |
download | frameworks_base-6b592723c9a9fc816a8ab75c935e8cd20ff65a0e.zip frameworks_base-6b592723c9a9fc816a8ab75c935e8cd20ff65a0e.tar.gz frameworks_base-6b592723c9a9fc816a8ab75c935e8cd20ff65a0e.tar.bz2 |
resolved conflicts for merge of f51ded0f to master
Change-Id: Ida356524a68aeb2b9b0013dfbb6ab4bd11e616e2
Diffstat (limited to 'libs/utils')
-rw-r--r-- | libs/utils/ResourceTypes.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp index 4a6a3db..cb6c246 100644 --- a/libs/utils/ResourceTypes.cpp +++ b/libs/utils/ResourceTypes.cpp @@ -2663,6 +2663,9 @@ uint32_t ResTable::identifierForName(const char16_t* name, size_t nameLen, goto nope; } } + if (outTypeSpecFlags) { + *outTypeSpecFlags = ResTable_typeSpec::SPEC_PUBLIC; + } return m->id; nope: ; @@ -2677,6 +2680,9 @@ nope: index); return 0; } + if (outTypeSpecFlags) { + *outTypeSpecFlags = ResTable_typeSpec::SPEC_PUBLIC; + } return Res_MAKEARRAY(index); } } @@ -2687,6 +2693,8 @@ nope: return 0; } + bool fakePublic = false; + // Figure out the package and type we are looking in... const char16_t* packageEnd = NULL; @@ -2698,7 +2706,13 @@ nope: else if (*p == '/') typeEnd = p; p++; } - if (*name == '@') name++; + if (*name == '@') { + name++; + if (*name == '*') { + fakePublic = true; + name++; + } + } if (name >= nameEnd) { return 0; } @@ -2803,6 +2817,9 @@ nope: if (dtohl(entry->key.index) == (size_t)ei) { if (outTypeSpecFlags) { *outTypeSpecFlags = typeConfigs->typeSpecFlags[i]; + if (fakePublic) { + *outTypeSpecFlags |= ResTable_typeSpec::SPEC_PUBLIC; + } } return Res_MAKEID(group->id-1, ti, i); } @@ -2819,7 +2836,8 @@ bool ResTable::expandResourceRef(const uint16_t* refStr, size_t refLen, String16* outName, const String16* defType, const String16* defPackage, - const char** outErrorMsg) + const char** outErrorMsg, + bool* outPublicOnly) { const char16_t* packageEnd = NULL; const char16_t* typeEnd = NULL; @@ -2836,6 +2854,16 @@ bool ResTable::expandResourceRef(const uint16_t* refStr, size_t refLen, p = refStr; if (*p == '@') p++; + if (outPublicOnly != NULL) { + *outPublicOnly = true; + } + if (*p == '*') { + p++; + if (outPublicOnly != NULL) { + *outPublicOnly = false; + } + } + if (packageEnd) { *outPackage = String16(p, packageEnd-p); p = packageEnd+1; |