diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2021-02-24 14:39:13 -0800 |
---|---|---|
committer | Ryan Mitchell <rtmitchell@google.com> | 2021-02-24 15:57:34 -0800 |
commit | 5855de7ed652aadb4859a0070ed0b6e60824c10c (patch) | |
tree | e0ad7e0ab6a058b034d3382428e32f6a6358f10c /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | d145f376ca970dac89559f19df6da8d0ec24741e (diff) |
Use R field directly for shared lib styleable attrs
If a shared library exposes an attribute and a client uses the
attribute in its own styleable, the value of the lib attribute
resource id in the client styleable must be fixed with the correct
package id at runtime. Since the client will not have an
onResourcesLoaded to call, the client should directly reference the
attribute resource field in its styleable.
Bug: 147674078
Test: aapt2_tests
Change-Id: I8e64bb2d3165a7072e2604fe1730b248545978f4
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
-rw-r--r-- | tools/aapt2/java/JavaClassGenerator_test.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/aapt2/java/JavaClassGenerator_test.cpp b/tools/aapt2/java/JavaClassGenerator_test.cpp index 04e20101a0dd..ec5b4151b1a6 100644 --- a/tools/aapt2/java/JavaClassGenerator_test.cpp +++ b/tools/aapt2/java/JavaClassGenerator_test.cpp @@ -581,7 +581,7 @@ TEST(JavaClassGeneratorTest, SortsDynamicAttributesAfterFrameworkAttributes) { out.Flush(); EXPECT_THAT(output, HasSubstr("public static final int[] MyStyleable={")); - EXPECT_THAT(output, HasSubstr("0x01010000, 0x00010000")); + EXPECT_THAT(output, HasSubstr("0x01010000, lib.R.attr.dynamic_attr")); EXPECT_THAT(output, HasSubstr("public static final int MyStyleable_android_framework_attr=0;")); EXPECT_THAT(output, HasSubstr("public static final int MyStyleable_dynamic_attr=1;")); } |