#include "services/device/generic_sensor/platform_sensor_provider_linux.h"
#include <utility>
#include <vector>
#include "base/compiler_specific.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/thread_pool.h"
#include "services/device/generic_sensor/linux/sensor_data_linux.h"
#include "services/device/generic_sensor/linux/sensor_device_manager.h"
#include "services/device/generic_sensor/platform_sensor_linux.h"
#include "services/device/generic_sensor/platform_sensor_reader_linux.h"
#include "services/device/public/cpp/generic_sensor/sensor_reading_shared_buffer.h"
namespace device {
namespace {
constexpr base::TaskTraits kBlockingTaskRunnerTraits = …;
}
PlatformSensorProviderLinux::PlatformSensorProviderLinux()
: … { … }
PlatformSensorProviderLinux::~PlatformSensorProviderLinux() = default;
base::WeakPtr<PlatformSensorProvider> PlatformSensorProviderLinux::AsWeakPtr() { … }
void PlatformSensorProviderLinux::CreateSensorInternal(
mojom::SensorType type,
CreateSensorCallback callback) { … }
void PlatformSensorProviderLinux::DidEnumerateSensors(
mojom::SensorType type,
CreateSensorCallback callback) { … }
void PlatformSensorProviderLinux::FreeResources() { … }
bool PlatformSensorProviderLinux::IsSensorTypeAvailable(
mojom::SensorType type) const { … }
SensorInfoLinux* PlatformSensorProviderLinux::GetSensorDevice(
mojom::SensorType type) const { … }
void PlatformSensorProviderLinux::SetSensorDeviceManagerForTesting(
std::unique_ptr<SensorDeviceManager> sensor_device_manager) { … }
void PlatformSensorProviderLinux::OnDeviceAdded(
mojom::SensorType type,
std::unique_ptr<SensorInfoLinux> sensor_device) { … }
void PlatformSensorProviderLinux::OnDeviceRemoved(
mojom::SensorType type,
const std::string& device_node) { … }
}