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<IEnumeratorT<Tizen::App::IActiveAppEventListener* > > pEnum(__activeAppEventListenerList.GetEnumeratorN());
if (pEnum.get())
{
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);
}
}
}
aul_app_get_pkgname_bypid(processId, pkgname, 255);
appId = _Aul::GetRealAppId(String(pkgname));
+
+ SysLog(NID_APP, "ActiveApp is %ls.", appId.GetPointer());
return E_SUCCESS;
}
+bool
+_AppManagerImpl::IsUserPreferredAppForAppControlResolution(const AppId& appId) const
+{
+ _IAppManager* pMgr = _AppManagerProxy::GetService();
+ SysTryReturn(NID_APP, pMgr, false, E_SYSTEM, "Failed to _AppManagerProxy::GetService().");
+
+ return pMgr->IsUserPreferredAppForAppControlResolution(appId);
+}
+
+result
+_AppManagerImpl::ClearUserPreferenceForAppControlResolution(const AppId& appId)
+{
+ _IAppManager* pMgr = _AppManagerProxy::GetService();
+ SysTryReturnResult(NID_APP, pMgr, E_SYSTEM, "Failed to _AppManagerProxy::GetService().");
+
+ return pMgr->ClearUserPreferenceForAppControlResolution(appId);
+}
+
}} // Tizen::App