platform_hardware_tequila_c.../libsensor/SensorEventQueue.h
Sebastiano Barezzi aea5a5fba5 compat: Add libsensor -> libsensorndkbridge wrapper
Change-Id: I62c27463af385dc791dde64731a39e9ebadfd587
2023-09-25 16:58:58 +00:00

37 lines
856 B
C++

/*
* Copyright (C) 2023 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <android/sensor.h>
#include <utils/Errors.h>
#include <utils/RefBase.h>
#include <utils/Timers.h>
#include "Sensor.h"
namespace android {
class SensorEventQueue : public RefBase {
public:
SensorEventQueue(ASensorEventQueue* aSensorEventQueue);
~SensorEventQueue() = default;
ssize_t read(ASensorEvent* events, size_t numEvents);
status_t waitForEvent() const;
status_t enableSensor(Sensor const* sensor) const;
/*
status_t enableSensor(Sensor const* sensor, int32_t samplingPeriodUs) const;
*/
status_t disableSensor(Sensor const* sensor) const;
status_t setEventRate(Sensor const* sensor, nsecs_t ns) const;
private:
ASensorEventQueue* mASensorEventQueue;
};
} // namespace android