summaryrefslogtreecommitdiff
path: root/libs/binder/Stability.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/binder/Stability.cpp')
-rw-r--r--libs/binder/Stability.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/libs/binder/Stability.cpp b/libs/binder/Stability.cpp
index e1565fac43..6115aec81d 100644
--- a/libs/binder/Stability.cpp
+++ b/libs/binder/Stability.cpp
@@ -22,7 +22,7 @@ namespace android {
namespace internal {
void Stability::markCompilationUnit(IBinder* binder) {
- status_t result = set(binder, kLocalStability, true /*log*/);
+ status_t result = set(binder, getLocalStability(), true /*log*/);
LOG_ALWAYS_FATAL_IF(result != OK, "Should only mark known object.");
}
@@ -45,7 +45,26 @@ bool Stability::requiresVintfDeclaration(const sp<IBinder>& binder) {
}
void Stability::tryMarkCompilationUnit(IBinder* binder) {
- (void) set(binder, kLocalStability, false /*log*/);
+ (void) set(binder, getLocalStability(), false /*log*/);
+}
+
+Stability::Level Stability::getLocalStability() {
+#ifdef __ANDROID_VNDK__
+ #ifdef __ANDROID_APEX__
+ // TODO(b/142684679) avoid use_vendor on system APEXes
+ #if !defined(__ANDROID_APEX_COM_ANDROID_MEDIA_SWCODEC__) \
+ && !defined(__ANDROID_APEX_TEST_COM_ANDROID_MEDIA_SWCODEC__)
+ #error VNDK + APEX only defined for com.android.media.swcodec
+ #endif
+ // TODO(b/142684679) avoid use_vendor on system APEXes
+ return Level::SYSTEM;
+ #else
+ return Level::VENDOR;
+ #endif
+#else
+ // TODO(b/139325195): split up stability levels for system/APEX.
+ return Level::SYSTEM;
+#endif
}
status_t Stability::set(IBinder* binder, int32_t stability, bool log) {