const wchar_t TIZEN_OPERATION_PICK[] = L"http://tizen.org/appcontrol/operation/pick";
const wchar_t SELECTOR_NOTI_KEY[] = L"__APP_SVC_CALLER_NOTI__";
const int _MAX_PACKAGE_ID_LENGTH = 10;
-const int _MAX_DATA_ARGUMENT_LENGTH = 32768; // 32KB
_InProcessInfo::~_InProcessInfo(void)
{
// [INFO] Ugly solution for submode support
pArg->UpdateAppId(tempId);
kb = pArg->GetBundle();
-
- bundle_raw* dataBuf = null;
- int dataLen = 0;
- int res = bundle_encode(kb, &dataBuf, &dataLen);
- bundle_free_encoded_rawdata(&dataBuf);
- SysTryReturnResult(NID_APP, res == 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- SysTryReturnResult(NID_APP, dataLen <= _MAX_DATA_ARGUMENT_LENGTH, E_MAX_EXCEEDED,
- "The data length (%d) exceeds the maximum limit.", dataLen);
pid = appsvc_run_service(kb, req, LaunchResultCb, this);
if (pid > 0)
const int _MAX_CATEGORY = 12;
const int _MAX_PACKAGE_ID_LENGTH = 10;
-const int _MAX_DATA_ARGUMENT_LENGTH = 32768; // 32KB
// borrowed from app-svc/include/pri_key.h
#define APP_SVC_K_RES_VAL "__APP_SVC_K_RES_VAL__"
snprintf(tmp, 32, "%d", static_cast<int>(res));
appsvc_add_data(b, APP_SVC_K_RES_VAL, tmp);
- bundle_raw* dataBuf = null;
- int dataLen = 0;
- int ret = bundle_encode(b, &dataBuf, &dataLen);
- bundle_free_encoded_rawdata(&dataBuf);
- SysTryReturnResult(NID_APP, ret == 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- SysTryReturnResult(NID_APP, dataLen <= _MAX_DATA_ARGUMENT_LENGTH, E_MAX_EXCEEDED,
- "The data length (%d) exceeds the maximum limit.", dataLen);
-
int aul_ret = aul_send_service_result(b);
return GetConvertedResult(aul_ret, "SendResult");
namespace Tizen { namespace App
{
+static const int _MAX_ARGUMENT_SIZE = 16384; // 16KB
+
result
_DataControlProviderManagerImpl::SetSqlDataControlProviderEventListener(ISqlDataControlProviderEventListener* pListener)
{
}
SysTryCatch(NID_APP, pErrorMessage, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
"[E_OUT_OF_MEMORY] The memory was insufficient.");
+ SysTryCatch(NID_APP, pErrorMessage->GetLength() <= _MAX_ARGUMENT_SIZE, r = E_MAX_EXCEEDED, E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The size of sending argument (%d) exceeds the maximum limit.", pErrorMessage->GetLength());
pResultArgList->Add(*pErrorMessage); // result list[1]
switch (requestType)
"[E_OUT_OF_MEMORY] The memory was insufficient.");
pResultArgList->Add(*pResultCount); // result list[2]
+ long long argSize = 0;
for (int i = currentoffset; i < num; i++)
{
String* pTempValue = dynamic_cast< String* >(pResultValueList->GetAt(i));
SysTryCatch(NID_APP, pResultValue, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
"[E_OUT_OF_MEMORY] The memory was insufficient.");
pResultArgList->Add(*pResultValue); // list[3] ~
+ argSize += pResultValue->GetLength() * sizeof(wchar_t);
}
+ SysTryCatch(NID_APP, argSize <= _MAX_ARGUMENT_SIZE, r = E_MAX_EXCEEDED, E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The size of sending argument (%d) exceeds the maximum limit.", argSize);
}
break;
}
{
static const int MAX_REQUEST_COUNT = 128;
+static const int _MAX_ARGUMENT_SIZE = 16384; // 16KB
class _MapDataControlEventArg
: public IEventArg
SysTryReturnResult(NID_APP, (__access & _DATACONTROL_ACCESS_READ) > 0, E_ILLEGAL_ACCESS,
"The GetValue query is not permitted by DataControl provider.");
+ String* pPageNo = null;
+ String* pCountPerPage = null;
int id = 0;
result r = E_SUCCESS;
- ArrayList* pArgList = null;
- pArgList = new ArrayList();
+ ArrayList* pArgList = new ArrayList();
pArgList->Construct();
pArgList->Add(*(new String(dataId)));
pArgList->Add(*(new String(key)));
+ long long argSize = dataId.GetLength() * sizeof(wchar_t);
+ argSize += key.GetLength() * sizeof(wchar_t);
+ SysTryCatch(NID_APP, argSize <= _MAX_ARGUMENT_SIZE, r = E_MAX_EXCEEDED, E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The size of sending argument (%d) exceeds the maximum limit.", argSize);
- String* pPageNo = new String();
+ pPageNo = new (std::nothrow) String();
pPageNo->Append(pageNo);
pArgList->Add(*pPageNo);
- String* pCountPerPage = new String();
+ pCountPerPage = new (std::nothrow) String();
pCountPerPage->Append(countPerPage);
pArgList->Add(*pCountPerPage);
pArgList->Add(*(new String(dataId)));
pArgList->Add(*(new String(key)));
pArgList->Add(*(new String(value)));
+ long long argSize = dataId.GetLength() * sizeof(wchar_t);
+ argSize += key.GetLength() * sizeof(wchar_t);
+ argSize += value.GetLength() * sizeof(wchar_t);
+ SysTryCatch(NID_APP, argSize <= _MAX_ARGUMENT_SIZE, r = E_MAX_EXCEEDED, E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The size of sending argument (%d) exceeds the maximum limit.", argSize);
r = StartMapDataControl(_DATACONTROL_REQUEST_TYPE_MAP_INSERT, pArgList, &id);
SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating to caller...", GetErrorMessage(r));
pArgList->Add(*(new String(key)));
pArgList->Add(*(new String(oldValue)));
pArgList->Add(*(new String(newValue)));
+ long long argSize = dataId.GetLength() * sizeof(wchar_t);
+ argSize += key.GetLength() * sizeof(wchar_t);
+ argSize += oldValue.GetLength() * sizeof(wchar_t);
+ argSize += newValue.GetLength() * sizeof(wchar_t);
+ SysTryCatch(NID_APP, argSize <= _MAX_ARGUMENT_SIZE, r = E_MAX_EXCEEDED, E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The size of sending argument (%d) exceeds the maximum limit.", argSize);
r = StartMapDataControl(_DATACONTROL_REQUEST_TYPE_MAP_UPDATE, pArgList, &id);
SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating to caller...", GetErrorMessage(r));
pArgList->Add(*(new String(dataId)));
pArgList->Add(*(new String(key)));
pArgList->Add(*(new String(value)));
+ long long argSize = dataId.GetLength() * sizeof(wchar_t);
+ argSize += key.GetLength() * sizeof(wchar_t);
+ argSize += value.GetLength() * sizeof(wchar_t);
+ SysTryCatch(NID_APP, argSize <= _MAX_ARGUMENT_SIZE, r = E_MAX_EXCEEDED, E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The size of sending argument (%d) exceeds the maximum limit.", argSize);
r = StartMapDataControl(_DATACONTROL_REQUEST_TYPE_MAP_DELETE, pArgList, &id);
SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating to caller...", GetErrorMessage(r));
{
static const int MAX_REQUEST_COUNT = 128;
+static const int _MAX_ARGUMENT_SIZE = 16384; // 16KB
class _SqlDataControlEventArg
: public IEventArg
pArgList->Construct();
pArgList->Add(*(new String(dataId))); // list(0): data ID
+ long long argSize = dataId.GetLength() * sizeof(wchar_t);
if (pColumnList != null)
{
"[E_INVALID_ARG] The object is not String class.");
pArgList->Add(*(new String(*pColumn)));
+ argSize += pColumn->GetLength() * sizeof(wchar_t);
SysLog(NID_APP, "[DC_CALLER] column[%d]: %ls", i, pColumn->GetPointer());
i++;
}
if (pWhere != null) // list(3): where clause
{
pArgList->Add(*(new String(*pWhere)));
+ argSize += pWhere->GetLength() * sizeof(wchar_t);
SysLog(NID_APP, "[DC_CALLER] pWhere: %ls", pWhere->GetPointer());
}
else
if (pOrder != null) // list(4): order clause
{
pArgList->Add(*(new String(*pOrder)));
+ argSize += pOrder->GetLength() * sizeof(wchar_t);
SysLog(NID_APP, "[DC_CALLER] pOrder: %ls", pOrder->GetPointer());
}
else
{
pArgList->Add(*(new String(L"NULL")));
}
+ SysTryCatch(NID_APP, argSize <= _MAX_ARGUMENT_SIZE, r = E_MAX_EXCEEDED, E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The size of sending argument (%d) exceeds the maximum limit.", argSize);
pArgList->Add(*(new String(Integer::ToString(pageNo)))); // list(5): page number
}
result
-_SqlDataControlImpl::Insert(const Tizen::Base::String& dataId, const Tizen::Base::Collection::IMap& insertMap,
- RequestId& reqId)
+_SqlDataControlImpl::Insert(const String& dataId, const IMap& insertMap, RequestId& reqId)
{
SysTryReturnResult(NID_APP, (__access & _DATACONTROL_ACCESS_WRITE) > 0, E_ILLEGAL_ACCESS,
"The INSERT query is not permitted by DataControl provider.");
pArgList->Construct();
pArgList->Add(*(new String(dataId))); // list(0): data ID
+ long long argSize = dataId.GetLength() * sizeof(wchar_t);
pArgList->Add(*(new String(Integer::ToString(columnCount)))); // list(1): inserted column count
SysLog(NID_APP, "[DC_CALLER] inserted column count: %d", columnCount);
pArgList->Add(*(new String(*pValue)));
SysLog(NID_APP, "[DC_CALLER] pValue[%d]: %ls", i, pValue->GetPointer());
+ argSize += pColumn->GetLength() * sizeof(wchar_t);
+ argSize += pValue->GetLength() * sizeof(wchar_t);
i++;
}
+ SysTryCatch(NID_APP, argSize <= _MAX_ARGUMENT_SIZE, r = E_MAX_EXCEEDED, E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The size of sending argument (%d) exceeds the maximum limit.", argSize);
r = StartSqlDataControl(_DATACONTROL_REQUEST_TYPE_SQL_INSERT, pArgList, &id);
SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating to caller...", GetErrorMessage(r));
}
result
-_SqlDataControlImpl::Update(const Tizen::Base::String& dataId, const Tizen::Base::Collection::IMap& updateMap,
- const Tizen::Base::String* pWhere, RequestId& reqId)
+_SqlDataControlImpl::Update(const String& dataId, const IMap& updateMap, const String* pWhere, RequestId& reqId)
{
SysTryReturnResult(NID_APP, (__access & _DATACONTROL_ACCESS_WRITE) > 0, E_ILLEGAL_ACCESS,
"The UPDATE query is not permitted by DataControl provider.");
pArgList->Construct();
pArgList->Add(*(new String(dataId))); // list(0): data ID
+ long long argSize = dataId.GetLength() * sizeof(wchar_t);
pArgList->Add(*(new String(Integer::ToString(columnCount)))); // list(1): updated column count
SysLog(NID_APP, "[DC_CALLER] updated column count: %d", columnCount);
pArgList->Add(*(new String(*pValue)));
SysLog(NID_APP, "[DC_CALLER] pValue[%d]: %ls", i, pValue->GetPointer());
+ argSize += pColumn->GetLength() * sizeof(wchar_t);
+ argSize += pValue->GetLength() * sizeof(wchar_t);
i++;
}
if (pWhere != null) // list(3): where clause
{
pArgList->Add(*(new String(*pWhere)));
+ argSize += pWhere->GetLength() * sizeof(wchar_t);
SysLog(NID_APP, "[DC_CALLER] pWhere: %ls", pWhere->GetPointer());
}
else
{
pArgList->Add(*(new String(L"NULL")));
}
+ SysTryCatch(NID_APP, argSize <= _MAX_ARGUMENT_SIZE, r = E_MAX_EXCEEDED, E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The size of sending argument (%d) exceeds the maximum limit.", argSize);
r = StartSqlDataControl(_DATACONTROL_REQUEST_TYPE_SQL_UPDATE, pArgList, &id);
SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating to caller...", GetErrorMessage(r));
}
result
-_SqlDataControlImpl::Delete(const Tizen::Base::String& dataId, const Tizen::Base::String* pWhere, RequestId& reqId)
+_SqlDataControlImpl::Delete(const String& dataId, const String* pWhere, RequestId& reqId)
{
SysTryReturnResult(NID_APP, (__access & _DATACONTROL_ACCESS_WRITE) > 0, E_ILLEGAL_ACCESS,
"The DELETE query is not permitted by DataControl provider.");
pArgList->Construct();
pArgList->Add(*(new String(dataId))); // list(0): data ID
+ long long argSize = dataId.GetLength() * sizeof(wchar_t);
if (pWhere != null) // list(1): where clause
{
pArgList->Add(*(new String(*pWhere)));
+ argSize += pWhere->GetLength() * sizeof(wchar_t);
SysLog(NID_APP, "[DC_CALLER] pWhere: %ls", pWhere->GetPointer());
}
else
{
pArgList->Add(*(new String(L"NULL")));
}
+ SysTryCatch(NID_APP, argSize <= _MAX_ARGUMENT_SIZE, r = E_MAX_EXCEEDED, E_MAX_EXCEEDED,
+ "[E_MAX_EXCEEDED] The size of sending argument (%d) exceeds the maximum limit.", argSize);
r = StartSqlDataControl(_DATACONTROL_REQUEST_TYPE_SQL_DELETE, pArgList, &id);
SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating to caller...", GetErrorMessage(r));
_SqlDataControlImpl(void);
static SqlDataControl* CreateSqlDataControl(const Tizen::Base::String& appId, const Tizen::Base::String& providerId,
- const Tizen::Base::String& access);
+ const Tizen::Base::String& access);
result StartSqlDataControl(int type, const Tizen::Base::Collection::IList* pDataList, int* pReq);