summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-12-16 00:44:08 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-12-16 00:44:08 +0000
commitb24ea3c5f45121e3b301bbb97ea2578b9b68ca1f (patch)
treed5cd16f07554f66a732a26159c86a7705f54bad3
parenteab0f58fe9d22ad8c624c63998413df53f1267d3 (diff)
parentab46bbf13db41df921ad884a4bcf65e4a102f759 (diff)
Merge "binder: consistent vendor #defines" into main am: 84145b2e07 am: ab46bbf13d
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2876691 Change-Id: I96521dd08de574a2a4bc14011257bdc81ad5ba1c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--libs/binder/Android.bp2
-rw-r--r--libs/binder/Stability.cpp8
-rw-r--r--libs/binder/trusty/kernel/rules.mk1
-rw-r--r--libs/binder/trusty/rules.mk1
4 files changed, 12 insertions, 0 deletions
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp
index bf3699ccab..ae0fb018ef 100644
--- a/libs/binder/Android.bp
+++ b/libs/binder/Android.bp
@@ -258,7 +258,9 @@ cc_defaults {
"-DBINDER_DISABLE_NATIVE_HANDLE",
"-DBINDER_DISABLE_BLOB",
"-DBINDER_NO_LIBBASE",
+ // TODO: switch to "vendor: true" rather than copying this
// Trusty libbinder uses vendor stability for its binders
+ "-D__ANDROID_VENDOR__",
"-D__ANDROID_VNDK__",
"-U__ANDROID__",
"-D__TRUSTY__",
diff --git a/libs/binder/Stability.cpp b/libs/binder/Stability.cpp
index c432b3af29..665dfea456 100644
--- a/libs/binder/Stability.cpp
+++ b/libs/binder/Stability.cpp
@@ -73,6 +73,14 @@ void Stability::tryMarkCompilationUnit(IBinder* binder) {
(void)setRepr(binder, getLocalLevel(), REPR_NONE);
}
+// after deprecation of the VNDK, these should be aliases. At some point
+// all references to __ANDROID_VNDK__ should be replaced by __ANDROID_VENDOR__
+// but for right now, check that this condition holds because some
+// places check __ANDROID_VNDK__ and some places check __ANDROID_VENDOR__
+#if defined(__ANDROID_VNDK__) != defined(__ANDROID_VENDOR__)
+#error "__ANDROID_VNDK__ and __ANDROID_VENDOR__ should be aliases"
+#endif
+
Stability::Level Stability::getLocalLevel() {
#ifdef __ANDROID_APEX__
#error "APEX can't use libbinder (must use libbinder_ndk)"
diff --git a/libs/binder/trusty/kernel/rules.mk b/libs/binder/trusty/kernel/rules.mk
index 788184d2ce..5cbe0afafa 100644
--- a/libs/binder/trusty/kernel/rules.mk
+++ b/libs/binder/trusty/kernel/rules.mk
@@ -69,6 +69,7 @@ GLOBAL_COMPILEFLAGS += \
-DBINDER_DISABLE_NATIVE_HANDLE \
-DBINDER_DISABLE_BLOB \
-DBINDER_NO_LIBBASE \
+ -D__ANDROID_VENDOR__ \
-D__ANDROID_VNDK__ \
MODULE_DEPS += \
diff --git a/libs/binder/trusty/rules.mk b/libs/binder/trusty/rules.mk
index e0f821f2c9..f2f140d9ba 100644
--- a/libs/binder/trusty/rules.mk
+++ b/libs/binder/trusty/rules.mk
@@ -72,6 +72,7 @@ MODULE_EXPORT_COMPILEFLAGS += \
-DBINDER_DISABLE_NATIVE_HANDLE \
-DBINDER_DISABLE_BLOB \
-DBINDER_NO_LIBBASE \
+ -D__ANDROID_VENDOR__ \
-D__ANDROID_VNDK__ \
# libbinder has some deprecated declarations that we want to produce warnings