summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2019-08-08 18:17:51 -0700
committer Steven Moreland <smoreland@google.com> 2019-08-08 18:19:12 -0700
commit6932fe1bf92c804c8b5a0d5277965cbf82e78da8 (patch)
tree997cdeff6269eddd351b4649d77af896e699e987
parenta9860b6d18de4a6bf2b5c4cea92b0cc71ca2e5be (diff)
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
-rw-r--r--libs/binder/ndk/stability.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/binder/ndk/stability.cpp b/libs/binder/ndk/stability.cpp
index abafe1f69f..a5b3ecea4a 100644
--- a/libs/binder/ndk/stability.cpp
+++ b/libs/binder/ndk/stability.cpp
@@ -27,6 +27,10 @@ using ::android::internal::Stability;
#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());