From c148eb5d9ba7af43c9c34f45e330ee26a8ea7bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E6=80=9D=E6=88=90?= Date: Tue, 27 May 2025 08:33:08 +0000 Subject: [PATCH] =?UTF-8?q?ScheduleSaveAppState=20pid=E5=8C=B9=E9=85=8Dtid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 林思成 --- frameworks/native/ability/native/recovery/app_recovery.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frameworks/native/ability/native/recovery/app_recovery.cpp b/frameworks/native/ability/native/recovery/app_recovery.cpp index 4655b2f69a6..5ac5e75316c 100644 --- a/frameworks/native/ability/native/recovery/app_recovery.cpp +++ b/frameworks/native/ability/native/recovery/app_recovery.cpp @@ -229,6 +229,10 @@ bool AppRecovery::ScheduleSaveAppState(StateReason reason, uintptr_t ability) return false; } + if (getpid() == gettid()) { + DoSaveAppState(reason); + return true; + } auto task = [reason, ability]() { AppRecovery::GetInstance().DoSaveAppState(reason, ability); }; -- Gitee