validator_.isConstructorCall(this, tizen.DownloadRequest);
var url_ = converter_.toString(url);
- var destination_ = destination === undefined ? '' : converter_.toString(destination);
- var fileName_ = fileName === undefined ? '' : converter_.toString(fileName);
+ var destination_;
+
+ if (undefined === destination || null === destination) {
+ destination_ = '';
+ } else {
+ destination_ = converter_.toString(destination);
+ }
+
+ var fileName_;
+
+ if (undefined === fileName || null === fileName) {
+ fileName_ = '';
+ } else {
+ fileName_ = converter_.toString(fileName);
+ }
var networkType_;
- if (networkType === undefined || !(networkType in DownloadNetworkType)) {
+ if (
+ undefined === networkType ||
+ null === networkType ||
+ !(networkType in DownloadNetworkType)
+ ) {
networkType_ = 'ALL';
} else {
networkType_ = networkType;
bool& network_support,
bool& network_available,
DownloadInfoPtr di_ptr) {
+ ScopeLogger("network_type: %s", network_type.c_str());
+
connection_h connection = nullptr;
int ret = connection_create(&connection);
CHECK_CONNECTION_ERROR(ret)
ret = connection_get_type(connection, &connection_type);
CHECK_CONNECTION_ERROR(ret)
- if (CONNECTION_TYPE_DISCONNECTED == connection_type) {
- return LogAndCreateResult(common::ErrorCode::UNKNOWN_ERR, "Connection problem occurred",
- ("Connection type is disconnected"));
- }
-
if ("CELLULAR" == network_type) {
// check if connection type is supported
bool cell_support = false;
"The input parameter contains an invalid network type.",
("The input parameter contains an invalid network type: %s", network_type.c_str()));
}
+ if (CONNECTION_TYPE_DISCONNECTED == connection_type) {
+ return LogAndCreateResult(common::ErrorCode::UNKNOWN_ERR, "Connection problem occurred",
+ ("Connection type is disconnected"));
+ }
return common::PlatformResult(common::ErrorCode::NO_ERROR);
}
#undef CHECK_CONNECTION_ERROR