From 17301bcce4aee4ebcec25d545af7b44ab42d4d9b Mon Sep 17 00:00:00 2001 From: Tomasz Marciniak Date: Wed, 7 Jun 2017 12:07:09 +0200 Subject: [PATCH] [Power] Restore system side brightness [Verification] Code compiles. TCT pass rate 100% (auto and manual) Now system side brightness is restored when application is closed/terminated. Change-Id: I9fe5a60c7f4f85e5ed9f891f16fb7e5cf57ee857 Signed-off-by: Tomasz Marciniak (cherry picked from commit 6b9c2ba596d9358e319717139a7c51c6de261563) --- src/power/power_instance.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/power/power_instance.cc b/src/power/power_instance.cc index 8296123..746f21e 100755 --- a/src/power/power_instance.cc +++ b/src/power/power_instance.cc @@ -74,7 +74,13 @@ PowerInstance::PowerInstance() { PowerInstance::~PowerInstance() { LoggerD("Enter"); + PowerManager::GetInstance()->RemoveListener(this); + + PlatformResult result = PowerManager::GetInstance()->RestoreScreenBrightness(); + if (result.IsError()) { + LoggerE("Failed to restore brightness."); + } } enum PowerCallbacks { -- 2.7.4