mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-04 00:35:47 +00:00
Fix RGB LED capability flag on Android 12 and 13
This commit is contained in:
parent
62bae62386
commit
e92fdeef47
@ -2808,10 +2808,15 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
|||||||
|
|
||||||
for (Light light : inputDevice.getLightsManager().getLights()) {
|
for (Light light : inputDevice.getLightsManager().getLights()) {
|
||||||
if (light.hasRgbControl()) {
|
if (light.hasRgbControl()) {
|
||||||
|
// 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;
|
capabilities |= MoonBridge.LI_CCAP_RGB_LED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Report analog triggers if we have at least one trigger axis
|
// Report analog triggers if we have at least one trigger axis
|
||||||
if (leftTriggerAxis != -1 || rightTriggerAxis != -1) {
|
if (leftTriggerAxis != -1 || rightTriggerAxis != -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user