[Power] Restore system side brightness 38/132738/1
authorTomasz Marciniak <t.marciniak@samsung.com>
Wed, 7 Jun 2017 10:07:09 +0000 (12:07 +0200)
committerTomasz Marciniak <t.marciniak@samsung.com>
Wed, 7 Jun 2017 10:07:09 +0000 (12:07 +0200)
[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>
src/power/power_instance.cc

index 8296123556ad1c55d57122000fe451743d066cb2..746f21e231d285b61969fd9898757b3f5fffe5a3 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 {