Updated Modello Common libraries 36/31736/1
authorAlice Liu <alice.liu@intel.com>
Tue, 9 Dec 2014 06:21:18 +0000 (14:21 +0800)
committerAlice Liu <alice.liu@intel.com>
Tue, 9 Dec 2014 06:21:18 +0000 (14:21 +0800)
Package version up (3.0.37).

Change-Id: I3649a1382e7e0453391cc714066657f6c8c704ef
Signed-off-by: Alice Liu <alice.liu@intel.com>
package/changelog
package/pkginfo.manifest
web-ui-fw/0.0.2/0.0.2_Common/original/js/services/carIndicator.js

index f16cdd0..7015f9d 100644 (file)
@@ -1,3 +1,7 @@
+* 3.0.37
+- Updated Modello Common libraries
+== Alice Liu <alice.liu@intel.com> 2014-12-09
+
 * 3.0.36
 - Updated Vehicle API auto completion
 == Alice Liu <alice.liu@intel.com> 2014-12-08
index 928ff32..7ca060a 100644 (file)
@@ -1,4 +1,4 @@
-Version:3.0.36
+Version:3.0.37
 Maintainer: Wenchao Wang<wenchao.wang@intel.com>
 
 Package:ivi-3.0-web-add-ons
index a2f6191..99d33a6 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 /**
- * Class provides AMB related functionality utilizing `tizen.vehicle` API for signals used in HTML applications. This component is usually initialized by {{#crossLink "Bootstrap"}}{{/crossLink}} class
+ * Class provides AMB related functionality utilizing `navigator.vehicle` API for signals used in HTML applications. This component is usually initialized by {{#crossLink "Bootstrap"}}{{/crossLink}} class
  * and can be later accessed using {{#crossLink "Bootstrap/carIndicator:property"}}{{/crossLink}} property. Signals recognized by this class needs to be registered in property
  * {{#crossLink "CarIndicator/_mappingTable:property"}}{{/crossLink}}.
  *
@@ -478,25 +478,28 @@ CarIndicator.prototype.addListener = function(aCallbackObject) {
 
                                        if (mapping.callBackPropertyName.toLowerCase() === prop.toLowerCase() && !mapping.subscribeCount) {
                                                mapping.subscribeCount = typeof (mapping.subscribeCount) === "undefined" ? 0 : mapping.subscribeCount++;
-
-                                               if (typeof (tizen.vehicle[interfaceName]) !== "undefined") {
-                                                       if (!(interfaceName.toString().trim().toLowerCase() === "nightmode" && id === this._listenerIDs[0])) {
-                                                               if (tizen.vehicle[interfaceName]){
-                                                                       var setUpData = tizen.vehicle[interfaceName].get(zone);
-                                                                       if (setUpData !== undefined)
-                                                                               self.onDataUpdate(setUpData, self, id);
+                                               if (typeof (navigator.vehicle) !== 'undefined') {
+                                                       if (typeof (navigator.vehicle[interfaceName]) !== "undefined") {
+                                                               if (!(interfaceName.toString().trim().toLowerCase() === "nightmode" && id === this._listenerIDs[0])) {
+                                                                       if (navigator.vehicle[interfaceName]){
+                                                                               var setUpData = navigator.vehicle[interfaceName].get(zone);
+                                                                               if (setUpData !== undefined)
+                                                                                       self.onDataUpdate(setUpData, self, id);
+                                                                       }
                                                                }
-                                                       }
-                                                       if (typeof (tizen.vehicle[interfaceName].subscribe) !== "undefined")
-                                                       {
-                                                               console.log("Modello: Subscribing to AMB signal - " + interfaceName);
-                                                               tizen.vehicle[interfaceName].subscribe(subscribeCallback, zone);
+                                                               if (typeof (navigator.vehicle[interfaceName].subscribe) !== "undefined")
+                                                               {
+                                                                       console.log("Modello: Subscribing to AMB signal - " + interfaceName);
+                                                                       navigator.vehicle[interfaceName].subscribe(subscribeCallback, zone);
+                                                               }
+                                                       } else {
+                                                               if (typeof (navigator.vehicle[interfaceName]) === "undefined")
+                                                                       console.warn(interfaceName + " is not available to subscribe to");
+                                                               else
+                                                                       console.warn("Tizen API is not available, cannot subscribe to signal", signal);
                                                        }
                                                } else {
-                                                       if (typeof (tizen.vehicle[interfaceName]) === "undefined")
-                                                               console.warn(interfaceName + " is not available to subscribe to");
-                                                       else
-                                                               console.warn("Tizen API is not available, cannot subscribe to signal", signal);
+                                                       console.warn("Vehicle API is not available.");
                                                }
                                        }
                                }
@@ -507,7 +510,7 @@ CarIndicator.prototype.addListener = function(aCallbackObject) {
        return id;
 };
 /**
- * This method is call as callback if data oon tizen.vehicle was change onDataUpdate
+ * This method is call as callback if data oon navigator.vehicle was change onDataUpdate
  * @method onDataUpdate
  * @param data {object} object whit new data.
  * @param self {object} this carIndicator Object.
@@ -606,8 +609,12 @@ CarIndicator.prototype.removeListener = function(aId) {
                                        var mapping = this._mappingTable[signal];
 
                                        if (mapping.subscribeCount === 0) { // Last signal, unscubscribe
-                                               tizen.vehicle.unsubscribe(signal);
-                                               mapping.subscribeCount = undefined;
+                                               if (typeof (navigator.vehicle) !== 'undefined') {
+                                                       navigator.vehicle.unsubscribe(signal);
+                                                       mapping.subscribeCount = undefined;
+                                               } else {
+                                                       console.warn("Vehicle API is not available.");
+                                               }
                                        } else if (typeof (mapping.subscribeCount) !== 'undefined') {
                                                mapping.subscribeCount--;
                                        }
@@ -670,7 +677,7 @@ CarIndicator.prototype.getStatus = function(callback) {
 };
 
 /**
- * this method set status for property in tizen.vehicle and status object
+ * this method set status for property in navigator.vehicle and status object
  * @method setStatus
  * @param indicator {string} indicator name.
  * @param status {??} ??.
@@ -699,9 +706,13 @@ CarIndicator.prototype.setStatus = function(indicator, newValue, callback, zone)
                propertyValue[mappingProperty] = newValue;
                propertyValue.zone = propertyZone;
 
-               tizen.vehicle.set(objectName, propertyValue, function(msg) {
-                       console.error("Set error: " + msg);
-               });
+               if (typeof (navigator.vehicle) !== 'undefined') {
+                       navigator.vehicle.set(objectName, propertyValue, function(msg) {
+                               console.error("Set error: " + msg);
+                       });
+               } else {
+                       console.warn("Vehicle API is not available.");
+               }
        }
        if (!!callback) {
                callback();