From 95e3b5b5b97b04659b70a5be4ed7df09c6896bec Mon Sep 17 00:00:00 2001 From: zhujc0606 Date: Thu, 6 Apr 2023 15:52:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?IssueNo:call=5Fmanager=20=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BD=93=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: call_manager Sig: SIG_Telephony Feature or Bugfix:call_manager 结构体整改 Binary Source: No Signed-off-by: zhujc0606 Change-Id: Ic9fb75bd69364a03ab38c2e8cfa045c2e0570850 --- .../js/napi/include/napi_call_manager_types.h | 112 +++---- .../innerkits/call_manager_inner_type.h | 280 +++++++++--------- services/audio/include/ring.h | 4 +- services/audio/include/tone.h | 6 +- services/call/include/call_request_handler.h | 22 +- services/call/include/common_type.h | 36 +-- 6 files changed, 230 insertions(+), 230 deletions(-) diff --git a/frameworks/js/napi/include/napi_call_manager_types.h b/frameworks/js/napi/include/napi_call_manager_types.h index 260826b5..e4a2e730 100644 --- a/frameworks/js/napi/include/napi_call_manager_types.h +++ b/frameworks/js/napi/include/napi_call_manager_types.h @@ -48,115 +48,115 @@ const int16_t UNKNOWN_EVENT = 0; struct AsyncContext { virtual ~AsyncContext() {} - napi_env env; - napi_async_work work; - napi_deferred deferred; - napi_ref callbackRef; - int32_t callId; + napi_env env = nullptr; + napi_async_work work = nullptr; + napi_deferred deferred = nullptr; + napi_ref callbackRef = nullptr; + int32_t callId = 0; int32_t resolved = TELEPHONY_ERROR; - char number[kMaxNumberLen + 1]; - size_t numberLen; - napi_value value[VALUE_MAXIMUM_LIMIT]; - size_t valueLen; + char number[kMaxNumberLen + 1] = { 0 }; + size_t numberLen = 0; + napi_value value[VALUE_MAXIMUM_LIMIT] = { 0 }; + size_t valueLen = 0; int32_t errorCode = TELEPHONY_SUCCESS; int32_t eventId = UNKNOWN_EVENT; }; struct DialAsyncContext : AsyncContext { - int32_t accountId; - int32_t videoState; - int32_t dialScene; - int32_t dialType; + int32_t accountId = 0; + int32_t videoState = 0; + int32_t dialScene = 0; + int32_t dialType = 0; }; struct AnswerAsyncContext : AsyncContext { - int32_t videoState; + int32_t videoState = 0; }; struct BoolResultAsyncContext : AsyncContext { - int32_t slotId; - bool enabled; + int32_t slotId = 0; + bool enabled = false; }; struct IntResultAsyncContext : AsyncContext { - int32_t result; + int32_t result = 0; }; struct RejectAsyncContext : AsyncContext { - bool isSendSms; - std::string messageContent; + bool isSendSms = false; + std::string messageContent = ""; }; struct ListAsyncContext : AsyncContext { - std::vector listResult; + std::vector listResult {}; }; struct SupplementAsyncContext : AsyncContext { - int32_t slotId; - int32_t type; - int32_t mode; - std::string content; - bool flag; - napi_ref thisVar; + int32_t slotId = 0; + int32_t type = 0; + int32_t mode = 0; + std::string content = ""; + bool flag = false; + napi_ref thisVar = nullptr; }; struct ImsSwitchAsyncContext : AsyncContext { - int32_t slotId; - bool enabled; + int32_t slotId = 0; + bool enabled = false; }; struct CallRestrictionAsyncContext : AsyncContext { - int32_t slotId; + int32_t slotId = 0; CallRestrictionInfo info; - napi_ref thisVar; + napi_ref thisVar = nullptr; }; struct CallTransferAsyncContext : AsyncContext { - int32_t slotId; + int32_t slotId = 0; CallTransferInfo info; - napi_ref thisVar; + napi_ref thisVar = nullptr; }; struct UtilsAsyncContext : AsyncContext { - int32_t slotId; - bool enabled; - std::u16string formatNumber; - std::string code; + int32_t slotId = 0; + bool enabled = false; + std::u16string formatNumber = u""; + std::string code = ""; }; struct EventCallback { EventCallback() : env(nullptr), thisVar(nullptr), callbackRef(nullptr), deferred(nullptr), callbackBeginTime_(0) {} - napi_env env; - napi_ref thisVar; - napi_ref callbackRef; - napi_deferred deferred; + napi_env env = nullptr; + napi_ref thisVar = nullptr; + napi_ref callbackRef = nullptr; + napi_deferred deferred = nullptr; time_t callbackBeginTime_; }; struct AudioAsyncContext : AsyncContext { - bool isMute; - std::string address; - int32_t deviceType; + bool isMute = false; + std::string address = ""; + int32_t deviceType = 0; }; struct VideoAsyncContext : AsyncContext { - int32_t x; - int32_t y; - int32_t z; - int32_t width; - int32_t height; - double zoomRatio; - int32_t rotation; - int32_t callingUid; - int32_t callingPid; - std::string cameraId; - std::u16string callingPackage; - char path[kMaxNumberLen + 1]; + int32_t x = 0; + int32_t y = 0; + int32_t z = 0; + int32_t width = 0; + int32_t height = 0; + double zoomRatio = 0; + int32_t rotation = 0; + int32_t callingUid = 0; + int32_t callingPid = 0; + std::string cameraId = ""; + std::u16string callingPackage = u""; + char path[kMaxNumberLen + 1] = { 0 }; }; struct OttCallAsyncContext : AsyncContext { - std::vector ottVec; + std::vector ottVec {}; }; struct OttEventAsyncContext : AsyncContext { diff --git a/interfaces/innerkits/call_manager_inner_type.h b/interfaces/innerkits/call_manager_inner_type.h index bf809f3c..5d6f1792 100644 --- a/interfaces/innerkits/call_manager_inner_type.h +++ b/interfaces/innerkits/call_manager_inner_type.h @@ -112,10 +112,10 @@ enum class CallEndedType { }; struct SIMCardInfo { - int32_t simId; // IccId - int32_t country; - int32_t state; // SIM card active status - PhoneNetType phoneNetType; + int32_t simId = 0; // IccId + int32_t country = 0; + int32_t state = 0; // SIM card active status + PhoneNetType phoneNetType = PhoneNetType::PHONE_TYPE_CDMA; }; enum class DialType { @@ -154,38 +154,38 @@ enum class CallAnswerType { }; struct CallAttributeInfo { - char accountNumber[kMaxNumberLen + 1]; - char bundleName[kMaxBundleNameLen + 1]; - bool speakerphoneOn; - int32_t accountId; - VideoStateType videoState; - int64_t startTime; // Call start time - bool isEcc; - CallType callType; - int32_t callId; - TelCallState callState; - TelConferenceState conferenceState; - time_t callBeginTime; - time_t callEndTime; - time_t ringBeginTime; - time_t ringEndTime; - CallDirection callDirection; - CallAnswerType answerType; + char accountNumber[kMaxNumberLen + 1] = { 0 }; + char bundleName[kMaxBundleNameLen + 1] = { 0 }; + bool speakerphoneOn = false; + int32_t accountId = 0; + VideoStateType videoState = VideoStateType::TYPE_VIDEO; + int64_t startTime = 0; // Call start time + bool isEcc = false; + CallType callType = CallType::TYPE_CS; + int32_t callId = 0; + TelCallState callState = TelCallState::CALL_STATUS_ACTIVE; + TelConferenceState conferenceState = TelConferenceState::TEL_CONFERENCE_ACTIVE; + time_t callBeginTime = 0; + time_t callEndTime = 0; + time_t ringBeginTime = 0; + time_t ringEndTime = 0; + CallDirection callDirection = CallDirection::CALL_DIRECTION_IN; + CallAnswerType answerType = CallAnswerType::CALL_ANSWER_ACTIVED; }; struct CallRecordInfo { - int32_t callId; - char phoneNumber[kMaxNumberLen + 1]; - char formattedPhoneNumber[kMaxNumberLen + 1]; - CallType callType; - time_t callBeginTime; - time_t callEndTime; - uint32_t ringDuration; - uint32_t callDuration; - CallDirection directionType; - CallAnswerType answerType; - int32_t countryCode; - int32_t slotId; + int32_t callId = 0; + char phoneNumber[kMaxNumberLen + 1] = { 0 }; + char formattedPhoneNumber[kMaxNumberLen + 1] = { 0 }; + CallType callType = CallType::TYPE_CS; + time_t callBeginTime = 0; + time_t callEndTime = 0; + uint32_t ringDuration = 0; + uint32_t callDuration = 0; + CallDirection directionType = CallDirection::CALL_DIRECTION_IN; + CallAnswerType answerType = CallAnswerType::CALL_ANSWER_ACTIVED; + int32_t countryCode = 0; + int32_t slotId = 0; }; enum class CallAbilityEventId { @@ -195,31 +195,31 @@ enum class CallAbilityEventId { }; struct CallEventInfo { - CallAbilityEventId eventId; - char phoneNum[kMaxNumberLen + 1]; - char bundleName[kMaxBundleNameLen + 1]; + CallAbilityEventId eventId = CallAbilityEventId::EVENT_DIAL_NO_CARRIER; + char phoneNum[kMaxNumberLen + 1] = { 0 }; + char bundleName[kMaxBundleNameLen + 1] = { 0 }; }; struct AccountInfo { - int32_t accountId; - int32_t power; - char bundleName[kMaxNumberLen + 1]; - bool isEnabled; + int32_t accountId = 0; + int32_t power = 0; + char bundleName[kMaxNumberLen + 1] = { 0 }; + bool isEnabled = false; }; struct CallReportInfo { - int32_t index; - char accountNum[kMaxNumberLen + 1]; // call phone number - int32_t accountId; - CallType callType; // call type: CS、IMS - VideoStateType callMode; // call mode: video or audio - TelCallState state; // call state - int32_t voiceDomain; // 0:CS、1:IMS + int32_t index = 0; + char accountNum[kMaxNumberLen + 1] = { 0 }; // call phone number + int32_t accountId = 0; + CallType callType = CallType::TYPE_CS; // call type: CS、IMS + VideoStateType callMode = VideoStateType::TYPE_VOICE; // call mode: video or audio + TelCallState state = TelCallState::CALL_STATUS_ACTIVE; // call state + int32_t voiceDomain = 0; // 0:CS、1:IMS }; struct CallsReportInfo { - std::vector callVec; - int32_t slotId; + std::vector callVec {}; + int32_t slotId = 0; }; /* @@ -312,8 +312,8 @@ enum class DisconnectedReason : int32_t { }; struct DisconnectedDetails { - DisconnectedReason reason; - std::string message; + DisconnectedReason reason = DisconnectedReason::ACCESS_CLASS_BLOCKED; + std::string message = ""; }; enum class AudioDeviceType { @@ -414,8 +414,8 @@ enum class CallResultReportId { }; struct CellularCallEventInfo { - CellularCallEventType eventType; - RequestResultEventId eventId; + CellularCallEventType eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE; + RequestResultEventId eventId = RequestResultEventId::INVALID_REQUEST_RESULT_EVENT_ID; }; enum class RBTPlayInfo { @@ -424,48 +424,48 @@ enum class RBTPlayInfo { }; struct CallWaitResponse { - int32_t result; // 0: ok other: error - int32_t status; - int32_t classCw; + int32_t result = 0; // 0: ok other: error + int32_t status = 0; + int32_t classCw = 0; }; struct ClipResponse { - int32_t result; // 0: ok other: error - int32_t action; - int32_t clipStat; + int32_t result = 0; // 0: ok other: error + int32_t action = 0; + int32_t clipStat = 0; }; struct ClirResponse { - int32_t result; // 0: ok other: error - int32_t action; - int32_t clirStat; + int32_t result = 0; // 0: ok other: error + int32_t action = 0; + int32_t clirStat = 0; }; struct ColrResponse { - int32_t result; // 0: ok other: error - int32_t action; - int32_t colrStat; + int32_t result = 0; // 0: ok other: error + int32_t action = 0; + int32_t colrStat = 0; }; struct ColpResponse { - int32_t result; // 0: ok other: error - int32_t action; - int32_t colpStat; + int32_t result = 0; // 0: ok other: error + int32_t action = 0; + int32_t colpStat = 0; }; struct MmiCodeInfo { - int32_t result; // 0: ok other: error - char message[kMaxNumberLen + 1]; + int32_t result = 0; // 0: ok other: error + char message[kMaxNumberLen + 1] = { 0 }; }; struct CallTransferResponse { - int32_t result; // 0: ok other: error - int32_t status; - int32_t classx; - int32_t type; - char number[kMaxNumberLen + 1]; - int32_t reason; - int32_t time; + int32_t result = 0; // 0: ok other: error + int32_t status = 0; + int32_t classx = 0; + int32_t type = 0; + char number[kMaxNumberLen + 1] = { 0 }; + int32_t reason = 0; + int32_t time = 0; int32_t startHour = INVALID_TIME; int32_t startMinute = INVALID_TIME; int32_t endHour = INVALID_TIME; @@ -473,50 +473,50 @@ struct CallTransferResponse { }; struct CallRestrictionResponse { - int32_t result; // 0: ok other: error - int32_t status; // parameter sets/shows the result code presentation status in the TA - int32_t classCw; // parameter shows the subscriber CLIP service status in the network, <0-4> + int32_t result = 0; // 0: ok other: error + int32_t status = 0; // parameter sets/shows the result code presentation status in the TA + int32_t classCw = 0; // parameter shows the subscriber CLIP service status in the network, <0-4> }; struct CallPreferenceResponse { - int32_t result; // 0: ok other: error + int32_t result = 0; // 0: ok other: error /* * 1:CS Voice only * 2:CS Voice preferred, IMS PS Voice as secondary * 3:IMS PS Voice preferred, CS Voice as secondary * 4:IMS PS Voice only */ - int32_t mode; + int32_t mode = 0; }; struct GetImsConfigResponse { - int32_t result; - int32_t value; + int32_t result = 0; + int32_t value = 0; }; struct GetImsFeatureValueResponse { - int32_t result; - int32_t value; + int32_t result = 0; + int32_t value = 0; }; struct GetLteEnhanceModeResponse { - int32_t result; - int32_t value; + int32_t result = 0; + int32_t value = 0; }; struct MuteControlResponse { - int32_t result; - int32_t value; // 0: Un mute 1: Set mute + int32_t result = 0; + int32_t value = 0; // 0: Un mute 1: Set mute }; struct CellularCallInfo { - int32_t callId; // uuid - char phoneNum[kMaxNumberLen]; // call phone number - int32_t slotId; // del - int32_t accountId; - CallType callType; // call type: CS、IMS - int32_t videoState; // 0: audio 1:video - int32_t index; // CallInfo index + int32_t callId = 0; // uuid + char phoneNum[kMaxNumberLen] = { 0 }; // call phone number + int32_t slotId = 0; // del + int32_t accountId = 0; + CallType callType = CallType::TYPE_CS; // call type: CS、IMS + int32_t videoState = 0; // 0: audio 1:video + int32_t index = 0; // CallInfo index }; /** @@ -552,13 +552,13 @@ enum class CallTransferType { }; struct CallTransferInfo { - char transferNum[kMaxNumberLen + 1]; - CallTransferSettingType settingType; - CallTransferType type; - int32_t startHour; - int32_t startMinute; - int32_t endHour; - int32_t endMinute; + char transferNum[kMaxNumberLen + 1] = { 0 }; + CallTransferSettingType settingType = CallTransferSettingType::CALL_TRANSFER_DISABLE; + CallTransferType type = CallTransferType::TRANSFER_TYPE_BUSY; + int32_t startHour = 0; + int32_t startMinute = 0; + int32_t endHour = 0; + int32_t endMinute = 0; }; enum class SsRequestType { @@ -570,11 +570,11 @@ enum class SsRequestType { }; struct VideoWindow { - int32_t x; - int32_t y; - int32_t z; - int32_t width; - int32_t height; + int32_t x = 0; + int32_t y = 0; + int32_t z = 0; + int32_t width = 0; + int32_t height = 0; }; // 3GPP TS 22.030 V4.0.0 (2001-03) @@ -597,9 +597,9 @@ enum class CallRestrictionMode { }; struct CallRestrictionInfo { - char password[kMaxNumberLen + 1]; - CallRestrictionType fac; - CallRestrictionMode mode; + char password[kMaxNumberLen + 1] = { 0 }; + CallRestrictionType fac = CallRestrictionType::RESTRICTION_TYPE_ALL_CALLS; + CallRestrictionMode mode = CallRestrictionMode::RESTRICTION_MODE_ACTIVATION; }; // 3GPP TS 27.007 V3.9.0 (2001-06) Call related supplementary services +CHLD @@ -633,13 +633,13 @@ enum ImsCallMode { }; struct CallMediaModeRequest { - char phoneNum[kMaxNumberLen + 1]; - ImsCallMode mode; + char phoneNum[kMaxNumberLen + 1] = { 0 }; + ImsCallMode mode = ImsCallMode::CALL_MODE_AUDIO_ONLY; }; struct CallMediaModeResponse { - char phoneNum[kMaxNumberLen + 1]; - int32_t result; + char phoneNum[kMaxNumberLen + 1] = { 0 }; + int32_t result = 0; }; enum ImsConfigItem { @@ -709,16 +709,16 @@ enum class OttCallRequestId { }; struct OttCallRequestInfo { - char phoneNum[kMaxNumberLen + 1]; // call phone number - char bundleName[kMaxBundleNameLen + 1]; - VideoStateType videoState; // 0: audio 1:video + char phoneNum[kMaxNumberLen + 1] = { 0 }; // call phone number + char bundleName[kMaxBundleNameLen + 1] = { 0 }; + VideoStateType videoState = VideoStateType::TYPE_VIDEO; // 0: audio 1:video }; struct OttCallDetailsInfo { - char phoneNum[kMaxNumberLen + 1]; // call phone number - char bundleName[kMaxBundleNameLen + 1]; - VideoStateType videoState; // 0: audio 1:video - TelCallState callState; + char phoneNum[kMaxNumberLen + 1] = { 0 }; // call phone number + char bundleName[kMaxBundleNameLen + 1] = { 0 }; + VideoStateType videoState = VideoStateType::TYPE_VIDEO; // 0: audio 1:video + TelCallState callState = TelCallState::CALL_STATUS_ACTIVE; }; enum class OttCallEventId { @@ -726,36 +726,36 @@ enum class OttCallEventId { }; struct OttCallEventInfo { - OttCallEventId ottCallEventId; - char bundleName[kMaxBundleNameLen + 1]; + OttCallEventId ottCallEventId = OttCallEventId::OTT_CALL_EVENT_FUNCTION_UNSUPPORTED; + char bundleName[kMaxBundleNameLen + 1] = { 0 }; }; struct CallDetailInfo { - int32_t index; - char phoneNum[kMaxNumberLen + 1]; // call phone number - char bundleName[kMaxBundleNameLen + 1]; - int32_t accountId; - CallType callType; // call type: CS、IMS - VideoStateType callMode; // call mode: video or audio - TelCallState state; // call state - int32_t voiceDomain; // 0:CS、1:IMS + int32_t index = 0; + char phoneNum[kMaxNumberLen + 1] = { 0 }; // call phone number + char bundleName[kMaxBundleNameLen + 1] = { 0 }; + int32_t accountId = 0; + CallType callType = CallType::TYPE_CS; // call type: CS、IMS + VideoStateType callMode = VideoStateType::TYPE_VIDEO; // call mode: video or audio + TelCallState state = TelCallState::CALL_STATUS_ACTIVE; // call state + int32_t voiceDomain = 0; // 0:CS、1:IMS }; struct CallDetailsInfo { - std::vector callVec; - int32_t slotId; - char bundleName[kMaxBundleNameLen + 1]; + std::vector callVec {}; + int32_t slotId = 0; + char bundleName[kMaxBundleNameLen + 1] = { 0 }; }; struct AudioDevice { - AudioDeviceType deviceType; - char address[kMaxAddressLen + 1]; + AudioDeviceType deviceType = AudioDeviceType::DEVICE_BLUETOOTH_SCO; + char address[kMaxAddressLen + 1] = { 0 }; }; struct AudioDeviceInfo { - std::vector audioDeviceList; + std::vector audioDeviceList {}; AudioDevice currentAudioDevice; - bool isMuted; + bool isMuted = false; }; enum class MmiCodeResult { diff --git a/services/audio/include/ring.h b/services/audio/include/ring.h index b3db3624..37db268a 100644 --- a/services/audio/include/ring.h +++ b/services/audio/include/ring.h @@ -26,8 +26,8 @@ namespace OHOS { namespace Telephony { struct RingtoneStream { - std::string ringtonePath; - uint32_t playedPosition; + std::string ringtonePath = ""; + uint32_t playedPosition = 0; }; enum RingState { RINGING = 0, diff --git a/services/audio/include/tone.h b/services/audio/include/tone.h index 76151a96..e4701fcb 100644 --- a/services/audio/include/tone.h +++ b/services/audio/include/tone.h @@ -48,9 +48,9 @@ enum ToneDescriptor { TONE_DTMF_CHAR_W }; struct ToneStream { - ToneDescriptor toneDescriptor; - int32_t duration; - int32_t volume; + ToneDescriptor toneDescriptor = ToneDescriptor::TONE_CALL_RECORDING; + int32_t duration = 0; + int32_t volume = 0; }; /** diff --git a/services/call/include/call_request_handler.h b/services/call/include/call_request_handler.h index 85e41581..aca792ff 100644 --- a/services/call/include/call_request_handler.h +++ b/services/call/include/call_request_handler.h @@ -29,29 +29,29 @@ namespace OHOS { namespace Telephony { struct AnswerCallPara { - int32_t callId; - int32_t videoState; + int32_t callId = 0; + int32_t videoState = 0; }; struct RejectCallPara { - int32_t callId; - bool isSendSms; - char content[REJECT_CALL_MSG_MAX_LEN + 1]; + int32_t callId = 0; + bool isSendSms = 0; + char content[REJECT_CALL_MSG_MAX_LEN + 1] = { 0 }; }; struct StartRttPara { - int32_t callId; - std::u16string msg; + int32_t callId = 0; + std::u16string msg = u""; }; struct CallMediaUpdatePara { - int32_t callId; - ImsCallMode mode; + int32_t callId = 0; + ImsCallMode mode = ImsCallMode::CALL_MODE_AUDIO_ONLY; }; struct JoinConferencePara { - int32_t callId; - std::vector numberList; + int32_t callId = 0; + std::vector numberList {}; }; /** diff --git a/services/call/include/common_type.h b/services/call/include/common_type.h index 136a3662..9c19b47a 100644 --- a/services/call/include/common_type.h +++ b/services/call/include/common_type.h @@ -35,17 +35,17 @@ struct DialParaInfo { DialParaInfo() : accountId(0), callId(0), index(0), dialType(DialType::DIAL_CARRIER_TYPE), videoState(VideoStateType::TYPE_VOICE), callType(CallType::TYPE_ERR_CALL), callState(TelCallState::CALL_STATUS_IDLE), isDialing(false), isEcc(false) {} - int32_t accountId; - int32_t callId; - int32_t index; - std::string number; - DialType dialType; - VideoStateType videoState; - CallType callType; - TelCallState callState; - bool isDialing; - bool isEcc; - std::string bundleName; + int32_t accountId = 0; + int32_t callId = 0; + int32_t index = 0; + std::string number = ""; + DialType dialType = DialType::DIAL_CARRIER_TYPE; + VideoStateType videoState = VideoStateType::TYPE_VIDEO; + CallType callType = CallType::TYPE_CS; + TelCallState callState = TelCallState::CALL_STATUS_ACTIVE; + bool isDialing = false; + bool isEcc = false; + std::string bundleName = ""; }; enum PolicyFlag : uint64_t { @@ -74,13 +74,13 @@ enum PolicyFlag : uint64_t { }; struct ContactInfo { - char name[CONTACT_NAME_LEN]; - char number[kMaxNumberLen]; - bool isContacterExists; - char ringtonePath[FILE_PATH_MAX_LEN]; - bool isSendToVoicemail; - bool isEcc; - bool isVoiceMail; + char name[CONTACT_NAME_LEN] = { 0 }; + char number[kMaxNumberLen] = { 0 }; + bool isContacterExists = false; + char ringtonePath[FILE_PATH_MAX_LEN] = { 0 }; + bool isSendToVoicemail = false; + bool isEcc = false; + bool isVoiceMail = false; }; } // namespace Telephony } // namespace OHOS -- Gitee From 92c1ef185facee8e7349233581d6b6bb400d7c53 Mon Sep 17 00:00:00 2001 From: zhujc0606 Date: Sat, 15 Apr 2023 17:16:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?IssueNo:call=5Fmanager=20=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BD=93=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: call_manager Sig: SIG_Telephony Feature or Bugfix:call_manager Binary Source: No Signed-off-by: zhujc0606 Change-Id: Iaa244e103c1281d4b02e48c326bed4920262d462 --- .../innerkits/call_manager_inner_type.h | 48 +++++++++---------- services/audio/include/tone.h | 2 +- services/call/include/common_type.h | 6 +-- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/interfaces/innerkits/call_manager_inner_type.h b/interfaces/innerkits/call_manager_inner_type.h index 5d6f1792..539828ea 100644 --- a/interfaces/innerkits/call_manager_inner_type.h +++ b/interfaces/innerkits/call_manager_inner_type.h @@ -115,7 +115,7 @@ struct SIMCardInfo { int32_t simId = 0; // IccId int32_t country = 0; int32_t state = 0; // SIM card active status - PhoneNetType phoneNetType = PhoneNetType::PHONE_TYPE_CDMA; + PhoneNetType phoneNetType = PhoneNetType::PHONE_TYPE_GSM; }; enum class DialType { @@ -158,32 +158,32 @@ struct CallAttributeInfo { char bundleName[kMaxBundleNameLen + 1] = { 0 }; bool speakerphoneOn = false; int32_t accountId = 0; - VideoStateType videoState = VideoStateType::TYPE_VIDEO; + VideoStateType videoState = VideoStateType::TYPE_VOICE; int64_t startTime = 0; // Call start time bool isEcc = false; - CallType callType = CallType::TYPE_CS; + CallType callType = CallType::TYPE_ERR_CALL; int32_t callId = 0; - TelCallState callState = TelCallState::CALL_STATUS_ACTIVE; - TelConferenceState conferenceState = TelConferenceState::TEL_CONFERENCE_ACTIVE; + TelCallState callState = TelCallState::CALL_STATUS_UNKNOWN; + TelConferenceState conferenceState = TelConferenceState::TEL_CONFERENCE_IDLE; time_t callBeginTime = 0; time_t callEndTime = 0; time_t ringBeginTime = 0; time_t ringEndTime = 0; - CallDirection callDirection = CallDirection::CALL_DIRECTION_IN; - CallAnswerType answerType = CallAnswerType::CALL_ANSWER_ACTIVED; + CallDirection callDirection = CallDirection::CALL_DIRECTION_UNKNOW; + CallAnswerType answerType = CallAnswerType::CALL_ANSWER_MISSED; }; struct CallRecordInfo { int32_t callId = 0; char phoneNumber[kMaxNumberLen + 1] = { 0 }; char formattedPhoneNumber[kMaxNumberLen + 1] = { 0 }; - CallType callType = CallType::TYPE_CS; + CallType callType = CallType::TYPE_ERR_CALL; time_t callBeginTime = 0; time_t callEndTime = 0; uint32_t ringDuration = 0; uint32_t callDuration = 0; - CallDirection directionType = CallDirection::CALL_DIRECTION_IN; - CallAnswerType answerType = CallAnswerType::CALL_ANSWER_ACTIVED; + CallDirection directionType = CallDirection::CALL_DIRECTION_UNKNOW; + CallAnswerType answerType = CallAnswerType::CALL_ANSWER_MISSED; int32_t countryCode = 0; int32_t slotId = 0; }; @@ -211,9 +211,9 @@ struct CallReportInfo { int32_t index = 0; char accountNum[kMaxNumberLen + 1] = { 0 }; // call phone number int32_t accountId = 0; - CallType callType = CallType::TYPE_CS; // call type: CS、IMS + CallType callType = CallType::TYPE_ERR_CALL; // call type: CS、IMS VideoStateType callMode = VideoStateType::TYPE_VOICE; // call mode: video or audio - TelCallState state = TelCallState::CALL_STATUS_ACTIVE; // call state + TelCallState state = TelCallState::CALL_STATUS_UNKNOWN; // call state int32_t voiceDomain = 0; // 0:CS、1:IMS }; @@ -312,7 +312,7 @@ enum class DisconnectedReason : int32_t { }; struct DisconnectedDetails { - DisconnectedReason reason = DisconnectedReason::ACCESS_CLASS_BLOCKED; + DisconnectedReason reason = DisconnectedReason::FAILED_UNKNOWN; std::string message = ""; }; @@ -514,7 +514,7 @@ struct CellularCallInfo { char phoneNum[kMaxNumberLen] = { 0 }; // call phone number int32_t slotId = 0; // del int32_t accountId = 0; - CallType callType = CallType::TYPE_CS; // call type: CS、IMS + CallType callType = CallType::TYPE_ERR_CALL; // call type: CS、IMS int32_t videoState = 0; // 0: audio 1:video int32_t index = 0; // CallInfo index }; @@ -554,7 +554,7 @@ enum class CallTransferType { struct CallTransferInfo { char transferNum[kMaxNumberLen + 1] = { 0 }; CallTransferSettingType settingType = CallTransferSettingType::CALL_TRANSFER_DISABLE; - CallTransferType type = CallTransferType::TRANSFER_TYPE_BUSY; + CallTransferType type = CallTransferType::TRANSFER_TYPE_UNCONDITIONAL; int32_t startHour = 0; int32_t startMinute = 0; int32_t endHour = 0; @@ -598,8 +598,8 @@ enum class CallRestrictionMode { struct CallRestrictionInfo { char password[kMaxNumberLen + 1] = { 0 }; - CallRestrictionType fac = CallRestrictionType::RESTRICTION_TYPE_ALL_CALLS; - CallRestrictionMode mode = CallRestrictionMode::RESTRICTION_MODE_ACTIVATION; + CallRestrictionType fac = CallRestrictionType::RESTRICTION_TYPE_ALL_INCOMING; + CallRestrictionMode mode = CallRestrictionMode::RESTRICTION_MODE_DEACTIVATION; }; // 3GPP TS 27.007 V3.9.0 (2001-06) Call related supplementary services +CHLD @@ -711,14 +711,14 @@ enum class OttCallRequestId { struct OttCallRequestInfo { char phoneNum[kMaxNumberLen + 1] = { 0 }; // call phone number char bundleName[kMaxBundleNameLen + 1] = { 0 }; - VideoStateType videoState = VideoStateType::TYPE_VIDEO; // 0: audio 1:video + VideoStateType videoState = VideoStateType::TYPE_VOICE; // 0: audio 1:video }; struct OttCallDetailsInfo { char phoneNum[kMaxNumberLen + 1] = { 0 }; // call phone number char bundleName[kMaxBundleNameLen + 1] = { 0 }; - VideoStateType videoState = VideoStateType::TYPE_VIDEO; // 0: audio 1:video - TelCallState callState = TelCallState::CALL_STATUS_ACTIVE; + VideoStateType videoState = VideoStateType::TYPE_VOICE; // 0: audio 1:video + TelCallState callState = TelCallState::CALL_STATUS_UNKNOWN; }; enum class OttCallEventId { @@ -735,9 +735,9 @@ struct CallDetailInfo { char phoneNum[kMaxNumberLen + 1] = { 0 }; // call phone number char bundleName[kMaxBundleNameLen + 1] = { 0 }; int32_t accountId = 0; - CallType callType = CallType::TYPE_CS; // call type: CS、IMS - VideoStateType callMode = VideoStateType::TYPE_VIDEO; // call mode: video or audio - TelCallState state = TelCallState::CALL_STATUS_ACTIVE; // call state + CallType callType = CallType::TYPE_ERR_CALL; // call type: CS、IMS + VideoStateType callMode = VideoStateType::TYPE_VOICE; // call mode: video or audio + TelCallState state = TelCallState::CALL_STATUS_UNKNOWN; // call state int32_t voiceDomain = 0; // 0:CS、1:IMS }; @@ -748,7 +748,7 @@ struct CallDetailsInfo { }; struct AudioDevice { - AudioDeviceType deviceType = AudioDeviceType::DEVICE_BLUETOOTH_SCO; + AudioDeviceType deviceType = AudioDeviceType::DEVICE_UNKNOWN; char address[kMaxAddressLen + 1] = { 0 }; }; diff --git a/services/audio/include/tone.h b/services/audio/include/tone.h index e4701fcb..8ecffa9d 100644 --- a/services/audio/include/tone.h +++ b/services/audio/include/tone.h @@ -48,7 +48,7 @@ enum ToneDescriptor { TONE_DTMF_CHAR_W }; struct ToneStream { - ToneDescriptor toneDescriptor = ToneDescriptor::TONE_CALL_RECORDING; + ToneDescriptor toneDescriptor = ToneDescriptor::TONE_UNKNOWN; int32_t duration = 0; int32_t volume = 0; }; diff --git a/services/call/include/common_type.h b/services/call/include/common_type.h index 9c19b47a..c7d191d2 100644 --- a/services/call/include/common_type.h +++ b/services/call/include/common_type.h @@ -40,9 +40,9 @@ struct DialParaInfo { int32_t index = 0; std::string number = ""; DialType dialType = DialType::DIAL_CARRIER_TYPE; - VideoStateType videoState = VideoStateType::TYPE_VIDEO; - CallType callType = CallType::TYPE_CS; - TelCallState callState = TelCallState::CALL_STATUS_ACTIVE; + VideoStateType videoState = VideoStateType::TYPE_VOICE; + CallType callType = CallType::TYPE_ERR_CALL; + TelCallState callState = TelCallState::CALL_STATUS_UNKNOWN; bool isDialing = false; bool isEcc = false; std::string bundleName = ""; -- Gitee