mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-02 07:45:40 +00:00
Fix RGB LED capability flag on Android 12 and 13
This commit is contained in:
parent
62bae62386
commit
e92fdeef47
@ -2808,7 +2808,12 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
|
||||
for (Light light : inputDevice.getLightsManager().getLights()) {
|
||||
if (light.hasRgbControl()) {
|
||||
capabilities |= MoonBridge.LI_CCAP_RGB_LED;
|
||||
// Light.hasRgbControl() was totally broken prior to Android 14.
|
||||
// It always returned true because LIGHT_CAPABILITY_RGB was defined as 0,
|
||||
// so we will just guess RGB is supported if it's a PlayStation controller.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE || type == MoonBridge.LI_CTYPE_PS) {
|
||||
capabilities |= MoonBridge.LI_CCAP_RGB_LED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user