1/* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16interface OHOS.DisplayPowerMgr.IDisplayBrightnessCallback; 17interface OHOS.DisplayPowerMgr.IDisplayPowerCallback; 18 19interface OHOS.DisplayPowerMgr.IDisplayPowerMgr { 20 [ipccode 0] void SetDisplayState([in] unsigned int id, [in] unsigned int state, [in] unsigned int reason, 21 [out] boolean bResult); 22 void GetDisplayState([in] unsigned int id, [out] int displayState); 23 void GetDisplayIds([out] unsigned int[] ids); 24 void GetMainDisplayId([out] unsigned int id); 25 void SetBrightness([in] unsigned int value, [in] unsigned int displayId, [in] boolean continuous, 26 [out] boolean bResult, [out] int retCode); 27 void DiscountBrightness([in] double value, [in] unsigned int displayId, [out] boolean bResult); 28 void OverrideBrightness([in] unsigned int value, [in] unsigned int displayId, [in] unsigned int duration, 29 [out] boolean bResult); 30 void OverrideDisplayOffDelay([in] unsigned int delayMs, [out] boolean bResult); 31 void RestoreBrightness([in] unsigned int displayId, [in] unsigned int duration, [out] boolean bResult); 32 void GetBrightness([in] unsigned int displayId, [out] unsigned int brightness); 33 void GetDefaultBrightness([out] unsigned int defaultBrightness); 34 void GetMaxBrightness([out] unsigned int maxBrightness); 35 void GetMinBrightness([out] unsigned int minBrightness); 36 void AdjustBrightness([in] unsigned int id, [in] int value, [in] unsigned int duration, [out] boolean bResult); 37 void AutoAdjustBrightness([in] boolean enable, [out] boolean bResult); 38 void IsAutoAdjustBrightness([out] boolean bResult); 39 void RegisterCallback([in] IDisplayPowerCallback displayPowercallback, [out] boolean bResult); 40 void BoostBrightness([in] int timeoutMs, [in] unsigned int displayId, [out] boolean bResult); 41 void CancelBoostBrightness([in] unsigned int displayId, [out] boolean bResult); 42 void GetDeviceBrightness([in] unsigned int displayId, [out] unsigned int deviceBrightness); 43 void SetCoordinated([in] boolean coordinated, [in] unsigned int displayId, [out] boolean bResult); 44 [ipccode 21] void SetLightBrightnessThreshold([in] int[] threshold, 45 [in] IDisplayBrightnessCallback displayBrightnessCallback, [out] unsigned int retCode); 46 void SetMaxBrightness([in] double value, [in] unsigned int enterTestMode, [out] boolean bResult, 47 [out] int retCode); 48 void SetMaxBrightnessNit([in] unsigned int maxNit, [in] unsigned int enterTestMode, [out] boolean bResult, 49 [out] int retCode); 50 void NotifyScreenPowerStatus([in] unsigned int displayId, [in] unsigned int displayPowerStatus, 51 [out] int retCode); 52 void SetScreenOnBrightness([out] boolean bResult); 53}