1 /* 2 * Copyright (c) 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 "default_params.h" 17 18 namespace OHOS { 19 namespace Msdp { 20 namespace DeviceStatus { DefaultParam(int32_t userData)21DefaultParam::DefaultParam(int32_t userData) 22 : userData(userData) 23 {} 24 Marshalling(MessageParcel & parcel) const25bool DefaultParam::Marshalling(MessageParcel &parcel) const 26 { 27 return parcel.WriteInt32(userData); 28 } 29 Unmarshalling(MessageParcel & parcel)30bool DefaultParam::Unmarshalling(MessageParcel &parcel) 31 { 32 return parcel.ReadInt32(userData); 33 } 34 Marshalling(MessageParcel & parcel) const35bool DefaultReply::Marshalling(MessageParcel &parcel) const 36 { 37 return true; 38 } 39 Unmarshalling(MessageParcel & parcel)40bool DefaultReply::Unmarshalling(MessageParcel &parcel) 41 { 42 return true; 43 } 44 BooleanReply(bool state)45BooleanReply::BooleanReply(bool state) : state(state) 46 {} 47 Marshalling(MessageParcel & parcel) const48__attribute__((no_sanitize("cfi"))) bool BooleanReply::Marshalling(MessageParcel &parcel) const 49 { 50 return parcel.WriteBool(state); 51 } 52 Unmarshalling(MessageParcel & parcel)53bool BooleanReply::Unmarshalling(MessageParcel &parcel) 54 { 55 return parcel.ReadBool(state); 56 } 57 } // namespace DeviceStatus 58 } // namespace Msdp 59 } // namespace OHOS