|
30 | 30 | #include <android/binder_auto_utils.h> |
31 | 31 | #include <android/binder_ibinder.h> |
32 | 32 |
|
| 33 | +#if defined(__ANDROID_VENDOR_API__) |
| 34 | +#include <android/llndk-versioning.h> |
| 35 | +#elif !defined(API_LEVEL_AT_LEAST) |
33 | 36 | #if defined(__BIONIC__) |
34 | | -#define API_LEVEL_AT_LEAST(sdk_api_level) __builtin_available(android sdk_api_level, *) |
35 | | -#elif defined(TRUSTY_USERSPACE) |
36 | | -// TODO(b/349936395): set to true for Trusty |
37 | | -#define API_LEVEL_AT_LEAST(sdk_api_level) (false) |
| 37 | +#define API_LEVEL_AT_LEAST(sdk_api_level, vendor_api_level) \ |
| 38 | + (__builtin_available(android sdk_api_level, *)) |
38 | 39 | #else |
39 | | -#define API_LEVEL_AT_LEAST(sdk_api_level) (true) |
| 40 | +#define API_LEVEL_AT_LEAST(sdk_api_level, vendor_api_level) (true) |
40 | 41 | #endif // __BIONIC__ |
| 42 | +#endif // __ANDROID_VENDOR_API__ |
41 | 43 |
|
42 | 44 | #if __has_include(<android/binder_shell.h>) |
43 | 45 | #include <android/binder_shell.h> |
@@ -296,8 +298,9 @@ AIBinder_Class* ICInterface::defineClass(const char* interfaceDescriptor, |
296 | 298 | #endif |
297 | 299 |
|
298 | 300 | #if defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__) || __ANDROID_API__ >= 36 |
299 | | - if (API_LEVEL_AT_LEAST(36)) { |
300 | | - if (codeToFunction != nullptr) { |
| 301 | + if API_LEVEL_AT_LEAST (36, 202504) { |
| 302 | + if (codeToFunction != nullptr && |
| 303 | + (&AIBinder_Class_setTransactionCodeToFunctionNameMap != nullptr)) { |
301 | 304 | AIBinder_Class_setTransactionCodeToFunctionNameMap(clazz, codeToFunction, |
302 | 305 | functionCount); |
303 | 306 | } |
|
0 commit comments