[Messaging-Email] add checking codes whether telephony is supported or not
authortaekeun.kang <taekeun.kang@samsung.com>
Tue, 8 Sep 2015 12:04:18 +0000 (21:04 +0900)
committertaekeun.kang <taekeun.kang@samsung.com>
Tue, 8 Sep 2015 12:06:04 +0000 (21:06 +0900)
  TCT Results
  Pass  290
  Fail    2
  Block  16
  N/A     0

Change-Id: Iaf0da34b2e1553fcce5720f4400ab4d8ee805ef8
Signed-off-by: taekeun.kang <taekeun.kang@samsung.com>
src/messaging/messaging_instance.cc

index 33d880f80cd5e21251ebdab120f3bae3030abdb5..99f3d03c28a9812be462bb52f680cc4f2ac1942c 100755 (executable)
@@ -18,6 +18,7 @@
 
 #include <sstream>
 #include <stdexcept>
+#include <system_info.h>
 
 #include "common/logger.h"
 
@@ -221,11 +222,18 @@ void MessagingInstance::MessageServiceSendMessage(const picojson::value& args,
     simIndex = static_cast<long>
       (MessagingUtil::getValueFromJSONObject<double>(data,SEND_MESSAGE_ARGS_SIMINDEX));
 
-    if (!callback->setSimIndex(simIndex)) {
-      delete callback;
-      callback = nullptr;
-      POST_AND_RETURN(PlatformResult(ErrorCode::UNKNOWN_ERR, "set sim index failed"),
-                      json, obj, JSON_CALLBACK_ERROR)
+    bool cell_support = false;
+    system_info_get_platform_bool("http://tizen.org/feature/network.telephony", &cell_support);
+    if (cell_support) {
+      LoggerD("cell_support is true");
+      if (!callback->setSimIndex(simIndex)) {
+        delete callback;
+        callback = nullptr;
+        POST_AND_RETURN(PlatformResult(ErrorCode::UNKNOWN_ERR, "set sim index failed"),
+                        json, obj, JSON_CALLBACK_ERROR)
+      }
+    } else {
+      LoggerD("cell_support is false");
     }
 
     queue_.add(static_cast<long>(callbackId), PostPriority::HIGH);