aidl: light: Fix a bug where breath wouldn't be disabled when not needed

Change-Id: I65c84c845fe8fb514d6b8345013077e3d0946972
This commit is contained in:
Sebastiano Barezzi 2023-11-13 01:14:17 +01:00
parent d71257fb4a
commit 481f209d2a
No known key found for this signature in database
GPG Key ID: 763BD3AE91A7A13F

View File

@ -115,12 +115,9 @@ void Lights::setLED(const HwLightState& state) {
if (mWhiteLED) {
rc = kLEDs[WHITE].setBreath(blink);
} else {
if (!!color.red)
rc &= kLEDs[RED].setBreath(blink);
if (!!color.green)
rc &= kLEDs[GREEN].setBreath(blink);
if (!!color.blue)
rc &= kLEDs[BLUE].setBreath(blink);
rc = kLEDs[RED].setBreath(blink && color.red);
rc &= kLEDs[GREEN].setBreath(blink && color.green);
rc &= kLEDs[BLUE].setBreath(blink && color.blue);
}
if (rc)
break;