cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtan...@apache.org
Subject webworks commit: Normalize BlackBerry Device values
Date Thu, 15 Nov 2012 19:03:24 GMT
Updated Branches:
  refs/heads/master 30c933afc -> bad44d869


Normalize BlackBerry Device values


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/commit/bad44d86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/tree/bad44d86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/diff/bad44d86

Branch: refs/heads/master
Commit: bad44d869c5aea556313e328b42ff2c8729d39ed
Parents: 30c933a
Author: Gord Tanner <gtanner@gmail.com>
Authored: Thu Nov 15 14:03:13 2012 -0500
Committer: Gord Tanner <gtanner@gmail.com>
Committed: Thu Nov 15 14:03:13 2012 -0500

----------------------------------------------------------------------
 .../src/org/apache/cordova/network/Network.as      |    8 +++
 javascript/cordova.blackberry.js                   |   36 ++++++++-------
 2 files changed, 27 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/bad44d86/framework/ext-air/Cordova_Network/src/org/apache/cordova/network/Network.as
----------------------------------------------------------------------
diff --git a/framework/ext-air/Cordova_Network/src/org/apache/cordova/network/Network.as b/framework/ext-air/Cordova_Network/src/org/apache/cordova/network/Network.as
index cd8be87..d2ad030 100644
--- a/framework/ext-air/Cordova_Network/src/org/apache/cordova/network/Network.as
+++ b/framework/ext-air/Cordova_Network/src/org/apache/cordova/network/Network.as
@@ -24,6 +24,7 @@ package org.apache.cordova.network {
     import flash.net.NetworkInfo;
     import flash.net.NetworkInterface;
 	import flash.events.Event;
+    import qnx.system.Device;
 
     import webworks.extension.DefaultExtension;
 
@@ -47,6 +48,13 @@ package org.apache.cordova.network {
 			}
         }
 
+        public function getDeviceInfo(id:String):void{
+            evalJavaScriptEvent(id, [{
+                "uuid" : Device.device.pin,
+                "version": Device.device.scmBundle
+            }]);
+        }
+
         private function networkChange( event: Event ) : void {
 
             /**

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/bad44d86/javascript/cordova.blackberry.js
----------------------------------------------------------------------
diff --git a/javascript/cordova.blackberry.js b/javascript/cordova.blackberry.js
index 3ed2e15..13d07e0 100644
--- a/javascript/cordova.blackberry.js
+++ b/javascript/cordova.blackberry.js
@@ -1,6 +1,6 @@
-// commit 759bd701e4557921913da13555fdd4661dd98cf6
+// commit c0f68da4de34d47e27c35572727307a71db21ac3
 
-// File generated at :: Mon Nov 12 2012 20:30:55 GMT-0500 (EST)
+// File generated at :: Thu Nov 15 2012 14:00:24 GMT-0500 (EST)
 
 /*
  Licensed to the Apache Software Foundation (ASF) under one
@@ -5228,17 +5228,23 @@ 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"
-        });
+        //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" : "Device info returned"
};
+        return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "" };
     }
-
 };
 
 });
@@ -9011,7 +9017,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,
@@ -9496,12 +9502,8 @@ module.exports = {
             return {"status" : 9, "message" : "Media Object id was not sent in arguments"};
         }
 
-        var id = args[0],
-            audio = audioObjects[id],
-            result;
-
         if (args.length <= 1) {
-            result = {"status" : 9, "message" : "Media start recording, insufficient arguments"};
+            return {"status" : 9, "message" : "Media start recording, insufficient arguments"};
         }
 
         blackberry.media.microphone.record(args[1], win, fail);


Mime
View raw message