diff --git a/frameworks/native/ability/native/recovery/app_recovery.cpp b/frameworks/native/ability/native/recovery/app_recovery.cpp index 4655b2f69a64688a149096f2a4993d262d91a6b7..efb220e6d8998fe3adef8532f87a90d3f0202263 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;