#include "FApp_AppControlEventArg.h"
#include "FApp_AppArg.h"
#include "FApp_AppMessageImpl.h"
+#include "FApp_Aul.h"
#include "FAppPkg_PackageManagerImpl.h"
using namespace Tizen::Base;
{
const char* pBundleValue = bundle_get_val(__pBundle, AUL_K_CALLEE_APPID);
- String retVal = pBundleValue;
+ const AppId retVal = pBundleValue;
- String temp;
- // [INFO] ugly code for submode callee
- retVal.SubString(11, temp);
- if (temp == L"_AppControl")
- {
- String id;
- retVal.SubString(0, 10, id);
- const String& name = _PackageManagerImpl::GetInstance()->GetDefaultAppExecutableName(id);
-
- retVal = id + L'.' + name;
- SysLog(NID_APP, "Converted caller Id is %ls", retVal.GetPointer());
- }
-
- return retVal;
+ return _Aul::GetRealAppId(retVal);
}
result
_AppManagerImpl::GetActiveApp(AppId& appId)
{
- unsigned int windowId = GetActiveWindow();
- int processId = GetProcessId(windowId);
+ const unsigned int windowId = GetActiveWindow();
+ const int processId = GetProcessId(windowId);
char pkgname[255] = {0, };
aul_app_get_pkgname_bypid(processId, pkgname, 255);
- // TODO: Translate it to package name --> AppId
- appId = pkgname;
+
+ appId = _Aul::GetRealAppId(String(pkgname));
return E_SUCCESS;
}
return ret;
}
-bool _Aul::IsInstalled(const AppId& appId)
+
+bool
+_Aul::IsInstalled(const AppId& appId)
{
String packageId;
packageId = _PackageManagerImpl::GetPackageIdByAppId(appId);
return _PackageManagerImpl::GetInstance()->IsPackageInstalled(packageId);
}
+
+AppId
+_Aul::GetRealAppId(const AppId& appId)
+{
+ String temp;
+ // [INFO] ugly code for submode callee
+ appId.SubString(11, temp);
+ if (temp == L"_AppControl")
+ {
+ String id;
+ appId.SubString(0, 10, id);
+ const String& name = _PackageManagerImpl::GetInstance()->GetDefaultAppExecutableName(id);
+
+ const String retVal = id + L'.' + name;
+ SysLog(NID_APP, "Converted caller Id is %ls", retVal.GetPointer());
+
+ return retVal;
+ }
+ else
+ {
+ return appId;
+ }
+}
+
+
result
_Aul::_DesktopFile::MakePath(const AppId& appId, char* path, int size)
{
static bool IsInstalled(const AppId& appId);
+ _OSP_LOCAL_ static AppId GetRealAppId(const AppId& appId);
+
public:
/**
* This is static helper class for desktop file.