[Power] apply Currentbrightness, Custombrightness method
authorjk.pu <jk.pu@samsung.com>
Fri, 30 Oct 2015 05:35:07 +0000 (14:35 +0900)
committerjk.pu <jk.pu@samsung.com>
Fri, 30 Oct 2015 05:36:15 +0000 (14:36 +0900)
Change-Id: I48c5d3bb6d505c7eec3f41f0a676d5c26cefd74b
Signed-off-by: jk.pu <jk.pu@samsung.com>
src/power/power_manager.cc
src/power/power_platform_proxy.cc

index 8278982cac265edc37c5b21cc68bed3ecd93443a..42eaccc7764662183ee305b93150738558613c40 100644 (file)
@@ -419,7 +419,13 @@ PlatformResult PowerManager::GetPlatformBrightness(int* result) {
   int brightness = 0;
 
   int is_custom_mode = 0;
-  vconf_get_int(VCONFKEY_PM_CUSTOM_BRIGHTNESS_STATUS, &is_custom_mode);
+  auto error_code = PowerPlatformProxy::GetInstance().IsCustomBrightness(&is_custom_mode);
+
+  if (!error_code) {
+    LoggerE("Failed to check if custom brightness is set.");
+    return error_code;
+  }
+
   if ((is_custom_mode && current_brightness_ != -1) || should_be_read_from_cache_) {
     LoggerD("return custom brightness %d", current_brightness_);
     *result = current_brightness_;
index 5ccd90ffaa79930b6811163db00e8d84c7715af7..5a9c4703d99933fec3aeead100b535274f21911a 100644 (file)
@@ -84,7 +84,7 @@ common::PlatformResult PowerPlatformProxy::SetBrightness(int val, int* result)
 
 common::PlatformResult PowerPlatformProxy::GetBrightness(int* result) {
   LoggerD("Entered");
-  return dbus_op_.InvokeSyncGetInt("GetBrightness", nullptr, result);
+  return dbus_op_.InvokeSyncGetInt("CurrentBrightness", nullptr, result);
 }
 
 common::PlatformResult PowerPlatformProxy::IsCustomBrightness(int* result) {