whyred: light: Minor cleanup

Change-Id: I42215a38ea3f98d5e202308bc80fab672ed8d776
This commit is contained in:
Michael Bestas 2018-05-04 23:02:56 +03:00 committed by Vasishath Kaushal
parent ac9beafcbc
commit 44aa3a9119
4 changed files with 6 additions and 8 deletions

View file

@ -181,12 +181,12 @@ static std::vector<std::pair<Type, LightState>> notificationStates = {
static void handleNotification(Type type, const LightState& state) {
bool handled = false;
for(auto it : notificationStates) {
for (auto it : notificationStates) {
if (it.first == type) {
it.second = state;
}
if (!handled && isLit(it.second)) {
if (!handled && isLit(it.second)) {
setNotification(it.second);
handled = true;
}
@ -197,7 +197,7 @@ static void handleNotification(Type type, const LightState& state) {
}
}
static std::map<Type, std::function<void(Type type, const LightState&)>> lights = {
static std::map<Type, std::function<void(Type, const LightState&)>> lights = {
{ Type::ATTENTION, handleNotification },
{ Type::NOTIFICATIONS, handleNotification },
{ Type::BATTERY, handleNotification },
@ -205,7 +205,7 @@ static std::map<Type, std::function<void(Type type, const LightState&)>> lights
{ Type::BUTTONS, handleButtons },
};
} // anonymous namespace
} // anonymous namespace
namespace android {
namespace hardware {