支持ability窗口资源释放

Signed-off-by: yihao lin <linyh@zju.edu.cn>
This commit is contained in:
yihao lin 2022-08-02 09:45:41 +08:00
parent e853f22818
commit 7e43ebf2a6
2 changed files with 9 additions and 5 deletions

View File

@ -756,7 +756,13 @@ void Ability::InitConfigurationProperties(const Configuration& changeConfigurati
*
*/
void Ability::OnMemoryLevel(int level)
{}
{
HILOG_INFO("%{public}s start.", __func__);
if (scene_ == nullptr) {
HILOG_DEBUG("WindowScene is null");
}
scene_->NotifyMemoryLevel(level);
}
/**
* @brief This is like openFile, open a file that need to be able to return sub-sections of filesoften assets

View File

@ -494,10 +494,8 @@ int32_t AppRunningManager::NotifyMemoryLevel(int32_t level)
std::lock_guard<std::recursive_mutex> guard(lock_);
for (const auto &item : appRunningRecordMap_) {
const auto &appRecord = item.second;
if (appRecord->GetState() == ApplicationState::APP_STATE_BACKGROUND) {
HILOG_INFO("Notification app [%{public}s]", appRecord->GetName().c_str());
appRecord->ScheduleMemoryLevel(level);
}
HILOG_INFO("Notification app [%{public}s]", appRecord->GetName().c_str());
appRecord->ScheduleMemoryLevel(level);
}
return ERR_OK;
}