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