sm8450-common: Add hals.conf to load sensors.xiaomi to odm and move notifier to subdir
Change-Id: I9e16531e60fa6a0122330ee352cddd0840feb39c
This commit is contained in:
37
sensors/sensor-notifier/include/SensorNotifier.h
Normal file
37
sensors/sensor-notifier/include/SensorNotifier.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <android/frameworks/sensorservice/1.0/ISensorManager.h>
|
||||
#include <thread>
|
||||
|
||||
using android::sp;
|
||||
using android::frameworks::sensorservice::V1_0::IEventQueue;
|
||||
using android::frameworks::sensorservice::V1_0::IEventQueueCallback;
|
||||
using android::frameworks::sensorservice::V1_0::ISensorManager;
|
||||
using android::frameworks::sensorservice::V1_0::Result;
|
||||
|
||||
class SensorNotifier {
|
||||
public:
|
||||
SensorNotifier(sp<ISensorManager> manager);
|
||||
virtual ~SensorNotifier();
|
||||
|
||||
void activate();
|
||||
void deactivate();
|
||||
|
||||
protected:
|
||||
Result initializeSensorQueue(std::string typeAsString, bool wakeup, sp<IEventQueueCallback>);
|
||||
virtual void notify() = 0;
|
||||
|
||||
sp<IEventQueue> mQueue;
|
||||
int32_t mSensorHandle = -1;
|
||||
bool mActive = false;
|
||||
|
||||
private:
|
||||
sp<ISensorManager> mManager;
|
||||
std::thread mThread;
|
||||
};
|
Reference in New Issue
Block a user