9cbf7b03e3
Change-Id: Ia7fff2a4374ad4d05718909000dc2fd99b9264f0
48 lines
1017 B
C++
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
|