1 /*
2  * Copyright (C) 2024 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 "assistant.h"
17 #include "message_parcel.h"
18 #include "hilog_wrapper.h"
19 
20 namespace OHOS {
21 using namespace OHOS::FileAccessFwk;
22 
Parcelable()23 Parcelable::Parcelable() : Parcelable(false)
24 {}
25 
Parcelable(bool asRemote)26 Parcelable::Parcelable(bool asRemote)
27 {
28     asRemote_ = asRemote;
29     behavior_ = 0;
30 }
31 
WriteInterfaceToken(std::u16string name)32 bool MessageParcel::WriteInterfaceToken(std::u16string name)
33 {
34     return Assistant::ins_->Bool();
35 }
36 
WriteParcelable(const Parcelable * object)37 bool Parcel::WriteParcelable(const Parcelable *object)
38 {
39     return Assistant::ins_->Bool();
40 }
41 
WriteInt32(int32_t value)42 bool Parcel::WriteInt32(int32_t value)
43 {
44     return Assistant::ins_->Bool();
45 }
46 
ReadInt32()47 int32_t Parcel::ReadInt32()
48 {
49     return Assistant::ins_->Bool();
50 }
51 
ReadInt32(int32_t & value)52 bool Parcel::ReadInt32(int32_t &value)
53 {
54     value = Assistant::ins_->Int();
55     return Assistant::ins_->Bool();
56 }
57 
WriteRemoteObject(const Parcelable * object)58 bool Parcel::WriteRemoteObject(const Parcelable *object)
59 {
60     return Assistant::ins_->Bool();
61 }
62 
WriteRemoteObject(const sptr<IRemoteObject> & object)63 bool MessageParcel::WriteRemoteObject(const sptr<IRemoteObject> &object)
64 {
65     return Assistant::ins_->Bool();
66 }
67 
WriteBool(bool value)68 bool Parcel::WriteBool(bool value)
69 {
70     return Assistant::ins_->Bool();
71 }
72 } // namespace OHOS