1 #pragma once
2 
3 #ifndef COM_ANDROID_HARDWARE_LIBSENSOR_FLAGS
4 #define COM_ANDROID_HARDWARE_LIBSENSOR_FLAGS(FLAG) COM_ANDROID_HARDWARE_LIBSENSOR_FLAGS_##FLAG
5 #endif
6 
7 #ifndef COM_ANDROID_HARDWARE_LIBSENSOR_FLAGS_SENSORMANAGER_PING_BINDER
8 #define COM_ANDROID_HARDWARE_LIBSENSOR_FLAGS_SENSORMANAGER_PING_BINDER true
9 #endif
10 
11 #ifdef __cplusplus
12 
13 #include <memory>
14 
15 namespace com::android::hardware::libsensor::flags {
16 
17 class flag_provider_interface {
18 public:
19     virtual ~flag_provider_interface() = default;
20     virtual bool sensor_event_queue_report_sensor_usage_in_tracing() = 0;
21     virtual bool sensormanager_ping_binder() = 0;
22 };
23 
24 extern std::unique_ptr<flag_provider_interface> provider_;
25 
26 
sensor_event_queue_report_sensor_usage_in_tracing()27 inline bool sensor_event_queue_report_sensor_usage_in_tracing() {
28     return true;
29 }
sensormanager_ping_binder()30 inline bool sensormanager_ping_binder() {
31     return COM_ANDROID_HARDWARE_LIBSENSOR_FLAGS_SENSORMANAGER_PING_BINDER;
32 }
33 
34 }
35 
36 extern "C" {
37 #endif // __cplusplus
38 
39 
40 bool com_android_hardware_libsensor_flags_sensor_event_queue_report_sensor_usage_in_tracing();
41 bool com_android_hardware_libsensor_flags_sensormanager_ping_binder();
42 
43 #ifdef __cplusplus
44 } // extern "C"
45 #endif
46 
47