From 6d68877d21765ec716dae2f0a18e9c44bd5e651c 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:22:12 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DScheduleSaveAppState=20?= =?UTF-8?q?=E4=B8=ADtid=E4=B8=8Epid=E4=B8=8D=E5=8C=B9=E9=85=8D=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= 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..efb220e6d89 100644 --- a/frameworks/native/ability/native/recovery/app_recovery.cpp +++ b/frameworks/native/ability/native/recovery/app_recovery.cpp @@ -232,6 +232,10 @@ bool AppRecovery::ScheduleSaveAppState(StateReason reason, uintptr_t ability) auto task = [reason, ability]() { AppRecovery::GetInstance().DoSaveAppState(reason, ability); }; + if (getpid() == gettid()) { + DoSaveAppState(reason); + return true; + } if (!handler->PostTask(task, "AppRecovery:SaveAppState")) { TAG_LOGE(AAFwkTag::RECOVERY, "schedule save app state failed"); return false; -- Gitee