AAPT2: Process <java-symbols> and private symbol package
Need to introduce the idea of multiple levels of visibility to support <java-symbol>.
Public, Private, Undefined.
Public means it is accessible from outside and requires an ID assigned.
Private means that we explicitly want this to be a symbol (show up in R.java), but not visible
to other packages. No ID required.
Undefined is any normal resource. When --private-symbols is specified in the link phase,
these resources will not show up in R.java.
Change-Id: Icba89221e08e685dee7683786aa7112baf28c856
diff --git a/tools/aapt2/link/PrivateAttributeMover.cpp b/tools/aapt2/link/PrivateAttributeMover.cpp
index db20bcb..5a2f5f07 100644
--- a/tools/aapt2/link/PrivateAttributeMover.cpp
+++ b/tools/aapt2/link/PrivateAttributeMover.cpp
@@ -61,7 +61,7 @@
continue;
}
- if (!type->publicStatus.isPublic) {
+ if (type->symbolStatus.state != SymbolState::kPublic) {
// No public attributes, so we can safely leave these private attributes where they are.
return true;
}
@@ -71,7 +71,7 @@
moveIf(type->entries, std::back_inserter(privAttrType->entries),
[](const std::unique_ptr<ResourceEntry>& entry) -> bool {
- return !entry->publicStatus.isPublic;
+ return entry->symbolStatus.state != SymbolState::kPublic;
});
break;
}