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 6753CD593 for ; Thu, 15 Nov 2012 18:56:28 +0000 (UTC) Received: (qmail 13639 invoked by uid 500); 15 Nov 2012 18:56:28 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 13610 invoked by uid 500); 15 Nov 2012 18:56:27 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 13602 invoked by uid 500); 15 Nov 2012 18:56:27 -0000 Delivered-To: apmail-incubator-callback-commits@incubator.apache.org Received: (qmail 13599 invoked by uid 99); 15 Nov 2012 18:56:27 -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, 15 Nov 2012 18:56:27 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 80268313A11; Thu, 15 Nov 2012 18:56:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gtanner@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: js commit: Normalizing BlackBerry device information Message-Id: <20121115185627.80268313A11@tyr.zones.apache.org> Date: Thu, 15 Nov 2012 18:56:27 +0000 (UTC) Updated Branches: refs/heads/master 75eb826d1 -> 57dcbcc16 Normalizing BlackBerry device information Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/57dcbcc1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/57dcbcc1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/57dcbcc1 Branch: refs/heads/master Commit: 57dcbcc162ae2a56526b0a2a131212801d82b617 Parents: 75eb826 Author: Gord Tanner Authored: Thu Nov 15 13:55:54 2012 -0500 Committer: Gord Tanner Committed: Thu Nov 15 13:55:54 2012 -0500 ---------------------------------------------------------------------- lib/blackberry/plugin/air/device.js | 88 ++++++++++++++++-------------- lib/blackberry/plugin/qnx/device.js | 2 +- 2 files changed, 48 insertions(+), 42 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/57dcbcc1/lib/blackberry/plugin/air/device.js ---------------------------------------------------------------------- diff --git a/lib/blackberry/plugin/air/device.js b/lib/blackberry/plugin/air/device.js index 42003c0..bd89ee1 100644 --- a/lib/blackberry/plugin/air/device.js +++ b/lib/blackberry/plugin/air/device.js @@ -1,41 +1,47 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var channel = require('cordova/channel'), - cordova = require('cordova'); - -// Tell cordova channel to wait on the CordovaInfoReady event -channel.waitForInitialization('onCordovaInfoReady'); - -module.exports = { - getDeviceInfo : function(args, win, fail){ - win({ - platform: "PlayBook", - version: blackberry.system.softwareVersion, - name: blackberry.system.model, - uuid: blackberry.identity.PIN, - cordova: "2.2.0" - }); - - return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "Device info returned" }; - } - -}; +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var channel = require('cordova/channel'), + cordova = require('cordova'); + +// Tell cordova channel to wait on the CordovaInfoReady event +channel.waitForInitialization('onCordovaInfoReady'); + +module.exports = { + getDeviceInfo : function(args, win, fail){ + //Register an event handler for the networkChange event + var callback = blackberry.events.registerEventHandler("deviceInfo", function (info) { + win({ + platform: "BlackBerry", + version: info.version, + name: "PlayBook", + uuid: info.uuid, + cordova: "2.2.0" + }); + }), + request = new blackberry.transport.RemoteFunctionCall("org/apache/cordova/getDeviceInfo"); + + request.addParam("id", callback); + request.makeSyncCall(); + + return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "" }; + } +}; http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/57dcbcc1/lib/blackberry/plugin/qnx/device.js ---------------------------------------------------------------------- diff --git a/lib/blackberry/plugin/qnx/device.js b/lib/blackberry/plugin/qnx/device.js index ca21d68..a8cbb1f 100644 --- a/lib/blackberry/plugin/qnx/device.js +++ b/lib/blackberry/plugin/qnx/device.js @@ -28,7 +28,7 @@ channel.waitForInitialization('onCordovaInfoReady'); module.exports = { getDeviceInfo : function(args, win, fail){ win({ - platform: "BB10", + platform: "BlackBerry", version: blackberry.system.softwareVersion, name: "Dev Alpha", uuid: blackberry.identity.uuid,