Interpret STATUS_UNKNOWN_TRANSACTION as a unsupported vibrator result
The AIDL versioning documentation says this is the exception code
returned by older versions that do not implement the methods:
https://source.android.com/devices/architecture/aidl/stable-aidl#versioning-interfaces
Update the vibrator::HalResult for this exception code to be
unsupported, which will prevent the service from retrying this operation
on that device.
Bug: 190526054
Test: libvibratorservice_test
Change-Id: Ifdc9c02431ec7c3ad3fd54b62049e15766f6a5a1
diff --git a/services/vibratorservice/VibratorHalWrapper.cpp b/services/vibratorservice/VibratorHalWrapper.cpp
index 1010aa5..f15a963 100644
--- a/services/vibratorservice/VibratorHalWrapper.cpp
+++ b/services/vibratorservice/VibratorHalWrapper.cpp
@@ -95,7 +95,10 @@
}
HalResult<void> HalResult<void>::fromStatus(binder::Status status) {
- if (status.exceptionCode() == binder::Status::EX_UNSUPPORTED_OPERATION) {
+ if (status.exceptionCode() == binder::Status::EX_UNSUPPORTED_OPERATION ||
+ status.transactionError() == android::UNKNOWN_TRANSACTION) {
+ // UNKNOWN_TRANSACTION means the HAL implementation is an older version, so this is
+ // the same as the operation being unsupported by this HAL. Should not retry.
return HalResult<void>::unsupported();
}
if (status.isOk()) {