Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 006e5123 authored by Sahil Somani's avatar Sahil Somani Committed by Automerger Merge Worker
Browse files

Merge "Added dummy Lights to the Light HAL default implementation" am:...

Merge "Added dummy Lights to the Light HAL default implementation" am: 67bb5eb3 am: faf7e5bc am: 30a7e1dd am: fa594366 am: 2ea9269d

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2167085



Change-Id: I20121381c112f7f856acc6c75ab06b56056914dd
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 12efe217 2ea9269d
Loading
Loading
Loading
Loading
+11 −2
Original line number Original line Diff line number Diff line
@@ -23,12 +23,21 @@ namespace android {
namespace hardware {
namespace hardware {
namespace light {
namespace light {


static constexpr int kNumDefaultLights = 3;

ndk::ScopedAStatus Lights::setLightState(int id, const HwLightState& state) {
ndk::ScopedAStatus Lights::setLightState(int id, const HwLightState& state) {
    LOG(INFO) << "Lights setting state for id=" << id << " to color " << std::hex << state.color;
    LOG(INFO) << "Lights setting state for id=" << id << " to color " << std::hex << state.color;
    if (id <= 0 || id > kNumDefaultLights) {
        return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
        return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
    } else {
        return ndk::ScopedAStatus::ok();
    }
}
}


ndk::ScopedAStatus Lights::getLights(std::vector<HwLight>* /*lights*/) {
ndk::ScopedAStatus Lights::getLights(std::vector<HwLight>* lights) {
    for (int i = 1; i <= kNumDefaultLights; i++) {
        lights->push_back({i, i});
    }
    LOG(INFO) << "Lights reporting supported lights";
    LOG(INFO) << "Lights reporting supported lights";
    return ndk::ScopedAStatus::ok();
    return ndk::ScopedAStatus::ok();
}
}