diff options
author | Donald Chai <dchai@google.com> | 2020-01-06 13:52:41 -0800 |
---|---|---|
committer | Donald Chai <dchai@google.com> | 2020-01-07 21:17:59 -0800 |
commit | f80d0ae89b118414e4c2f994fd684f4a47323b1a (patch) | |
tree | 3698709b2e5366acc8ac25bb948724ef8b57df22 /tools/aapt2/ResourceParser.h | |
parent | 8ab35ca19d8db831a61c7c0c720ab42aadc7ff52 (diff) |
Add option to avoid clobbering visibility of <declare-styleable>
"aapt2 compile" marks styleables as public instead of preserving
information from <public/> or --visibility options. This behavior can
now be disabled via --preserve-visibility-of-styleables.
Bug: 146649511
Change-Id: Ifb8ab396573d1393df737a59625e79e9cf2494a7
Tested: aapt2_tests
Diffstat (limited to 'tools/aapt2/ResourceParser.h')
-rw-r--r-- | tools/aapt2/ResourceParser.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/aapt2/ResourceParser.h b/tools/aapt2/ResourceParser.h index 06bb0c9cf264..9d3ecc866c5d 100644 --- a/tools/aapt2/ResourceParser.h +++ b/tools/aapt2/ResourceParser.h @@ -46,6 +46,12 @@ struct ResourceParserOptions { */ bool error_on_positional_arguments = true; + /** + * If true, apply the same visibility rules for styleables as are used for + * all other resources. Otherwise, all styleables will be made public. + */ + bool preserve_visibility_of_styleables = false; + // If visibility was forced, we need to use it when creating a new resource and also error if we // try to parse the <public>, <public-group>, <java-symbol> or <symbol> tags. Maybe<Visibility::Level> visibility; |