//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
#include <notification/notification.h>
#include <appsvc/appsvc.h>
#include <vconf.h>
+#include <appinfo.h>
#include <FBaseInteger.h>
#include <FBaseColArrayList.h>
#include <FAppIAppControlProviderEventListener.h>
#include <FAppIAppLaunchConditionEventListener.h>
#include <FIoFile.h>
-
#include <FBaseSysLog.h>
+
+#include <FBase_StringConverter.h>
#include <FIo_RegistryImpl.h>
#include <FSys_EnvironmentImpl.h>
#include <FSys_PowerManagerImpl.h>
#include "FApp_AppArg.h"
#include "FApp_IAppImpl.h"
#include "FApp_AppResourceImpl.h"
+#include <FSys_SettingInfoImpl.h>
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
const int HEARTBEAT_WAIT_COUNT = 3;
const wchar_t SERVICE_APPID[] = L"aospd00043.osp-app-service";
const char SELECTOR_RESPONSE_KEY[] = "__APP_SVC_START_INFO__";
+const wchar_t FILE_SCHEME_WITH_DELIMITER[] = L"file://";
#ifndef VCONFKEY_APPSERVICE_STATUS
#define VCONFKEY_APPSERVICE_STATUS "memory/appservice/status"
#endif
_AppImpl* _AppImpl::__pAppImpl = null;
bool _AppImpl::__isTerminationRequested = false;
+#if 0
static const int _DATACONTROL_PACKET_INDEX_APPID = 0;
static const int _DATACONTROL_PACKET_INDEX_REQUESTTYPE = 1;
static const int _DATACONTROL_PACKET_INDEX_REQID = 2;
static const int _DATACONTROL_PACKET_INDEX_PROVIDERID = 3;
-static const int _DATACONTROL_PACKET_INDEX_DATAID = 4;
-static const int _DATACONTROL_PACKET_INDEX_COLUMNCOUNT = 5;
-static const int _DATACONTROL_PACKET_INDEX_DELETEWHERE = 5;
-static const int _DATACONTROL_PACKET_INDEX_COLUMNLIST = 6;
-static const int _DATACONTROL_PACKET_INDEX_INSERTMAP = 6;
-static const int _DATACONTROL_PACKET_INDEX_UPDATEMAP = 6;
+#endif
+static const int _DATACONTROL_PACKET_INDEX_DATAID = 0;
+static const int _DATACONTROL_PACKET_INDEX_COLUMNCOUNT = 1;
+static const int _DATACONTROL_PACKET_INDEX_DELETEWHERE = 1;
+static const int _DATACONTROL_PACKET_INDEX_MAPKEY = 1;
+static const int _DATACONTROL_PACKET_INDEX_COLUMNLIST = 2;
+static const int _DATACONTROL_PACKET_INDEX_INSERTMAP = 2;
+static const int _DATACONTROL_PACKET_INDEX_UPDATEMAP = 2;
struct charDeleter
{
_AppInfo::SetAppState(INITIALIZING);
+ r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] failed to add setting event listener.", GetErrorMessage(r));
+
return E_SUCCESS;
}
-
result
_AppImpl::Execute(_IAppImpl* pIAppImpl)
{
SysLogTag(NID_APP, "LAUNCH","[%ls:<Initialize Application>:start]", _AppInfo::GetAppExecutableName().GetPointer());
result r = E_SUCCESS;
int eflResult = APP_ERROR_NONE;
- int argc = _AppInfo::GetArgc();
- char** pArgv = _AppInfo::GetArgv();
+ int argc = 0;
+ char** pArgv = NULL;
_IAppManager* pAppManager = null;
_AppImpl* pAppImpl = _AppImpl::GetInstance();
pAppImpl->SetLegacyRequestHandler();
}
- // clear previous notification
- // [INFO] behavior change : platform does not clear previous notification
- notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
-
app_event_callback_s state_handler;
memset(&state_handler, 0, sizeof(app_event_callback_s));
state_handler.terminate = &OnTerminate;
state_handler.pause = &OnPause;
state_handler.resume = &OnResume;
- state_handler.device_orientation = &OnDeviceOrientationChanged;
+ state_handler.device_orientation = NULL;
state_handler.low_memory = &OnLowMemory;
- state_handler.low_battery = &OnLowBattery;
- state_handler.language_changed = &OnLanguageChanged;
- state_handler.region_format_changed = &OnRegionFormatChanged;
+ state_handler.low_battery = NULL;
+ state_handler.language_changed = NULL;
+ state_handler.region_format_changed = NULL;
_Aul::SetPowerOffNotiListener(OnPowerOffNotiReceived, this);
// if (pAppManager != null)
// SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Application registration failed.", GetErrorMessage(r));
// }
+ appinfo_get_argv(&argc, &pArgv);
eflResult = app_efl_main(&argc, &pArgv, &state_handler, this);
-
SysTryLog(NID_APP, eflResult == APP_ERROR_NONE, "app_efl_main failed with error (%d): Unknown", eflResult);
- // clear outstanding ongoing notification
- notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_ONGOING);
-
-//CATCH:
pAppManager = _AppManagerProxy::GetService();
if (pAppManager != null)
pAppManager->UnregisterApplication(_AppInfo::GetProcessId());
}
+ // clear outstanding ongoing notification
+ notification_delete_all_by_type(appinfo_get_appid(), NOTIFICATION_TYPE_ONGOING);
+
return r;
}
if (pAppManager != null)
{
- result r = pAppManager->RegisterApplication(_AppInfo::GetPackageId(), _AppInfo::GetAppExecutableName(), static_cast<_AppType>(_AppInfo::GetAppType()), _AppInfo::GetProcessId());
+ result r = pAppManager->RegisterApplication(_AppInfo::GetApplicationId(), static_cast<_AppType>(_AppInfo::GetAppType()), _AppInfo::GetProcessId());
SysTryLog(NID_APP, !IsFailed(r), "[%s] Application registration failed.", GetErrorMessage(r));
}
SysLogTag(NID_APP, "LAUNCH","[%ls:<RegisterApplication>:done]", _AppInfo::GetAppExecutableName().GetPointer());
service_get_window(service, &winId);
if (winId > 0)
{
- _AppInfo::GetAppInfo()->SetParentWindowHandle(winId);
+ _AppInfo::SetParentWindowHandle(winId);
SysLog(NID_APP, "Saving window handle 0x%x.", winId);
}
// call for callbacks
int errVal = service_get_operation(service, &pBuf);
pOperation.reset(pBuf);
- if((errVal == SERVICE_ERROR_NONE) && (!strcmp((const char*)pOperation.get(), "osp.appsvc.operation.ALARM")))
+ if((errVal == SERVICE_ERROR_NONE) && (!strcmp((const char*)pOperation.get(), "osp.operation.ALARM")))
{
std::unique_ptr<char[], charDeleter> pAlarmId(null);
char* pBuf = null;
SysTryReturnVoidResult(NID_APP, pAppImpl != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting App instance failed.");
SysTryReturnVoidResult(NID_APP, pAppImpl->__pIAppImpl != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting App instance failed.");
+ result r = _SettingInfoImpl::RemoveSettingEventListenerForInternal(*pAppImpl);
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] failed to remove setting event listener.", GetErrorMessage(r));
+
__isTerminationRequested = true;
pAppImpl->__pIAppImpl->OnTerminate();
}
}
-void
-_AppImpl::OnDeviceOrientationChanged(app_device_orientation_e orientation, void* user_data)
-{
- _AppImpl* pAppImpl = _AppImpl::GetInstance();
- SysTryReturnVoidResult(NID_APP, pAppImpl != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting App instance failed.");
- SysTryReturnVoidResult(NID_APP, pAppImpl->__pIAppImpl != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting App instance failed.");
-
- const AppState state = _AppInfo::GetAppState();
- SysTryReturnVoidResult(NID_APP, state == INITIALIZING || state == RUNNING, E_INVALID_STATE, "[E_INVALID_STATE] Invalid application state : %d.", state);
-
- pAppImpl->__pIAppImpl->OnDeviceOrientationChanged(orientation);
-}
-
-
_AppImpl::~_AppImpl(void)
{
__pAppImpl = null;
SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
String* pData = new (std::nothrow) String(LEGACY_LAUNCH_REASON_NORMAL);
SysTryReturn(NID_APP, pData != null, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
- String* pData2 = new (std::nothrow) String(L"osp.operation.MAIN");
+ String* pData2 = new (std::nothrow) String(LEGACY_OPERATION_MAIN);
SysTryReturn(NID_APP, pData2 != null, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
pList->Construct();
{
result r = E_SUCCESS;
+ SysLog(NID_APP, "Terminate() is called by application itself");
+
__isTerminationRequested = true;
app_efl_exit();
OnDataControlRequestReceived(*pArg, static_cast< RequestId >(req));
- _AppControlManager::GetInstance()->RemoveResultRequest(req);
+ //_AppControlManager::GetInstance()->RemoveResultRequest(req);
break;
case _APP_HANDLER_LAUNCH_COND:
{
case _APP_HANDLER_LAUNCH_NORMAL:
SysLog(NID_APP, "Handling normal launch request");
- OnUserEventReceivedN(AppLaunchRequestId, pArg->GetArgListN(req));
+ OnUserEventReceivedN(AppLaunchRequestId, pArg->GetArgListN(req), true);
// [TODO] request handle memory cleanup confirm
_AppControlManager::GetInstance()->RemoveResultRequest(req);
case _APP_HANDLER_LAUNCH_COND:
SysLog(NID_APP, "Handling conditional launch request");
- OnUserEventReceivedN(AppLaunchRequestId, pArg->GetArgListN(req));
+ OnUserEventReceivedN(AppLaunchRequestId, pArg->GetArgListN(req), true);
// [TODO] request handle memory cleanup confirm
_AppControlManager::GetInstance()->RemoveResultRequest(req);
void
-_AppImpl::OnLowBattery(void* user_data)
-{
- // Osp doesn't implement this callback.
-}
-
-void
_AppImpl::OnBatteryLevelChanged(BatteryLevel batteryLevel)
{
SysTryReturnVoidResult(NID_APP, __pApp != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting internal instance failed.");
__pApp->OnBatteryLevelChanged(batteryLevel);
}
-void
-_AppImpl::OnLanguageChanged(void* user_data)
-{
- SysLog(NID_APP, "");
- _AppInfo::UpdatePackageInfo(true);
-
- _AppResourceImpl::Reinitialize();
- SysLog(NID_APP, "Language change done.");
-}
-
-void
-_AppImpl::OnRegionFormatChanged(void* user_data)
-{
- // Osp doesn't implement this callback.
-}
-
-
result
-_AppImpl::SendUserEvent(RequestId requestId, const IList* pArgs)
+_AppImpl::SendUserEvent(RequestId requestId, const IList* pArgs, bool isPublic)
{
- _AppUserEventArg* pArg = new (std::nothrow) _AppUserEventArg(requestId, pArgs);
+ _AppUserEventArg* pArg = new (std::nothrow) _AppUserEventArg(requestId, pArgs, isPublic);
SysTryReturnResult(NID_APP, pArg != null, E_OUT_OF_MEMORY, "User event creation failure for %d.", requestId);
result r = __appUserEvent.FireAsync(*pArg);
void
-_AppImpl::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
+_AppImpl::OnUserEventReceivedN(RequestId requestId, IList* pArgs, bool isPublic)
{
SysTryReturnVoidResult(NID_APP, __pApp != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting internal instance failed.");
- __pApp->OnUserEventReceivedN(requestId, pArgs);
+ if (isPublic)
+ {
+ __pApp->OnUserEventReceivedN(requestId, pArgs);
+ }
+ else
+ {
+ switch (requestId)
+ {
+ case _APP_EVENT_TERMINATE:
+ SysLog(NID_APP, "App terminate is requested.");
+ Terminate();
+ break;
+ case _APP_EVENT_RAISE:
+ SysLog(NID_APP, "App raise is requested.");
+ RaiseWindow();
+ break;
+ default:
+ SysLog(NID_APP, "Unknown event : 0x%x.", requestId);
+ break;
+ }
+ }
}
return;
}
- const String& appId = _AppInfo::GetApplicationId();
+ const char* pAppId = appinfo_get_appid();
const char* p = appsvc_get_operation(arg.GetBundle());
String operationId = (p) ? String(p) : TIZEN_OPERATION_MAIN;
operationId = TIZEN_OPERATION_MAIN;
}
- SysLog(NID_APP, "AppControl (%ls, %ls).", appId.GetPointer(), operationId.GetPointer());
+ SysLog(NID_APP, "AppControl (%s, %ls).", pAppId, operationId.GetPointer());
String uri;
String mime;
if (p)
{
uri = p;
+ if (uri[0] == L'/')
+ {
+ // SLP deals with the URI as plain /opt/.../a.jpg.
+ uri.Insert(FILE_SCHEME_WITH_DELIMITER, 0);
+ }
pUri = &uri;
SysLog(NID_APP, "Delivered uri is [%ls].", pUri->GetPointer());
pAppControlProviderEventListener->OnAppControlRequestReceived(reqId, operationId, pUri, pMime, pMap.get());
- SysLog(NID_APP, "AppControl (%ls, %ls) invocation finished.", appId.GetPointer(), operationId.GetPointer());
+ SysLog(NID_APP, "AppControl (%s, %ls) invocation finished.", pAppId, operationId.GetPointer());
}
ArrayList* pColumnList = null;
HashMap* pInsertMap = null;
HashMap* pUpdateMap = null;
- String* pAppId = null;
- String* pRequestType = null;
- String* pProviderId = null;
+ String appId;
+ String reqType;
+ String providerId;
+ String version;
String* pDataId = null;
- String* pReqId = null;
+ String callerReqId;
String* pColumnCount = null;
String* pColumn = null;
String* pValue = null;
String* pErrorMsg = null;
String* pNo = null;
String* pCount = null;
+ String* pTmpPath = null;
String empty(L"NULL");
-#if 0
- _DataControlResultSetImpl* pResultSetImpl = null;
- String* pResult = null;
- String* pObject = null;
- String* pTempObject = null;
- String* pTempFilePath = null;
-#endif
_AppArg resultArg;
int type = 0;
_DataControlRequestType requestType = _DATACONTROL_REQUEST_TYPE_UNDEFINED;
int countPerPage = 0;
int i = 0;
int index = 0;
- //ArrayList* pResultArgList = null;
result r = E_SUCCESS;
result res = E_SUCCESS;
ArrayList* pList = null;
String* pKey = null;
String* pNewValue = null;
String* pOldValue = null;
-#if 0
- String* pResultCount = null;
- String* pResultValue = null;
-#endif
- SysLog(NID_APP, "[DC_PROVIDER] Data control request is received.");
- //arg.Print();
+ SysLog(NID_APP, "[DC_PROV_RECV] Data control request is received.");
+ //arg.Print(); // request info
- pList = arg.GetArgListN(0);
- SysTryCatch(NID_APP, pList, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+ // key-based request
+ appId = arg.GetCallerAppId();
- // key-based
- pAppId = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_APPID)); // key(0)
- SysTryCatch(NID_APP, pAppId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
-
- pRequestType = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_REQUESTTYPE)); // key(1)
- SysTryCatch(NID_APP, pRequestType, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
- Integer::Parse(*pRequestType, type);
+ reqType = arg.GetValue(OSP_K_DATACONTROL_REQUEST_TYPE);
+ Integer::Parse(reqType, type);
requestType = static_cast< _DataControlRequestType >(type);
- pReqId = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_REQID)); // key(2)
- SysTryCatch(NID_APP, pReqId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+ version = arg.GetValue(OSP_K_DATACONTROL_PROTOCOL_VERSION);
+ callerReqId = arg.GetValue(OSP_K_REQUEST_ID);
+ providerId = arg.GetValue(OSP_K_DATACONTROL_PROVIDER);
- pProviderId = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_PROVIDERID)); // key(3)
- SysTryCatch(NID_APP, pProviderId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+ // list-based request
+ pList = _AppArg::GetListN(arg.GetBundle(), OSP_K_ARG);
+ SysTryCatch(NID_APP, pList, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid result object");
- // list-based
- pDataId = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_DATAID));// list(0): data ID
+ pDataId = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_DATAID));// request list[0]: data ID
SysTryCatch(NID_APP, pDataId, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
if (requestType >= _DATACONTROL_REQUEST_TYPE_SQL_QUERY && requestType <= _DATACONTROL_REQUEST_TYPE_SQL_DELETE)
}
else if (requestType >= _DATACONTROL_REQUEST_TYPE_MAP_QUERY && requestType <= _DATACONTROL_REQUEST_TYPE_MAP_DELETE)
{
- pKey = dynamic_cast< String* >(pList->GetAt(5)); // list[1]
+ pKey = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_MAPKEY)); // request list[1]
SysTryCatch(NID_APP, pKey, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
pMapListener = __pMapDataControlProviderEventListener;
switch (requestType)
{
case _DATACONTROL_REQUEST_TYPE_SQL_QUERY:
- SysLog(NID_APP, "[DC_PROVIDER] SqlDataControl SELECT");
+ SysLog(NID_APP, "[DC_PROV_RECV] SqlDataControl SELECT");
- // list(1): selected column count
+ // request list[1]: selected column count
pColumnCount = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_COLUMNCOUNT));
SysTryCatch(NID_APP, pColumnCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
pColumnList = new (std::nothrow) ArrayList();
SysTryReturnVoidResult(NID_APP, pColumnList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
pColumnList->Construct();
- SysLog(NID_APP, "[DC_PROVIDER] selected column count: %d", columnCount);
+ SysLog(NID_APP, "[DC_PROV_RECV] selected column count: %d", columnCount);
i = 0;
- while (i < columnCount) // list(2): column list
+ while (i < columnCount) // request list[2]: column list
{
pColumn = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_COLUMNLIST + i));
SysTryCatch(NID_APP, pColumn != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
pColumnList->Add(*(new String(*pColumn)));
- SysLog(NID_APP, "[DC_PROVIDER] column[%d]: %ls", i, pColumn->GetPointer());
+ SysLog(NID_APP, "[DC_PROV_RECV] column[%d]: %ls", i, pColumn->GetPointer());
i++;
}
}
i += _DATACONTROL_PACKET_INDEX_COLUMNLIST;
- pWhere = dynamic_cast< String* >(pList->GetAt(i)); // list(3): where clause
+ pWhere = dynamic_cast< String* >(pList->GetAt(i)); // request list: where clause
SysTryCatch(NID_APP, pWhere, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
if (pWhere->Equals(empty) == true)
}
else
{
- SysLog(NID_APP, "[DC_PROVIDER] pWhere: %ls", pWhere->GetPointer());
+ SysLog(NID_APP, "[DC_PROV_RECV] pWhere: %ls", pWhere->GetPointer());
}
i++;
- pOrder = dynamic_cast< String* >(pList->GetAt(i)); // list(4): order clause
+ pOrder = dynamic_cast< String* >(pList->GetAt(i)); // request list: order clause
SysTryCatch(NID_APP, pOrder, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
if (pOrder->Equals(empty) == true)
}
else
{
- SysLog(NID_APP, "[DC_PROVIDER] pOrder: %ls", pOrder->GetPointer());
+ SysLog(NID_APP, "[DC_PROV_RECV] pOrder: %ls", pOrder->GetPointer());
}
i++;
- pNo = dynamic_cast <String*>(pList->GetAt(i)); // list(5): page number
+ pNo = dynamic_cast <String*>(pList->GetAt(i)); // request list: page number
SysTryCatch(NID_APP, pNo, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
Integer::Parse(*pNo, pageNo);
i++;
- pCount = dynamic_cast <String*>(pList->GetAt(i)); // list(6): count per page
+ pCount = dynamic_cast <String*>(pList->GetAt(i)); // request list: count per page
SysTryCatch(NID_APP, pCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
Integer::Parse(*pCount, countPerPage);
- pSqlListener->OnSqlDataControlSelectRequestReceived(reqId, *pProviderId, *pDataId, pColumnList,
+ pSqlListener->OnSqlDataControlSelectRequestReceived(reqId, providerId, *pDataId, pColumnList,
pWhere, pOrder);
- SysLog(NID_APP, "[DC_PROVIDER] caller appId: %ls, requestType: %d, reqId: %ls, providerId: %ls, dataId: %ls, pColumnList: 0x%0x, pWhere: 0x%x, pOrder: 0x%x, pageNo: %d, countPerPage: %d",
- pAppId->GetPointer(), requestType, pReqId->GetPointer(), pProviderId->GetPointer(),
+ SysSecureLog(NID_APP, "[DC_PROV_RECV] caller app: %ls, requestType: %d, caller req: %ls, provider: %ls, data: %ls, pColumnList: 0x%0x, pWhere: 0x%x, pOrder: 0x%x, pageNo: %d, countPerPage: %d",
+ appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
pDataId->GetPointer(), pColumnList, pWhere, pOrder, pageNo, countPerPage);
break;
case _DATACONTROL_REQUEST_TYPE_SQL_INSERT:
- SysLog(NID_APP, "[DC_PROVIDER] SqlDataControl INSERT");
+ SysLog(NID_APP, "[DC_PROV_RECV] SqlDataControl INSERT");
- // list(1): insert column count
+ // request list[1]: inserted column count
pColumnCount = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_COLUMNCOUNT));
SysTryCatch(NID_APP, pColumnCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
Integer::Parse(*pColumnCount, columnCount);
- SysLog(NID_APP, "[DC_PROVIDER] inserted column count: %d", columnCount);
+ SysLog(NID_APP, "[DC_PROV_RECV] inserted column count: %d", columnCount);
pInsertMap = new (std::nothrow) HashMap();
SysTryReturnVoidResult(NID_APP, pInsertMap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
pInsertMap->Construct();
- i = 0;
- index = 0;
- while (i < columnCount * 2) // list(2): column-value pairs
+ SysLog(NID_APP, "[DC_PROV_RECV] version: %ls", version.GetPointer());
+ if (version == L"ver_2.1.0.2" || version == L"ver_2.1.0.3")
+ {
+ pTmpPath = dynamic_cast< String* >(pList->GetAt(2)); // request list[2]: path
+ SysTryCatch(NID_APP, pTmpPath != null, , E_SYSTEM, "[E_SYSTEM] invalid request");
+ SysLog(NID_APP, "[DC_PROV_RECV] request: %ls", pTmpPath->GetPointer());
+
+ File request;
+ r = request.Construct(*pTmpPath, "r");
+ SysTryCatch(NID_APP, !IsFailed(r), , E_SYSTEM, "[%s] Failed to open request (%ls).",
+ GetErrorMessage(r), pTmpPath->GetPointer());
+
+ for (i = 0; i < columnCount; ++i) // column-value pairs
+ {
+ int length = -1;
+ int ret = request.Read(&length, sizeof(int));
+ SysTryCatch(NID_APP, ret > 0, , E_SYSTEM, "[%s] Failed to receive request.",
+ GetErrorMessage(GetLastResult()));
+
+ char* pColumn = new (std::nothrow) char[length + 1];
+ ret = request.Read(pColumn, length);
+ SysTryCatch(NID_APP, ret > 0, delete pColumn, E_SYSTEM, "[%s] Failed to receive request.",
+ GetErrorMessage(GetLastResult()));
+ pColumn[length] = '\0';
+ SysLog(NID_APP, "[DC_PROV_RECV] column[%d]: %s", i, pColumn);
+
+ ret = request.Read(&length, sizeof(int));
+ SysTryCatch(NID_APP, ret > 0, delete pColumn, E_SYSTEM, "[%s] Failed to receive request.",
+ GetErrorMessage(GetLastResult()));
+
+ char* pValue = new (std::nothrow) char[length + 1];
+ ret = request.Read(pValue, length);
+ if (ret == 0)
+ {
+ SysLogException(NID_APP, E_SYSTEM, "[%s] Failed to receive request.", GetErrorMessage(GetLastResult()));
+ delete pColumn;
+ delete pValue;
+ }
+ pValue[length] = '\0';
+ SysLog(NID_APP, "[DC_PROV_RECV] value[%d]: %s", i, pValue);
+
+ pInsertMap->Add(new (std::nothrow) String(pColumn), new (std::nothrow) String(pValue));
+ delete pColumn;
+ delete pValue;
+ }
+ }
+ else
{
- pColumn = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_INSERTMAP + i++));
- SysTryCatch(NID_APP, pColumn != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
- SysLog(NID_APP, "[DC_PROVIDER] column[%d]: %ls", index, pColumn->GetPointer());
+ i = 0;
+ index = 0;
+ while (i < columnCount * 2) // request list: column-value pairs
+ {
+ pColumn = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_INSERTMAP + i++));
+ SysTryCatch(NID_APP, pColumn != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+ SysLog(NID_APP, "[DC_PROV_RECV] column[%d]: %ls", index, pColumn->GetPointer());
- pValue = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_INSERTMAP + i++));
- SysTryCatch(NID_APP, pValue != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
- SysLog(NID_APP, "[DC_PROVIDER] value[%d]: %ls", index, pValue->GetPointer());
+ pValue = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_INSERTMAP + i++));
+ SysTryCatch(NID_APP, pValue != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+ SysLog(NID_APP, "[DC_PROV_RECV] value[%d]: %ls", index, pValue->GetPointer());
- pInsertMap->Add(*(new String(*pColumn)), *(new String(*pValue)));
- index++;
+ pInsertMap->Add(new (std::nothrow) String(*pColumn), new (std::nothrow) String(*pValue));
+ index++;
+ }
}
- pSqlListener->OnSqlDataControlInsertRequestReceived(reqId, *pProviderId, *pDataId, *pInsertMap);
+ if (pTmpPath)
+ {
+ r = File::Remove(*pTmpPath);
+ SysTryLog(NID_APP, !IsFailed(r), "Failed to remove result: %ls", pTmpPath->GetPointer());
+ }
- SysLog(NID_APP, "[DC_PROVIDER] caller appId: %ls, requestType: %d, reqId: %ls, providerId: %ls, dataId: %ls, pInsertMap: 0x%x",
- pAppId->GetPointer(), requestType, pReqId->GetPointer(), pProviderId->GetPointer(),
+ pSqlListener->OnSqlDataControlInsertRequestReceived(reqId, providerId, *pDataId, *pInsertMap);
+
+ SysLog(NID_APP, "[DC_PROV_RECV] caller app: %ls, requestType: %d, caller req: %ls, provider: %ls, data: %ls, pInsertMap: 0x%x",
+ appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
pDataId->GetPointer(), pInsertMap);
break;
case _DATACONTROL_REQUEST_TYPE_SQL_UPDATE:
- SysLog(NID_APP, "[DC_PROVIDER] SqlDataControl UPDATE");
+ SysLog(NID_APP, "[DC_PROV_RECV] SqlDataControl UPDATE");
- // list(1): updated column count
+ // request list[1]: updated column count
pColumnCount = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_COLUMNCOUNT));
SysTryCatch(NID_APP, pColumnCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
Integer::Parse(*pColumnCount, columnCount);
- SysLog(NID_APP, "[DC_PROVIDER] updated column count: %d", columnCount);
+ SysLog(NID_APP, "[DC_PROV_RECV] updated column count: %d", columnCount);
pUpdateMap = new (std::nothrow) HashMap();
SysTryReturnVoidResult(NID_APP, pUpdateMap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
pUpdateMap->Construct();
- i = 0;
- index = 0;
- while (i < columnCount * 2) // list(2): column-value pairs
+ SysLog(NID_APP, "[DC_PROV_RECV] version: %ls", version.GetPointer());
+ if (version == L"ver_2.1.0.2" || version == L"ver_2.1.0.3")
{
- pColumn = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_UPDATEMAP + i++));
- SysTryCatch(NID_APP, pColumn != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
- SysLog(NID_APP, "[DC_PROVIDER] column[%d]: %ls", index, pColumn->GetPointer());
+ pTmpPath = dynamic_cast< String* >(pList->GetAt(2)); // request list[2]: path
+ SysTryCatch(NID_APP, pTmpPath != null, , E_SYSTEM, "[E_SYSTEM] invalid request");
+ SysLog(NID_APP, "[DC_PROV_RECV] request: %ls", pTmpPath->GetPointer());
- pValue = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_UPDATEMAP + i++));
- SysTryCatch(NID_APP, pValue != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
- SysLog(NID_APP, "[DC_PROVIDER] value[%d]: %ls", index, pValue->GetPointer());
+ File request;
+ r = request.Construct(*pTmpPath, "r");
+ SysTryCatch(NID_APP, !IsFailed(r), , E_SYSTEM, "[%s] Failed to open request (%ls).",
+ GetErrorMessage(r), pTmpPath->GetPointer());
- pUpdateMap->Add(*(new String(*pColumn)), *(new String(*pValue)));
- index++;
+ for (i = 0; i < columnCount; ++i) // column-value pairs
+ {
+ int length = -1;
+ int ret = request.Read(&length, sizeof(int));
+ SysTryCatch(NID_APP, ret > 0, , E_SYSTEM, "[%s] Failed to receive request.",
+ GetErrorMessage(GetLastResult()));
+
+ char* pColumn = new (std::nothrow) char[length + 1];
+ ret = request.Read(pColumn, length);
+ SysTryCatch(NID_APP, ret > 0, delete pColumn, E_SYSTEM, "[%s] Failed to receive request.",
+ GetErrorMessage(GetLastResult()));
+ pColumn[length] = '\0';
+ SysLog(NID_APP, "[DC_PROV_RECV] column[%d]: %s", i, pColumn);
+
+ ret = request.Read(&length, sizeof(int));
+ SysTryCatch(NID_APP, ret > 0, delete pColumn, E_SYSTEM, "[%s] Failed to receive request.",
+ GetErrorMessage(GetLastResult()));
+
+ char* pValue = new (std::nothrow) char[length + 1];
+ ret = request.Read(pValue, length);
+ if (ret == 0)
+ {
+ SysLogException(NID_APP, E_SYSTEM, "[%s] Failed to receive request.", GetErrorMessage(GetLastResult()));
+ delete pColumn;
+ delete pValue;
+ }
+ pValue[length] = '\0';
+ SysLog(NID_APP, "[DC_PROV_RECV] value[%d]: %s", i, pValue);
+
+ pUpdateMap->Add(new (std::nothrow) String(pColumn), new (std::nothrow) String(pValue));
+ delete pColumn;
+ delete pValue;
+ }
+
+ // request list: where clause
+ pWhere = dynamic_cast< String* >(pList->GetAt(3));
+ SysTryCatch(NID_APP, pWhere != null, , E_SYSTEM, "[E_SYSTEM] invalid request");
}
+ else
+ {
+ i = 0;
+ index = 0;
+ while (i < columnCount * 2) // request list: column-value pairs
+ {
+ pColumn = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_UPDATEMAP + i++));
+ SysTryCatch(NID_APP, pColumn != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+ SysLog(NID_APP, "[DC_PROV_RECV] column[%d]: %ls", index, pColumn->GetPointer());
- // list(3): where clause
- pWhere = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_UPDATEMAP + i));
- SysTryCatch(NID_APP, pWhere, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+ pValue = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_UPDATEMAP + i++));
+ SysTryCatch(NID_APP, pValue != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+ SysLog(NID_APP, "[DC_PROV_RECV] value[%d]: %ls", index, pValue->GetPointer());
+
+ pUpdateMap->Add(new (std::nothrow) String(*pColumn), new (std::nothrow) String(*pValue));
+ index++;
+ }
+
+ // request list: where clause
+ pWhere = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_UPDATEMAP + i));
+ SysTryCatch(NID_APP, pWhere, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
+ }
if (pWhere->Equals(empty) == true)
{
}
else
{
- SysLog(NID_APP, "[DC_PROVIDER] pWhere: %ls", pWhere->GetPointer());
+ SysLog(NID_APP, "[DC_PROV_RECV] pWhere: %ls", pWhere->GetPointer());
+ }
+
+ if (pTmpPath)
+ {
+ r = File::Remove(*pTmpPath);
+ SysTryLog(NID_APP, !IsFailed(r), "Failed to remove result: %ls", pTmpPath->GetPointer());
}
- pSqlListener->OnSqlDataControlUpdateRequestReceived(reqId, *pProviderId, *pDataId, *pUpdateMap, pWhere);
+ pSqlListener->OnSqlDataControlUpdateRequestReceived(reqId, providerId, *pDataId, *pUpdateMap, pWhere);
- SysLog(NID_APP, "[DC_PROVIDER] caller appId: %ls, requestType: %d, reqId: %ls, providerId: %ls, dataId: %ls, pUpdateMap: 0x%x, pWhere: 0x%x",
- pAppId->GetPointer(), requestType, pReqId->GetPointer(), pProviderId->GetPointer(),
+ SysLog(NID_APP, "[DC_PROV_RECV] caller app: %ls, requestType: %d, caller req: %ls, provider: %ls, data: %ls, pUpdateMap: 0x%x, pWhere: 0x%x",
+ appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
pDataId->GetPointer(), pUpdateMap, pWhere);
break;
case _DATACONTROL_REQUEST_TYPE_SQL_DELETE:
- SysLog(NID_APP, "[DC_PROVIDER] SqlDataControl DELETE");
+ SysLog(NID_APP, "[DC_PROV_RECV] SqlDataControl DELETE");
- // list(1): where clause
+ // request list[1]: where clause
pWhere = dynamic_cast< String* >(pList->GetAt(_DATACONTROL_PACKET_INDEX_DELETEWHERE));
SysTryCatch(NID_APP, pWhere, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
}
else
{
- SysLog(NID_APP, "[DC_PROVIDER] pWhere: %ls", pWhere->GetPointer());
+ SysLog(NID_APP, "[DC_PROV_RECV] pWhere: %ls", pWhere->GetPointer());
}
- pSqlListener->OnSqlDataControlDeleteRequestReceived(reqId, *pProviderId, *pDataId, pWhere);
+ pSqlListener->OnSqlDataControlDeleteRequestReceived(reqId, providerId, *pDataId, pWhere);
- SysLog(NID_APP, "[DC_PROVIDER] caller appId: %ls, requestType: %d, reqId: %ls, providerId: %ls, dataId: %ls, pWhere: 0x%x",
- pAppId->GetPointer(), requestType, pReqId->GetPointer(), pProviderId->GetPointer(),
+ SysLog(NID_APP, "[DC_PROV_RECV] caller app: %ls, requestType: %d, caller req: %ls, provider: %ls, data: %ls, pWhere: 0x%x",
+ appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
pDataId->GetPointer(), pWhere);
break;
case _DATACONTROL_REQUEST_TYPE_MAP_QUERY:
- pNo = dynamic_cast <String*>(pList->GetAt(6)); // list[2]
+ SysLog(NID_APP, "[DC_PROV_RECV] MapDataControl GetValue");
+
+ pNo = dynamic_cast <String*>(pList->GetAt(2)); // request list[2]
SysTryCatch(NID_APP, pNo, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
Integer::Parse(*pNo, pageNo);
- pCount = dynamic_cast <String*>(pList->GetAt(7)); //list[3]
+ pCount = dynamic_cast <String*>(pList->GetAt(3)); // request list[3]
SysTryCatch(NID_APP, pCount, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
Integer::Parse(*pCount, countPerPage);
- pMapListener->OnMapDataControlGetValueRequestReceived(reqId, *pProviderId, *pDataId, *pKey);
+ pMapListener->OnMapDataControlGetValueRequestReceived(reqId, providerId, *pDataId, *pKey);
+
+ SysLog(NID_APP, "[DC_PROV_RECV] caller app: %ls, requestType: %d, caller req: %ls, provider: %ls, data: %ls, key: %ls, pageNo: %d, countPerPage: %d",
+ appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
+ pDataId->GetPointer(), pKey->GetPointer(), pageNo, countPerPage);
break;
case _DATACONTROL_REQUEST_TYPE_MAP_INSERT:
- pValue = dynamic_cast <String*>(pList->GetAt(6)); // list[2]
+ SysLog(NID_APP, "[DC_PROV_RECV] MapDataControl AddValue");
+
+ pValue = dynamic_cast <String*>(pList->GetAt(2)); // request list[2]
SysTryCatch(NID_APP, pValue, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
- pMapListener->OnMapDataControlAddValueRequestReceived(reqId, *pProviderId, *pDataId, *pKey, *pValue);
+ pMapListener->OnMapDataControlAddValueRequestReceived(reqId, providerId, *pDataId, *pKey, *pValue);
+
+ SysLog(NID_APP, "[DC_PROV_RECV] caller app: %ls, requestType: %d, caller req: %ls, provider: %ls, data: %ls, key: %ls, value: %ls",
+ appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
+ pDataId->GetPointer(), pKey->GetPointer(), pValue->GetPointer());
break;
case _DATACONTROL_REQUEST_TYPE_MAP_UPDATE:
- pOldValue = dynamic_cast <String*>(pList->GetAt(6)); // list[2]
+ SysLog(NID_APP, "[DC_PROV_RECV] MapDataControl SetValue");
+
+ pOldValue = dynamic_cast <String*>(pList->GetAt(2)); // request list[2]
SysTryCatch(NID_APP, pOldValue, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
- pNewValue = dynamic_cast <String*>(pList->GetAt(7)); // list[3]
+ pNewValue = dynamic_cast <String*>(pList->GetAt(3)); // request list[3]
SysTryCatch(NID_APP, pNewValue, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
- pMapListener->OnMapDataControlSetValueRequestReceived(reqId, *pProviderId, *pDataId, *pKey, *pOldValue, *pNewValue);
+ pMapListener->OnMapDataControlSetValueRequestReceived(reqId, providerId, *pDataId, *pKey, *pOldValue, *pNewValue);
+
+ SysLog(NID_APP, "[DC_PROV_RECV] caller app: %ls, requestType: %d, caller req: %ls, provider: %ls, data: %ls, key: %ls, oldValue: %ls, newValue: %ls",
+ appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
+ pDataId->GetPointer(), pKey->GetPointer(), pOldValue->GetPointer(), pNewValue->GetPointer());
break;
case _DATACONTROL_REQUEST_TYPE_MAP_DELETE:
- pValue = dynamic_cast <String*>(pList->GetAt(6)); // list[2]
+ SysLog(NID_APP, "[DC_PROV_RECV] MapDataControl RemoveValue");
+
+ pValue = dynamic_cast <String*>(pList->GetAt(2)); // request list[2]
SysTryCatch(NID_APP, pValue, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
- pMapListener->OnMapDataControlRemoveValueRequestReceived(reqId, *pProviderId, *pDataId, *pKey, *pValue);
+ pMapListener->OnMapDataControlRemoveValueRequestReceived(reqId, providerId, *pDataId, *pKey, *pValue);
+
+ SysLog(NID_APP, "[DC_PROV_RECV] caller app: %ls, requestType: %d, caller req: %ls, provider: %ls, data: %ls, key: %ls, value: %ls",
+ appId.GetPointer(), requestType, callerReqId.GetPointer(), providerId.GetPointer(),
+ pDataId->GetPointer(), pKey->GetPointer(), pValue->GetPointer());
break;
default:
SysTryCatch(NID_APP, false, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] invalid request");
break;
}
- if (requestType >= _DATACONTROL_REQUEST_TYPE_MAP_QUERY && requestType <= _DATACONTROL_REQUEST_TYPE_MAP_DELETE)
- {
- SysLog(NID_APP, "caller appId: %ls, requestType: %d, reqId: %ls, providerId: %ls, dataId: %ls, key: %ls",
- pAppId->GetPointer(), requestType, pReqId->GetPointer(), pProviderId->GetPointer(),
- pDataId->GetPointer(), pKey->GetPointer());
- }
-
if (pColumnList)
{
pColumnList->RemoveAll(true);
return;
CATCH:
- if (r == E_SYSTEM)
- {
- pErrorMsg = new (std::nothrow) String("[E_SYSTEM] A system error has occurred.");
- }
- else if (r == E_OUT_OF_MEMORY)
- {
- pErrorMsg = new (std::nothrow) String("[E_OUT_OF_MEMORY] The memory was insufficient.");
- }
- SysTryReturnVoidResult(NID_APP, pErrorMsg, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory was insufficient.");
-
- res = DataControlProviderManager::GetInstance()->SendDataControlError(reqId, *pErrorMsg);
-
if (pColumnList)
{
pColumnList->RemoveAll(true);
delete pUpdateMap;
}
+ if (r == E_SYSTEM)
+ {
+ pErrorMsg = new (std::nothrow) String("[E_SYSTEM] A system error has occurred.");
+ }
+ else if (r == E_OUT_OF_MEMORY)
+ {
+ pErrorMsg = new (std::nothrow) String("[E_OUT_OF_MEMORY] The memory was insufficient.");
+ }
+ SysTryReturnVoidResult(NID_APP, pErrorMsg, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory was insufficient.");
+
+ res = DataControlProviderManager::GetInstance()->SendDataControlError(reqId, *pErrorMsg);
+
delete pErrorMsg;
return;
void
+_AppImpl::RaiseWindow(void)
+{
+ SysTryReturnVoidResult(NID_APP, __pIAppImpl != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting App instance failed.");
+
+ __pIAppImpl->OnFrameRaiseRequested();
+}
+
+
+void
_AppImpl::OnAppCheckpoint(void)
{
if (__pCheckpointEventListener)
{
switch (appEvent)
{
- case AE_CHECKPOINT:
+ case _APP_EVENT_CHECKPOINT:
SysTryReturnResult(NID_APP, __pCheckpointEventListener == null, E_OBJ_ALREADY_EXIST, "Checkpoint listener is already set.");
// fall through
- case AE_CLEAR_LISTENER:
+ case _APP_EVENT_CLEAR_LISTENER:
__pCheckpointEventListener = dynamic_cast <IAppCheckpointEventListener*>(pListener);
break;
return __isTerminationRequested;
}
+typedef void (*cbForVconf)(keynode_t* node, void *pData);
+
void
-_AppImpl::OnPowerOffNotiReceived(void* user_data)
+_AppImpl::OnPowerOffNotiReceived(void* node, void* user_data)
{
- SysLog(NID_APP, "Application is being terminated by power off.");
+ int value = -1;
+ if (!vconf_get_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, &value))
+ {
+ if (value == VCONFKEY_SYSMAN_POWER_OFF_DIRECT || value == VCONFKEY_SYSMAN_POWER_OFF_RESTART)
+ {
+ SysLog(NID_APP, "Application is being terminated by power off.");
- _AppImpl* pAppImpl = _AppImpl::GetInstance();
- if (pAppImpl != null)
+ if (vconf_ignore_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, (cbForVconf)_AppImpl::OnPowerOffNotiReceived))
+ {
+ SysLog(NID_APP, "Fail to ignore vconf for key(%s)", VCONFKEY_SYSMAN_POWER_OFF_STATUS);
+ }
+
+ _AppImpl* pAppImpl = _AppImpl::GetInstance();
+ if (pAppImpl != null)
+ {
+ pAppImpl->__forcedTermination = true;
+ }
+
+ app_efl_exit();
+ }
+ }
+}
+
+void
+_AppImpl::OnSettingChanged(String& key)
+{
+ if (key == L"http://tizen.org/setting/locale.language")
{
- pAppImpl->__forcedTermination = true;
+ _AppInfo::UpdatePackageInfo(true);
+ _AppResourceImpl::Reinitialize();
+ SysLog(NID_APP, "Reinitialized resources due to locale change.");
}
-
- app_efl_exit();
}
-bool
+bool
_AppImpl::IsForcedTermination(void)
{
return __forcedTermination;