Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1637F10053 for ; Thu, 6 Jun 2013 15:07:12 +0000 (UTC) Received: (qmail 53250 invoked by uid 500); 6 Jun 2013 15:07:11 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 53104 invoked by uid 500); 6 Jun 2013 15:07:11 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 52951 invoked by uid 99); 6 Jun 2013 15:07:09 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 15:07:09 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6DD74813286; Thu, 6 Jun 2013 15:07:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pplaquette@apache.org To: commits@cordova.apache.org Date: Thu, 06 Jun 2013 15:07:09 -0000 Message-Id: <8bf0c3e84d254f898cdafb9c6dd62aa3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/5] js commit: [TIZEN][SDK 2.1 - NECTARINE] Updated Branches: refs/heads/master dcbd18980 -> 0a5fa1fa2 [TIZEN][SDK 2.1 - NECTARINE] fix device , to circumvent an issue accessing the platformversion field of the SystemInfoCapabilities structure as returned by systeminfo getCapabilities() method. fix network, by setting a timeout handler provide an anwser before the 5 seconds timeout there is whithin Cordova to get Connection information ready (timer is set to 3 sec) Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/523d9106 Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/523d9106 Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/523d9106 Branch: refs/heads/master Commit: 523d9106f9dc1c4cec735893c87081ba3deeb57c Parents: 11bdd38 Author: pplaquette Authored: Wed Jun 5 16:56:54 2013 +0200 Committer: pplaquette Committed: Wed Jun 5 16:56:54 2013 +0200 ---------------------------------------------------------------------- lib/tizen/plugin/tizen/Device.js | 11 +++++------ lib/tizen/plugin/tizen/NetworkStatus.js | 22 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/523d9106/lib/tizen/plugin/tizen/Device.js ---------------------------------------------------------------------- diff --git a/lib/tizen/plugin/tizen/Device.js b/lib/tizen/plugin/tizen/Device.js index 8b88dfb..fb10d9d 100644 --- a/lib/tizen/plugin/tizen/Device.js +++ b/lib/tizen/plugin/tizen/Device.js @@ -29,7 +29,7 @@ var channel = require('cordova/channel'); //channel.waitForInitialization('onCordovaInfoReady'); function Device() { - this.version = null; + this.version = "2.1.0"; // waiting a working solution of the security error see below this.uuid = null; this.name = null; this.model = null; @@ -40,16 +40,15 @@ function Device() { } Device.prototype.getDeviceInfo = function() { - + var deviceCapabilities = tizen.systeminfo.getCapabilities(); - + if (deviceCapabilities) { - - this.version = deviceCapabilities.platformVersion; + // this.version = deviceCapabilities.platformVersion; // this is currently provoking a security Error in SDk 2.1 this.uuid = deviceCapabilities.duid; this.model = deviceCapabilities.platformName; this.name = this.model; - + channel.onCordovaInfoReady.fire(); } else { http://git-wip-us.apache.org/repos/asf/cordova-js/blob/523d9106/lib/tizen/plugin/tizen/NetworkStatus.js ---------------------------------------------------------------------- diff --git a/lib/tizen/plugin/tizen/NetworkStatus.js b/lib/tizen/plugin/tizen/NetworkStatus.js index 4ae75c3..febcbb9 100644 --- a/lib/tizen/plugin/tizen/NetworkStatus.js +++ b/lib/tizen/plugin/tizen/NetworkStatus.js @@ -30,9 +30,17 @@ module.exports = { var cncType = Connection.NONE; var infoCount = 0; var deviceCapabilities = null; + var timerId = 0; + var timeout = 300; function connectionCB() { + + if (timerId !== null) { + clearTimeout(timerId); + timerId = null; + }jake + infoCount++; if (infoCount > 1) { @@ -64,14 +72,24 @@ module.exports = { connectionCB(); } + deviceCapabilities = tizen.systeminfo.getCapabilities(); + + + timerId = setTimeout( function(){ + timerId = null; + infoCount = 1; + connectionCB(); + }, timeout); if (deviceCapabilities.wifi) { tizen.systeminfo.getPropertyValue("WIFI_NETWORK", wifiSuccessCB, errorCB); } - - tizen.systeminfo.getPropertyValue("CELLULAR_NETWORK", cellularSuccessCB, errorCB); + + if (deviceCapabilities.telephony) { + tizen.systeminfo.getPropertyValue("CELLULAR_NETWORK", cellularSuccessCB, errorCB); + } } };