Group player leds in Sony Dualsense controller

Sony reported that Android will not group the player LEDs properly
for the DualSense controller. After investigating, our mechanism
to group LEDs would not support the standard name for player ID
lights. This fix expands the regular expression so it will support
this format in addition of the name that the gamepad driver will
use in certain older devices.

Bug: 289067916
Flag: EXEMPT bugfix
Test: `adb shell dumpsys input`
Change-Id: I5b5e3f5e8478422bbc717a6c272a24e6568464fc
diff --git a/services/inputflinger/reader/controller/PeripheralController.cpp b/services/inputflinger/reader/controller/PeripheralController.cpp
index 27b9d23..49ad8b5 100644
--- a/services/inputflinger/reader/controller/PeripheralController.cpp
+++ b/services/inputflinger/reader/controller/PeripheralController.cpp
@@ -418,7 +418,11 @@
         }
         rawInfos.insert_or_assign(rawId, rawInfo.value());
         // Check if this is a group LEDs for player ID
-        std::regex lightPattern("([a-z]+)([0-9]+)");
+        // The name for the light has already been parsed and is the `function`
+        // value; for player ID lights the function is expected to be `player-#`.
+        // However, the Sony driver will use `sony#` instead on SIXAXIS
+        // gamepads.
+        std::regex lightPattern("(player|sony)-?([0-9]+)");
         std::smatch results;
         if (std::regex_match(rawInfo->name, results, lightPattern)) {
             std::string commonName = results[1].str();