using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Runtime;
+using namespace Tizen::System;
const wchar_t USE_UI_KEY[] = L"UseUi";
const wchar_t USE_UI_VAL_TRUE[] = L"True";
namespace Tizen { namespace App
{
+static const wchar_t* ALARM_PLUGIN_LIBRARY_PATH = L"/opt/apps/aospd00043/lib/libosp-cond-alarm.so";
+typedef void (*OnAlarmForLaunch)(int alarmId);
+
_ServiceAppImpl* _ServiceAppImpl::__pServiceAppImpl = null;
SysLog(NID_APP, "Service requested.");
char* pOperation = NULL;
int errVal = service_get_operation(service, &pOperation);
+ result r = E_SUCCESS;
if ( (errVal == SERVICE_ERROR_NONE) && (!strcmp(pOperation, "osp.appsvc.operation.ALARM")) )
{
char* pAlarmId = NULL;
-
errVal = service_get_extra_data(service, SERVICE_DATA_ALARM_ID, &pAlarmId);
if (errVal == SERVICE_ERROR_NONE)
{
- //int alarmId = atoi(pAlarmId);
+ int alarmId = atoi(pAlarmId);
+
+ SysLog(NID_SYS, "Start to load external lib");
+ Library lib;
+ OnAlarmForLaunch pOnAlarmForLaunch = null;
+ r = lib.Construct(ALARM_PLUGIN_LIBRARY_PATH);
- String* pAlarmStr = new (std::nothrow) String(pAlarmId);
- ArrayList alarmArg;
- alarmArg.Add(*pAlarmStr);
- __pServiceApp->OnUserEventReceivedN(HANDLER_REQUEST_ALARMID, &alarmArg);
+ if(r == E_SUCCESS)
+ {
+ SysLog(NID_SYS, "Open alarm condition library");
+ pOnAlarmForLaunch = (OnAlarmForLaunch)lib.GetProcAddress(L"OnAlarmForLaunch");
+ if(pOnAlarmForLaunch != null)
+ {
+ SysLog(NID_SYS, "Function is found");
+ pOnAlarmForLaunch(alarmId);
+ SysLog(NID_SYS, "Requested to check current alarm id to AlarmConditionHandler %d", alarmId);
+ }
+ else
+ {
+ SysLog(NID_SYS, "Fail to find alarm function");
+ }
+ }
+ else
+ {
+ SysLog(NID_SYS, "Fail to open alarm condition library");
+ }
}
if (pAlarmId)
pBundle = bundle_create();
SysTryCatch(NID_SYS, pBundle != null, r = E_SYSTEM, r, "It is failed to create bundle");
- ret = appsvc_set_operation(pBundle,"osp.appsvc.operation.ALARM");
+ ret = appsvc_set_operation(pBundle,"osp.operation.ALARM");
SysTryCatch(NID_SYS, ret == SERVICE_ERROR_NONE, r = E_SYSTEM, r, "It is failed to set operation");
ret = appsvc_set_appid(pBundle, (const char*)(pId.get()));