Skip to content

Commit 3ea49b8

Browse files
committed
Exclude setting code maps from APEX
some APEX modules are running into null-deref when calling AIBinder_Class_setTransactionCodeToFunctionNameMap (artd). Don't call the API from APEX modules. Test: m CtsNdkBinderTestCases && atest -c CtsNdkBinderTestCases Bug: 370091328 Change-Id: Id2a47f29fedb6b045d58fc034bda5d8f2cab0f51
1 parent 6f017d5 commit 3ea49b8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

libs/binder/ndk/include_cpp/android/binder_interface_utils.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ AIBinder_Class* ICInterface::defineClass(const char* interfaceDescriptor,
298298
#endif
299299

300300
// TODO(b/368559337): fix versioning on product partition
301-
#if !defined(__ANDROID_PRODUCT__) && \
301+
// TODO(b/370091328): APEX modules call this function even it is unavailable.
302+
#if !defined(__ANDROID_APEX__) && !defined(__ANDROID_PRODUCT__) && \
302303
(defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__) || __ANDROID_API__ >= 36)
303304
if API_LEVEL_AT_LEAST (36, 202504) {
304305
if (codeToFunction != nullptr) {
@@ -309,7 +310,8 @@ AIBinder_Class* ICInterface::defineClass(const char* interfaceDescriptor,
309310
#else
310311
(void)codeToFunction;
311312
(void)functionCount;
312-
#endif // defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__) || __ANDROID_API__ >= 36
313+
#endif // !defined(__ANDROID_APEX__) && !defined(__ANDROID_PRODUCT__) && \
314+
// (defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__) || __ANDROID_API__ >= 36)
313315
return clazz;
314316
}
315317

0 commit comments

Comments
 (0)