X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fapp%2FFApp_AppManagerImpl.cpp;h=f696327281344a6e7758b10209015fa3e727e824;hb=86951b192bc698e49669e4827b366969745d7e15;hp=6b0862647397d165a23c9656a28254444a05deb0;hpb=85520d31c95af8dd8632e0b825a5851bcf7faae3;p=platform%2Fframework%2Fnative%2Fappfw.git diff --git a/src/app/FApp_AppManagerImpl.cpp b/src/app/FApp_AppManagerImpl.cpp index 6b08626..f696327 100755 --- a/src/app/FApp_AppManagerImpl.cpp +++ b/src/app/FApp_AppManagerImpl.cpp @@ -1062,6 +1062,14 @@ _AppManagerImpl::FireActiveAppEvent(unsigned int xid, int pid, char* pAppName) if (oldPid != pid) { oldPid = pid; + char pkgname[255] = {0, }; + if ((AUL_R_OK != aul_app_get_pkgname_bypid(pid, pkgname, 255)) || pkgname[0] == 0) + { + SysSecureLog(NID_APP, "Failed to get the package name from pid=%x pAppName=%s", pid, pAppName ? pAppName : "null"); + return; + } + AppId appId(_Aul::GetRealAppId(String(pkgname))); + std::unique_ptr > pEnum(__activeAppEventListenerList.GetEnumeratorN()); if (pEnum.get()) { @@ -1071,10 +1079,7 @@ _AppManagerImpl::FireActiveAppEvent(unsigned int xid, int pid, char* pAppName) pEnum->GetCurrent(pListener); if (pListener) { - char pkgname[255] = {0, }; - aul_app_get_pkgname_bypid(pid, pkgname, 255); - // TODO: Translate it to package name --> AppId - pListener->OnActiveAppChanged(AppId(pkgname)); + pListener->OnActiveAppChanged(appId); } } }