diff options
Diffstat (limited to 'libs/binder/ndk/include_platform/android/binder_stability.h')
-rw-r--r-- | libs/binder/ndk/include_platform/android/binder_stability.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/libs/binder/ndk/include_platform/android/binder_stability.h b/libs/binder/ndk/include_platform/android/binder_stability.h index f5e8bf60ef..f113ba8f21 100644 --- a/libs/binder/ndk/include_platform/android/binder_stability.h +++ b/libs/binder/ndk/include_platform/android/binder_stability.h @@ -30,7 +30,7 @@ enum { FLAG_PRIVATE_VENDOR = 0x10000000, }; -#if defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__) +#if defined(__ANDROID_VENDOR__) enum { FLAG_PRIVATE_LOCAL = FLAG_PRIVATE_VENDOR, @@ -45,7 +45,19 @@ static inline void AIBinder_markCompilationUnitStability(AIBinder* binder) { AIBinder_markVendorStability(binder); } -#else // defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__) +/** + * Given a binder interface at a certain stability, there may be some + * requirements associated with that higher stability level. For instance, a + * VINTF stability binder is required to be in the VINTF manifest. This API + * can be called to use that same interface within the vendor partition. + */ +void AIBinder_forceDowngradeToVendorStability(AIBinder* binder); + +static inline void AIBinder_forceDowngradeToLocalStability(AIBinder* binder) { + AIBinder_forceDowngradeToVendorStability(binder); +} + +#else // defined(__ANDROID_VENDOR__) enum { FLAG_PRIVATE_LOCAL = 0, @@ -62,9 +74,27 @@ static inline void AIBinder_markCompilationUnitStability(AIBinder* binder) { AIBinder_markSystemStability(binder); } -#endif // defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__) +/** + * Given a binder interface at a certain stability, there may be some + * requirements associated with that higher stability level. For instance, a + * VINTF stability binder is required to be in the VINTF manifest. This API + * can be called to use that same interface within the system partition. + */ +void AIBinder_forceDowngradeToSystemStability(AIBinder* binder); + +static inline void AIBinder_forceDowngradeToLocalStability(AIBinder* binder) { + AIBinder_forceDowngradeToSystemStability(binder); +} + +#endif // defined(__ANDROID_VENDOR__) /** + * WARNING: this is not expected to be used manually. When the build system has + * versioned checks in place for an interface that prevent it being changed year + * over year (specifically like those for @VintfStability stable AIDL + * interfaces), this could be called. Calling this without this or equivalent + * infrastructure will lead to de facto frozen APIs or GSI test failures. + * * This interface has system<->vendor stability */ void AIBinder_markVintfStability(AIBinder* binder); |