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(uint32_t type)62 bool PowerMgrClient::IsRunningLockTypeSupported(uint32_t 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
RegisterShutdownCallback(const sptr<IShutdownCallback> & callback,IShutdownCallback::ShutdownPriority priority)97 bool PowerMgrClient::RegisterShutdownCallback(
98 const sptr<IShutdownCallback>& callback, IShutdownCallback::ShutdownPriority priority)
99 {
100 return true;
101 }
102
UnRegisterShutdownCallback(const sptr<IShutdownCallback> & callback)103 bool PowerMgrClient::UnRegisterShutdownCallback(const sptr<IShutdownCallback>& callback)
104 {
105 return true;
106 }
107
RegisterPowerModeCallback(const sptr<IPowerModeCallback> & callback)108 bool PowerMgrClient::RegisterPowerModeCallback(const sptr<IPowerModeCallback>& callback)
109 {
110 return true;
111 }
112
UnRegisterPowerModeCallback(const sptr<IPowerModeCallback> & callback)113 bool PowerMgrClient::UnRegisterPowerModeCallback(const sptr<IPowerModeCallback>& callback)
114 {
115 return true;
116 }
117
SetDisplaySuspend(bool enable)118 bool PowerMgrClient::SetDisplaySuspend(bool enable)
119 {
120 return true;
121 }
122
SetDeviceMode(const PowerMode mode)123 PowerErrors PowerMgrClient::SetDeviceMode(const PowerMode mode)
124 {
125 return PowerErrors::ERR_OK;
126 }
127
GetDeviceMode()128 PowerMode PowerMgrClient::GetDeviceMode()
129 {
130 return PowerMode::NORMAL_MODE;
131 }
132
Dump(const std::vector<std::string> & args)133 std::string PowerMgrClient::Dump(const std::vector<std::string>& args)
134 {
135 return "ERR_OK";
136 }
137 } // namespace PowerMgr
138 } // namespace OHOS