sdm660-common: light: Drop unnecessary handled variable in setLight()
Change-Id: If6e76671cc1860102a5da6502338cda138dad3ee
This commit is contained in:
parent
9e4356c1f2
commit
a2e190f5a2
1 changed files with 2 additions and 6 deletions
|
@ -224,7 +224,6 @@ namespace implementation {
|
||||||
|
|
||||||
Return<Status> Light::setLight(Type type, const LightState& state) {
|
Return<Status> Light::setLight(Type type, const LightState& state) {
|
||||||
LightStateHandler handler = nullptr;
|
LightStateHandler handler = nullptr;
|
||||||
bool handled = false;
|
|
||||||
|
|
||||||
/* Lock global mutex until light state is updated. */
|
/* Lock global mutex until light state is updated. */
|
||||||
std::lock_guard<std::mutex> lock(globalLock);
|
std::lock_guard<std::mutex> lock(globalLock);
|
||||||
|
@ -246,15 +245,12 @@ Return<Status> Light::setLight(Type type, const LightState& state) {
|
||||||
for (LightBackend& backend : backends) {
|
for (LightBackend& backend : backends) {
|
||||||
if (handler == backend.handler && isLit(backend.state)) {
|
if (handler == backend.handler && isLit(backend.state)) {
|
||||||
handler(backend.state);
|
handler(backend.state);
|
||||||
handled = true;
|
return Status::SUCCESS;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If no type has been lit up, then turn off the hardware. */
|
/* If no type has been lit up, then turn off the hardware. */
|
||||||
if (!handled) {
|
|
||||||
handler(state);
|
handler(state);
|
||||||
}
|
|
||||||
|
|
||||||
return Status::SUCCESS;
|
return Status::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue