cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/4] cordova-plugin-device git commit: added device.manufacturer property for Android, iOS (Apple duh), Blackberry (RIM duh)
Date Tue, 03 Feb 2015 23:56:23 GMT
Repository: cordova-plugin-device
Updated Branches:
  refs/heads/master c7cec5d0e -> e1410aa52


added device.manufacturer property for Android, iOS (Apple duh), Blackberry (RIM duh)


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/commit/c1388533
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/tree/c1388533
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/diff/c1388533

Branch: refs/heads/master
Commit: c1388533fc0f15dd24b828c3cf1b7005fc7afd33
Parents: 264ab94
Author: Bas van Beek <bas@tobin.nl>
Authored: Thu Aug 7 21:15:03 2014 +0200
Committer: Bas van Beek <bas@tobin.nl>
Committed: Thu Aug 7 21:15:03 2014 +0200

----------------------------------------------------------------------
 src/android/Device.java   | 5 +++++
 src/blackberry10/index.js | 1 +
 src/ios/CDVDevice.m       | 1 +
 www/device.js             | 2 ++
 4 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/c1388533/src/android/Device.java
----------------------------------------------------------------------
diff --git a/src/android/Device.java b/src/android/Device.java
index ad9002b..5eded90 100644
--- a/src/android/Device.java
+++ b/src/android/Device.java
@@ -73,6 +73,7 @@ public class Device extends CordovaPlugin {
             r.put("version", this.getOSVersion());
             r.put("platform", this.getPlatform());
             r.put("model", this.getModel());
+            r.put("manufacturer", this.getManufacturer());
             callbackContext.success(r);
         }
         else {
@@ -120,6 +121,10 @@ public class Device extends CordovaPlugin {
         return productname;
     }
 
+    public String getManufacturer() {
+        String manufacturer = android.os.Build.MANUFACTURER;
+        return manufacturer;
+    }
     /**
      * Get the OS version.
      *

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/c1388533/src/blackberry10/index.js
----------------------------------------------------------------------
diff --git a/src/blackberry10/index.js b/src/blackberry10/index.js
index 4d09492..dc1deae 100644
--- a/src/blackberry10/index.js
+++ b/src/blackberry10/index.js
@@ -57,6 +57,7 @@ module.exports = {
             modelName = getModelName(),
             uuid = getUUID(),
             info = {
+                manufacturer: 'Research in Motion',
                 platform: "blackberry10",
                 version: window.qnx.webplatform.device.scmBundle,
                 model: modelName,

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/c1388533/src/ios/CDVDevice.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVDevice.m b/src/ios/CDVDevice.m
index 7e18d92..9ac73f5 100644
--- a/src/ios/CDVDevice.m
+++ b/src/ios/CDVDevice.m
@@ -72,6 +72,7 @@
     UIDevice* device = [UIDevice currentDevice];
     NSMutableDictionary* devProps = [NSMutableDictionary dictionaryWithCapacity:4];
 
+    [devProps setObject:@"Apple" forKey:@"manufacturer"];
     [devProps setObject:[device modelVersion] forKey:@"model"];
     [devProps setObject:@"iOS" forKey:@"platform"];
     [devProps setObject:[device systemVersion] forKey:@"version"];

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/c1388533/www/device.js
----------------------------------------------------------------------
diff --git a/www/device.js b/www/device.js
index 05f4c47..b1d0d25 100644
--- a/www/device.js
+++ b/www/device.js
@@ -41,6 +41,7 @@ function Device() {
     this.uuid = null;
     this.cordova = null;
     this.model = null;
+    this.manufacturer = null;
 
     var me = this;
 
@@ -55,6 +56,7 @@ function Device() {
             me.uuid = info.uuid;
             me.cordova = buildLabel;
             me.model = info.model;
+            me.manufacturer = info.manufacturer || 'unknown';
             channel.onCordovaInfoReady.fire();
         },function(e) {
             me.available = false;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message