Android-cuttlefish cvd tool
sensors_hal_proxy.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <atomic>
20#include <thread>
21
28
29namespace cuttlefish {
30namespace sensors {
31
33 public:
34 SensorsHalProxy(SharedFD sensors_in_fd, SharedFD sensors_out_fd,
35 SharedFD kernel_events_fd,
36 SensorsSimulator& sensors_simulator, DeviceType device_type);
37
38 private:
45 std::atomic<bool> hal_activated_ = false;
46 std::atomic<bool> running_ = true;
47};
48
49} // namespace sensors
50} // namespace cuttlefish
Definition: shared_fd.h:129
Definition: sensors_hal_proxy.h:32
std::atomic< bool > hal_activated_
Definition: sensors_hal_proxy.h:45
std::thread reboot_monitor_thread_
Definition: sensors_hal_proxy.h:41
SharedFD kernel_events_fd_
Definition: sensors_hal_proxy.h:43
std::thread req_responder_thread_
Definition: sensors_hal_proxy.h:39
SensorsHalProxy(SharedFD sensors_in_fd, SharedFD sensors_out_fd, SharedFD kernel_events_fd, SensorsSimulator &sensors_simulator, DeviceType device_type)
Definition: sensors_hal_proxy.cpp:123
std::atomic< bool > running_
Definition: sensors_hal_proxy.h:46
SensorsSimulator & sensors_simulator_
Definition: sensors_hal_proxy.h:44
std::thread data_reporter_thread_
Definition: sensors_hal_proxy.h:40
transport::SharedFdChannel channel_
Definition: sensors_hal_proxy.h:42
Definition: sensors_simulator.h:37
Definition: channel_sharedfd.h:25
Definition: alloc_utils.cpp:23
DeviceType
Definition: device_type.h:22