cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhigg...@apache.org
Subject webworks commit: [CB-3433] Added Q5 to Device API
Date Fri, 14 Jun 2013 13:01:01 GMT
Updated Branches:
  refs/heads/master 1c9438f52 -> 49e902cbb


[CB-3433] Added Q5 to Device API

Reviewed by Bryan Higgins <bhiggins@blackberry.com>
Tested by Tracy Li <tli@blackberry.com>


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

Branch: refs/heads/master
Commit: 49e902cbbc02d6d5c67f9d5a790a3f5239bf2813
Parents: 1c9438f
Author: DanielAudino <daudino@blackberry.com>
Authored: Tue Jun 11 10:34:23 2013 -0400
Committer: Bryan Higgins <bhiggins@blackberry.com>
Committed: Fri Jun 14 09:04:37 2013 -0400

----------------------------------------------------------------------
 blackberry10/plugins/Device/src/blackberry10/index.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/49e902cb/blackberry10/plugins/Device/src/blackberry10/index.js
----------------------------------------------------------------------
diff --git a/blackberry10/plugins/Device/src/blackberry10/index.js b/blackberry10/plugins/Device/src/blackberry10/index.js
index 89a40e4..db85ce1 100644
--- a/blackberry10/plugins/Device/src/blackberry10/index.js
+++ b/blackberry10/plugins/Device/src/blackberry10/index.js
@@ -19,7 +19,11 @@ function getModelName () {
     //Pre 10.2 (meaning Z10 or Q10)
     if (typeof modelName === "undefined") {
         if (window.screen.height === 720 && window.screen.width === 720) {
-            modelName = "Q10";
+            if ( window.matchMedia("(-blackberry-display-technology: -blackberry-display-oled)").matches)
{
+                modelName = "Q10";
+            } else {
+                modelName = "Q5";
+            }
         } else if ((window.screen.height === 1280 && window.screen.width === 768)
||
                    (window.screen.height === 768 && window.screen.width === 1280))
{
             modelName = "Z10";
@@ -51,7 +55,6 @@ module.exports = {
                 platform: "blackberry10",
                 version: window.qnx.webplatform.device.scmBundle,
                 model: modelName,
-                name: modelName, // deprecated: please use device.model
                 uuid: uuid,
                 cordova: "dev"
             };


Mime
View raw message