[Power] Restore system side brightness 41/132741/1
authorTomasz Marciniak <t.marciniak@samsung.com>
Wed, 7 Jun 2017 10:07:09 +0000 (12:07 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Wed, 7 Jun 2017 10:16:32 +0000 (10:16 +0000)
[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 <t.marciniak@samsung.com>
(cherry picked from commit 6b9c2ba596d9358e319717139a7c51c6de261563)

src/power/power_instance.cc

index 8296123..746f21e 100755 (executable)
@@ -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 {