diff options
author | Brian Stack <bstack@google.com> | 2018-10-19 16:04:11 -0700 |
---|---|---|
committer | Brian Stack <bstack@google.com> | 2018-10-24 16:26:33 -0700 |
commit | 9a407f23a6134185c5f720a04dd19b33cf7edab1 (patch) | |
tree | 2a740b82f7639474cf0970b7c9fc3120e34af7d3 /sensors/2.0/default/Sensors.cpp | |
parent | 475d4d4d5ecd13ee614009dabf9b1fb6b87dd966 (diff) |
Implement default functions for direct channel
Implements default functions for a Sensors 2.0 HAL that does not
support direct channel operation.
Although Sensors 2.0 supports direct channel operation, it is not a
requirement unless a device supports High Fidelity Sensors. A direct
channel implementation is vendor-specific, and therefore, the default
implementation does not provide a reference implementation.
A default implementation is able to be found in Sensors 1.0 since
direct channel operation has not changed between Sensors 1.0 and 2.0.
Bug: 111070257
Test: Builds
Change-Id: I1c4ef0cd9d4bd4b7ae3212358f9493c28c2798f4
Diffstat (limited to 'sensors/2.0/default/Sensors.cpp')
-rw-r--r-- | sensors/2.0/default/Sensors.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sensors/2.0/default/Sensors.cpp b/sensors/2.0/default/Sensors.cpp index ea6e000286..9fea647989 100644 --- a/sensors/2.0/default/Sensors.cpp +++ b/sensors/2.0/default/Sensors.cpp @@ -103,21 +103,19 @@ Return<Result> Sensors::injectSensorData(const Event& /* event */) { } Return<void> Sensors::registerDirectChannel(const SharedMemInfo& /* mem */, - registerDirectChannel_cb /* _hidl_cb */) { - // TODO implement - return Void(); + registerDirectChannel_cb _hidl_cb) { + _hidl_cb(Result::INVALID_OPERATION, 0 /* channelHandle */); + return Return<void>(); } Return<Result> Sensors::unregisterDirectChannel(int32_t /* channelHandle */) { - // TODO implement - return Result{}; + return Result::INVALID_OPERATION; } Return<void> Sensors::configDirectReport(int32_t /* sensorHandle */, int32_t /* channelHandle */, - RateLevel /* rate */, - configDirectReport_cb /* _hidl_cb */) { - // TODO implement - return Void(); + RateLevel /* rate */, configDirectReport_cb _hidl_cb) { + _hidl_cb(Result::INVALID_OPERATION, 0 /* reportToken */); + return Return<void>(); } void Sensors::deleteEventFlag() { |