summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/sensorservice/hidl/DirectReportChannel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/sensorservice/hidl/DirectReportChannel.cpp b/services/sensorservice/hidl/DirectReportChannel.cpp
index 9caba47912..773ce8cd0a 100644
--- a/services/sensorservice/hidl/DirectReportChannel.cpp
+++ b/services/sensorservice/hidl/DirectReportChannel.cpp
@@ -32,8 +32,9 @@ DirectReportChannel::~DirectReportChannel() {
// Methods from ::android::frameworks::sensorservice::V1_0::IDirectReportChannel follow.
Return<Result> DirectReportChannel::configure(int32_t sensorHandle, RateLevel rate) {
- return convertResult(mManager.configureDirectChannel(mId,
- static_cast<int>(sensorHandle), static_cast<int>(rate)));
+ int token = mManager.configureDirectChannel(mId,
+ static_cast<int>(sensorHandle), static_cast<int>(rate));
+ return token <= 0 ? convertResult(token) : Result::OK;
}