From bf87fbae3e9f5aec9bc0cccef5a532f186f0bfa4 Mon Sep 17 00:00:00 2001 From: zhuzhihui7 Date: Mon, 31 Mar 2025 15:40:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=B8=83=E5=BC=8F=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E4=B8=BB=E5=8A=A8=E4=BD=BF=E8=83=BD=E7=A1=AC=E4=BB=B6=E5=90=8E?= =?UTF-8?q?=E7=BB=84=E7=BD=91=E6=96=AD=E5=BC=80=E8=BF=9B=E7=A8=8B=E6=9C=AA?= =?UTF-8?q?=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhuzhihui7 --- .../src/task/disable_task.cpp | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/services/distributedhardwarefwkservice/src/task/disable_task.cpp b/services/distributedhardwarefwkservice/src/task/disable_task.cpp index 8fb417d5..98e44357 100644 --- a/services/distributedhardwarefwkservice/src/task/disable_task.cpp +++ b/services/distributedhardwarefwkservice/src/task/disable_task.cpp @@ -148,30 +148,20 @@ int32_t DisableTask::GetCallingPid() int32_t DisableTask::DoAutoDisable() { - bool disableSink = false; - bool disableSource = false; - int32_t ret = ComponentManager::GetInstance().CheckDemandStart(GetUUID(), GetDhType(), disableSink, disableSource); - if (ret != DH_FWK_SUCCESS) { - DHLOGE("CheckDemandStart failed!"); - return ret; - } + int32_t ret = DH_FWK_SUCCESS; if (DHContext::GetInstance().GetRealTimeOnlineDeviceCount() == 0 && DHContext::GetInstance().GetIsomerismConnectCount() == 0) { DHDescriptor dhDescriptor { .id = GetDhId(), .dhType = GetDhType() }; - if (disableSink) { - ret = ComponentManager::GetInstance().ForceDisableSink(dhDescriptor); - if (ret != DH_FWK_SUCCESS) { - DHLOGE("DisableSink failed!"); - } + ret = ComponentManager::GetInstance().ForceDisableSink(dhDescriptor); + if (ret != DH_FWK_SUCCESS) { + DHLOGE("DisableSink failed!"); } - if (disableSource) { - ret = ComponentManager::GetInstance().ForceDisableSource(GetNetworkId(), dhDescriptor); - if (ret != DH_FWK_SUCCESS) { - DHLOGE("DisableSource failed!"); - } + ret = ComponentManager::GetInstance().ForceDisableSource(GetNetworkId(), dhDescriptor); + if (ret != DH_FWK_SUCCESS) { + DHLOGE("DisableSource failed!"); } } return ret; -- Gitee