Updating tizen api checks to avoid failure if they don't exist 34/26334/1 accepted/tizen/ivi/20140821.133859 submit/tizen_ivi/20140820.205154
authorBrian Jones <brian.j.jones@intel.com>
Wed, 20 Aug 2014 20:42:03 +0000 (13:42 -0700)
committerBrian Jones <brian.j.jones@intel.com>
Wed, 20 Aug 2014 20:42:54 +0000 (13:42 -0700)
Change-Id: I5e1064c41993bf29e941a0b257ee609ec4141cf1

css/car/components/bottomPanel/bottomPanel.js
css/car/components/topBarIcons/topBarIcons.js
js/services/speech.js
packaging/modello-common.changes

index 6110fc4..cf8af44 100644 (file)
@@ -45,7 +45,7 @@
              */
             onBackButtonClick: function () {
                 BottomPanel.thisObj.trigger("clickOnBackButton");
-                if (typeof tizen !== "undefined") {
+                if (typeof (tizen.application.getCurrentApplication) !== "undefined") {
                     tizen.application.getCurrentApplication().exit();
                 }
             }
index ae4d650..a7be155 100644 (file)
@@ -168,7 +168,7 @@ function launchApplication(id) {
                 */
                init: function() {
                        TopBarIcons.initLaunchingAppsByVoiceRecognition();
-                       TopBarIcons.runningAppName = typeof(tizen) === 'undefined' ? "" : tizen.application.getCurrentApplication().appInfo.id;
+                       TopBarIcons.runningAppName = typeof(tizen.application.getCurrentApplication) === 'undefined' ? "" : tizen.application.getCurrentApplication().appInfo.id;
 
                        this.empty();
                        this.addClass("topBarIcons");
@@ -186,7 +186,7 @@ function launchApplication(id) {
 
                _getApps: function() {
                        try {
-                               if (typeof(tizen) !== 'undefined') {
+                               if (typeof(tizen.application.getAppsInfo) !== 'undefined') {
                                        tizen.application.getAppsInfo(TopBarIcons.onAppInfoSuccess, function(err) {
                                                // Workaround due to https://bugs.tizen.org/jira/browse/TIVI-2018
                                                window.setTimeout(function() {
index 9d2a21c..e8aafba 100644 (file)
@@ -52,9 +52,8 @@ var Speech = (function() {
        Speech.prototype._initVoiceRecognition = function() {
                var self = this;
                console.log("Speech init voice recognition called.");
-               if (typeof (tizen) !== 'undefined' && typeof (tizen.speech) !== 'undefined' && typeof (tizen.speech.setCBListener) !== 'undefined') {
+               if (typeof (tizen.speech.setCBListener) !== 'undefined') {
                        try {
-
                                tizen.speech.setCBListener(function(result) {
                                                console.log("Speech: onresult received");
                                                for ( var i = 0; i < result.length; i++) {
@@ -190,7 +189,7 @@ var Speech = (function() {
         */
        Speech.prototype.vocalizeString = function(string) {
                console.log("Speech vocalize string called.");
-               if (typeof (tizen) !== 'undefined' && typeof (tizen.speech) !== 'undefined' && typeof (tizen.speech.vocalizeString) !== 'undefined') {
+               if (typeof (tizen.speech.vocalizeString) !== 'undefined') {
                        try {
                                tizen.speech.vocalizeString(string);
                        } catch (err) {
@@ -208,7 +207,7 @@ var Speech = (function() {
         * @method readCurrentAppName
         */
        Speech.prototype.readCurrentAppName = function() {
-               if (typeof (tizen) !== 'undefined') {
+               if (typeof (tizen.application.getCurrentApplication) !== 'undefined') {
                        var appName = tizen.application.getCurrentApplication().appInfo.name.toString().trim().toLowerCase();
                        if (appName === "modello hvac") {
                                appName = "air conditioning";
index f11a771..ef10285 100644 (file)
@@ -1,3 +1,6 @@
+* Wed Aug 20 2014 Brian Jones <brian.j.jones@intel.com> accepted/tizen/ivi/20140814.201957-2-g5b6386a
+- Updating tizen api checks to avoid failure if they don't exist
+
 * Thu Aug 14 2014 Jimmy Huang <jimmy.huang@intel.com> accepted/tizen/ivi/20140814.201957-1-g4c3a4b4
 - Clear the cached bluetooth devices due to UI bug