summaryrefslogtreecommitdiff
path: root/tools/aapt2/process/SymbolTable.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2021-02-24 14:39:13 -0800
committerRyan Mitchell <rtmitchell@google.com>2021-02-24 15:57:34 -0800
commit5855de7ed652aadb4859a0070ed0b6e60824c10c (patch)
treee0ad7e0ab6a058b034d3382428e32f6a6358f10c /tools/aapt2/process/SymbolTable.cpp
parentd145f376ca970dac89559f19df6da8d0ec24741e (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/process/SymbolTable.cpp')
-rw-r--r--tools/aapt2/process/SymbolTable.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/aapt2/process/SymbolTable.cpp b/tools/aapt2/process/SymbolTable.cpp
index daedc2a14767..98ee63d2e5c6 100644
--- a/tools/aapt2/process/SymbolTable.cpp
+++ b/tools/aapt2/process/SymbolTable.cpp
@@ -370,11 +370,11 @@ std::unique_ptr<SymbolTable::Symbol> AssetManagerSymbolSource::FindByName(
} else {
s = util::make_unique<SymbolTable::Symbol>();
s->id = res_id;
- s->is_dynamic = IsPackageDynamic(ResourceId(res_id).package_id(), real_name.package);
}
if (s) {
s->is_public = (type_spec_flags & android::ResTable_typeSpec::SPEC_PUBLIC) != 0;
+ s->is_dynamic = IsPackageDynamic(ResourceId(res_id).package_id(), real_name.package);
return s;
}
return {};
@@ -417,11 +417,11 @@ std::unique_ptr<SymbolTable::Symbol> AssetManagerSymbolSource::FindById(
} else {
s = util::make_unique<SymbolTable::Symbol>();
s->id = id;
- s->is_dynamic = IsPackageDynamic(ResourceId(id).package_id(), name.package);
}
if (s) {
s->is_public = (*flags & android::ResTable_typeSpec::SPEC_PUBLIC) != 0;
+ s->is_dynamic = IsPackageDynamic(ResourceId(id).package_id(), name.package);
return s;
}
return {};