libbinder_ndk: consider empty result as false
associateClassInternal returns std::optional<bool> where nullopt means
not sure yet, true means success, and false means failure. However,
there was one case where we considered nullopt to mean true.
Bug: N/A
Test: atest aidl_integration_test
Change-Id: I7caef23dfbd8d9a562a21a0f369fa22c976a8da0
diff --git a/libs/binder/ndk/ibinder.cpp b/libs/binder/ndk/ibinder.cpp
index d7075b2..577f0a0 100644
--- a/libs/binder/ndk/ibinder.cpp
+++ b/libs/binder/ndk/ibinder.cpp
@@ -99,6 +99,7 @@
if (set) {
// if this is a local object, it's not one known to libbinder_ndk
mClazz = clazz;
+ return true;
}
return {};
@@ -127,7 +128,7 @@
return false;
}
- return associateClassInternal(clazz, newDescriptor, true).value_or(true);
+ return associateClassInternal(clazz, newDescriptor, true).value();
}
ABBinder::ABBinder(const AIBinder_Class* clazz, void* userData)