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:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user