1 /*
2 * Copyright (c) 2022-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 "audio_log.h"
17 #include "audio_system_manager.h"
18
19 namespace OHOS {
20 namespace AudioStandard {
InterruptGroupInfo()21 InterruptGroupInfo::InterruptGroupInfo()
22 {
23 }
24
InterruptGroupInfo(int32_t interruptGroupId,int32_t mappingId,std::string groupName,std::string networkId,ConnectType type)25 InterruptGroupInfo::InterruptGroupInfo(int32_t interruptGroupId, int32_t mappingId, std::string groupName,
26 std::string networkId, ConnectType type) : interruptGroupId_(interruptGroupId), mappingId_(mappingId),
27 groupName_(groupName), networkId_(networkId), connectType_(type)
28 {}
29
~InterruptGroupInfo()30 InterruptGroupInfo::~InterruptGroupInfo()
31 {}
32
Marshalling(Parcel & parcel) const33 bool InterruptGroupInfo::Marshalling(Parcel &parcel) const
34 {
35 parcel.WriteInt32(interruptGroupId_);
36 parcel.WriteInt32(mappingId_);
37 parcel.WriteString(groupName_);
38 parcel.WriteString(networkId_);
39 parcel.WriteInt32(connectType_);
40 return true;
41 }
42
Unmarshalling(Parcel & in)43 sptr<InterruptGroupInfo> InterruptGroupInfo::Unmarshalling(Parcel &in)
44 {
45 sptr<InterruptGroupInfo> interruptGroupInfo = new(std::nothrow) InterruptGroupInfo();
46 if (interruptGroupInfo == nullptr) {
47 return nullptr;
48 }
49
50 interruptGroupInfo->interruptGroupId_ = in.ReadInt32();
51 interruptGroupInfo->mappingId_ = in.ReadInt32();
52 interruptGroupInfo->groupName_ = in.ReadString();
53 interruptGroupInfo->networkId_ = in.ReadString();
54 interruptGroupInfo->connectType_ = static_cast<ConnectType>(in.ReadInt32());
55 return interruptGroupInfo;
56 }
57 } // namespace AudioStandard
58 } // namespace OHOS
59