!313 更新设置亮度强度百分比

Merge pull request !313 from null/dev
This commit is contained in:
openharmony_ci 2022-08-08 08:57:31 +00:00 committed by Gitee
commit d9b090c2c9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#include "iservice_registry.h"
#include "parameter.h"
#include "system_ability_definition.h"
#include "display_power_mgr_client.h"
namespace OHOS {
namespace AccessibilityConfig {
@ -986,6 +987,11 @@ void AccessibilityConfig::Impl::SetBrightnessDiscount(const float brightness)
{
HILOG_INFO("brightness = [%{public}f]", brightness);
std::lock_guard<std::mutex> lock(mutex_);
auto& displayPowerMgrClient = DisplayPowerMgr::DisplayPowerMgrClient::GetInstance();
if (!displayPowerMgrClient.DiscountBrightness(brightness)) {
HILOG_ERROR("Failed to set brightness discount");
return;
}
if (!serviceProxy_) {
HILOG_ERROR("Failed to get accessibility service");
return;

View File

@ -52,11 +52,13 @@ ohos_shared_library("accessibilityconfig") {
external_deps = [
"ability_base:want",
"c_utils:utils",
"display_manager:displaymgr",
"eventhandler:libeventhandler",
"hiviewdfx_hilog_native:libhilog",
"init:libbeget_proxy",
"init:libbegetutil",
"ipc:ipc_core",
"power_manager:powermgr_client",
"samgr:samgr_proxy",
]