From: Przemyslaw Ciezkowski Date: Tue, 26 May 2015 08:40:31 +0000 (+0200) Subject: [Download] Check for ethernet network type X-Git-Tag: submit/tizen_mobile/20150612.133019^2~2^2~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa2d92faa0dd418c52fa3bdfbe95aeca203d44bb;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Download] Check for ethernet network type If networkType is set to ALL, check if ethernet is available. Fixes a bug where on tv networkType ALL is throwing an error that it is not supported. [Verification] On tv will make it possible to download with networkType ALL. 100% TCT pass rate on mobile. Change-Id: Ifa66442ede3d8c659bddcfeff67eb3fe2e00cd4d Signed-off-by: Przemyslaw Ciezkowski --- diff --git a/src/download/download_instance.cc b/src/download/download_instance.cc index 69cc524e..69ce642f 100644 --- a/src/download/download_instance.cc +++ b/src/download/download_instance.cc @@ -406,6 +406,12 @@ void DownloadInstance::DownloadManagerStart bool network_support = false; bool cell_support = false; bool wifi_support = false; + // todo retrieve this from system_info +#ifdef TIZEN_TV + bool ethernet_support = true; +#else + bool ethernet_support = false; +#endif system_info_get_platform_bool("http://tizen.org/feature/network.telephony", &cell_support); @@ -417,14 +423,17 @@ void DownloadInstance::DownloadManagerStart connection_cellular_state_e cell_state = CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE; connection_wifi_state_e wifi_state = CONNECTION_WIFI_STATE_DEACTIVATED; + connection_ethernet_state_e ethernet_state = CONNECTION_ETHERNET_STATE_DEACTIVATED; connection_get_cellular_state(connection, &cell_state); connection_get_wifi_state(connection, &wifi_state); + connection_get_ethernet_state(connection, ðernet_state); connection_destroy(connection); bool network_available = false; bool cell_available = (CONNECTION_CELLULAR_STATE_CONNECTED == cell_state); bool wifi_available = (CONNECTION_WIFI_STATE_CONNECTED == wifi_state); + bool ethernet_available = CONNECTION_ETHERNET_STATE_CONNECTED == ethernet_state; if (networkType == "CELLULAR") { network_support = cell_support; @@ -435,8 +444,8 @@ void DownloadInstance::DownloadManagerStart network_available = wifi_available; diPtr->network_type = DOWNLOAD_NETWORK_WIFI; } else if (networkType == "ALL") { - network_support = cell_support || wifi_support; - network_available = cell_available || wifi_available; + network_support = cell_support || wifi_support || ethernet_support; + network_available = cell_available || wifi_available || ethernet_available; diPtr->network_type = DOWNLOAD_NETWORK_ALL; } else { LoggerE("The input parameter contains an invalid network type");