1595d5899Sopenharmony_ci/* 2595d5899Sopenharmony_ci * Copyright (c) 2023-2023 Huawei Device Co., Ltd. 3595d5899Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4595d5899Sopenharmony_ci * you may not use this file except in compliance with the License. 5595d5899Sopenharmony_ci * You may obtain a copy of the License at 6595d5899Sopenharmony_ci * 7595d5899Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8595d5899Sopenharmony_ci * 9595d5899Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10595d5899Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11595d5899Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12595d5899Sopenharmony_ci * See the License for the specific language governing permissions and 13595d5899Sopenharmony_ci * limitations under the License. 14595d5899Sopenharmony_ci */ 15595d5899Sopenharmony_ci 16595d5899Sopenharmony_ci#include "brightness_param_helper.h" 17595d5899Sopenharmony_ci 18595d5899Sopenharmony_ci#include "sysparam.h" 19595d5899Sopenharmony_ci 20595d5899Sopenharmony_cinamespace OHOS { 21595d5899Sopenharmony_cinamespace DisplayPowerMgr { 22595d5899Sopenharmony_ciusing namespace OHOS::PowerMgr; 23595d5899Sopenharmony_ciuint32_t BrightnessParamHelper::GetDefaultBrightness() 24595d5899Sopenharmony_ci{ 25595d5899Sopenharmony_ci int32_t value = SysParam::GetIntValue(KEY_DEFAULT_BRIGHTNESS, BRIGHTNESS_DEFAULT); 26595d5899Sopenharmony_ci return static_cast<uint32_t>(value); 27595d5899Sopenharmony_ci} 28595d5899Sopenharmony_ci 29595d5899Sopenharmony_ciuint32_t BrightnessParamHelper::GetMaxBrightness() 30595d5899Sopenharmony_ci{ 31595d5899Sopenharmony_ci int32_t value = SysParam::GetIntValue(KEY_MAX_BRIGHTNESS, BRIGHTNESS_MAX); 32595d5899Sopenharmony_ci return static_cast<uint32_t>(value); 33595d5899Sopenharmony_ci} 34595d5899Sopenharmony_ci 35595d5899Sopenharmony_ciuint32_t BrightnessParamHelper::GetMinBrightness() 36595d5899Sopenharmony_ci{ 37595d5899Sopenharmony_ci int32_t value = SysParam::GetIntValue(KEY_MIN_BRIGHTNESS, BRIGHTNESS_MIN); 38595d5899Sopenharmony_ci return static_cast<uint32_t>(value); 39595d5899Sopenharmony_ci} 40595d5899Sopenharmony_ci 41595d5899Sopenharmony_ciuint32_t BrightnessParamHelper::GetSleepBrightness() 42595d5899Sopenharmony_ci{ 43595d5899Sopenharmony_ci int32_t value = SysParam::GetIntValue(KEY_SLEEP_BRIGHTNESS, BRIGHTNESS_SLEEP); 44595d5899Sopenharmony_ci return static_cast<uint32_t>(value); 45595d5899Sopenharmony_ci} 46595d5899Sopenharmony_ci 47595d5899Sopenharmony_ciuint32_t BrightnessParamHelper::GetSleepMinumumReductionBrightness() 48595d5899Sopenharmony_ci{ 49595d5899Sopenharmony_ci int32_t value = SysParam::GetIntValue(KEY_SLEEP_MINUMUM_REDUCTION_BRIGHTNESS, BRIGHTNESS_SLEEP_MINUMUM_REDUCTION); 50595d5899Sopenharmony_ci return static_cast<uint32_t>(value); 51595d5899Sopenharmony_ci} 52595d5899Sopenharmony_ci 53595d5899Sopenharmony_ciuint32_t BrightnessParamHelper::GetSleepDarkenTime() 54595d5899Sopenharmony_ci{ 55595d5899Sopenharmony_ci int32_t value = SysParam::GetIntValue(KEY_SLEEP_DARKEN_TIME, BRIGHTNESS_SLEEP_DARKEN_TIME); 56595d5899Sopenharmony_ci return static_cast<uint32_t>(value); 57595d5899Sopenharmony_ci} 58595d5899Sopenharmony_ci 59595d5899Sopenharmony_civoid BrightnessParamHelper::RegisterBootCompletedCallback(BootCompletedCallback& callback) 60595d5899Sopenharmony_ci{ 61595d5899Sopenharmony_ci SysParam::RegisterBootCompletedCallback(callback); 62595d5899Sopenharmony_ci} 63595d5899Sopenharmony_ci} // namespace DisplayPowerMgr 64595d5899Sopenharmony_ci} // namespace OHOS