You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pp...@apache.org on 2013/05/17 16:22:13 UTC
[03/21] js commit: [Tizen, Tizen SDK 2.0, Devices.js]
[Tizen, Tizen SDK 2.0, Devices.js]
re-implement Device.js, getDeviceInfo() for Tizen SDK 2.0
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/03d33825
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/03d33825
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/03d33825
Branch: refs/heads/master
Commit: 03d338256aa726406f758e4a02d4eb658f166e66
Parents: b23bc1c
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 10 15:17:46 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:13 2013 +0200
----------------------------------------------------------------------
lib/tizen/plugin/tizen/Device.js | 26 ++++++--------------------
1 files changed, 6 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/03d33825/lib/tizen/plugin/tizen/Device.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Device.js b/lib/tizen/plugin/tizen/Device.js
index 71408ef..c97c04e 100644
--- a/lib/tizen/plugin/tizen/Device.js
+++ b/lib/tizen/plugin/tizen/Device.js
@@ -23,7 +23,7 @@
var channel = require('cordova/channel');
// Tell cordova channel to wait on the CordovaInfoReady event
-channel.waitForInitialization('onCordovaInfoReady');
+//channel.waitForInitialization('onCordovaInfoReady');
function Device() {
this.version = null;
@@ -32,28 +32,14 @@ function Device() {
this.model = null;
this.cordova = "2.5.0";
this.platform = "Tizen";
-
- var me = this;
-
- function onSuccessCallback(sysInfoProp) {
- me.name = sysInfoProp.model;
- me.model = sysInfoProp.model;
- me.uuid = sysInfoProp.imei;
- me.version = sysInfoProp.version;
- channel.onCordovaInfoReady.fire();
- }
-
- function onErrorCallback(error) {
- console.log("error initializing cordova: " + error);
- }
-
- channel.onCordovaReady.subscribe(function() {
- me.getDeviceInfo(onSuccessCallback, onErrorCallback);
- });
}
Device.prototype.getDeviceInfo = function(success, fail, args) {
- tizen.systeminfo.getPropertyValue("Device", success, fail);
+ var systemInfo = tizen.systeminfo.getCapabilities();
+
+ this.version = systemInfo.platformVersion;
+ this.uuid = systemInfo.duid;
+ this.model = systemInfo.platformName;
};
module.exports = new Device();