Revert "Merge "[version] 1.92" into tizen" 45/139945/1
authorPiotr Kosko <p.kosko@samsung.com>
Fri, 21 Jul 2017 06:27:21 +0000 (08:27 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Fri, 21 Jul 2017 06:28:32 +0000 (08:28 +0200)
This reverts commit 8e9d32ce4179a97f00a92244b69c6bdca7c3bfb3, reversing
changes made to b4ea08a3cd8c5cc6bbba2a6ca6adf8d1b81b5888.

Change-Id: I5921609c2573fff0cd7b82b7cb22752c568d6579

src/humanactivitymonitor/humanactivitymonitor_manager.cc
src/messaging/message.cc
src/networkbearerselection/networkbearerselection_manager.cc
src/systeminfo/systeminfo_properties_manager.cc

index de845e9..526bef7 100755 (executable)
@@ -1336,12 +1336,10 @@ HumanActivityMonitorManager::HumanActivityMonitorManager()
     LOGGER(DEBUG) << "  pedometer_data->diffs_coun: " << pedometer_data->diffs_count;
     if (pedometer_data->diffs_count > 0) {
       for (int i = 0; i < pedometer_data->diffs_count; ++i) {
-        InsertStepDifference(pedometer_data->diffs[i].steps,
-            static_cast<float>(getCurrentTimeStamp(pedometer_data->diffs[i].timestamp) / 1000), &diffs);
+        InsertStepDifference(pedometer_data->diffs[i].steps, getCurrentTimeStamp(pedometer_data->diffs[i].timestamp) / 1000, &diffs);
       }
     } else {
-      InsertStepDifference(steps_so_far > 0.0 ? pedometer_data->steps() - steps_so_far : 0.0,
-          static_cast<float>(getCurrentTimeStamp(pedometer_data->timestamp) / 1000), &diffs);
+      InsertStepDifference(steps_so_far > 0.0 ? pedometer_data->steps() - steps_so_far : 0.0, getCurrentTimeStamp(pedometer_data->timestamp) / 1000, &diffs);
     }
 
     steps_so_far = pedometer_data->steps();
index 14f3763..57703b1 100755 (executable)
@@ -592,10 +592,6 @@ PlatformResult addSingleEmailAttachment(std::shared_ptr<Message> message,
     if (ret.IsError()) return ret;
 
     email_attachment_data_t* tmp = (email_attachment_data_t*)calloc(1, sizeof(email_attachment_data_t));
-    if (nullptr == tmp) {
-      return LogAndCreateResult(
-                        ErrorCode::UNKNOWN_ERR, "Unknown error while adding attachment.");
-    }
     tmp->attachment_name = strdup(att->getShortFileName().c_str());
     tmp->attachment_path  = strdup(std::string(dirPath + "/"
             + att->getShortFileName()).c_str());
index 4c3ff43..34b23e1 100644 (file)
@@ -358,7 +358,6 @@ void NetworkBearerSelectionManager::registStateChangeListener(
   LoggerD("enter");
   char* interfaceName = nullptr;
   char* hostAddr = nullptr;
-  char* gateway = nullptr;
   std::unique_ptr<char, void(*)(void*)> host_addr_ptr(nullptr, &std::free);
   struct addrinfo* servinfo = nullptr;
 
@@ -366,9 +365,6 @@ void NetworkBearerSelectionManager::registStateChangeListener(
     if (interfaceName) {
       free(interfaceName);
     }
-    if (gateway) {
-      free(gateway);
-    }
     freeaddrinfo(servinfo);
   };
 
@@ -395,15 +391,12 @@ void NetworkBearerSelectionManager::registStateChangeListener(
 
     struct in_addr  *addr = nullptr;
     if (AF_INET == servinfo->ai_family) {
-      LoggerD("IPv4 address");
       struct sockaddr_in *ipv = (struct sockaddr_in *)servinfo->ai_addr;
       addr = &(ipv->sin_addr);
     } else {
-      LoggerD("IPv6 address");
       struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)servinfo->ai_addr;
       addr = (struct in_addr *) &(ipv6->sin6_addr);
     }
-
     if (nullptr == inet_ntop(servinfo->ai_family, addr, hostAddr, servinfo->ai_addrlen)) {
       LoggerE("Error while calling inet_ntop()");
       destroyProfileHandle();
@@ -421,29 +414,8 @@ void NetworkBearerSelectionManager::registStateChangeListener(
     LoggerE("Callback register is failed.");
     destroyProfileHandle();
   } else {
-    int ret = CONNECTION_ERROR_NONE;
-    if (AF_INET == servinfo->ai_family) {
-      LoggerD("IPv4 add route");
-      ret = connection_add_route(m_connection_handle_, interfaceName, hostAddr);
-    } else if (AF_INET6 == servinfo->ai_family) {
-      LoggerD("IPv6 add route");
-      ret = connection_profile_get_gateway_address(
-          m_profile_handle_, CONNECTION_ADDRESS_FAMILY_IPV6, &gateway);
-
-      if (CONNECTION_ERROR_NONE != ret) {
-        LoggerD("Error %d", ret);
-        makeErrorCallback(domain_name, kPlatformError);
-        return;
-      }
-
-      ret = connection_add_route_ipv6(m_connection_handle_, interfaceName, hostAddr, gateway);
-    } else {
-      LoggerE("Unknown ai_family address");
-      makeErrorCallback(domain_name, kPlatformError);
-      return;
-    }
-
-    if (CONNECTION_ERROR_NONE != ret) {
+    if (connection_add_route(m_connection_handle_, interfaceName, hostAddr) !=
+        CONNECTION_ERROR_NONE) {
       LoggerE("add route is failed.");
       connection_profile_unset_state_changed_cb(m_profile_handle_);
       makeErrorCallback(domain_name, kPlatformError);
index c9b7a37..955719b 100644 (file)
@@ -43,7 +43,7 @@ using common::ErrorCode;
 namespace {
 const std::string kMemoryStateNormal = "NORMAL";
 const std::string kMemoryStateWarinig = "WARNING";
-const double kDisplayInchToMillimeter = 25.4;
+const double kDisplayInchToMillimeter = 2.54;
 //Battery
 const double kRemainingBatteryChargeMax = 100.0;
 const int kVconfErrorNone = 0;
@@ -367,7 +367,7 @@ PlatformResult SysteminfoPropertiesManager::ReportDisplay(picojson::object* out)
 
   //FETCH PHYSICAL WIDTH
   if (dotsPerInchWidth != 0 && screenWidth != 0) {
-    physicalWidth = (static_cast<double>(screenWidth) / dotsPerInchWidth) * kDisplayInchToMillimeter;
+    physicalWidth = (screenWidth / dotsPerInchWidth) * kDisplayInchToMillimeter;
   } else {
     std::string log_msg = "Failed to get physical screen width value";
     LoggerE("%s, screenWidth : %d, dotsPerInchWidth: %d", log_msg.c_str(),
@@ -376,7 +376,7 @@ PlatformResult SysteminfoPropertiesManager::ReportDisplay(picojson::object* out)
 
   //FETCH PHYSICAL HEIGHT
   if (dotsPerInchHeight != 0 && screenHeight != 0) {
-    physicalHeight = (static_cast<double>(screenHeight) / dotsPerInchHeight) * kDisplayInchToMillimeter;
+    physicalHeight = (screenHeight / dotsPerInchHeight) * kDisplayInchToMillimeter;
   } else {
     std::string log_msg = "Failed to get physical screen height value";
     LoggerE("%s, screenHeight : %d, dotsPerInchHeight: %d", log_msg.c_str(),