Document return values of ABinderRpc_Accessor_delegateAccessor
Also changed the `OK` return value to `STATUS_OK` in the implementation.
The are both anonymous enums with the same value(0), but `STATUS_OK` is
intended to be used as a `binder_status_t`.
Test: na
Bug: 373660469
Change-Id: I66522047356e976bcaa08284b3c83bdb15374ff4
diff --git a/libs/binder/ndk/binder_rpc.cpp b/libs/binder/ndk/binder_rpc.cpp
index 07b8c40..886eb4b 100644
--- a/libs/binder/ndk/binder_rpc.cpp
+++ b/libs/binder/ndk/binder_rpc.cpp
@@ -255,7 +255,7 @@
"new variant was added to the ABinderRpc_ConnectionInfo and this needs to be "
"updated.");
}
- return OK;
+ return STATUS_OK;
};
sp<IBinder> accessorBinder = android::createAccessor(String16(instance), std::move(generate));
if (accessorBinder == nullptr) {
@@ -321,7 +321,7 @@
// This AIBinder needs a strong ref to pass ownership to the caller
binder->incStrong(nullptr);
*outDelegator = binder.get();
- return OK;
+ return STATUS_OK;
}
ABinderRpc_ConnectionInfo* ABinderRpc_ConnectionInfo_new(const sockaddr* addr, socklen_t len) {
diff --git a/libs/binder/ndk/include_platform/android/binder_rpc.h b/libs/binder/ndk/include_platform/android/binder_rpc.h
index 9fe5d78..66667d3 100644
--- a/libs/binder/ndk/include_platform/android/binder_rpc.h
+++ b/libs/binder/ndk/include_platform/android/binder_rpc.h
@@ -287,6 +287,11 @@
* this object with one strong ref count and is responsible for removing
* that ref count with with AIBinder_decStrong when the caller wishes to
* drop the reference.
+ * \return STATUS_OK on success.
+ * STATUS_UNEXPECTED_NULL if instance or binder arguments are null.
+ * STATUS_BAD_TYPE if the binder is not an IAccessor.
+ * STATUS_NAME_NOT_FOUND if the binder is an IAccessor, but not
+ * associated with the provided instance name.
*/
binder_status_t ABinderRpc_Accessor_delegateAccessor(const char* _Nonnull instance,
AIBinder* _Nonnull binder,