NDK: don't export parcel headers
- no AIDL client should ever be manually parceling things
- subjecting these headers to custom downstream cflags is sometimes
problematic
Bug: 143556646
Test: compile (things in tree don't rely on this)
Change-Id: I5c7132f32691892a67dd4faeeb6e3ffb347fa59a
diff --git a/generate_ndk.cpp b/generate_ndk.cpp
index 60c93d6..fc9cc20 100644
--- a/generate_ndk.cpp
+++ b/generate_ndk.cpp
@@ -170,7 +170,11 @@
static void GenerateHeaderIncludes(CodeWriter& out, const AidlTypenames& types,
const AidlDefinedType& defined_type) {
- out << "#include <android/binder_parcel_utils.h>\n";
+ out << "#include <cstdint>\n";
+ out << "#include <memory>\n";
+ out << "#include <optional>\n";
+ out << "#include <string>\n";
+ out << "#include <vector>\n";
out << "#ifdef BINDER_STABILITY_SUPPORT\n";
out << "#include <android/binder_stability.h>\n";
out << "#endif // BINDER_STABILITY_SUPPORT\n";
@@ -196,6 +200,8 @@
}
static void GenerateSourceIncludes(CodeWriter& out, const AidlTypenames& types,
const AidlDefinedType& /*defined_type*/) {
+ out << "#include <android/binder_parcel_utils.h>\n";
+
types.IterateTypes([&](const AidlDefinedType& a_defined_type) {
if (a_defined_type.AsInterface() != nullptr) {
out << "#include <" << NdkHeaderFile(a_defined_type, ClassNames::CLIENT, false /*use_os_sep*/)