Skip to content

Commit bf69e0d

Browse files
mark9064JF002
authored andcommitted
aod: fix flashlight brightness restore
1 parent 947c4f5 commit bf69e0d

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/displayapp/screens/FlashLight.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace {
1717
FlashLight::FlashLight(System::SystemTask& systemTask, Controllers::BrightnessController& brightnessController)
1818
: systemTask {systemTask}, brightnessController {brightnessController} {
1919

20+
previousBrightnessLevel = brightnessController.Level();
2021
brightnessController.Set(Controllers::BrightnessController::Levels::Low);
2122

2223
flashLight = lv_label_create(lv_scr_act(), nullptr);
@@ -52,6 +53,7 @@ FlashLight::FlashLight(System::SystemTask& systemTask, Controllers::BrightnessCo
5253
FlashLight::~FlashLight() {
5354
lv_obj_clean(lv_scr_act());
5455
lv_obj_set_style_local_bg_color(lv_scr_act(), LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
56+
brightnessController.Set(previousBrightnessLevel);
5557
systemTask.PushMessage(Pinetime::System::Messages::EnableSleeping);
5658
}
5759

src/displayapp/screens/FlashLight.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ namespace Pinetime {
2727
Controllers::BrightnessController& brightnessController;
2828

2929
Controllers::BrightnessController::Levels brightnessLevel = Controllers::BrightnessController::Levels::High;
30+
Controllers::BrightnessController::Levels previousBrightnessLevel;
3031

3132
lv_obj_t* flashLight;
3233
lv_obj_t* backgroundAction;

0 commit comments

Comments
 (0)