diff options
| author | 2017-04-10 12:47:45 -0700 | |
|---|---|---|
| committer | 2017-04-11 20:22:40 +0000 | |
| commit | c7cbda64bea65f1675b7c681f07b438fdf88e6b5 (patch) | |
| tree | d94a7fe1d458f414b7caeb43a568ab4ecb3fae4c | |
| parent | b162d089a014ba41484a192cb3fbe1c8e2b2d655 (diff) | |
IDirectReport.configure returns token
Test: pass
Test: VtsHalSensorManagerV1_0TargetTest
Bug: 37244013
Change-Id: I104a33420089c13cc85973b470f8179292d8094d
| -rw-r--r-- | services/sensorservice/hidl/DirectReportChannel.cpp | 7 | ||||
| -rw-r--r-- | services/sensorservice/hidl/DirectReportChannel.h | 3 |
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; |