diff options
author | Clark DuVall <cduvall@google.com> | 2020-04-22 13:19:28 -0700 |
---|---|---|
committer | Clark DuVall <cduvall@google.com> | 2020-04-22 13:19:28 -0700 |
commit | 8f51d6b876644765f86c82d45fb363db60b3ced1 (patch) | |
tree | c23e75b364e6739e92630b96b697d5dfcbb243db /tools/aapt2/java/JavaClassGenerator.cpp | |
parent | 61115d7d8f1bdd8c9456dd930ff077be7fd2707e (diff) |
Reorder styleable attributes in shared libraries
This is a similar fix to
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/10109386
but deals with styleable attributes instead of style items.
Bug: 147674078
Test: JavaClassGeneratorTest.SortsDynamicAttributesAfterFrameworkAttributes
Change-Id: Ida6572cf07e2b5987e9d8941cf169a37c43578c4
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
-rw-r--r-- | tools/aapt2/java/JavaClassGenerator.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/aapt2/java/JavaClassGenerator.cpp b/tools/aapt2/java/JavaClassGenerator.cpp index bb541fe2490b..0869c570f5d6 100644 --- a/tools/aapt2/java/JavaClassGenerator.cpp +++ b/tools/aapt2/java/JavaClassGenerator.cpp @@ -218,13 +218,10 @@ struct StyleableAttr { static bool operator<(const StyleableAttr& lhs, const StyleableAttr& rhs) { const ResourceId lhs_id = lhs.attr_ref->id.value_or_default(ResourceId(0)); const ResourceId rhs_id = rhs.attr_ref->id.value_or_default(ResourceId(0)); - if (lhs_id < rhs_id) { - return true; - } else if (lhs_id > rhs_id) { - return false; - } else { + if (lhs_id == rhs_id) { return lhs.attr_ref->name.value() < rhs.attr_ref->name.value(); } + return cmp_ids_dynamic_after_framework(lhs_id, rhs_id); } void JavaClassGenerator::ProcessStyleable(const ResourceNameRef& name, const ResourceId& id, |