}
-
-
-
r = SaveCbsSettings();
return r;
}
//SysLog(NID_MSG, "received time: [%s]", ctime(pReceivedTime));
SysTryReturnVoidResult(NID_MSG, GetInstance()->__pSmsClientId != null, E_OUT_OF_MEMORY,"failed to get client id.");
- for ( int i = 0; i < GetInstance()->__pSmsClientId->GetCount(); i++)
+ IMapEnumerator* pMapEnum = GetInstance()->__pSmsClientId->GetMapEnumeratorN();
+ SysTryReturnVoidResult(NID_MSG, pMapEnum != null, E_OUT_OF_MEMORY,"MapEnum failed.");
+
+ while (pMapEnum->MoveNext() == E_SUCCESS)
+ {
+ Integer* pKey = null;
+ String* pValue = null;
+ String portNum;
+
+ pKey = static_cast< Integer* > (pMapEnum->GetKey());
+ pValue = static_cast< String* > (pMapEnum->GetValue());
+ SysLog(NID_MSG, "pKey %d, value %ls", pKey->ToInt(), pValue->GetPointer());
+ portNum.Append(port);
+ if (pValue->Contains(portNum))
{
- Integer * pId = static_cast <Integer*>(GetInstance()->__pSmsClientId->GetAt(i));
- _SmsService::GetStubInstance()->IncomingSmsCallback(port, displayTime, message, senderAddress,pId->ToInt());
+ SysLog(NID_MSG, "pKey %d, value %ls", pKey->ToInt(), pValue->GetPointer());
+ _SmsService::GetStubInstance()->IncomingSmsCallback(port, displayTime, message, senderAddress,pKey->ToInt());
+
}
}
+ delete pMapEnum;
+ SysLog(NID_MSG, "End");
+
+
+}
+
void
_IpcCallbackHandler::IncomingCbsMessageCallback(msg_handle_t hMsgHandle, msg_struct_t newMsg, void* pUserParam)
{
SysLog(NID_MSG, "push body length: [%d]", bodyLength);
SysTryReturnVoidResult(NID_MSG, _IpcCallbackHandler::GetInstance()->__pWapPushClientId != null, E_OUT_OF_MEMORY, "failed to get client id.");
- for ( int i = 0; i < _IpcCallbackHandler::GetInstance()->__pWapPushClientId->GetCount(); i++)
+ IMapEnumerator* pMapEnum = _IpcCallbackHandler::GetInstance()->__pWapPushClientId->GetMapEnumeratorN();
+ SysTryReturnVoidResult(NID_MSG, pMapEnum != null, E_OUT_OF_MEMORY,"MapEnum failed.");
+
+ while (pMapEnum->MoveNext() == E_SUCCESS)
{
+ Integer* pKey = null;
+ String* pValue = null;
- Integer * pId = static_cast <Integer*>(_IpcCallbackHandler::GetInstance()->__pWapPushClientId->GetAt(i));
- _WapPushService::GetStubInstance()->IncomingWapPushMessageCallback(msgHeader, msgBody, bodyLength, pId->ToInt());
+ pKey = static_cast< Integer* > (pMapEnum->GetKey());
+ pValue = static_cast< String* > (pMapEnum->GetValue());
+
+
+ if (msgHeader.Contains(*pValue))
+ {
+ SysLog(NID_MSG, "pKey %d, value %ls", pKey->ToInt(), pValue->GetPointer());
+ _WapPushService::GetStubInstance()->IncomingWapPushMessageCallback(msgHeader, msgBody, bodyLength, pKey->ToInt());
+ }
}
+ delete pMapEnum;
+ SysLog(NID_MSG, "End");
+
}
Tizen::Base::String
}
result
-_IpcCallbackHandler::SetWapPushClientId( int id)
+_IpcCallbackHandler::SetWapPushClientId(const Tizen::Base::String& AppId, int id)
{
result r = E_SUCCESS;
Integer *pId = new Integer(id);
+ String *pApp = new String(AppId);
if(!__pWapPushClientId)
{
- __pWapPushClientId = new (std::nothrow) Tizen::Base::Collection::ArrayList();
+ __pWapPushClientId = new (std::nothrow) Tizen::Base::Collection::MultiHashMap();
SysTryReturnResult(NID_MSG, __pWapPushClientId != null, E_OUT_OF_MEMORY, "memory allocation failed.");
__pWapPushClientId->Construct();
}
- if(!__pWapPushClientId->Contains(*pId))
+ if(!__pWapPushClientId->Contains(*pId, *pApp))
{
- r = __pWapPushClientId->Add(*pId);
- SysLog(NID_MSG, "Client %d",id);
+ r = __pWapPushClientId->Add(*pId, *pApp);
+ SysLog(NID_MSG, "AppId %ls, Client %d",AppId.GetPointer(), id);
return r;
}
delete pId;
+ delete pApp;
return r;
}
result
-_IpcCallbackHandler::SetSmsClientId ( int id)
+_IpcCallbackHandler::SetSmsClientId (int port, int id)
{
result r = E_SUCCESS;
Integer *pId = new Integer(id);
+ String *pPort = new String;
+ pPort->Append(port);
if(!__pSmsClientId)
{
- __pSmsClientId = new (std::nothrow) Tizen::Base::Collection::ArrayList();
+ __pSmsClientId = new (std::nothrow) Tizen::Base::Collection::MultiHashMap();
SysTryReturnResult(NID_MSG, __pSmsClientId != null, E_OUT_OF_MEMORY, "memory allocation failed.");
__pSmsClientId->Construct();
}
- if(!__pSmsClientId->Contains(*pId))
+ if(!__pSmsClientId->Contains(*pId, *pPort))
{
- r = __pSmsClientId->Add(*pId);
- SysLog(NID_MSG, "Client %d",id);
+ r = __pSmsClientId->Add(*pId, *pPort);
+ SysLog(NID_MSG, "Port %ls, Client %d",pPort->GetPointer(), id);
return r;
}
delete pId;
+ delete pPort;
return r;
}
if(__pWapPushClientId)
{
-
- if(__pWapPushClientId->Contains(*pId))
- {
r = __pWapPushClientId->Remove(*pId);
SysLog(NID_MSG, "WapPush Removed :Client %d",id);
- }
}
if(__pSmsClientId)
{
-
- if(__pSmsClientId->Contains(*pId))
- {
r = __pSmsClientId->Remove(*pId);
SysLog(NID_MSG, "SMS Removed :Client %d",id);
- }
}
if(__pCbsEtwsClientId)