summaryrefslogtreecommitdiff
path: root/src/platform/Tizen/Call/CallManager.cpp
diff options
context:
space:
mode:
authorSangtai Kim <sangtai.kim@samsung.com>2012-02-17 20:48:29 +0900
committerSangtai Kim <sangtai.kim@samsung.com>2012-02-17 20:57:02 +0900
commit1c5040afa54de91e8cc3ff0c43f71b4234dbb67b (patch)
tree05c3812a779c55ddb134dccb671aca462767e10b /src/platform/Tizen/Call/CallManager.cpp
parenta87694c0ced5c390c924a345ab3eb0ad1549718d (diff)
downloadwrt-plugins-tizen-1c5040afa54de91e8cc3ff0c43f71b4234dbb67b.tar.gz
wrt-plugins-tizen-1c5040afa54de91e8cc3ff0c43f71b4234dbb67b.tar.bz2
wrt-plugins-tizen-1c5040afa54de91e8cc3ff0c43f71b4234dbb67b.zip
merge wrt-plugins-tizen_0.2.0-3
Diffstat (limited to 'src/platform/Tizen/Call/CallManager.cpp')
-rwxr-xr-xsrc/platform/Tizen/Call/CallManager.cpp44
1 files changed, 27 insertions, 17 deletions
diff --git a/src/platform/Tizen/Call/CallManager.cpp b/src/platform/Tizen/Call/CallManager.cpp
index 0d5f77a..6666187 100755
--- a/src/platform/Tizen/Call/CallManager.cpp
+++ b/src/platform/Tizen/Call/CallManager.cpp
@@ -19,6 +19,7 @@
#include <call.h>
#include <dpl/log/log.h>
#include <API/Account/AccountServices.h>
+#include <API/Call/CallDefine.h>
#include "CallManager.h"
using namespace WrtDeviceApis::Commons;
@@ -86,41 +87,50 @@ void CallManager::OnRequestReceived(const EventGetCallServicePtr& event)
ThrowMsg(UnsupportedException, "Not supported filter : providerId");
}
- std::string typeId(filter->getServiceTypeId());
+ std::string typeId(filter->getCallType());
StringArrayPtr tags(filter->getTags());
- if (typeId.compare("tizen.tel") != 0) {
- ThrowMsg(UnsupportedException, "Not supported value : serviceTypeId");
+ if (typeId.compare(STR_TIZEN_TEL) != 0
+ && typeId.compare(STR_TIZEN_XMPP) != 0
+ && typeId.compare(STR_TIZEN_SIP) != 0
+ && typeId.compare("") != 0) {
+ ThrowMsg(InvalidArgumentException, "Invalid value : ServiceTypeId");
}
- for (size_t cnt = 0; cnt < tags->size(); cnt++) {
- if (((*tags)[cnt]).compare("call") == 0
- ||((*tags)[cnt]).compare("call.voice") == 0
- || ((*tags)[cnt]).compare("call.video") == 0
- || ((*tags)[cnt]).compare("call.emergency") == 0) {
- continue;
- } else {
- ThrowMsg(UnsupportedException, "Not supported value : tags");
+ size_t cnt = 0;
+ for (; cnt < tags->size(); cnt++) {
+ if (((*tags)[cnt]).compare(STR_CALL) != 0
+ &&((*tags)[cnt]).compare(STR_CALL_VOICE) != 0
+ && ((*tags)[cnt]).compare(STR_CALL_VIDEO) != 0
+ && ((*tags)[cnt]).compare(STR_CALL_EMERGENCY) != 0) {
+ ThrowMsg(InvalidArgumentException, "Invalid value : tags");
}
}
AccountServicesArrayPtr accountServicesList(new AccountServicesArray());
AccountServicesPtr callServices(new AccountServices());
- callServices->setServiceTypeId("tizen.tel");
+ if (typeId.compare(STR_TIZEN_XMPP) == 0
+ || typeId.compare(STR_TIZEN_SIP) == 0) {
+ event->setResult(accountServicesList);
+ EventRequestReceiver<EventGetCallService>::ManualAnswer(event);
+ }
+
+ callServices->setServiceTypeId(STR_TIZEN_TEL);
StringArrayPtr supportTags(new StringArray());
- supportTags->push_back("call.voice");
- supportTags->push_back("call.video");
- supportTags->push_back("call.emergency");
+ supportTags->push_back(STR_CALL_VOICE);
+ supportTags->push_back(STR_CALL_VIDEO);
+ supportTags->push_back(STR_CALL_EMERGENCY);
callServices->setTags(*supportTags);
+ callServices->setApplicationId(STR_TIZEN_DIALER);
accountServicesList->push_back(callServices);
event->setResult(accountServicesList);
EventRequestReceiver<EventGetCallService>::ManualAnswer(event);
- } catch (const UnsupportedException& ex) {
+ } catch (const InvalidArgumentException& ex) {
LogError("Exception: " << ex.GetMessage());
- event->setExceptionCode(ExceptionCodes::UnsupportedException);
+ event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
EventRequestReceiver<EventGetCallService>::ManualAnswer(event);
} catch (const PlatformException& ex) {
LogError("Exception: " << ex.GetMessage());