#include <unistd.h>
#include <cstdio>
+#include <aul.h>
+
#include <FBaseRtLibrary.h>
#include <FAppApp.h>
#include <FBaseSysLog.h>
+
#include <FBase_StringConverter.h>
#include <FIo_DirectoryImpl.h>
#include <FApp_AppArg.h>
SysLog(NID_APP, "Enter");
result r = LoadPlugin();
- __conditionalOperations.Construct( 16, 0.75f, __strHashMapProvider, __strComparer);
+ __conditionalOperations.Construct(16, 0.75f, __strHashMapProvider, __strComparer);
SysLog(NID_APP, "Exit");
return r;
}
result
-_ConditionHandler::AddCondition( _AppLaunchCondition& operation)
+_ConditionHandler::AddCondition(_AppLaunchCondition& operation)
{
SysTryReturnResult(NID_APP, __pPluginInstance != null, E_INVALID_STATE, "" );
SysLog(NID_APP,"Unregistered app(%ls), condition(%ls)", pOperation->GetAppId().GetPointer(), pOperation->GetConditionString().GetPointer() );
delete pOperation;
- if ( pCondition != null)
+ if (pCondition != null)
{
pValues->RemoveAll();
delete pValues;
{
SysLog(NID_APP, "Enter");
+ std::unique_ptr<_AppArg> pArg(new (std::nothrow) _AppArg);
+
if (pExtraData != null)
{
SysLog(NID_APP, "pExtraData is not null");
- _AppArg* pArg = new (std::nothrow) _AppArg();
-
result r = pArg->ConstructForAppLaunchCondition(operation.GetConditionString(), operation.__pArguments, pExtraData);
SysTryLog(NID_APP, !IsFailed(r), "[%s] ConstructForAppLaunchCondition(%ls, .. ) fails", GetErrorMessage(r), operation.GetConditionString().GetPointer());
-
-
HashMap* temp = pArg->GetArgMapN();
if (temp != null)
{
{
SysLog(NID_APP, "null");
}
-
- r = _AppControlManager::GetInstance()->LaunchApp(operation.GetAppId(), pArg);
- SysTryLog(NID_APP, !IsFailed(r), "[%ls] LaunchApplication failed, app(%ls).", GetErrorMessage(r), operation.GetAppId().GetPointer());
-
- delete pArg;
}
else
{
SysLog(NID_APP, "pExtraData is null");
- result r = _AppControlManager::GetInstance()->LaunchAppWithCondition(operation.GetAppId(), operation.GetConditionString(), operation.__pArguments );
- SysTryLog(NID_APP, !IsFailed(r), "[%ls] LaunchApplication failed.", GetErrorMessage(r));
+ result r = pArg->ConstructForAppLaunchCondition(operation.GetConditionString(), operation.__pArguments);
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] ConstructForAppLaunchCondition(%ls, .. ) fails", GetErrorMessage(r), operation.GetConditionString().GetPointer());
}
+#if 1
+ std::unique_ptr<char[]> pPackage(_StringConverter::CopyToCharArrayN(operation.GetAppId()));
+
+ int ret = aul_launch_app(pPackage.get(), pArg->GetBundle());
+ SysTryLog(NID_APP, ret == AUL_R_OK, "Application launch failed : 0x%x", ret);
+#else
+ const result ret = _AppControlManager::GetInstance()->LaunchApp(operation.GetAppId(), pArg.get());
+ SysTryLog(NID_APP, !IsFailed(ret), "[%ls] LaunchApplication failed, app(%ls).", GetErrorMessage(ret), operation.GetAppId().GetPointer());
+#endif
+
SysLog(NID_APP, "Exit");
}