diff options
author | Svet Ganov <svetoslavganov@google.com> | 2018-03-22 20:58:52 -0700 |
---|---|---|
committer | Svet Ganov <svetoslavganov@google.com> | 2018-03-22 20:59:05 -0700 |
commit | 3f085422081db5d7da5dfc394a0b9c2696c2e9be (patch) | |
tree | 31dd6bda2321ea5299f187abd36619eca19bf9f2 /libs/androidfw/ResourceUtils.cpp | |
parent | c7f6eadffc0a243618ce09ee8d6bb8235738135d (diff) |
Fix resource by name lookup
Test: added: '@' cases to ResourceUtilsTest
pass: ./out/host/darwin-x86/nativetest/libandroidfw_tests/libandroidfw_tests
pass: ./out/host/darwin-x86/nativetest/aapt2_tests/aapt2_tests
pass: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases
-t android.appsecurity.cts.PermissionsHostTest
Bug: 74612500
Change-Id: I144e4ca1b63b9cce71052fc02089bb6092739889
Diffstat (limited to 'libs/androidfw/ResourceUtils.cpp')
-rw-r--r-- | libs/androidfw/ResourceUtils.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/androidfw/ResourceUtils.cpp b/libs/androidfw/ResourceUtils.cpp index 1aa6cf6da28d..d63feb01ef83 100644 --- a/libs/androidfw/ResourceUtils.cpp +++ b/libs/androidfw/ResourceUtils.cpp @@ -26,6 +26,9 @@ bool ExtractResourceName(const StringPiece& str, StringPiece* out_package, Strin bool has_type_separator = false; const char* start = str.data(); const char* end = start + str.size(); + if (start[0] == '@') { + start++; + } const char* current = start; while (current != end) { if (out_type->size() == 0 && *current == '/') { |