From: Pawel Wasowski
Date: Tue, 29 Aug 2017 14:12:17 +0000 (+0200)
Subject: [Download] Enable download with net_proxy
X-Git-Tag: submit/tizen_3.0/20170906.125436~4^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2eb229555ffb8528d14ff74116b677cbea3f2fda;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Download] Enable download with net_proxy
[Verification] TCT download pass rate, (wearable connected
to the internet with Android mobile as a network proxy,
no Wi-Fi/cellular network connection): 100 %
Change-Id: I0efb8c2d5281d5249dad46d58eaf8aa7c5ddc930
Signed-off-by: Pawel Wasowski
---
diff --git a/src/download/download_instance.cc b/src/download/download_instance.cc
index 490c183b..dca989a4 100755
--- a/src/download/download_instance.cc
+++ b/src/download/download_instance.cc
@@ -514,43 +514,41 @@ void DownloadInstance::DownloadManagerStart
bool network_support = false;
bool cell_support = false;
bool wifi_support = false;
- bool ethernet_support = false;
system_info_get_platform_bool("http://tizen.org/feature/network.telephony",
&cell_support);
system_info_get_platform_bool("http://tizen.org/feature/network.wifi",
&wifi_support);
- system_info_get_platform_bool("http://tizen.org/feature/network.ethernet",
- ðernet_support);
connection_h connection = nullptr;
connection_create(&connection);
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_type_e connection_type = CONNECTION_TYPE_DISCONNECTED;
+ connection_get_type(connection, &connection_type);
+
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") {
+ if ("CELLULAR" == networkType) {
network_support = cell_support;
network_available = cell_available;
diPtr->network_type = DOWNLOAD_NETWORK_DATA_NETWORK;
- } else if (networkType == "WIFI") {
+ } else if ("WIFI" == networkType) {
network_support = wifi_support;
network_available = wifi_available;
diPtr->network_type = DOWNLOAD_NETWORK_WIFI;
- } else if (networkType == "ALL") {
- network_support = cell_support || wifi_support || ethernet_support;
- network_available = cell_available || wifi_available || ethernet_available;
+ } else if (("ALL" == networkType) && (CONNECTION_TYPE_DISCONNECTED != connection_type)) {
+ network_support = true;
+ network_available = true;
diPtr->network_type = DOWNLOAD_NETWORK_ALL;
} else {
LogAndReportError(
@@ -561,7 +559,10 @@ void DownloadInstance::DownloadManagerStart
return;
}
- if (!network_support) {
+ /*
+ * There is no relevant feature for networkType == "ALL".
+ */
+ if (!network_support && ("ALL" != networkType)) {
LogAndReportError(
common::PlatformResult(common::ErrorCode::NOT_SUPPORTED_ERR,
"The networkType of the given DownloadRequest "