summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/sensorservice/hidl/DirectReportChannel.cpp7
-rw-r--r--services/sensorservice/hidl/DirectReportChannel.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/services/sensorservice/hidl/DirectReportChannel.cpp b/services/sensorservice/hidl/DirectReportChannel.cpp
index 773ce8cd0a..adc4675098 100644
--- a/services/sensorservice/hidl/DirectReportChannel.cpp
+++ b/services/sensorservice/hidl/DirectReportChannel.cpp
@@ -31,10 +31,13 @@ DirectReportChannel::~DirectReportChannel() {
}
// Methods from ::android::frameworks::sensorservice::V1_0::IDirectReportChannel follow.
-Return<Result> DirectReportChannel::configure(int32_t sensorHandle, RateLevel rate) {
+Return<void> DirectReportChannel::configure(int32_t sensorHandle, RateLevel rate,
+ configure_cb _hidl_cb) {
int token = mManager.configureDirectChannel(mId,
static_cast<int>(sensorHandle), static_cast<int>(rate));
- return token <= 0 ? convertResult(token) : Result::OK;
+ _hidl_cb(token <= 0 ? 0 : token,
+ token <= 0 ? convertResult(token) : Result::OK);
+ return Void();
}
diff --git a/services/sensorservice/hidl/DirectReportChannel.h b/services/sensorservice/hidl/DirectReportChannel.h
index 913494427d..dd67827bb0 100644
--- a/services/sensorservice/hidl/DirectReportChannel.h
+++ b/services/sensorservice/hidl/DirectReportChannel.h
@@ -47,7 +47,8 @@ struct DirectReportChannel final : public IDirectReportChannel {
~DirectReportChannel();
// Methods from ::android::frameworks::sensorservice::V1_0::IDirectReportChannel follow.
- Return<Result> configure(int32_t sensorHandle, RateLevel rate) override;
+ Return<void> configure(int32_t sensorHandle, RateLevel rate,
+ configure_cb _hidl_cb) override;
private:
::android::SensorManager& mManager;