updated device apis to set name and platform on device ready
diff --git a/js/device.js b/js/device.js
index 78800e9..6808afd 100755
--- a/js/device.js
+++ b/js/device.js
@@ -8,6 +8,7 @@
this.version = null;
this.name = null;
this.uuid = null;
+ this.deviceInfo = null;
};
/*
@@ -16,7 +17,7 @@
* var deviceinfo = JSON.stringify(navigator.device.getDeviceInfo()).replace(/,/g, ', ');
*/
Device.prototype.getDeviceInfo = function() {
- return JSON.parse(PalmSystem.deviceInfo);
+ return this.deviceInfo;//JSON.parse(PalmSystem.deviceInfo);
};
/*
@@ -46,6 +47,15 @@
}, 10);
this.setUUID();
+ this.setDeviceInfo();
+};
+
+Device.prototype.setDeviceInfo = function() {
+ var parsedData = JSON.parse(PalmSystem.deviceInfo);
+
+ this.deviceInfo = parsedData;
+ this.version = parsedData.platformVersion;
+ this.name = parsedData.modelName;
};
Device.prototype.setUUID = function() {