summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/binder/ndk/ibinder.cpp2
-rw-r--r--libs/binder/ndk/include_ndk/android/binder_status.h17
2 files changed, 11 insertions, 8 deletions
diff --git a/libs/binder/ndk/ibinder.cpp b/libs/binder/ndk/ibinder.cpp
index b1b419408f..f16cde6140 100644
--- a/libs/binder/ndk/ibinder.cpp
+++ b/libs/binder/ndk/ibinder.cpp
@@ -122,7 +122,7 @@ status_t ABBinder::onTransact(transaction_code_t code, const Parcel& data, Parce
binder_flags_t flags) {
if (isUserCommand(code)) {
if (!data.checkInterface(this)) {
- return STATUS_PERMISSION_DENIED;
+ return STATUS_BAD_TYPE;
}
const AParcel in = AParcel::readOnly(this, &data);
diff --git a/libs/binder/ndk/include_ndk/android/binder_status.h b/libs/binder/ndk/include_ndk/android/binder_status.h
index d9c36d219b..6389a1bd3a 100644
--- a/libs/binder/ndk/include_ndk/android/binder_status.h
+++ b/libs/binder/ndk/include_ndk/android/binder_status.h
@@ -140,7 +140,8 @@ __attribute__((warn_unused_result)) AStatus* AStatus_fromServiceSpecificErrorWit
__attribute__((warn_unused_result)) AStatus* AStatus_fromStatus(binder_status_t status);
/**
- * Whether this object represents a successful transaction.
+ * Whether this object represents a successful transaction. If this function returns true, then
+ * AStatus_getExceptionCode will return EX_NONE.
*/
bool AStatus_isOk(const AStatus* status);
@@ -150,16 +151,18 @@ bool AStatus_isOk(const AStatus* status);
binder_exception_t AStatus_getExceptionCode(const AStatus* status);
/**
- * The service specific error if this object represents one. If this object represents a different
- * kind of exception or is ok, this function will return 0. Just because this function returns 0
- * does not mean that the transaction was a success.
+ * The service specific error if this object represents one. This function will only ever return a
+ * non-zero result if AStatus_getExceptionCode returns EX_SERVICE_SPECIFIC. If this function returns
+ * 0, the status object may still represent a different exception or status. To find out if this
+ * transaction as a whole is okay, use AStatus_isOk instead.
*/
int32_t AStatus_getServiceSpecificError(const AStatus* status);
/**
- * The status if this object represents one. If this object represents a different kind of exception
- * or is ok, this function will return 0. Just because this function returns 0 does not mean that
- * the transaction was a success.
+ * The status if this object represents one. This function will only ever return a non-zero result
+ * if AStatus_getExceptionCode returns EX_TRANSACTION_FAILED. If this function return 0, the status
+ * object may represent a different exception or a service specific error. To find out if this
+ * transaction as a whole is okay, use AStatus_isOk instead.
*/
binder_status_t AStatus_getStatus(const AStatus* status);