Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7cbda64 authored by Yifan Hong's avatar Yifan Hong Committed by Iliyan Malchev
Browse files

IDirectReport.configure returns token

Test: pass
Test: VtsHalSensorManagerV1_0TargetTest

Bug: 37244013

Change-Id: I104a33420089c13cc85973b470f8179292d8094d
parent b162d089
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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();
}


+2 −1
Original line number Diff line number Diff line
@@ -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;