1 /*
2 * Copyright (C) 2022 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 #include "mock_power_mgr_client.h"
17 #include "power_errors.h"
18
19 namespace OHOS {
20 namespace PowerMgr {
PowerMgrClient()21 PowerMgrClient::PowerMgrClient()
22 {}
~PowerMgrClient()23 PowerMgrClient::~PowerMgrClient()
24 {}
25
Connect()26 ErrCode PowerMgrClient::Connect()
27 {
28 return ERR_OK;
29 }
30
ResetProxy(const wptr<IRemoteObject> & remote)31 void PowerMgrClient::ResetProxy(const wptr<IRemoteObject>& remote)
32 {}
33
OnRemoteDied(const wptr<IRemoteObject> & remote)34 void PowerMgrClient::PowerMgrDeathRecipient::OnRemoteDied(const wptr<IRemoteObject>& remote)
35 {}
36
RebootDevice(const std::string & reason)37 PowerErrors PowerMgrClient::RebootDevice(const std::string& reason)
38 {
39 return PowerErrors::ERR_OK;
40 }
41
ShutDownDevice(const std::string & reason)42 PowerErrors PowerMgrClient::ShutDownDevice(const std::string& reason)
43 {
44 return PowerErrors::ERR_OK;
45 }
46
SuspendDevice(SuspendDeviceType reason,bool suspendImmed)47 PowerErrors PowerMgrClient::SuspendDevice(SuspendDeviceType reason, bool suspendImmed)
48 {
49 return PowerErrors::ERR_OK;
50 }
51
WakeupDevice(WakeupDeviceType reason,const std::string & detail)52 PowerErrors PowerMgrClient::WakeupDevice(WakeupDeviceType reason, const std::string& detail)
53 {
54 return PowerErrors::ERR_OK;
55 }
56
RefreshActivity(UserActivityType type)57 bool PowerMgrClient::RefreshActivity(UserActivityType type)
58 {
59 return true;
60 }
61
IsRunningLockTypeSupported(RunningLockType type)62 bool PowerMgrClient::IsRunningLockTypeSupported(RunningLockType type)
63 {
64 return true;
65 }
66
ForceSuspendDevice()67 bool PowerMgrClient::ForceSuspendDevice()
68 {
69 return true;
70 }
71
IsScreenOn()72 bool PowerMgrClient::IsScreenOn()
73 {
74 return true;
75 }
76
GetState()77 PowerState PowerMgrClient::GetState()
78 {
79 return PowerState::UNKNOWN;
80 }
81
CreateRunningLock(const std::string & name,RunningLockType type)82 std::shared_ptr<RunningLock> PowerMgrClient::CreateRunningLock(const std::string& name, RunningLockType type)
83 {
84 return nullptr;
85 }
86
RegisterPowerStateCallback(const sptr<IPowerStateCallback> & callback)87 bool PowerMgrClient::RegisterPowerStateCallback(const sptr<IPowerStateCallback>& callback)
88 {
89 return true;
90 }
91
UnRegisterPowerStateCallback(const sptr<IPowerStateCallback> & callback)92 bool PowerMgrClient::UnRegisterPowerStateCallback(const sptr<IPowerStateCallback>& callback)
93 {
94 return true;
95 }
96
RegisterPowerModeCallback(const sptr<IPowerModeCallback> & callback)97 bool PowerMgrClient::RegisterPowerModeCallback(const sptr<IPowerModeCallback>& callback)
98 {
99 return true;
100 }
101
UnRegisterPowerModeCallback(const sptr<IPowerModeCallback> & callback)102 bool PowerMgrClient::UnRegisterPowerModeCallback(const sptr<IPowerModeCallback>& callback)
103 {
104 return true;
105 }
106
SetDisplaySuspend(bool enable)107 bool PowerMgrClient::SetDisplaySuspend(bool enable)
108 {
109 return true;
110 }
111
SetDeviceMode(const PowerMode mode)112 PowerErrors PowerMgrClient::SetDeviceMode(const PowerMode mode)
113 {
114 return PowerErrors::ERR_OK;
115 }
116
GetDeviceMode()117 PowerMode PowerMgrClient::GetDeviceMode()
118 {
119 return PowerMode::NORMAL_MODE;
120 }
121
Dump(const std::vector<std::string> & args)122 std::string PowerMgrClient::Dump(const std::vector<std::string>& args)
123 {
124 return "ERR_OK";
125 }
126 } // namespace PowerMgr
127 } // namespace OHOS