hardware_xiaomi/aidl/light/Lights.h
Sebastiano Barezzi 9cbf7b03e3
aidl: light: Implement attention light type
Change-Id: Ia7fff2a4374ad4d05718909000dc2fd99b9264f0
2023-11-13 15:36:27 +01:00

48 lines
1017 B
C++

/*
* Copyright (C) 2021-2022 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/android/hardware/light/BnLights.h>
#include <mutex>
#include "Backlight.h"
using ::aidl::android::hardware::light::HwLight;
using ::aidl::android::hardware::light::HwLightState;
namespace aidl {
namespace android {
namespace hardware {
namespace light {
class Lights : public BnLights {
public:
Lights();
ndk::ScopedAStatus setLightState(int32_t id, const HwLightState& state) override;
ndk::ScopedAStatus getLights(std::vector<HwLight>* _aidl_return) override;
private:
void setLED();
std::vector<HwLight> mLights;
BacklightDevice* mBacklightDevice;
std::vector<std::string> mButtonsPaths;
bool mWhiteLED;
std::mutex mLEDMutex;
HwLightState mLastBatteryState;
HwLightState mLastNotificationState;
HwLightState mLastAttentionState;
};
} // namespace light
} // namespace hardware
} // namespace android
} // namespace aidl