From 5621e0edbd58a3d7f063e7daa98137a45ce5ac7b Mon Sep 17 00:00:00 2001 From: wangyantian Date: Mon, 15 Jul 2024 09:56:55 +0800 Subject: [PATCH] fix: Cancel xcollie in all branches Change-Id: I50a798495d81d492316392650648a91c9a74c0ec Signed-off-by: wangyantian --- services/zidl/src/power_mode_callback_stub.cpp | 3 ++- services/zidl/src/power_runninglock_callback_stub.cpp | 1 + services/zidl/src/power_state_callback_stub.cpp | 1 + services/zidl/src/screen_off_pre_callback_stub.cpp | 1 + services/zidl/src/shutdown/async_shutdown_callback_stub.cpp | 1 + services/zidl/src/shutdown/sync_shutdown_callback_stub.cpp | 1 + services/zidl/src/shutdown/takeover_shutdown_callback_stub.cpp | 1 + services/zidl/src/sync_hibernate_callback_stub.cpp | 1 + services/zidl/src/sync_sleep_callback_stub.cpp | 1 + 9 files changed, 10 insertions(+), 1 deletion(-) diff --git a/services/zidl/src/power_mode_callback_stub.cpp b/services/zidl/src/power_mode_callback_stub.cpp index 42adae29..7dcef583 100644 --- a/services/zidl/src/power_mode_callback_stub.cpp +++ b/services/zidl/src/power_mode_callback_stub.cpp @@ -29,7 +29,7 @@ namespace OHOS { namespace PowerMgr { int PowerModeCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) - { +{ POWER_HILOGD(COMP_SVC, "cmd = %{public}d, flags= %{public}d", code, option.GetFlags()); const int DFX_DELAY_S = 10; int id = HiviewDFX::XCollie::GetInstance().SetTimer("PowerModeCallbackStub", DFX_DELAY_S, nullptr, nullptr, @@ -38,6 +38,7 @@ int PowerModeCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel& data, M std::u16string remoteDescripter = data.ReadInterfaceToken(); if (descripter != remoteDescripter) { POWER_HILOGE(COMP_SVC, "Descriptor is not match"); + HiviewDFX::XCollie::GetInstance().CancelTimer(id); return E_GET_POWER_SERVICE_FAILED; } diff --git a/services/zidl/src/power_runninglock_callback_stub.cpp b/services/zidl/src/power_runninglock_callback_stub.cpp index 8dd6c201..74f78c94 100644 --- a/services/zidl/src/power_runninglock_callback_stub.cpp +++ b/services/zidl/src/power_runninglock_callback_stub.cpp @@ -35,6 +35,7 @@ int PowerRunningLockCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel & std::u16string remoteDescripter = data.ReadInterfaceToken(); if (descripter != remoteDescripter) { POWER_HILOGE(COMP_SVC, "Descriptor is not match"); + HiviewDFX::XCollie::GetInstance().CancelTimer(id); return E_GET_POWER_SERVICE_FAILED; } diff --git a/services/zidl/src/power_state_callback_stub.cpp b/services/zidl/src/power_state_callback_stub.cpp index 546e9bb8..b1c98838 100644 --- a/services/zidl/src/power_state_callback_stub.cpp +++ b/services/zidl/src/power_state_callback_stub.cpp @@ -35,6 +35,7 @@ int PowerStateCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel &data, std::u16string remoteDescripter = data.ReadInterfaceToken(); if (descripter != remoteDescripter) { POWER_HILOGE(COMP_SVC, "Descriptor is not match"); + HiviewDFX::XCollie::GetInstance().CancelTimer(id); return E_GET_POWER_SERVICE_FAILED; } diff --git a/services/zidl/src/screen_off_pre_callback_stub.cpp b/services/zidl/src/screen_off_pre_callback_stub.cpp index eae77bf2..08a0465c 100644 --- a/services/zidl/src/screen_off_pre_callback_stub.cpp +++ b/services/zidl/src/screen_off_pre_callback_stub.cpp @@ -35,6 +35,7 @@ int ScreenOffPreCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel &data std::u16string remoteDescripter = data.ReadInterfaceToken(); if (descripter != remoteDescripter) { POWER_HILOGE(COMP_SVC, "Descriptor is not match"); + HiviewDFX::XCollie::GetInstance().CancelTimer(id); return E_GET_POWER_SERVICE_FAILED; } diff --git a/services/zidl/src/shutdown/async_shutdown_callback_stub.cpp b/services/zidl/src/shutdown/async_shutdown_callback_stub.cpp index e4d242c3..150626be 100644 --- a/services/zidl/src/shutdown/async_shutdown_callback_stub.cpp +++ b/services/zidl/src/shutdown/async_shutdown_callback_stub.cpp @@ -34,6 +34,7 @@ int AsyncShutdownCallbackStub::OnRemoteRequest( std::u16string remoteDescripter = data.ReadInterfaceToken(); if (descripter != remoteDescripter) { POWER_HILOGE(COMP_SVC, "Descriptor is not match"); + HiviewDFX::XCollie::GetInstance().CancelTimer(id); return E_GET_POWER_SERVICE_FAILED; } diff --git a/services/zidl/src/shutdown/sync_shutdown_callback_stub.cpp b/services/zidl/src/shutdown/sync_shutdown_callback_stub.cpp index 89642251..02efa829 100644 --- a/services/zidl/src/shutdown/sync_shutdown_callback_stub.cpp +++ b/services/zidl/src/shutdown/sync_shutdown_callback_stub.cpp @@ -34,6 +34,7 @@ int SyncShutdownCallbackStub::OnRemoteRequest( std::u16string remoteDescripter = data.ReadInterfaceToken(); if (descripter != remoteDescripter) { POWER_HILOGE(COMP_SVC, "Descriptor is not match"); + HiviewDFX::XCollie::GetInstance().CancelTimer(id); return E_GET_POWER_SERVICE_FAILED; } diff --git a/services/zidl/src/shutdown/takeover_shutdown_callback_stub.cpp b/services/zidl/src/shutdown/takeover_shutdown_callback_stub.cpp index 4d73de5a..a96965d9 100644 --- a/services/zidl/src/shutdown/takeover_shutdown_callback_stub.cpp +++ b/services/zidl/src/shutdown/takeover_shutdown_callback_stub.cpp @@ -34,6 +34,7 @@ int TakeOverShutdownCallbackStub::OnRemoteRequest( std::u16string remoteDescripter = data.ReadInterfaceToken(); if (descripter != remoteDescripter) { POWER_HILOGE(COMP_SVC, "Descriptor is not match"); + HiviewDFX::XCollie::GetInstance().CancelTimer(id); return E_GET_POWER_SERVICE_FAILED; } diff --git a/services/zidl/src/sync_hibernate_callback_stub.cpp b/services/zidl/src/sync_hibernate_callback_stub.cpp index 2162f001..9992f5c9 100644 --- a/services/zidl/src/sync_hibernate_callback_stub.cpp +++ b/services/zidl/src/sync_hibernate_callback_stub.cpp @@ -35,6 +35,7 @@ int SyncHibernateCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel &dat std::u16string remoteDescripter = data.ReadInterfaceToken(); if (descripter != remoteDescripter) { POWER_HILOGE(COMP_SVC, "Descriptor is not match"); + HiviewDFX::XCollie::GetInstance().CancelTimer(id); return E_GET_POWER_SERVICE_FAILED; } diff --git a/services/zidl/src/sync_sleep_callback_stub.cpp b/services/zidl/src/sync_sleep_callback_stub.cpp index 3d1a59a0..f64ca6a1 100644 --- a/services/zidl/src/sync_sleep_callback_stub.cpp +++ b/services/zidl/src/sync_sleep_callback_stub.cpp @@ -35,6 +35,7 @@ int SyncSleepCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel &data, M std::u16string remoteDescripter = data.ReadInterfaceToken(); if (descripter != remoteDescripter) { POWER_HILOGE(COMP_SVC, "Descriptor is not match"); + HiviewDFX::XCollie::GetInstance().CancelTimer(id); return E_GET_POWER_SERVICE_FAILED; } -- Gitee