From e6849703d30a21bb2f72724d0b98dc40f2980ce0 Mon Sep 17 00:00:00 2001 From: li-tiangang4 Date: Tue, 24 Sep 2024 13:45:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87=E4=B8=8B?= =?UTF-8?q?=E7=BA=BF=E5=81=B6=E7=8E=B0=E5=BC=95=E8=B5=B7=E7=9A=84cfi?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=9B=9E=E5=90=885.0.1-release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-tiangang4 --- .../src/task/disable_task.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/distributedhardwarefwkservice/src/task/disable_task.cpp b/services/distributedhardwarefwkservice/src/task/disable_task.cpp index 6fbff36e..1ffe8dba 100644 --- a/services/distributedhardwarefwkservice/src/task/disable_task.cpp +++ b/services/distributedhardwarefwkservice/src/task/disable_task.cpp @@ -64,6 +64,10 @@ void DisableTask::DoTaskInner() /* trigger Unregister Distributed Hardware Task, sync function */ auto result = UnRegisterHardware(); + if (result == DH_FWK_SUCCESS) { + std::string enabledDeviceKey = GetCapabilityKey(GetDeviceIdByUUID(GetUUID()), GetDhId()); + TaskBoard::GetInstance().RemoveEnabledDevice(enabledDeviceKey); + } auto state = (result == DH_FWK_SUCCESS) ? TaskState::SUCCESS : TaskState::FAIL; SetTaskState(state); @@ -75,10 +79,6 @@ void DisableTask::DoTaskInner() } DHLOGD("finish disable task, remove it, id = %{public}s", GetId().c_str()); TaskBoard::GetInstance().RemoveTask(GetId()); - if (result == DH_FWK_SUCCESS) { - std::string enabledDeviceKey = GetCapabilityKey(GetDeviceIdByUUID(GetUUID()), GetDhId()); - TaskBoard::GetInstance().RemoveEnabledDevice(enabledDeviceKey); - } } int32_t DisableTask::UnRegisterHardware() -- Gitee