libbinder_ndk: __ANDROID_NDK__ canary
Noticed recently that libbinder_ndk had a static variant. Adding this
canary so that there is an error if it is accidentally compiled into an
app. This is aimed as a protection against potential future variants.
Bug: 136027762
Test: N/A
Change-Id: I7eaf1c0f12d9891fbb2a2f1dbaae06f06d6545cf
diff --git a/libs/binder/ndk/stability.cpp b/libs/binder/ndk/stability.cpp
index abafe1f..a5b3ece 100644
--- a/libs/binder/ndk/stability.cpp
+++ b/libs/binder/ndk/stability.cpp
@@ -27,6 +27,10 @@
#error libbinder_ndk should only be built in a system context
#endif
+#ifdef __ANDROID_NDK__
+#error libbinder_ndk should only be built in a system context
+#endif
+
// explicit extern because symbol is only declared in header when __ANDROID_VNDK__
extern "C" void AIBinder_markVendorStability(AIBinder* binder) {
Stability::markVndk(binder->getBinder().get());