diff --git a/frameworks/core/frame_aware_policy/src/intellisense_server.cpp b/frameworks/core/frame_aware_policy/src/intellisense_server.cpp index 11a79ffa172579946ba3ad00029e469b0cf03974..3f6d12aaca0a3a5f6377c698f2e3056833ab181b 100644 --- a/frameworks/core/frame_aware_policy/src/intellisense_server.cpp +++ b/frameworks/core/frame_aware_policy/src/intellisense_server.cpp @@ -150,22 +150,24 @@ void IntelliSenseServer::NewAppRecord(int pid) return; } } - AppInfo *tempRecord = new AppInfo(pid); - m_historyApp.push_back(*tempRecord); - tempRecord->SetAppState(AppState::APP_FOREGROUND); + AppInfo tempRecord(pid); + tempRecord.SetAppState(AppState::APP_FOREGROUND); + m_historyApp.push_back(tempRecord); } void IntelliSenseServer::NewDiedProcess(int pid) { HITRACE_METER(HITRACE_TAG_ACE); RME_LOGI("[ReportMessage]pid %{public}d died.", pid); - for (auto iter = m_historyApp.begin(); iter != m_historyApp.end(); iter++) { + for (auto iter = m_historyApp.begin(); iter != m_historyApp.end();) { if (iter->GetAppPid() == pid) { int grpId = iter->GetRtgrp(); if (grpId > 0) { DestroyRtgGrp(grpId); } - m_historyApp.erase(iter++); + iter = m_historyApp.erase(iter); + } else { + iter++; } } } @@ -239,8 +241,10 @@ void IntelliSenseServer::ReportCgroupChange(const int pid, const int uid, const return; } if (newState == CgroupPolicy::SP_BACKGROUND) { + RME_LOGI("CgroupChange NewBackground"); NewBackground(pid); } else if (newState == CgroupPolicy::SP_FOREGROUND) { + RME_LOGI("CgroupChange NewForeground"); NewForeground(pid); } } @@ -266,9 +270,11 @@ void IntelliSenseServer::ReportProcessInfo(const int pid, } switch (state) { case ThreadState::DIED: + RME_LOGI("ProcessInfo NewDiedProcess"); NewDiedProcess(pid); break; case ThreadState::CREATE: + RME_LOGI("ProcessInfo NewAppRecord"); NewAppRecord(pid); break; default: diff --git a/interfaces/innerkits/frameintf/frame_msg_intf.cpp b/interfaces/innerkits/frameintf/frame_msg_intf.cpp index f0961a160b60204be1b12776356898444eb060c2..57b09512790d236442a3c991e96d0c399440afa7 100644 --- a/interfaces/innerkits/frameintf/frame_msg_intf.cpp +++ b/interfaces/innerkits/frameintf/frame_msg_intf.cpp @@ -103,6 +103,7 @@ void FrameMsgIntf::ReportProcessInfo(const int pid, const int uid, const std::st RME_LOGI("[ReportProcessInfo]:threandHandler none!"); return; } + RME_LOGI("ReportProcessInfo pid is %{public}d, uid is %{public}d", pid, uid); threadHandler_->PostTask([pid, uid, bundleName, state] { IntelliSenseServer::GetInstance().ReportProcessInfo(pid, uid, bundleName, state); }); @@ -115,6 +116,7 @@ void FrameMsgIntf::ReportCgroupChange(const int pid, const int uid, const int ol RME_LOGI("[ReportProcessInfo]:threandHandler none!"); return; } + RME_LOGI("CgroupChanged pid is %{public}d, uid is %{public}d, oldGroup is %{public}d, newGroup is %{public}d", pid, uid, oldGroup, newGroup); threadHandler_->PostTask([pid, uid, oldGroup, newGroup] { IntelliSenseServer::GetInstance().ReportCgroupChange(pid, uid, oldGroup, newGroup); });