diff --git a/parts/src/org/lineageos/settings/popupcamera/Constants.java b/parts/src/org/lineageos/settings/popupcamera/Constants.java index 9554e8e..25feacb 100644 --- a/parts/src/org/lineageos/settings/popupcamera/Constants.java +++ b/parts/src/org/lineageos/settings/popupcamera/Constants.java @@ -36,6 +36,7 @@ public class Constants { public static final String OPEN_CAMERA_STATE = "1"; public static final String FRONT_CAMERA_ID = "1"; + public static final String LEFT_LED_BREATH_PATH = "/sys/class/leds/left/breath"; public static final String LEFT_LED_PATH = "/sys/class/leds/left/brightness"; public static final String RIGHT_LED_PATH = "/sys/class/leds/right/brightness"; public static final String POPUP_SOUND_PATH = "/system/media/audio/ui/"; diff --git a/parts/src/org/lineageos/settings/popupcamera/PopupCameraService.java b/parts/src/org/lineageos/settings/popupcamera/PopupCameraService.java index 3c1afe8..f3a6bbe 100644 --- a/parts/src/org/lineageos/settings/popupcamera/PopupCameraService.java +++ b/parts/src/org/lineageos/settings/popupcamera/PopupCameraService.java @@ -278,11 +278,19 @@ public class PopupCameraService extends Service implements Handler.Callback { private void lightUp() { if (mPopupCameraPreferences.isLedAllowed()) { + String ledBreathing = FileUtils.readOneLine(Constants.LEFT_LED_BREATH_PATH); + String ledBrightness = FileUtils.readOneLine(Constants.LEFT_LED_PATH); + + FileUtils.writeLine(Constants.LEFT_LED_BREATH_PATH, "0"); FileUtils.writeLine(Constants.LEFT_LED_PATH, "255"); FileUtils.writeLine(Constants.RIGHT_LED_PATH, "255"); mHandler.postDelayed(() -> { - FileUtils.writeLine(Constants.LEFT_LED_PATH, "0"); + if (ledBreathing.equals("1")) { + FileUtils.writeLine(Constants.LEFT_LED_BREATH_PATH, ledBreathing); + } else { + FileUtils.writeLine(Constants.LEFT_LED_PATH, ledBrightness); + } FileUtils.writeLine(Constants.RIGHT_LED_PATH, "0"); }, 1200); }