Add support for detecting Keyboard backlight using sysfs node
Add new light type for Keyboard backlight and corresponding
detection logic. Also, refactor PeripheralController logic to
support Light type and light capabilities similar to how it is
handled on Java side of code.
Test: atest inputflinger_tests
Bug: 245506418
Change-Id: Ic69e42555bf57a66683fcf359169869ee2a00749
diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h
index 415080d..0026e82 100644
--- a/include/input/InputDevice.h
+++ b/include/input/InputDevice.h
@@ -17,6 +17,7 @@
#pragma once
#include <android/sensor.h>
+#include <ftl/flags.h>
#include <input/Input.h>
#include <input/KeyCharacterMap.h>
#include <unordered_map>
@@ -105,12 +106,18 @@
};
enum class InputDeviceLightType : int32_t {
- MONO = 0,
+ INPUT = 0,
PLAYER_ID = 1,
- RGB = 2,
- MULTI_COLOR = 3,
+ KEYBOARD_BACKLIGHT = 2,
- ftl_last = MULTI_COLOR
+ ftl_last = KEYBOARD_BACKLIGHT
+};
+
+enum class InputDeviceLightCapability : uint32_t {
+ /** Capability to change brightness of the light */
+ BRIGHTNESS = 0x00000001,
+ /** Capability to change color of the light */
+ RGB = 0x00000002,
};
struct InputDeviceSensorInfo {
@@ -171,14 +178,17 @@
struct InputDeviceLightInfo {
explicit InputDeviceLightInfo(std::string name, int32_t id, InputDeviceLightType type,
+ ftl::Flags<InputDeviceLightCapability> capabilityFlags,
int32_t ordinal)
- : name(name), id(id), type(type), ordinal(ordinal) {}
+ : name(name), id(id), type(type), capabilityFlags(capabilityFlags), ordinal(ordinal) {}
// Name string of the light.
std::string name;
// Light id
int32_t id;
// Type of the light.
InputDeviceLightType type;
+ // Light capabilities.
+ ftl::Flags<InputDeviceLightCapability> capabilityFlags;
// Ordinal of the light
int32_t ordinal;
};
diff --git a/services/inputflinger/reader/EventHub.cpp b/services/inputflinger/reader/EventHub.cpp
index c9d21dc..5351a51 100644
--- a/services/inputflinger/reader/EventHub.cpp
+++ b/services/inputflinger/reader/EventHub.cpp
@@ -117,7 +117,8 @@
{"brightness", InputLightClass::BRIGHTNESS},
{"multi_index", InputLightClass::MULTI_INDEX},
{"multi_intensity", InputLightClass::MULTI_INTENSITY},
- {"max_brightness", InputLightClass::MAX_BRIGHTNESS}};
+ {"max_brightness", InputLightClass::MAX_BRIGHTNESS},
+ {"kbd_backlight", InputLightClass::KEYBOARD_BACKLIGHT}};
// Mapping for input multicolor led class node names.
// https://www.kernel.org/doc/html/latest/leds/leds-class-multicolor.html
@@ -365,15 +366,26 @@
info.path = nodePath;
info.name = nodePath.filename();
info.maxBrightness = std::nullopt;
- size_t nameStart = info.name.rfind(":");
- if (nameStart != std::string::npos) {
- // Trim the name to color name
- info.name = info.name.substr(nameStart + 1);
- // Set InputLightClass flag for colors
- const auto it = LIGHT_CLASSES.find(info.name);
- if (it != LIGHT_CLASSES.end()) {
- info.flags |= it->second;
+
+ // Light name should follow the naming pattern <name>:<color>:<function>
+ // Refer kernel docs /leds/leds-class.html for valid supported LED names.
+ std::regex indexPattern("([a-zA-Z0-9_.:]*:)?([a-zA-Z0-9_.]*):([a-zA-Z0-9_.]*)");
+ std::smatch results;
+
+ if (std::regex_match(info.name, results, indexPattern)) {
+ // regex_match will return full match at index 0 and <name> at index 1. For RawLightInfo
+ // we only care about sections <color> and <function> which will be at index 2 and 3.
+ for (int i = 2; i <= 3; i++) {
+ const auto it = LIGHT_CLASSES.find(results.str(i));
+ if (it != LIGHT_CLASSES.end()) {
+ info.flags |= it->second;
+ }
}
+
+ // Set name of the raw light to <function> which represents playerIDs for LEDs that
+ // turn on/off based on the current player ID (Refer to PeripheralController.cpp for
+ // player ID logic)
+ info.name = results.str(3);
}
// Scan the path for all the files
// Refer to https://www.kernel.org/doc/Documentation/leds/leds-class.txt
diff --git a/services/inputflinger/reader/controller/PeripheralController.cpp b/services/inputflinger/reader/controller/PeripheralController.cpp
index eaf5b51..cedbacb 100644
--- a/services/inputflinger/reader/controller/PeripheralController.cpp
+++ b/services/inputflinger/reader/controller/PeripheralController.cpp
@@ -16,6 +16,7 @@
#include <locale>
#include <regex>
+#include <set>
#include <ftl/enum.h>
@@ -70,7 +71,7 @@
// If the light node doesn't have max brightness, use the default max brightness.
int rawMaxBrightness = rawInfoOpt->maxBrightness.value_or(MAX_BRIGHTNESS);
- float ratio = MAX_BRIGHTNESS / rawMaxBrightness;
+ float ratio = static_cast<float>(MAX_BRIGHTNESS) / rawMaxBrightness;
// Scale the returned brightness in [0, rawMaxBrightness] to [0, 255]
if (rawMaxBrightness != MAX_BRIGHTNESS) {
brightness = brightness * ratio;
@@ -89,7 +90,7 @@
}
// If the light node doesn't have max brightness, use the default max brightness.
int rawMaxBrightness = rawInfo->maxBrightness.value_or(MAX_BRIGHTNESS);
- float ratio = MAX_BRIGHTNESS / rawMaxBrightness;
+ float ratio = static_cast<float>(MAX_BRIGHTNESS) / rawMaxBrightness;
// Scale the requested brightness in [0, 255] to [0, rawMaxBrightness]
if (rawMaxBrightness != MAX_BRIGHTNESS) {
brightness = ceil(brightness / ratio);
@@ -271,7 +272,8 @@
for (const auto& [lightId, light] : mLights) {
// Input device light doesn't support ordinal, always pass 1.
- InputDeviceLightInfo lightInfo(light->name, light->id, light->type, 1 /* ordinal */);
+ InputDeviceLightInfo lightInfo(light->name, light->id, light->type, light->capabilityFlags,
+ 1 /* ordinal */);
deviceInfo->addLightInfo(lightInfo);
}
}
@@ -284,6 +286,8 @@
dump += StringPrintf(INDENT4 "Id: %d", lightId);
dump += StringPrintf(INDENT4 "Name: %s", light->name.c_str());
dump += StringPrintf(INDENT4 "Type: %s", ftl::enum_string(light->type).c_str());
+ dump += StringPrintf(INDENT4 "Capability flags: %s",
+ light->capabilityFlags.string().c_str());
light->dump(dump);
}
}
@@ -363,6 +367,8 @@
std::unordered_map<LightColor, int32_t /* rawLightId */> rawRgbIds;
// Map from player Id to raw light Id
std::unordered_map<int32_t, int32_t> playerIdLightIds;
+ // Set of Keyboard backlights
+ std::set<int32_t> keyboardBacklightIds;
// Check raw lights
const std::vector<int32_t> rawLightIds = getDeviceContext().getRawLightIds();
@@ -391,6 +397,10 @@
}
}
}
+ // Check if this is a Keyboard backlight
+ if (rawInfo->flags.test(InputLightClass::KEYBOARD_BACKLIGHT)) {
+ keyboardBacklightIds.insert(rawId);
+ }
// Check if this is an LED of RGB light
if (rawInfo->flags.test(InputLightClass::RED)) {
hasRedLed = true;
@@ -431,8 +441,21 @@
ALOGD("Rgb light ids [%d, %d, %d] \n", rawRgbIds.at(LightColor::RED),
rawRgbIds.at(LightColor::GREEN), rawRgbIds.at(LightColor::BLUE));
}
+ bool isKeyboardBacklight = keyboardBacklightIds.find(rawRgbIds.at(LightColor::RED)) !=
+ keyboardBacklightIds.end() &&
+ keyboardBacklightIds.find(rawRgbIds.at(LightColor::GREEN)) !=
+ keyboardBacklightIds.end() &&
+ keyboardBacklightIds.find(rawRgbIds.at(LightColor::BLUE)) !=
+ keyboardBacklightIds.end() &&
+ (!rawGlobalId.has_value() ||
+ keyboardBacklightIds.find(rawGlobalId.value()) != keyboardBacklightIds.end());
+
std::unique_ptr<Light> light =
- std::make_unique<RgbLight>(getDeviceContext(), ++mNextId, rawRgbIds, rawGlobalId);
+ std::make_unique<RgbLight>(getDeviceContext(), ++mNextId,
+ isKeyboardBacklight
+ ? InputDeviceLightType::KEYBOARD_BACKLIGHT
+ : InputDeviceLightType::INPUT,
+ rawRgbIds, rawGlobalId);
mLights.insert_or_assign(light->id, std::move(light));
// Remove from raw light info as they've been composed a RBG light.
rawInfos.erase(rawRgbIds.at(LightColor::RED));
@@ -445,6 +468,10 @@
// Check the rest of raw light infos
for (const auto& [rawId, rawInfo] : rawInfos) {
+ InputDeviceLightType type = keyboardBacklightIds.find(rawId) != keyboardBacklightIds.end()
+ ? InputDeviceLightType::KEYBOARD_BACKLIGHT
+ : InputDeviceLightType::INPUT;
+
// If the node is multi-color led, construct a MULTI_COLOR light
if (rawInfo.flags.test(InputLightClass::MULTI_INDEX) &&
rawInfo.flags.test(InputLightClass::MULTI_INTENSITY)) {
@@ -453,7 +480,7 @@
}
std::unique_ptr<Light> light =
std::make_unique<MultiColorLight>(getDeviceContext(), rawInfo.name, ++mNextId,
- rawInfo.id);
+ type, rawInfo.id);
mLights.insert_or_assign(light->id, std::move(light));
continue;
}
@@ -462,7 +489,7 @@
ALOGD("Mono light Id %d name %s \n", rawInfo.id, rawInfo.name.c_str());
}
std::unique_ptr<Light> light = std::make_unique<MonoLight>(getDeviceContext(), rawInfo.name,
- ++mNextId, rawInfo.id);
+ ++mNextId, type, rawInfo.id);
mLights.insert_or_assign(light->id, std::move(light));
}
diff --git a/services/inputflinger/reader/controller/PeripheralController.h b/services/inputflinger/reader/controller/PeripheralController.h
index 25cf435..8ac42c3 100644
--- a/services/inputflinger/reader/controller/PeripheralController.h
+++ b/services/inputflinger/reader/controller/PeripheralController.h
@@ -67,6 +67,7 @@
std::string name;
int32_t id;
InputDeviceLightType type;
+ ftl::Flags<InputDeviceLightCapability> capabilityFlags;
virtual bool setLightColor(int32_t color) { return false; }
virtual std::optional<int32_t> getLightColor() { return std::nullopt; }
@@ -81,8 +82,10 @@
struct MonoLight : public Light {
explicit MonoLight(InputDeviceContext& context, const std::string& name, int32_t id,
- int32_t rawId)
- : Light(context, name, id, InputDeviceLightType::MONO), rawId(rawId) {}
+ InputDeviceLightType type, int32_t rawId)
+ : Light(context, name, id, type), rawId(rawId) {
+ capabilityFlags |= InputDeviceLightCapability::BRIGHTNESS;
+ }
int32_t rawId;
bool setLightColor(int32_t color) override;
@@ -91,15 +94,15 @@
};
struct RgbLight : public Light {
- explicit RgbLight(InputDeviceContext& context, int32_t id,
+ explicit RgbLight(InputDeviceContext& context, int32_t id, InputDeviceLightType type,
const std::unordered_map<LightColor, int32_t>& rawRgbIds,
std::optional<int32_t> rawGlobalId)
- : Light(context, "RGB", id, InputDeviceLightType::RGB),
- rawRgbIds(rawRgbIds),
- rawGlobalId(rawGlobalId) {
+ : Light(context, "RGB", id, type), rawRgbIds(rawRgbIds), rawGlobalId(rawGlobalId) {
brightness = rawGlobalId.has_value()
? getRawLightBrightness(rawGlobalId.value()).value_or(MAX_BRIGHTNESS)
: MAX_BRIGHTNESS;
+ capabilityFlags |= InputDeviceLightCapability::BRIGHTNESS;
+ capabilityFlags |= InputDeviceLightCapability::RGB;
}
// Map from color to raw light id.
std::unordered_map<LightColor, int32_t /* rawLightId */> rawRgbIds;
@@ -114,8 +117,11 @@
struct MultiColorLight : public Light {
explicit MultiColorLight(InputDeviceContext& context, const std::string& name, int32_t id,
- int32_t rawId)
- : Light(context, name, id, InputDeviceLightType::MULTI_COLOR), rawId(rawId) {}
+ InputDeviceLightType type, int32_t rawId)
+ : Light(context, name, id, type), rawId(rawId) {
+ capabilityFlags |= InputDeviceLightCapability::BRIGHTNESS;
+ capabilityFlags |= InputDeviceLightCapability::RGB;
+ }
int32_t rawId;
bool setLightColor(int32_t color) override;
@@ -131,7 +137,7 @@
// Map from player Id to raw light Id
std::unordered_map<int32_t, int32_t> rawLightIds;
- bool setLightPlayerId(int32_t palyerId) override;
+ bool setLightPlayerId(int32_t playerId) override;
std::optional<int32_t> getLightPlayerId() override;
void dump(std::string& dump) override;
};
diff --git a/services/inputflinger/reader/include/EventHub.h b/services/inputflinger/reader/include/EventHub.h
index 5cf2214..6b8cc25 100644
--- a/services/inputflinger/reader/include/EventHub.h
+++ b/services/inputflinger/reader/include/EventHub.h
@@ -174,6 +174,8 @@
MULTI_INTENSITY = 0x00000040,
/* The input light has max brightness node. */
MAX_BRIGHTNESS = 0x00000080,
+ /* The input light has kbd_backlight name */
+ KEYBOARD_BACKLIGHT = 0x00000100,
};
enum class InputBatteryClass : uint32_t {
diff --git a/services/inputflinger/tests/InputReader_test.cpp b/services/inputflinger/tests/InputReader_test.cpp
index ee6993c..5577bd4 100644
--- a/services/inputflinger/tests/InputReader_test.cpp
+++ b/services/inputflinger/tests/InputReader_test.cpp
@@ -10099,7 +10099,7 @@
TEST_F(LightControllerTest, MonoLight) {
RawLightInfo infoMono = {.id = 1,
- .name = "Mono",
+ .name = "mono_light",
.maxBrightness = 255,
.flags = InputLightClass::BRIGHTNESS,
.path = ""};
@@ -10110,7 +10110,29 @@
controller.populateDeviceInfo(&info);
std::vector<InputDeviceLightInfo> lights = info.getLights();
ASSERT_EQ(1U, lights.size());
- ASSERT_EQ(InputDeviceLightType::MONO, lights[0].type);
+ ASSERT_EQ(InputDeviceLightType::INPUT, lights[0].type);
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::BRIGHTNESS));
+
+ ASSERT_TRUE(controller.setLightColor(lights[0].id, LIGHT_BRIGHTNESS));
+ ASSERT_EQ(controller.getLightColor(lights[0].id).value_or(-1), LIGHT_BRIGHTNESS);
+}
+
+TEST_F(LightControllerTest, MonoKeyboardBacklight) {
+ RawLightInfo infoMono = {.id = 1,
+ .name = "mono_keyboard_backlight",
+ .maxBrightness = 255,
+ .flags = InputLightClass::BRIGHTNESS |
+ InputLightClass::KEYBOARD_BACKLIGHT,
+ .path = ""};
+ mFakeEventHub->addRawLightInfo(infoMono.id, std::move(infoMono));
+
+ PeripheralController& controller = addControllerAndConfigure<PeripheralController>();
+ InputDeviceInfo info;
+ controller.populateDeviceInfo(&info);
+ std::vector<InputDeviceLightInfo> lights = info.getLights();
+ ASSERT_EQ(1U, lights.size());
+ ASSERT_EQ(InputDeviceLightType::KEYBOARD_BACKLIGHT, lights[0].type);
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::BRIGHTNESS));
ASSERT_TRUE(controller.setLightColor(lights[0].id, LIGHT_BRIGHTNESS));
ASSERT_EQ(controller.getLightColor(lights[0].id).value_or(-1), LIGHT_BRIGHTNESS);
@@ -10141,7 +10163,85 @@
controller.populateDeviceInfo(&info);
std::vector<InputDeviceLightInfo> lights = info.getLights();
ASSERT_EQ(1U, lights.size());
- ASSERT_EQ(InputDeviceLightType::RGB, lights[0].type);
+ ASSERT_EQ(InputDeviceLightType::INPUT, lights[0].type);
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::BRIGHTNESS));
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::RGB));
+
+ ASSERT_TRUE(controller.setLightColor(lights[0].id, LIGHT_COLOR));
+ ASSERT_EQ(controller.getLightColor(lights[0].id).value_or(-1), LIGHT_COLOR);
+}
+
+TEST_F(LightControllerTest, CorrectRGBKeyboardBacklight) {
+ RawLightInfo infoRed = {.id = 1,
+ .name = "red_keyboard_backlight",
+ .maxBrightness = 255,
+ .flags = InputLightClass::BRIGHTNESS | InputLightClass::RED |
+ InputLightClass::KEYBOARD_BACKLIGHT,
+ .path = ""};
+ RawLightInfo infoGreen = {.id = 2,
+ .name = "green_keyboard_backlight",
+ .maxBrightness = 255,
+ .flags = InputLightClass::BRIGHTNESS | InputLightClass::GREEN |
+ InputLightClass::KEYBOARD_BACKLIGHT,
+ .path = ""};
+ RawLightInfo infoBlue = {.id = 3,
+ .name = "blue_keyboard_backlight",
+ .maxBrightness = 255,
+ .flags = InputLightClass::BRIGHTNESS | InputLightClass::BLUE |
+ InputLightClass::KEYBOARD_BACKLIGHT,
+ .path = ""};
+ mFakeEventHub->addRawLightInfo(infoRed.id, std::move(infoRed));
+ mFakeEventHub->addRawLightInfo(infoGreen.id, std::move(infoGreen));
+ mFakeEventHub->addRawLightInfo(infoBlue.id, std::move(infoBlue));
+
+ PeripheralController& controller = addControllerAndConfigure<PeripheralController>();
+ InputDeviceInfo info;
+ controller.populateDeviceInfo(&info);
+ std::vector<InputDeviceLightInfo> lights = info.getLights();
+ ASSERT_EQ(1U, lights.size());
+ ASSERT_EQ(InputDeviceLightType::KEYBOARD_BACKLIGHT, lights[0].type);
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::BRIGHTNESS));
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::RGB));
+
+ ASSERT_TRUE(controller.setLightColor(lights[0].id, LIGHT_COLOR));
+ ASSERT_EQ(controller.getLightColor(lights[0].id).value_or(-1), LIGHT_COLOR);
+}
+
+TEST_F(LightControllerTest, IncorrectRGBKeyboardBacklight) {
+ RawLightInfo infoRed = {.id = 1,
+ .name = "red",
+ .maxBrightness = 255,
+ .flags = InputLightClass::BRIGHTNESS | InputLightClass::RED,
+ .path = ""};
+ RawLightInfo infoGreen = {.id = 2,
+ .name = "green",
+ .maxBrightness = 255,
+ .flags = InputLightClass::BRIGHTNESS | InputLightClass::GREEN,
+ .path = ""};
+ RawLightInfo infoBlue = {.id = 3,
+ .name = "blue",
+ .maxBrightness = 255,
+ .flags = InputLightClass::BRIGHTNESS | InputLightClass::BLUE,
+ .path = ""};
+ RawLightInfo infoGlobal = {.id = 3,
+ .name = "global_keyboard_backlight",
+ .maxBrightness = 255,
+ .flags = InputLightClass::BRIGHTNESS | InputLightClass::GLOBAL |
+ InputLightClass::KEYBOARD_BACKLIGHT,
+ .path = ""};
+ mFakeEventHub->addRawLightInfo(infoRed.id, std::move(infoRed));
+ mFakeEventHub->addRawLightInfo(infoGreen.id, std::move(infoGreen));
+ mFakeEventHub->addRawLightInfo(infoBlue.id, std::move(infoBlue));
+ mFakeEventHub->addRawLightInfo(infoBlue.id, std::move(infoGlobal));
+
+ PeripheralController& controller = addControllerAndConfigure<PeripheralController>();
+ InputDeviceInfo info;
+ controller.populateDeviceInfo(&info);
+ std::vector<InputDeviceLightInfo> lights = info.getLights();
+ ASSERT_EQ(1U, lights.size());
+ ASSERT_EQ(InputDeviceLightType::INPUT, lights[0].type);
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::BRIGHTNESS));
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::RGB));
ASSERT_TRUE(controller.setLightColor(lights[0].id, LIGHT_COLOR));
ASSERT_EQ(controller.getLightColor(lights[0].id).value_or(-1), LIGHT_COLOR);
@@ -10149,7 +10249,7 @@
TEST_F(LightControllerTest, MultiColorRGBLight) {
RawLightInfo infoColor = {.id = 1,
- .name = "red",
+ .name = "multi_color",
.maxBrightness = 255,
.flags = InputLightClass::BRIGHTNESS |
InputLightClass::MULTI_INTENSITY |
@@ -10163,7 +10263,34 @@
controller.populateDeviceInfo(&info);
std::vector<InputDeviceLightInfo> lights = info.getLights();
ASSERT_EQ(1U, lights.size());
- ASSERT_EQ(InputDeviceLightType::MULTI_COLOR, lights[0].type);
+ ASSERT_EQ(InputDeviceLightType::INPUT, lights[0].type);
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::BRIGHTNESS));
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::RGB));
+
+ ASSERT_TRUE(controller.setLightColor(lights[0].id, LIGHT_COLOR));
+ ASSERT_EQ(controller.getLightColor(lights[0].id).value_or(-1), LIGHT_COLOR);
+}
+
+TEST_F(LightControllerTest, MultiColorRGBKeyboardBacklight) {
+ RawLightInfo infoColor = {.id = 1,
+ .name = "multi_color_keyboard_backlight",
+ .maxBrightness = 255,
+ .flags = InputLightClass::BRIGHTNESS |
+ InputLightClass::MULTI_INTENSITY |
+ InputLightClass::MULTI_INDEX |
+ InputLightClass::KEYBOARD_BACKLIGHT,
+ .path = ""};
+
+ mFakeEventHub->addRawLightInfo(infoColor.id, std::move(infoColor));
+
+ PeripheralController& controller = addControllerAndConfigure<PeripheralController>();
+ InputDeviceInfo info;
+ controller.populateDeviceInfo(&info);
+ std::vector<InputDeviceLightInfo> lights = info.getLights();
+ ASSERT_EQ(1U, lights.size());
+ ASSERT_EQ(InputDeviceLightType::KEYBOARD_BACKLIGHT, lights[0].type);
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::BRIGHTNESS));
+ ASSERT_TRUE(lights[0].capabilityFlags.test(InputDeviceLightCapability::RGB));
ASSERT_TRUE(controller.setLightColor(lights[0].id, LIGHT_COLOR));
ASSERT_EQ(controller.getLightColor(lights[0].id).value_or(-1), LIGHT_COLOR);
@@ -10201,6 +10328,8 @@
std::vector<InputDeviceLightInfo> lights = info.getLights();
ASSERT_EQ(1U, lights.size());
ASSERT_EQ(InputDeviceLightType::PLAYER_ID, lights[0].type);
+ ASSERT_FALSE(lights[0].capabilityFlags.test(InputDeviceLightCapability::BRIGHTNESS));
+ ASSERT_FALSE(lights[0].capabilityFlags.test(InputDeviceLightCapability::RGB));
ASSERT_FALSE(controller.setLightColor(lights[0].id, LIGHT_COLOR));
ASSERT_TRUE(controller.setLightPlayerId(lights[0].id, LIGHT_PLAYER_ID));