1 /*
2  * Copyright (C) 2021 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 "call_manager_utils.h"
17 #include "call_manager_base.h"
18 
19 namespace OHOS {
20 namespace Telephony {
21 
WriteCallAttributeInfo(const CallAttributeInfo & info,MessageParcel & messageParcel)22 void CallManagerUtils::WriteCallAttributeInfo(const CallAttributeInfo &info, MessageParcel &messageParcel)
23 {
24     messageParcel.WriteCString(info.accountNumber);
25     messageParcel.WriteCString(info.bundleName);
26     messageParcel.WriteBool(info.speakerphoneOn);
27     messageParcel.WriteInt32(info.accountId);
28     messageParcel.WriteInt32(static_cast<int32_t>(info.videoState));
29     messageParcel.WriteInt64(info.startTime);
30     messageParcel.WriteBool(info.isEcc);
31     messageParcel.WriteInt32(static_cast<int32_t>(info.callType));
32     messageParcel.WriteInt32(info.callId);
33     messageParcel.WriteInt32(static_cast<int32_t>(info.callState));
34     messageParcel.WriteInt32(static_cast<int32_t>(info.conferenceState));
35     messageParcel.WriteInt64(info.callBeginTime);
36     messageParcel.WriteInt64(info.callEndTime);
37     messageParcel.WriteInt64(info.ringBeginTime);
38     messageParcel.WriteInt64(info.ringEndTime);
39     messageParcel.WriteInt32(static_cast<int32_t>(info.callDirection));
40     messageParcel.WriteInt32(static_cast<int32_t>(info.answerType));
41     messageParcel.WriteInt32(info.index);
42     messageParcel.WriteInt32(info.crsType);
43     messageParcel.WriteInt32(info.originalCallType);
44     messageParcel.WriteCString(info.numberLocation);
45     messageParcel.WriteInt32(static_cast<int32_t>(info.numberMarkInfo.markType));
46     messageParcel.WriteCString(info.numberMarkInfo.markContent);
47     messageParcel.WriteInt32(info.numberMarkInfo.markCount);
48     messageParcel.WriteCString(info.numberMarkInfo.markSource);
49     messageParcel.WriteBool(info.numberMarkInfo.isCloud);
50     if (info.callType == CallType::TYPE_VOIP) {
51         messageParcel.WriteString(info.voipCallInfo.voipCallId);
52         messageParcel.WriteString(info.voipCallInfo.userName);
53         messageParcel.WriteString(info.voipCallInfo.abilityName);
54         messageParcel.WriteString(info.voipCallInfo.extensionId);
55         messageParcel.WriteString(info.voipCallInfo.voipBundleName);
56         messageParcel.WriteBool(info.voipCallInfo.showBannerForIncomingCall);
57         messageParcel.WriteBool(info.voipCallInfo.isConferenceCall);
58         messageParcel.WriteBool(info.voipCallInfo.isVoiceAnswerSupported);
59         messageParcel.WriteBool(info.voipCallInfo.hasMicPermission);
60         messageParcel.WriteInt32(info.voipCallInfo.uid);
61         messageParcel.WriteUInt8Vector(info.voipCallInfo.userProfile);
62     }
63 }
64 
65 } // namespace Telephony
66 } // namespace OHOS