hardware_xiaomi/aidl/light/Lights.h
Sebastiano Barezzi ee864f39ea
aidl: light: Refactor
Change-Id: Ib4ae8e9821dd0fb36e922e2c5f993aa6c0e28be1
2024-06-18 02:32:19 +02:00

44 lines
928 B
C++

/*
* Copyright (C) 2021-2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/android/hardware/light/BnLights.h>
#include <mutex>
#include "Devices.h"
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;
binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
private:
std::vector<HwLight> mLights;
Devices mDevices;
HwLightState mLastBatteryState;
HwLightState mLastNotificationsState;
HwLightState mLastAttentionState;
std::mutex mLedMutex;
void updateNotificationColor();
};
} // namespace light
} // namespace hardware
} // namespace android
} // namespace aidl