• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 #ifndef MOCK_DISPLAY_POWER_MGR_PROXY_H
17 #define MOCK_DISPLAY_POWER_MGR_PROXY_H
18 
19 #include "display_power_mgr_proxy.h"
20 
21 namespace OHOS {
22 namespace DisplayPowerMgr {
23 class MockDisplayPowerMgrProxy : public DisplayPowerMgrProxy {
24 public:
MockDisplayPowerMgrProxy(const sptr<IRemoteObject> & remote)25     explicit MockDisplayPowerMgrProxy(const sptr<IRemoteObject>& remote)
26         : DisplayPowerMgrProxy(remote)
27     {}
~MockDisplayPowerMgrProxy()28     ~MockDisplayPowerMgrProxy() {}
29     int32_t SetDisplayState(uint32_t id, uint32_t state, uint32_t reason, bool& bResult) override;
30     int32_t GetDisplayState(uint32_t id, int32_t& displayState) override;
31     int32_t GetDisplayIds(std::vector<uint32_t>& ids) override;
32     int32_t GetMainDisplayId(uint32_t& id) override;
33     int32_t SetBrightness(uint32_t value, uint32_t displayId, bool continuous, bool& bResult,
34         int32_t& retCode) override;
35     int32_t SetMaxBrightness(double value, uint32_t enterTestMode, bool& bResult, int32_t& retCode) override;
36     int32_t SetMaxBrightnessNit(uint32_t maxNit, uint32_t enterTestMode, bool& bResult, int32_t& retCode) override;
37     int32_t DiscountBrightness(double value, uint32_t displayId, bool& bResult) override;
38     int32_t OverrideBrightness(uint32_t value, uint32_t displayId, uint32_t duration, bool& bResult) override;
39     int32_t OverrideDisplayOffDelay(uint32_t delayMs, bool& bResult) override;
40     int32_t RestoreBrightness(uint32_t displayId, uint32_t duration, bool& bResult) override;
41     int32_t GetBrightness(uint32_t displayId, uint32_t& brightness) override;
42     int32_t GetDefaultBrightness(uint32_t& defaultBrightness) override;
43     int32_t GetMaxBrightness(uint32_t& maxBrightness) override;
44     int32_t GetMinBrightness(uint32_t& minBrightness) override;
45     int32_t AdjustBrightness(uint32_t id, int32_t value, uint32_t duration, bool& bResult) override;
46     int32_t AutoAdjustBrightness(bool enable, bool& bResult) override;
47     int32_t IsAutoAdjustBrightness(bool& bResult) override;
48     int32_t BoostBrightness(int32_t timeoutMs, uint32_t displayId, bool& bResult) override;
49     int32_t CancelBoostBrightness(uint32_t displayId, bool& bResult) override;
50     int32_t GetDeviceBrightness(uint32_t displayId, uint32_t& deviceBrightness) override;
51     int32_t SetCoordinated(bool coordinated, uint32_t displayId, bool& bResult) override;
52     int32_t SetLightBrightnessThreshold(const std::vector<int32_t>& threshold,
53         const sptr<IDisplayBrightnessCallback>& displayBrightnessCallback, uint32_t& retCode) override;
54     int32_t RegisterCallback(const sptr<IDisplayPowerCallback>& displayPowercallback, bool& bResult) override;
55     int32_t SetScreenOnBrightness(bool& bResult) override;
56     int32_t NotifyScreenPowerStatus(uint32_t displayId, uint32_t displayPowerStatus, int32_t& retCode) override;
57 };
58 } // namespace DisplayPowerMgr
59 } // namespace OHOS
60 #endif // MOCK_DISPLAY_POWER_MGR_PROXY_H
61