You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2015/10/23 00:31:10 UTC
[4/8] cordova-plugin-device git commit: update code to use 'isVirtual'
update code to use 'isVirtual'
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/60787409
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/tree/60787409
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/diff/60787409
Branch: refs/heads/master
Commit: 60787409adbcf3b94794060a265fc5e0e7f0bf47
Parents: 2aebeae
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Oct 22 11:29:13 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Oct 22 11:29:38 2015 -0700
----------------------------------------------------------------------
src/android/Device.java | 4 ++--
src/ios/CDVDevice.m | 4 ++--
www/device.js | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/60787409/src/android/Device.java
----------------------------------------------------------------------
diff --git a/src/android/Device.java b/src/android/Device.java
index 780c927..ecfe447 100644
--- a/src/android/Device.java
+++ b/src/android/Device.java
@@ -74,7 +74,7 @@ public class Device extends CordovaPlugin {
r.put("platform", this.getPlatform());
r.put("model", this.getModel());
r.put("manufacturer", this.getManufacturer());
- r.put("isSimulator", this.isSimulator());
+ r.put("isVirtual", this.isVirtual());
callbackContext.success(r);
}
else {
@@ -159,7 +159,7 @@ public class Device extends CordovaPlugin {
return false;
}
- public boolean isSimulator() {
+ public boolean isVirtual() {
return android.os.Build.FINGERPRINT.contains("generic") ||
android.os.Build.PRODUCT.contains("sdk");
}
http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/60787409/src/ios/CDVDevice.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVDevice.m b/src/ios/CDVDevice.m
index 625da58..600ffd0 100644
--- a/src/ios/CDVDevice.m
+++ b/src/ios/CDVDevice.m
@@ -82,7 +82,7 @@
[devProps setObject:[device systemVersion] forKey:@"version"];
[devProps setObject:[self uniqueAppInstanceIdentifier:device] forKey:@"uuid"];
[devProps setObject:[[self class] cordovaVersion] forKey:@"cordova"];
- [devProps setObject:@([self isSimulator]) forKey:@"isSimulator"];
+ [devProps setObject:@([self isVirtual]) forKey:@"isVirtual"];
NSDictionary* devReturn = [NSDictionary dictionaryWithDictionary:devProps];
return devReturn;
}
@@ -92,7 +92,7 @@
return CDV_VERSION;
}
-- (BOOL)isSimulator
+- (BOOL)isVirtual
{
return TARGET_IPHONE_SIMULATOR;
}
http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/60787409/www/device.js
----------------------------------------------------------------------
diff --git a/www/device.js b/www/device.js
index 2300be9..9997f5f 100644
--- a/www/device.js
+++ b/www/device.js
@@ -41,8 +41,8 @@ function Device() {
this.uuid = null;
this.cordova = null;
this.model = null;
- this.manufacturer = null;
- this.isSimulator = null;
+ this.manufacturer = null;
+ this.isVirtual = null;
var me = this;
@@ -57,7 +57,7 @@ function Device() {
me.uuid = info.uuid;
me.cordova = buildLabel;
me.model = info.model;
- me.isSimulator = info.isSimulator || false;
+ me.isVirtual = info.isVirtual;
me.manufacturer = info.manufacturer || 'unknown';
channel.onCordovaInfoReady.fire();
},function(e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org