Change return value when NDK symbol isn't present
In persistable bundle, if the NDK sysmbols aren't present the read/write
parcel calls will fail. STATUS_FAILED_TRANSACTION is a special return
value and shouldn't be used for this case. Return
STATUS_INVALID_OPERATION instead.
This change will allow the caller to handle the error.
Test: m
Bug: 317912559
Bug: 317676192
Change-Id: Ic15fe28f45887161af4ef4e28eb7c3b00dc46d29
diff --git a/libs/binder/ndk/include_cpp/android/persistable_bundle_aidl.h b/libs/binder/ndk/include_cpp/android/persistable_bundle_aidl.h
index f178027..3664297 100644
--- a/libs/binder/ndk/include_cpp/android/persistable_bundle_aidl.h
+++ b/libs/binder/ndk/include_cpp/android/persistable_bundle_aidl.h
@@ -57,7 +57,7 @@
if (__builtin_available(android __ANDROID_API_V__, *)) {
return APersistableBundle_readFromParcel(parcel, &mPBundle);
} else {
- return STATUS_FAILED_TRANSACTION;
+ return STATUS_INVALID_OPERATION;
}
}
@@ -68,7 +68,7 @@
if (__builtin_available(android __ANDROID_API_V__, *)) {
return APersistableBundle_writeToParcel(mPBundle, parcel);
} else {
- return STATUS_FAILED_TRANSACTION;
+ return STATUS_INVALID_OPERATION;
}
}