mirror of
https://github.com/LineageOS/android_device_xiaomi_whyred.git
synced 2025-10-05 19:41:57 +02:00
whyred: light: Minor cleanup
Change-Id: I42215a38ea3f98d5e202308bc80fab672ed8d776
This commit is contained in:
parent
ac9beafcbc
commit
44aa3a9119
4 changed files with 6 additions and 8 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue