OSDN Git Service

libbinder: Consider 'VNDK + APEX' as system stable
authorSteven Moreland <smoreland@google.com>
Thu, 26 Sep 2019 21:47:21 +0000 (14:47 -0700)
committerSteven Moreland <smoreland@google.com>
Thu, 26 Sep 2019 21:47:21 +0000 (14:47 -0700)
Currently, we have 'use_vendor' on APEX which means that
'__ANDROID_VNDK__' things might not be logically coupled with the vendor
partition. Since APEXes can't be used from the vendor partition now, we
can mark 'vndk && apex' things as having a stability corresponding to
the system partition.

Bug: 136027762
Test: boot && binderStabilityTest
Change-Id: Ib784c0da6bbb4435aec0f8c1fd1bf421332d64d7

libs/binder/Parcel.cpp
libs/binder/include/binder/Stability.h
libs/binder/ndk/include_platform/android/binder_stability.h

index ee26997..1131732 100644 (file)
@@ -509,7 +509,7 @@ void Parcel::updateWorkSourceRequestHeaderPosition() const {
     }
 }
 
-#ifdef __ANDROID_VNDK__
+#if defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
 constexpr int32_t kHeader = B_PACK_CHARS('V', 'N', 'D', 'R');
 #else
 constexpr int32_t kHeader = B_PACK_CHARS('S', 'Y', 'S', 'T');
index b84657a..2894482 100644 (file)
@@ -81,7 +81,7 @@ private:
         VINTF = 0b111111,
     };
 
-#ifdef __ANDROID_VNDK__
+#if defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
     static constexpr Level kLocalStability = Level::VENDOR;
 #else
     static constexpr Level kLocalStability = Level::SYSTEM;
index e6aeb04..b03fce1 100644 (file)
@@ -20,7 +20,7 @@
 
 __BEGIN_DECLS
 
-#ifdef __ANDROID_VNDK__
+#if defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
 
 /**
  * This interface has the stability of the vendor image.
@@ -31,7 +31,7 @@ static inline void AIBinder_markCompilationUnitStability(AIBinder* binder) {
     AIBinder_markVendorStability(binder);
 }
 
-#else  // ndef defined __ANDROID_VNDK__
+#else  // defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
 
 /**
  * This interface has the stability of the system image.
@@ -42,7 +42,7 @@ static inline void AIBinder_markCompilationUnitStability(AIBinder* binder) {
     AIBinder_markSystemStability(binder);
 }
 
-#endif  // ifdef __ANDROID_VNDK__
+#endif  // defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
 
 /**
  * This interface has system<->vendor stability