From 343ae5590a799d969f94a56145c9808eb63e3514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=B8=BF=E7=9D=BF?= Date: Mon, 8 Sep 2025 12:45:30 +0000 Subject: [PATCH 1/5] =?UTF-8?q?=E5=84=BF=E7=AB=A5=E8=A1=A8call=5Fmanager?= =?UTF-8?q?=E5=AF=B9dm=E5=92=8C=E8=BD=AF=E6=80=BB=E7=BA=BF=E5=81=9A?= =?UTF-8?q?=E8=A7=A3=E8=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王鸿睿 --- bundle.json | 3 +- callmanager.gni | 66 +++++++++++-------- services/audio/src/audio_proxy.cpp | 4 ++ test/fuzztest/BUILD.gn | 5 +- test/fuzztest/call_fuzzer/call_fuzzer.cpp | 6 +- test/unittest/BUILD.gn | 5 +- .../distributed_communication_test/BUILD.gn | 27 ++++---- 7 files changed, 73 insertions(+), 43 deletions(-) diff --git a/bundle.json b/bundle.json index 57e2eef6..a718e652 100644 --- a/bundle.json +++ b/bundle.json @@ -25,7 +25,8 @@ ], "features": [ "call_manager_feature_hfp_async_enable", - "call_manager_feature_not_support_multicall" + "call_manager_feature_not_support_multicall", + "call_manager_feature_support_dsoftbus" ], "adapted_system_type": [ "standard" diff --git a/callmanager.gni b/callmanager.gni index 333cf54d..b5a0cde7 100644 --- a/callmanager.gni +++ b/callmanager.gni @@ -11,7 +11,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +declare_args() { + call_manager_feature_support_dsoftbus = true +} + call_manager_path = "//base/telephony/call_manager" +call_manager_defines = [] call_manager_sources = [ "${call_manager_path}/services/antifraud/src/anonymize_adapter.cpp", @@ -102,24 +107,8 @@ call_manager_sources = [ "${call_manager_path}/services/display/src/fold_status_manager.cpp", "${call_manager_path}/services/distributed_call/src/distributed_call_manager.cpp", "${call_manager_path}/services/distributed_call/src/distributed_call_proxy.cpp", - "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_communication_manager.cpp", - "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_data_controller.cpp", - "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_data_sink_controller.cpp", - "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_data_source_controller.cpp", - "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_device_observer.cpp", - "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_sink_switch_controller.cpp", - "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_source_switch_controller.cpp", - "${call_manager_path}/services/distributed_call/src/transmission/client_session.cpp", - "${call_manager_path}/services/distributed_call/src/transmission/server_session.cpp", - "${call_manager_path}/services/distributed_call/src/transmission/session_adapter.cpp", - "${call_manager_path}/services/distributed_call/src/transmission/transmission_manager.cpp", "${call_manager_path}/services/hisysevent/src/call_manager_dump_helper.cpp", "${call_manager_path}/services/hisysevent/src/call_manager_hisysevent.cpp", - "${call_manager_path}/services/interoperable_call/src/interoperable_client_manager.cpp", - "${call_manager_path}/services/interoperable_call/src/interoperable_communication_manager.cpp", - "${call_manager_path}/services/interoperable_call/src/interoperable_data_controller.cpp", - "${call_manager_path}/services/interoperable_call/src/interoperable_device_observer.cpp", - "${call_manager_path}/services/interoperable_call/src/interoperable_server_manager.cpp", "${call_manager_path}/services/number_identity_proxy/src/number_identity_service.cpp", "${call_manager_path}/services/satellite_call/src/satellite_call_control.cpp", "${call_manager_path}/services/spam_call/src/callback_stub_helper.cpp", @@ -166,10 +155,7 @@ call_manager_include_dirs = [ "${call_manager_path}/services/display/include", "${call_manager_path}/services/distributed_call/include", "${call_manager_path}/services/distributed_call/include/dcall", - "${call_manager_path}/services/distributed_call/include/transmission", - "${call_manager_path}/services/distributed_call/include/distributed_communication", "${call_manager_path}/services/hisysevent/include", - "${call_manager_path}/services/interoperable_call/include", "${call_manager_path}/services/number_identity_proxy/include", "${call_manager_path}/services/satellite_call/include", "${call_manager_path}/services/spam_call/include", @@ -178,6 +164,40 @@ call_manager_include_dirs = [ "${call_manager_path}/utils/include", ] +if (call_manager_feature_support_dsoftbus) { + print("Support dsoftbus.") + call_manager_defines += [ "SUPPORT_DSOFTBUS" ] + call_manager_sources += [ + "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_communication_manager.cpp", + "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_data_controller.cpp", + "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_data_sink_controller.cpp", + "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_data_source_controller.cpp", + "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_device_observer.cpp", + "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_sink_switch_controller.cpp", + "${call_manager_path}/services/distributed_call/src/distributed_communication/distributed_source_switch_controller.cpp", + "${call_manager_path}/services/distributed_call/src/transmission/client_session.cpp", + "${call_manager_path}/services/distributed_call/src/transmission/server_session.cpp", + "${call_manager_path}/services/distributed_call/src/transmission/session_adapter.cpp", + "${call_manager_path}/services/distributed_call/src/transmission/transmission_manager.cpp", + "${call_manager_path}/services/interoperable_call/src/interoperable_client_manager.cpp", + "${call_manager_path}/services/interoperable_call/src/interoperable_communication_manager.cpp", + "${call_manager_path}/services/interoperable_call/src/interoperable_data_controller.cpp", + "${call_manager_path}/services/interoperable_call/src/interoperable_device_observer.cpp", + "${call_manager_path}/services/interoperable_call/src/interoperable_server_manager.cpp", + ] + + call_manager_include_dirs += [ + "${call_manager_path}/services/distributed_call/include/transmission", + "${call_manager_path}/services/distributed_call/include/distributed_communication", + "${call_manager_path}/services/interoperable_call/include", + ] + + if (target_platform == "watch") { + call_manager_defines += [ "SUPPORT_MUTE_BY_DATABASE" ] + call_manager_sources += [ "${call_manager_path}/services/interoperable_call/src/interoperable_settings_handler.cpp" ] + } +} + call_manager_external_deps = [ "ability_base:base", "ability_base:want", @@ -224,7 +244,6 @@ call_manager_external_deps = [ "samgr:samgr_proxy", ] -call_manager_defines = [] if (defined(global_parts_info) && defined(global_parts_info.communication_bluetooth) && global_parts_info.communication_bluetooth) { @@ -301,9 +320,4 @@ if (defined(global_parts_info) && defined(global_parts_info.multimedia_camera_framework) && global_parts_info.multimedia_camera_framework) { call_manager_external_deps += [ "camera_framework:camera_framework" ] -} - -if (target_platform == "watch") { - call_manager_defines += [ "SUPPORT_MUTE_BY_DATABASE" ] - call_manager_sources += [ "${call_manager_path}/services/interoperable_call/src/interoperable_settings_handler.cpp" ] -} +} \ No newline at end of file diff --git a/services/audio/src/audio_proxy.cpp b/services/audio/src/audio_proxy.cpp index 87fc2161..5425fc18 100644 --- a/services/audio/src/audio_proxy.cpp +++ b/services/audio/src/audio_proxy.cpp @@ -25,7 +25,9 @@ #include "audio_control_manager.h" #include "audio_group_manager.h" #include "distributed_call_manager.h" +#ifdef SUPPORT_DSOFTBUS #include "distributed_communication_manager.h" +#endif #include "voip_call.h" namespace OHOS { @@ -436,11 +438,13 @@ void AudioPreferDeviceChangeCallback::OnPreferredOutputDeviceUpdated( TELEPHONY_LOGE("desc size is zero"); return; } +#ifdef SUPPORT_DSOFTBUS if (DelayedSingleton::GetInstance()->IsAudioOnSink() && !DelayedSingleton::GetInstance()->IsSinkRole()) { TELEPHONY_LOGI("has already switch to distributed communication device"); return; } +#endif TELEPHONY_LOGI("OnPreferredOutputDeviceUpdated type: %{public}d", desc[0]->deviceType_); if (IsDistributedDeviceSelected(desc)) { diff --git a/test/fuzztest/BUILD.gn b/test/fuzztest/BUILD.gn index 733a4000..c13325b0 100644 --- a/test/fuzztest/BUILD.gn +++ b/test/fuzztest/BUILD.gn @@ -13,6 +13,7 @@ import("//build/config/features.gni") import("//build/test.gni") +import("../../callmanager.gni") group("fuzztest") { testonly = true @@ -35,5 +36,7 @@ group("fuzztest") { deps += [ "setpausepicture_fuzzer:fuzztest" ] deps += [ "startdtmf_fuzzer:fuzztest" ] deps += [ "telephonyinteraction_fuzzer:fuzztest" ] - deps += [ "distributedcommunication_fuzzer:fuzztest" ] + if (call_manager_feature_support_dsoftbus) { + deps += [ "distributedcommunication_fuzzer:fuzztest" ] + } } diff --git a/test/fuzztest/call_fuzzer/call_fuzzer.cpp b/test/fuzztest/call_fuzzer/call_fuzzer.cpp index 91dddc3d..74033c81 100644 --- a/test/fuzztest/call_fuzzer/call_fuzzer.cpp +++ b/test/fuzztest/call_fuzzer/call_fuzzer.cpp @@ -528,7 +528,7 @@ void AntiFraudServiceFunc(const uint8_t *data, size_t size) phoneNum, slotId, index); listener->HandleAntiFraudDetectRes(antiFraudResult); } - +#ifdef SUPPORT_DSOFTBUS void InterOperableCommunicationManagerFunc(const uint8_t *data, size_t size) { int index = 0; @@ -558,7 +558,7 @@ void InterOperableDeviceObserverFunc(const uint8_t *data, size_t size) stateCallback->OnDeviceOnline(deviceInfo); stateCallback->OnDeviceOffline(deviceInfo); } - +#endif void BluetoothCallConnectionFunc(const uint8_t *data, size_t size) { int index = 0; @@ -666,8 +666,10 @@ void DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size) OttVideoCallWindowFunc(data, size); SatelliteCallFunc(data, size); AntiFraudServiceFunc(data, size); +#ifdef SUPPORT_DSOFTBUS InterOperableCommunicationManagerFunc(data, size); InterOperableDeviceObserverFunc(data, size); +#endif BluetoothCallConnectionFunc(data, size); BluetoothCallStateFunc(data, size); CallMangerServiceFunc(data, size); diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index dc96f4ee..2b72fba2 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License. import("//build/test.gni") +import("../../callmanager.gni") CALL_MANAGER_PATH = "../.." config("call_manager_config") { @@ -125,7 +126,9 @@ group("unittest") { deps += [ "ui_client:tel_call_manager_ui_test" ] deps += [ "call_earthquake_alarm_test:tel_call_earthquake_alarm_test" ] deps += [ "call_voice_assistant_test:tel_call_voice_assistant_test" ] - deps += [ "distributed_communication_test:distributed_communication_test" ] + if (call_manager_feature_support_dsoftbus) { + deps += [ "distributed_communication_test:distributed_communication_test" ] + } deps += [ "call_manager_special_test:tel_call_manager_special1_test" ] deps += [ "call_manager_special_test:tel_call_manager_special2_test" ] deps += [ "call_manager_special_test:tel_call_manager_special3_test" ] diff --git a/test/unittest/distributed_communication_test/BUILD.gn b/test/unittest/distributed_communication_test/BUILD.gn index 0df5a628..acaa9a09 100644 --- a/test/unittest/distributed_communication_test/BUILD.gn +++ b/test/unittest/distributed_communication_test/BUILD.gn @@ -15,6 +15,7 @@ import("//build/test.gni") import("../../../callmanager.gni") CALL_MANAGER_PATH = "../../.." +sources = [] ohos_unittest("distributed_communication_test") { install_enable = true subsystem_name = "telephony" @@ -29,18 +30,20 @@ ohos_unittest("distributed_communication_test") { } branch_protector_ret = "pac_ret" - sources = [ - "src/distributed_communication_manager_test.cpp", - "src/distributed_data_test.cpp", - "src/distributed_dev_observer_test.cpp", - "src/distributed_dev_switch_test.cpp", - "src/distributed_transmission_test.cpp", - "src/interoperable_client_manager_test.cpp", - "src/interoperable_communication_manager_test.cpp", - "src/interoperable_data_controller_test.cpp", - "src/interoperable_device_observer_test.cpp", - "src/interoperable_server_manager_test.cpp", - ] + if (call_manager_feature_support_dsoftbus) { + sources = [ + "src/distributed_communication_manager_test.cpp", + "src/distributed_data_test.cpp", + "src/distributed_dev_observer_test.cpp", + "src/distributed_dev_switch_test.cpp", + "src/distributed_transmission_test.cpp", + "src/interoperable_client_manager_test.cpp", + "src/interoperable_communication_manager_test.cpp", + "src/interoperable_data_controller_test.cpp", + "src/interoperable_device_observer_test.cpp", + "src/interoperable_server_manager_test.cpp", + ] + } sources += call_manager_sources include_dirs = [] -- Gitee From 7aa9bb450bbfa514d2d6af73be8c361090d6dbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=B8=BF=E7=9D=BF?= Date: Mon, 8 Sep 2025 12:48:40 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=E5=84=BF=E7=AB=A5=E8=A1=A8call=5Fmanager?= =?UTF-8?q?=E5=AF=B9dm=E5=92=8C=E8=BD=AF=E6=80=BB=E7=BA=BF=E5=81=9A?= =?UTF-8?q?=E8=A7=A3=E8=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王鸿睿 --- services/audio/src/audio_device_manager.cpp | 14 +++++++++----- services/call/src/call_policy.cpp | 2 ++ .../src/distributed_call_manager.cpp | 1 - 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/services/audio/src/audio_device_manager.cpp b/services/audio/src/audio_device_manager.cpp index dbe6d121..3b7ff4b3 100644 --- a/services/audio/src/audio_device_manager.cpp +++ b/services/audio/src/audio_device_manager.cpp @@ -28,7 +28,9 @@ #include "distributed_call_manager.h" #include "audio_system_manager.h" #include "audio_device_info.h" +#ifdef SUPPORT_DSOFTBUS #include "distributed_communication_manager.h" +#endif #include "bluetooth_call_connection.h" namespace OHOS { @@ -586,17 +588,19 @@ int32_t AudioDeviceManager::ReportAudioDeviceChange(const AudioDevice &device) { if (audioDeviceType_ == AudioDeviceType::DEVICE_UNKNOWN) { audioDeviceType_ = DelayedSingleton::GetInstance()->GetInitAudioDeviceType(); - info_.currentAudioDevice.deviceType = audioDeviceType_; - } else { - info_.currentAudioDevice.deviceType = audioDeviceType_; } + info_.currentAudioDevice.deviceType = audioDeviceType_; std::string address = device.address; std::string deviceName = device.deviceName; if (audioDeviceType_ == AudioDeviceType::DEVICE_BLUETOOTH_SCO) { UpdateBtDevice(address, deviceName); - } else if (DelayedSingleton::GetInstance()->IsDistributedDev(device)) { + } +#ifdef SUPPORT_DSOFTBUS + else if (DelayedSingleton::GetInstance()->IsDistributedDev(device)) { TELEPHONY_LOGI("audio device is distributed communication dev"); - } else if (IsDistributedAudioDeviceType(audioDeviceType_)) { + } +#endif + else if (IsDistributedAudioDeviceType(audioDeviceType_)) { address = DelayedSingleton::GetInstance()->GetConnectedDCallDeviceAddr(); } else if (audioDeviceType_ == AudioDeviceType::DEVICE_NEARLINK) { UpdateNearlinkDevice(address, deviceName); diff --git a/services/call/src/call_policy.cpp b/services/call/src/call_policy.cpp index e119db86..e93c0757 100644 --- a/services/call/src/call_policy.cpp +++ b/services/call/src/call_policy.cpp @@ -219,12 +219,14 @@ int32_t CallPolicy::CanDialMulityCall(AppExecFwk::PacMap &extras, bool isEcc) return CALL_ERR_DIAL_IS_BUSY; } } +#ifdef SUPPORT_DSOFTBUS if (DelayedSingleton::GetInstance()->IsConnected() && DelayedSingleton::GetInstance()->IsSinkRole() && HasCellularCallExist()) { TELEPHONY_LOGE("dc-call sink can not dial call when any call exist!"); return CALL_ERR_CALL_COUNTS_EXCEED_LIMIT; } +#endif return TELEPHONY_SUCCESS; } diff --git a/services/distributed_call/src/distributed_call_manager.cpp b/services/distributed_call/src/distributed_call_manager.cpp index 652702e5..05c87933 100644 --- a/services/distributed_call/src/distributed_call_manager.cpp +++ b/services/distributed_call/src/distributed_call_manager.cpp @@ -21,7 +21,6 @@ #include "call_object_manager.h" #include "telephony_log_wrapper.h" #include "nlohmann/json.hpp" -#include "i_distributed_device_callback.h" #ifdef ABILITY_BLUETOOTH_SUPPORT #include "bluetooth_device.h" #endif -- Gitee From 6fe01c718d3b6c056e067b877fa9d79c7a952069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=B8=BF=E7=9D=BF?= Date: Mon, 8 Sep 2025 13:24:09 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=E5=84=BF=E7=AB=A5=E8=A1=A8call=5Fmanager?= =?UTF-8?q?=E5=AF=B9dm=E5=92=8C=E8=BD=AF=E6=80=BB=E7=BA=BF=E5=81=9A?= =?UTF-8?q?=E8=A7=A3=E8=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王鸿睿 --- services/audio/src/audio_control_manager.cpp | 17 ++++++++++++++--- services/call/src/call_control_manager.cpp | 6 +++++- services/call/src/call_status_manager.cpp | 18 ++++++++++++------ .../src/call_manager_service.cpp | 14 +++++++++++++- .../src/call_manager6_gtest.cpp | 5 ++++- 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/services/audio/src/audio_control_manager.cpp b/services/audio/src/audio_control_manager.cpp index 175e6019..636a54c3 100644 --- a/services/audio/src/audio_control_manager.cpp +++ b/services/audio/src/audio_control_manager.cpp @@ -29,7 +29,9 @@ #include "audio_device_descriptor.h" #include "voip_call_connection.h" #include "settings_datashare_helper.h" +#ifdef SUPPORT_DSOFTBUS #include "distributed_communication_manager.h" +#endif #include "os_account_manager.h" #include "ringtone_player.h" #include "int_wrapper.h" @@ -205,6 +207,10 @@ void AudioControlManager::CheckTypeAndSetAudioDevice(sptr &callObjectP VideoStateType nextVideoState, AudioDeviceType &initDeviceType, AudioDevice &device) { TelCallState telCallState = callObjectPtr->GetTelCallState(); + bool isAudioOnSink = false; +#ifdef SUPPORT_DSOFTBUS + isAudioOnSink = DelayedSingleton::GetInstance()->IsAudioOnSink(); +#endif if (!IsVideoCall(priorVideoState) && IsVideoCall(nextVideoState) && (telCallState != TelCallState::CALL_STATUS_INCOMING && telCallState != TelCallState::CALL_STATUS_WAITING)) { if (callObjectPtr->GetOriginalCallType() == VOICE_TYPE && @@ -218,8 +224,8 @@ void AudioControlManager::CheckTypeAndSetAudioDevice(sptr &callObjectP } TELEPHONY_LOGI("set device type, type: %{public}d", static_cast(device.deviceType)); SetAudioDevice(device); - } else if (!DelayedSingleton::GetInstance()->IsAudioOnSink() && - !isSetAudioDeviceByUser_ && IsVideoCall(priorVideoState) && !IsVideoCall(nextVideoState)) { + } else if (!isAudioOnSink && !isSetAudioDeviceByUser_ && IsVideoCall(priorVideoState) && + !IsVideoCall(nextVideoState)) { device.deviceType = AudioDeviceType::DEVICE_EARPIECE; if (IsExternalAudioDevice(initDeviceType)) { device.deviceType = initDeviceType; @@ -612,9 +618,11 @@ int32_t AudioControlManager::SetAudioDevice(const AudioDevice &device, bool isBy int32_t AudioControlManager::SwitchAudioDevice(AudioDeviceType audioDeviceType) { if (audioDeviceType != AudioDeviceType::DEVICE_UNKNOWN) { +#ifdef SUPPORT_DSOFTBUS if (DelayedSingleton::GetInstance()->IsAudioOnSink()) { DelayedSingleton::GetInstance()->SwitchToSourceDevice(); } +#endif if (DelayedSingleton::GetInstance()->IsDCallDeviceSwitchedOn()) { DelayedSingleton::GetInstance()->SwitchOffDCallDeviceSync(); } @@ -627,12 +635,14 @@ int32_t AudioControlManager::SwitchAudioDevice(AudioDeviceType audioDeviceType) int32_t AudioControlManager::HandleDistributeAudioDevice(const AudioDevice &device) { +#ifdef SUPPORT_DSOFTBUS if (DelayedSingleton::GetInstance()->IsDistributedDev(device)) { if (DelayedSingleton::GetInstance()->SwitchToSinkDevice(device)) { return TELEPHONY_SUCCESS; } return CALL_ERR_AUDIO_SET_AUDIO_DEVICE_FAILED; } +#endif if (!DelayedSingleton::GetInstance()->IsDCallDeviceSwitchedOn()) { if (DelayedSingleton::GetInstance()->SwitchOnDCallDeviceSync(device)) { return TELEPHONY_SUCCESS; @@ -977,6 +987,7 @@ AudioDeviceType AudioControlManager::GetInitAudioDeviceType() const if (audioInterruptState_ == AudioInterruptState::INTERRUPT_STATE_DEACTIVATED) { return AudioDeviceType::DEVICE_DISABLE; } else { +#ifdef SUPPORT_DSOFTBUS if (DelayedSingleton::GetInstance()->IsConnected()) { AudioDevice device = { .deviceType = AudioDeviceType::DEVICE_UNKNOWN, @@ -984,7 +995,7 @@ AudioDeviceType AudioControlManager::GetInitAudioDeviceType() const (void)DelayedSingleton::GetInstance()->GetPreferredOutputAudioDevice(device); return device.deviceType; } - +#endif /** * Init audio device type according to the priority in different call state: * In voice call state, bluetooth sco > wired headset > earpiece > speaker diff --git a/services/call/src/call_control_manager.cpp b/services/call/src/call_control_manager.cpp index 8135cd3e..85eb26b6 100644 --- a/services/call/src/call_control_manager.cpp +++ b/services/call/src/call_control_manager.cpp @@ -45,9 +45,11 @@ #include "audio_device_manager.h" #include "distributed_call_manager.h" #include "call_superprivacy_control_manager.h" -#include "distributed_communication_manager.h" #include "call_voice_assistant_manager.h" +#ifdef SUPPORT_DSOFTBUS #include "interoperable_communication_manager.h" +#include "distributed_communication_manager.h" +#endif #include "settings_datashare_helper.h" #ifdef ABILITY_POWER_SUPPORT @@ -1659,8 +1661,10 @@ void CallControlManager::CallStateObserve() callStateListenerPtr_->AddOneObserver(missedCallNotification_); callStateListenerPtr_->AddOneObserver(incomingCallWakeup_); callStateListenerPtr_->AddOneObserver(DelayedSingleton::GetInstance()); +#ifdef SUPPORT_DSOFTBUS callStateListenerPtr_->AddOneObserver(DelayedSingleton::GetInstance()); callStateListenerPtr_->AddOneObserver(DelayedSingleton::GetInstance()); +#endif callStateListenerPtr_->AddOneObserver(CallVoiceAssistantManager::GetInstance()); } diff --git a/services/call/src/call_status_manager.cpp b/services/call/src/call_status_manager.cpp index 1e0cbeb0..5403c9fd 100644 --- a/services/call/src/call_status_manager.cpp +++ b/services/call/src/call_status_manager.cpp @@ -36,7 +36,9 @@ #include "cs_call.h" #include "core_service_client.h" #include "datashare_predicates.h" +#ifdef SUPPORT_DSOFTBUS #include "distributed_communication_manager.h" +#endif #include "ffrt.h" #include "hitrace_meter.h" #include "hitrace/tracechain.h" @@ -569,8 +571,10 @@ void CallStatusManager::SetContactInfo(sptr &call, std::string phoneNu } callObjectPtr->SetCallerInfo(contactInfoTemp); CallVoiceAssistantManager::GetInstance()->UpdateContactInfo(contactInfoTemp, callObjectPtr->GetCallID()); +#ifdef SUPPORT_DSOFTBUS DelayedSingleton::GetInstance()->ProcessCallInfo(callObjectPtr, DistributedDataType::NAME); +#endif }); } @@ -1720,17 +1724,16 @@ sptr CallStatusManager::CreateNewCall(const CallDetailInfo &info, Call return; } DelayedSingleton::GetInstance()->NumberLocationUpdate(callBasePtr); +#ifdef SUPPORT_DSOFTBUS DelayedSingleton::GetInstance()->ProcessCallInfo(callBasePtr, DistributedDataType::LOCATION); +#endif if (info.state == TelCallState::CALL_STATUS_DIALING) { DelayedSingleton::GetInstance()->YellowPageAndMarkUpdate(callBasePtr); } }); } - time_t createTime = time(nullptr); - if (createTime < 0) { - createTime = 0; - } + time_t createTime = std::max(time(nullptr), 0L); callPtr->SetCallCreateTime(createTime); return callPtr; } @@ -2262,8 +2265,11 @@ void CallStatusManager::RefreshCallDisconnectReason(const sptr &call, TELEPHONY_LOGI("RefreshCallDisconnectReason message[%{public}s]", message.c_str()); std::string lowerStr = message; std::transform(lowerStr.begin(), lowerStr.end(), lowerStr.begin(), ::tolower); - if (DelayedSingleton::GetInstance()->IsSinkRole() || - lowerStr.find("elsewhere") != std::string::npos) { + bool isSinkRole = false; +#ifdef SUPPORT_DSOFTBUS + isSinkRole = DelayedSingleton::GetInstance()->IsSinkRole(); +#endif + if (isSinkRole || lowerStr.find("elsewhere") != std::string::npos) { call->SetAnswerType(CallAnswerType::CALL_ANSWERED_ELSEWHER); TELEPHONY_LOGI("call answered elsewhere"); } diff --git a/services/call_manager_service/src/call_manager_service.cpp b/services/call_manager_service/src/call_manager_service.cpp index 085f526c..630147c8 100644 --- a/services/call_manager_service/src/call_manager_service.cpp +++ b/services/call_manager_service/src/call_manager_service.cpp @@ -37,11 +37,13 @@ #include "voip_call_connection.h" #include "distributed_call_manager.h" #include "call_earthquake_alarm_subscriber.h" -#include "distributed_communication_manager.h" #include "want_params_wrapper.h" #include "string_wrapper.h" #include "bluetooth_call_connection.h" +#ifdef SUPPORT_DSOFTBUS #include "interoperable_communication_manager.h" +#include "distributed_communication_manager.h" +#endif #include "voip_call_connection.h" #include "audio_control_manager.h" @@ -104,7 +106,9 @@ bool CallManagerService::Init() DelayedSingleton::GetInstance()->Init(); DelayedSingleton::GetInstance()->Init(); DelayedSingleton::GetInstance()->Init(); +#ifdef SUPPORT_DSOFTBUS DelayedSingleton::GetInstance()->Init(); +#endif AddSystemAbilityListener(AUDIO_POLICY_SERVICE_ID); AddSystemAbilityListener(DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID); return true; @@ -120,7 +124,9 @@ void CallManagerService::OnAddSystemAbility(int32_t systemAbilityId, const std:: DelayedSingleton::GetInstance()->SetAudioPreferDeviceChangeCallback(); break; case DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID: +#ifdef SUPPORT_DSOFTBUS DelayedSingleton::GetInstance()->Init(); +#endif break; default: TELEPHONY_LOGE("OnAddSystemAbility unhandle id : %{public}d", systemAbilityId); @@ -347,6 +353,7 @@ int32_t CallManagerService::DialCall(std::u16string number, AppExecFwk::PacMap & void CallManagerService::BtCallWaitSlotId(AppExecFwk::PacMap &dialInfo, const std::u16string &number) { +#ifdef SUPPORT_DSOFTBUS TELEPHONY_LOGE("BtCallWaitSlotId enter"); std::string phoneNum(Str16ToStr8(number)); auto slotId = DelayedSingleton::GetInstance()->GetBtCallSlotId(phoneNum); @@ -356,6 +363,7 @@ void CallManagerService::BtCallWaitSlotId(AppExecFwk::PacMap &dialInfo, const st TELEPHONY_LOGI("bt call, slotId[%{public}d]", slotId); dialInfo.PutIntValue(SLOT_ID, slotId); } +#endif } int32_t CallManagerService::MakeCall(std::string number) @@ -917,10 +925,12 @@ int32_t CallManagerService::SetMuted(bool isMute) } if (callControlManagerPtr_ != nullptr) { auto ret = callControlManagerPtr_->SetMuted(isMute); +#ifdef SUPPORT_DSOFTBUS if (ret == TELEPHONY_SUCCESS) { DelayedSingleton::GetInstance()->SetMuted(isMute); DelayedSingleton::GetInstance()->SetMuted(isMute); } +#endif return ret; } else { TELEPHONY_LOGE("callControlManagerPtr_ is nullptr!"); @@ -940,6 +950,7 @@ int32_t CallManagerService::MuteRinger() } if (callControlManagerPtr_ != nullptr) { auto ret = callControlManagerPtr_->MuteRinger(); +#ifdef SUPPORT_DSOFTBUS if (ret == TELEPHONY_SUCCESS) { DelayedSingleton::GetInstance()->MuteRinger(); DelayedSingleton::GetInstance()->MuteRinger(); @@ -947,6 +958,7 @@ int32_t CallManagerService::MuteRinger() InteroperableSettingsHandler::SendMuteRinger(); #endif } +#endif return ret; } else { TELEPHONY_LOGE("callControlManagerPtr_ is nullptr!"); diff --git a/test/unittest/call_manager_gtest/src/call_manager6_gtest.cpp b/test/unittest/call_manager_gtest/src/call_manager6_gtest.cpp index 46ee9917..96e4aa7d 100644 --- a/test/unittest/call_manager_gtest/src/call_manager6_gtest.cpp +++ b/test/unittest/call_manager_gtest/src/call_manager6_gtest.cpp @@ -24,7 +24,9 @@ #include "bluetooth_hfp_ag.h" #include "call_manager_connect.h" #include "call_manager_service.h" +#ifdef SUPPORT_DSOFTBUS #include "interoperable_settings_handler.h" +#endif #include "surface_utils.h" #include "telephony_types.h" #include "voip_call.h" @@ -993,7 +995,7 @@ HWTEST_F(CallManagerGtest, Telephony_CallManager_SetDeviceDirection_0300, Functi int32_t rotation = CAMERA_ROTATION_90; EXPECT_NE(CallManagerGtest::clientPtr_->SetDeviceDirection(callId, rotation), RETURN_VALUE_IS_ZERO); } - +#ifdef SUPPORT_DSOFTBUS /** * @tc.number Telephony_InteroperableSettingsHandlerTest_001 * @tc.name test interoperable settings handler @@ -1009,5 +1011,6 @@ HWTEST_F(CallManagerGtest, Telephony_CallManager_InteroperableSettingsHandlerTes EXPECT_EQ(helper->Update(uri, "nokey", "0"), -1); EXPECT_EQ(helper->Insert(uri, SYNERGY_MUTE_KEY, "0"), -1); } +#endif } // namespace Telephony } // namespace OHOS -- Gitee From 3eb5e529a9091040db760570460a3451e788b1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=B8=BF=E7=9D=BF?= Date: Mon, 8 Sep 2025 14:34:31 +0000 Subject: [PATCH 4/5] =?UTF-8?q?=E5=84=BF=E7=AB=A5=E8=A1=A8call=5Fmanager?= =?UTF-8?q?=E5=AF=B9dm=E5=92=8C=E8=BD=AF=E6=80=BB=E7=BA=BF=E5=81=9A?= =?UTF-8?q?=E8=A7=A3=E8=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王鸿睿 --- services/call/src/call_policy.cpp | 2 ++ test/fuzztest/call_fuzzer/call_fuzzer.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/services/call/src/call_policy.cpp b/services/call/src/call_policy.cpp index e93c0757..e20123bd 100644 --- a/services/call/src/call_policy.cpp +++ b/services/call/src/call_policy.cpp @@ -25,7 +25,9 @@ #include "call_control_manager.h" #include "call_superprivacy_control_manager.h" #include "call_manager_base.h" +#ifdef SUPPORT_DSOFTBUS #include "distributed_communication_manager.h" +#endif #include "cellular_call_connection.h" namespace OHOS { diff --git a/test/fuzztest/call_fuzzer/call_fuzzer.cpp b/test/fuzztest/call_fuzzer/call_fuzzer.cpp index 74033c81..830aa063 100644 --- a/test/fuzztest/call_fuzzer/call_fuzzer.cpp +++ b/test/fuzztest/call_fuzzer/call_fuzzer.cpp @@ -27,8 +27,10 @@ #include "surface_utils.h" #include "voip_call.h" #include "antifraud_service.h" +#ifdef SUPPORT_DSOFTBUS #include "interoperable_device_observer.h" #include "interoperable_communication_manager.h" +#endif #include "bluetooth_call_connection.h" #include "bluetooth_call_state.h" #include "antifraud_adapter.h" -- Gitee From 4d2a73106efa4d5d96f79789026ac447e92771ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=B8=BF=E7=9D=BF?= Date: Tue, 9 Sep 2025 02:01:23 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=E5=84=BF=E7=AB=A5=E8=A1=A8call=5Fmanager?= =?UTF-8?q?=E5=AF=B9dm=E5=92=8C=E8=BD=AF=E6=80=BB=E7=BA=BF=E5=81=9A?= =?UTF-8?q?=E8=A7=A3=E8=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王鸿睿 --- services/call/src/call_status_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/call/src/call_status_manager.cpp b/services/call/src/call_status_manager.cpp index 5403c9fd..f69ffe17 100644 --- a/services/call/src/call_status_manager.cpp +++ b/services/call/src/call_status_manager.cpp @@ -1733,7 +1733,7 @@ sptr CallStatusManager::CreateNewCall(const CallDetailInfo &info, Call } }); } - time_t createTime = std::max(time(nullptr), 0L); + time_t createTime = std::max(time(nullptr), static_cast(0)); callPtr->SetCallCreateTime(createTime); return callPtr; } -- Gitee