1 /*
2 * Copyright (C) 2022-2023 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_remote_object.h"
17
18 namespace OHOS {
19 namespace PowerMgr {
20 namespace {
21 int32_t g_code = 1;
22 }
MockPowerRemoteObject(std::u16string descriptor)23 MockPowerRemoteObject::MockPowerRemoteObject(std::u16string descriptor) : IRemoteObject(descriptor) {}
24
~MockPowerRemoteObject()25 MockPowerRemoteObject::~MockPowerRemoteObject() {}
26
SetRequestValue(int32_t value)27 void MockPowerRemoteObject::SetRequestValue(int32_t value)
28 {
29 g_code = value;
30 }
31
GetObjectRefCount()32 int32_t MockPowerRemoteObject::GetObjectRefCount()
33 {
34 return 0;
35 }
36
Dump(int fd,const std::vector<std::u16string> & args)37 int MockPowerRemoteObject::Dump(int fd, const std::vector<std::u16string>& args)
38 {
39 (void)args;
40 return 0;
41 }
42
SendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)43 int MockPowerRemoteObject::SendRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option)
44 {
45 (void)code;
46 (void)data;
47 (void)reply;
48 (void)option;
49 return g_code;
50 }
51
AddDeathRecipient(const sptr<DeathRecipient> & recipient)52 bool MockPowerRemoteObject::AddDeathRecipient(const sptr<DeathRecipient>& recipient)
53 {
54 (void)recipient;
55 return false;
56 }
57
RemoveDeathRecipient(const sptr<DeathRecipient> & recipient)58 bool MockPowerRemoteObject::RemoveDeathRecipient(const sptr<DeathRecipient>& recipient)
59 {
60 (void)recipient;
61 return false;
62 }
63 } // namespace PowerMgr
64 } // namespace OHOS
65