summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2019-11-14 08:09:37 -0800
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-11-14 19:06:39 +0000
commitd7d35ad924aaa391ce58d922b92889545df159d6 (patch)
tree127bfb55426bff770700db9f3c9de88afa09c31d
parent4417ee0aa329fbbbf02c2b5abe7702bf5e62a806 (diff)
downloadnative-d7d35ad924aaa391ce58d922b92889545df159d6.tar.gz
libbinder_ndk: R system users can run on Q devices
This is in response to an awareness of a requirement that we compile client code of this library and run it on Q device and that code should also use R APIs when the same binary is used in R. Most likely this should result in new infrastructure, but it's not unlikely that infrastructure will be equivalent to weak pointers. This change makes AIBinder_markSystemStability as a weak pointer and only uses it when it is available (on R+ devices). Luckily, only system clients have this requirement now. Since there are no vendor clients, we can leave AIBinder_markVendorStability strong. These are the more important bits to set for stability purposes. Test: boot, test mapping, readelf: 6: 00000000 0 FUNC WEAK DEFAULT UND AIBinder_markSystemStability@LIBBINDER_NDK30 (4) Bug: 144465080 Change-Id: I3d76be2903433a6b180b46aea6592d446be1c076 (cherry picked from commit db685b1281e8c14df5f0a7dc0cd3b4884784164e)
-rw-r--r--libs/binder/ndk/include_platform/android/binder_stability.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/binder/ndk/include_platform/android/binder_stability.h b/libs/binder/ndk/include_platform/android/binder_stability.h
index 2a4ded8691..56d95a7759 100644
--- a/libs/binder/ndk/include_platform/android/binder_stability.h
+++ b/libs/binder/ndk/include_platform/android/binder_stability.h
@@ -56,9 +56,11 @@ enum {
/**
* This interface has the stability of the system image.
*/
-void AIBinder_markSystemStability(AIBinder* binder);
+__attribute__((weak)) void AIBinder_markSystemStability(AIBinder* binder);
static inline void AIBinder_markCompilationUnitStability(AIBinder* binder) {
+ if (AIBinder_markSystemStability == nullptr) return;
+
AIBinder_markSystemStability(binder);
}