sm8150-common: parts: Switch to brightness nodes for popup LEDs

Switching to brightness node allows the PopupCameraService to have
direct control over the LED state, ensuring the lights turn on
instantly and turn off reliably when the handler expires.

Change-Id: I634f64656a016688f28d481be1a36436e9272e67
This commit is contained in:
armdebug
2026-01-30 18:56:35 +00:00
committed by firebird11
parent bd96d4c375
commit ab2c03f8de
2 changed files with 4 additions and 4 deletions

View File

@@ -53,7 +53,7 @@
<!-- Popup camera light nodes -->
<string-array name="popupcamera_light_nodes" translatable="false">
<item>/sys/class/leds/green/breath</item>
<item>/sys/class/leds/blue/breath</item>
<item>/sys/class/leds/green/brightness</item>
<item>/sys/class/leds/blue/brightness</item>
</string-array>
</resources>

View File

@@ -316,14 +316,14 @@ public class PopupCameraService extends Service implements Handler.Callback {
private void lightUp() {
if (mPopupCameraPreferences.isLedAllowed()) {
for (String node : mLightNodes) {
FileUtils.writeLine(node, "1");
FileUtils.writeLine(node, "180");
}
mHandler.postDelayed(() -> {
for (String node : mLightNodes) {
FileUtils.writeLine(node, "0");
}
}, 2300);
}, 1000);
}
}