summaryrefslogtreecommitdiff
path: root/tools/aapt2/Resource.cpp
diff options
context:
space:
mode:
author Iurii Makhno <iuriimak@google.com> 2022-02-22 14:16:31 +0000
committer Iurii Makhno <iuriimak@google.com> 2022-02-25 18:16:29 +0000
commit9d4a4d6021e514eb6f3abd702b45a3343dc5bc39 (patch)
tree13a1b8adea5a93f0ec85e1aafbb1d2f15786e700 /tools/aapt2/Resource.cpp
parentf0c5ff46edfe99c5038558f7b89186e476eb9780 (diff)
Use dot instead of colon as separator of custom part.
This is done becase ':' is already used as a separator between package and type in a full resource name. So if we use ':' it will be consfusing for custom resource types: com.my.package:layout:2/myLayout -> com.my.package:layout.2/myLayout. DD: go/custom-resource-types-in-aapt2 Bug: b/215108200 Test: Resource_test Change-Id: Ieed256e4376abe0a3788d8198110bef189b55740
Diffstat (limited to 'tools/aapt2/Resource.cpp')
-rw-r--r--tools/aapt2/Resource.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/aapt2/Resource.cpp b/tools/aapt2/Resource.cpp
index 0bb330e26e6f..df8c3b9956d0 100644
--- a/tools/aapt2/Resource.cpp
+++ b/tools/aapt2/Resource.cpp
@@ -139,10 +139,10 @@ ResourceNamedTypeRef ResourceNamedTypeWithDefaultName(ResourceType t) {
}
std::optional<ResourceNamedTypeRef> ParseResourceNamedType(const android::StringPiece& s) {
- auto colon = std::find(s.begin(), s.end(), ':');
+ auto dot = std::find(s.begin(), s.end(), '.');
const ResourceType* parsedType;
- if (colon != s.end() && colon != std::prev(s.end())) {
- parsedType = ParseResourceType(s.substr(s.begin(), colon));
+ if (dot != s.end() && dot != std::prev(s.end())) {
+ parsedType = ParseResourceType(s.substr(s.begin(), dot));
} else {
parsedType = ParseResourceType(s);
}