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.h | |
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.h')
-rw-r--r-- | tools/aapt2/java/JavaClassGenerator.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/aapt2/java/JavaClassGenerator.h b/tools/aapt2/java/JavaClassGenerator.h index 853120b3cb98..d9d1b39805f9 100644 --- a/tools/aapt2/java/JavaClassGenerator.h +++ b/tools/aapt2/java/JavaClassGenerator.h @@ -105,7 +105,7 @@ class JavaClassGenerator { // Writes a styleable resource to the R.java file, optionally writing out a rewrite rule for // its package ID if `out_rewrite_method` is not nullptr. // `package_name_to_generate` is the package - void ProcessStyleable(const ResourceNameRef& name, const ResourceId& id, + bool ProcessStyleable(const ResourceNameRef& name, const ResourceId& id, const Styleable& styleable, const android::StringPiece& package_name_to_generate, ClassDefinition* out_class_def, MethodDefinition* out_rewrite_method, |