HMI Components
authorJustin Dickow <jjdickow@gmail.com>
Tue, 15 Jul 2014 15:36:55 +0000 (11:36 -0400)
committerJustin Dickow <jjdickow@gmail.com>
Tue, 15 Jul 2014 15:36:55 +0000 (11:36 -0400)
Signed-off-by: Justin Dickow <jjdickow@gmail.com>
27 files changed:
src/components/HMI/app/StateManager.js
src/components/HMI/app/controller/SettingsController.js
src/components/HMI/app/controller/sdl/Controller.js
src/components/HMI/app/controller/sdl/RPCController.js
src/components/HMI/app/model/sdl/AppModel.js
src/components/HMI/app/model/sdl/MediaModel.js
src/components/HMI/app/model/sdl/Model.js
src/components/HMI/app/model/sdl/NonMediaModel.js
src/components/HMI/app/view/sdl/AlertPopUp.js
src/components/HMI/app/view/sdl/AudioPassThruPopUp.js
src/components/HMI/app/view/sdl/PopUp.js
src/components/HMI/app/view/sdl/VRHelpListView.js
src/components/HMI/app/view/sdl/VRPopUp.js
src/components/HMI/app/view/sdl/shared/interactionChoicesView.js
src/components/HMI/app/view/sdl/shared/scrollableMessage.js
src/components/HMI/app/view/sdl/shared/sliderView.js
src/components/HMI/app/view/sdl/shared/tbtTurnList.js
src/components/HMI/app/view/settings/policies/appPermissionsView.js
src/components/HMI/app/view/settings/policies/deviceConfigView.js
src/components/HMI/app/view/settings/policies/deviceStateChangeView.js [new file with mode: 0644]
src/components/HMI/app/view/settings/policiesView.js
src/components/HMI/app/view/settingsView.js
src/components/HMI/ffw/BasicCommunicationRPC.js
src/components/HMI/ffw/RPCObserver.js
src/components/HMI/ffw/UIRPC.js
src/components/HMI/ffw/VRRPC.js
src/components/HMI/index.html

index 7b88578..3f197b7 100644 (file)
@@ -193,6 +193,15 @@ var StateManager = Em.StateManager.extend({
 \r
             appPermissions: Em.State.create({\r
 \r
+            }),\r
+\r
+            deviceStateChange: Em.State.create({\r
+\r
+                enter: function () {\r
+\r
+                    this._super();\r
+                    SDL.DeviceStateChangeView.showDeviceList();\r
+                }\r
             })\r
         })\r
     }),\r
index 1f78af7..aaa3bd4 100644 (file)
@@ -77,8 +77,11 @@ SDL.SettingsController = Em.Object.create( {
             allowedText = " - Allowed";\r
         }\r
 \r
-        for (var i = 0; i < SDL.SDLModel.conectedDevices.length; ++i) {\r
-            SDL.SDLModel.conectedDevices[i].allowed = allowedValue;\r
+        var dev = SDL.SDLModel.connectedDevices;\r
+        for (var key in dev) {\r
+            if (dev.hasOwnProperty(key)) {\r
+                dev[key].allowed = allowedValue;\r
+            }\r
         }\r
 \r
         SDL.DeviceConfigView.showDeviceList();\r
@@ -87,29 +90,34 @@ SDL.SettingsController = Em.Object.create( {
     },\r
 \r
     changeDeviceAccess: function(event) {\r
-        for (var i = 0; i < SDL.SDLModel.conectedDevices.length; ++i) {\r
 \r
-            if (SDL.SDLModel.conectedDevices[i].id == event.id) {\r
+        var dev = SDL.SDLModel.connectedDevices;\r
+        for (var key in dev) {\r
 \r
-                if (SDL.SDLModel.conectedDevices[i].allowed) {\r
+            if (dev.hasOwnProperty(key)) {\r
 \r
-                    SDL.SDLModel.conectedDevices[i].allowed = false;\r
-                    event.set('text', event.name + " - Not allowed");\r
-                } else {\r
+                if (dev[key].id == event.id) {\r
 \r
-                    SDL.SDLModel.conectedDevices[i].allowed = true;\r
-                    event.set('text', event.name + " - Allowed");\r
-                }\r
+                    if (dev[key].allowed) {\r
 \r
-                var device = {\r
-                    "name": SDL.SDLModel.conectedDevices[i].name,\r
-                    "id": SDL.SDLModel.conectedDevices[i].id\r
-                };\r
+                        dev[key].allowed = false;\r
+                        event.set('text', event.name + " - Not allowed");\r
+                    } else {\r
 \r
-                SDL.DeviceConfigView.set('globalConfigurationValue', null);\r
+                        dev[key].allowed = true;\r
+                        event.set('text', event.name + " - Allowed");\r
+                    }\r
 \r
-                FFW.BasicCommunication.OnAllowSDLFunctionality(SDL.SDLModel.conectedDevices[i].allowed, "GUI", device);\r
-                break;\r
+                    var device = {\r
+                        "name": dev[key].name,\r
+                        "id": dev[key].id\r
+                    };\r
+\r
+                    SDL.DeviceConfigView.set('globalConfigurationValue', null);\r
+\r
+                    FFW.BasicCommunication.OnAllowSDLFunctionality(dev[key].allowed, "GUI", device);\r
+                    break;\r
+                }\r
             }\r
         }\r
     },\r
@@ -213,7 +221,7 @@ SDL.SettingsController = Em.Object.create( {
 \r
             SDL.SettingsController.userFriendlyMessagePopUp();\r
 \r
-            SDL.SDLModel.getListOfPermissionsPull.remove(message.id);\r
+            delete SDL.SDLModel.getListOfPermissionsPull[message.id];\r
         }\r
     },\r
 \r
@@ -228,12 +236,14 @@ SDL.SettingsController = Em.Object.create( {
 \r
             for (var i = 0; i < len; i++) {\r
 \r
-                SDL.SDLController.getApplicationModel(appID).allowedFunctions[i].text = message.label;\r
+                if (message && message.label) {\r
+                    SDL.SDLController.getApplicationModel(appID).allowedFunctions[i].text = message.label;\r
+                }\r
             }\r
 \r
             SDL.AppPermissionsView.update(appID);\r
 \r
-            this.onState('policies.appPermissions');\r
+            SDL.States.goToStates('settings.policies.appPermissions');\r
     },\r
 \r
     updateSDL: function() {\r
@@ -246,7 +256,7 @@ SDL.SettingsController = Em.Object.create( {
 \r
     AllowSDLFunctionality: function(device) {\r
         this.currentDeviceAllowance = device;\r
-        SDL.PopUp.popupActivate("Would you like to allow SDL functionality for device '" + device.name + "'?", SDL.SettingsController.OnAllowSDLFunctionality);\r
+        SDL.SDLModel.connectedDevices[device.id].sdlFunctionality.popUpId = SDL.PopUp.popupActivate("Would you like to allow SDL functionality for device '" + device.name + "'?", SDL.SettingsController.OnAllowSDLFunctionality);\r
     },\r
 \r
     onSDLConsentNeededHandler: function(params) {\r
@@ -255,16 +265,19 @@ SDL.SettingsController = Em.Object.create( {
         FFW.BasicCommunication.GetUserFriendlyMessage(function(message){SDL.PopUp.popupActivate(message, this.OnAllowSDLFunctionality)});\r
     },\r
 \r
-    userFriendlyMessagePopUp: function() {\r
+    userFriendlyMessagePopUp: function(appId, messageCode) {\r
 \r
-        FFW.BasicCommunication.GetUserFriendlyMessage(function(message){SDL.PopUp.popupActivate(message)});\r
+        FFW.BasicCommunication.GetUserFriendlyMessage(function(message){SDL.PopUp.popupActivate(message)}, appId, messageCode);\r
     },\r
 \r
     OnAllowSDLFunctionality: function(result) {\r
 \r
-        for (var i = 0; i < SDL.SDLModel.conectedDevices.length; ++i) {\r
-            if (SDL.SDLModel.conectedDevices[i].id == SDL.SettingsController.currentDeviceAllowance.id) {\r
-                SDL.SDLModel.conectedDevices[i].allowed = result;\r
+        var dev = SDL.SDLModel.connectedDevices;\r
+        for (var key in dev) {\r
+            if (dev.hasOwnProperty(key)) {\r
+                if (dev[key].id == SDL.SettingsController.currentDeviceAllowance.id) {\r
+                    dev[key].allowed = result;\r
+                }\r
             }\r
         }\r
 \r
@@ -274,6 +287,10 @@ SDL.SettingsController = Em.Object.create( {
 \r
         FFW.BasicCommunication.OnAllowSDLFunctionality(result, "GUI", SDL.SettingsController.currentDeviceAllowance);\r
 \r
+        SDL.SDLModel.connectedDevices[SDL.SettingsController.currentDeviceAllowance.id].sdlFunctionality.allowed = result;\r
+\r
+        SDL.SDLModel.connectedDevices[SDL.SettingsController.currentDeviceAllowance.id].sdlFunctionality.popUpId = null;\r
+\r
         SDL.SettingsController.currentDeviceAllowance = null;\r
     }\r
-});
\ No newline at end of file
+});\r
index 8c9fb5e..b4c913b 100644 (file)
@@ -180,9 +180,6 @@ SDL.SDLController = Em.Object
                     }
                 }
             }
-            if (SDL.SDLAppController.model && !SDL.SDLModel.VRActive && SDL.SDLAppController.model.activeRequests.vrPerformInteraction) {
-                SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['ABORTED']);
-            }
         }.observes('SDL.SDLModel.VRActive', 'SDL.SDLModel.interactionData.vrHelp'),
 
         /**
@@ -323,27 +320,27 @@ SDL.SDLController = Em.Object
          * Action for ClosePopUp request that triggers deactivate function from
          * opened popUp
          */
-        closePopUp: function() {
+        closePopUp: function(methodName) {
 
-            if (SDL.AlertPopUp.active) {
+            if (methodName == "UI.Alert") {
                 SDL.AlertPopUp.deactivate();
             }
-            if (SDL.AudioPassThruPopUp.active) {
+            if (methodName == "UI.PerformAudioPassThru") {
                 SDL.AudioPassThruPopUp.deactivate();
                 this.performAudioPassThruResponse(SDL.SDLModel.resultCode["SUCCESS"]);
             }
-            if (SDL.InteractionChoicesView.active) {
+            if (methodName == "UI.PerformInteraction") {
                 SDL.InteractionChoicesView.deactivate("ABORTED");
             }
-            if (SDL.ScrollableMessage.active) {
+            if (methodName == "UI.ScrollableMessage") {
                 SDL.ScrollableMessage.deactivate(true);
             }
-            if (SDL.SliderView.active) {
+            if (methodName == "UI.Slider") {
                 SDL.SliderView.deactivate(true);
             }
-            if (SDL.VRHelpListView.active) {
-                SDL.VRHelpListView.deactivate();
-            }
+//            if (SDL.VRHelpListView.active) {
+//                SDL.VRHelpListView.deactivate();
+//            }
         },
 
         /**
@@ -396,8 +393,10 @@ SDL.SDLController = Em.Object
          */
         systemRequestViewSelected: function(state) {
 
-            if (SDL.SDLModel.policyURLs) {
-                this.OnSystemRequest("PROPRIETARY", SDL.SDLModel.policyURLs[0].policyAppId, null, SDL.SDLModel.policyURLs[0].url);
+            if (SDL.SDLModel.policyURLs.length) {
+                FFW.BasicCommunication.OnSystemRequest(state, SDL.SDLModel.policyURLs[0].policyAppId, null, SDL.SDLModel.policyURLs[0].url);
+            } else {
+                FFW.BasicCommunication.OnSystemRequest(state);
             }
 
         },
@@ -422,6 +421,8 @@ SDL.SDLController = Em.Object
             SDL.SDLAppController.model.activeRequests.vrPerformInteraction = null;
 
             SDL.SDLModel.set('VRActive', false);
+
+            SDL.InteractionChoicesView.timerUpdate();
         },
         /**
          * Method to sent notification for Alert
@@ -544,13 +545,12 @@ SDL.SDLController = Em.Object
          */
         registerApplication: function(params, applicationType) {
 
-            SDL.SDLModel.get('registeredApps')
-                .pushObject(this.applicationModels[applicationType].create( {
-                    appID: params.appID,
-                    appName: params.appName,
-                    deviceName: params.deviceName,
-                    appType: params.appType
-                }));
+            SDL.SDLModel.get('registeredApps').pushObject(this.applicationModels[applicationType].create( {
+                appID: params.appID,
+                appName: params.appName,
+                deviceName: params.deviceName,
+                appType: params.appType
+            }));
 
             var exitCommand = {
                 "id": -10,
@@ -670,16 +670,6 @@ SDL.SDLController = Em.Object
             this.turnChangeDeviceViewBack();
         },
         /**
-         * Method creates list of Application ID's Then call HMI method for
-         * display a list of Applications
-         * 
-         * @param {Object}
-         */
-        onGetAppList: function(appList) {
-
-            SDL.SDLModel.onGetAppList(appList);
-        },
-        /**
          * Method call's request to get list of applications
          */
         findNewApps: function() {
@@ -795,8 +785,8 @@ SDL.SDLController = Em.Object
         /**
          * Send system context
          */
-        onSystemContextChange: function() {
+        onSystemContextChange: function(appID) {
 
-            FFW.UI.OnSystemContext(this.get('sysContext'));
+            FFW.UI.OnSystemContext(this.get('sysContext'), appID);
         }
     });
index 408b81d..2c65bf9 100644 (file)
@@ -59,9 +59,10 @@ SDL.RPCController = Em.Object
             var error = false;
             if (array instanceof Array) {
                 for ( var i = 0; i < array.length; i++) {
-                    if (array[i].image && array[i].image.imageType !== "DYNAMIC") {
+                    if (array[i].image && 
+                        ((array[i].image.imageType !== "DYNAMIC") && 
+                         (array[i].image.imageType !== "STATIC"))) {
 
-                        error = true;
                     }
                 }
             }
@@ -77,6 +78,50 @@ SDL.RPCController = Em.Object
 
                 resultStruct: {},
 
+               /**
+                 * Validate method for request UpdateDeviceList
+                 * 
+                 * @param {Object}
+                 *            params
+                 */
+                UpdateDeviceList: function(params) {
+
+                    if (params == null) {
+
+                        this.resultStruct = {
+                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+                            "resultMessage": "Parameter 'params' does not exists!"
+                        };
+
+                        return this.resultStruct;
+                    }
+                    if (params.deviceList == null) {
+
+                        this.resultStruct = {
+                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+                            "resultMessage": "Parameter 'deviceList' does not exists!"
+                        };
+
+                        return this.resultStruct;
+                    }
+                    if (params.deviceList.length < 0) {
+
+                        this.resultStruct = {
+                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+                            "resultMessage": "Wrong type of parameter 'deviceList'!"
+                        };
+
+                        return this.resultStruct;
+                    }
+
+                    this.resultStruct = {
+                        "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+                    };
+
+                    return this.resultStruct;
+                },
+
+
                 /**
                  * Validate method for request PolicyUpdate
                  *
@@ -294,50 +339,6 @@ SDL.RPCController = Em.Object
                     return this.resultStruct;
                 },
 
-
-                /**
-                 * Validate method for request UpdateDeviceList
-                 * 
-                 * @param {Object}
-                 *            params
-                 */
-                UpdateDeviceList: function(params) {
-
-                    if (params == null) {
-
-                        this.resultStruct = {
-                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
-                            "resultMessage": "Parameter 'params' does not exists!"
-                        };
-
-                        return this.resultStruct;
-                    }
-                    if (params.deviceList == null) {
-
-                        this.resultStruct = {
-                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
-                            "resultMessage": "Parameter 'deviceList' does not exists!"
-                        };
-
-                        return this.resultStruct;
-                    }
-                    if (params.deviceList.length < 0) {
-
-                        this.resultStruct = {
-                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
-                            "resultMessage": "Wrong type of parameter 'deviceList'!"
-                        };
-
-                        return this.resultStruct;
-                    }
-
-                    this.resultStruct = {
-                        "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
-                    };
-
-                    return this.resultStruct;
-                },
-
                 /**
                  * Validate method for request AllowDeviceToConnect
                  * 
@@ -388,49 +389,6 @@ SDL.RPCController = Em.Object
                 },
 
                 /**
-                 * Validate method for request UpdateAppList
-                 * 
-                 * @param {Object}
-                 *            params
-                 */
-                UpdateAppList: function(params) {
-
-                    if (params == null) {
-
-                        this.resultStruct = {
-                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
-                            "resultMessage": "Parameter 'params' does not exists!"
-                        };
-
-                        return this.resultStruct;
-                    }
-                    if (params.applications == null) {
-
-                        this.resultStruct = {
-                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
-                            "resultMessage": "Parameter 'applications' does not exists!"
-                        };
-
-                        return this.resultStruct;
-                    }
-                    if (params.applications.length < 1) {
-
-                        this.resultStruct = {
-                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
-                            "resultMessage": "Wrong type of parameter 'applications'!"
-                        };
-
-                        return this.resultStruct;
-                    }
-
-                    this.resultStruct = {
-                        "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
-                    };
-
-                    return this.resultStruct;
-                },
-
-                /**
                  * Validate method for request MixingAudioSupported
                  * 
                  * @param {Object}
@@ -1077,7 +1035,7 @@ SDL.RPCController = Em.Object
                         }
                     }
                     if ("turnIcon" in params
-                        && (params.turnIcon.imageType !== "DYNAMIC" && params.turnIcon.imageType !== "STATIC")) {
+                        && ((params.turnIcon.imageType !== "DYNAMIC") && (params.turnIcon.imageType !== "STATIC"))) {
                         this.resultStruct = {
                             "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
                             "resultMessage": "Unsupported image type!"
@@ -1086,7 +1044,7 @@ SDL.RPCController = Em.Object
                         return this.resultStruct;
                     }
                     if ("nextTurnIcon" in params
-                        && params.nextTurnIcon.imageType !== "DYNAMIC") {
+                        && ((params.turnIcon.imageType !== "DYNAMIC") && (params.turnIcon.imageType !== "STATIC"))) {
                         this.resultStruct = {
                             "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
                             "resultMessage": "Unsupported image type!"
@@ -1170,7 +1128,8 @@ SDL.RPCController = Em.Object
 
                         for ( var i = 0; i < params.turnList.length; i++) {
                             if (params.turnList[i].image
-                                && params.turnList[i].image.imageType !== "DYNAMIC") {
+                                && ((params.turnIcon.imageType !== "DYNAMIC")
+                                &&  (params.turnIcon.imageType !== "STATIC"))) {
 
                                 this.resultStruct = {
                                     "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
@@ -1338,7 +1297,8 @@ SDL.RPCController = Em.Object
 
                         return this.resultStruct;
                     }
-                    if ("icon" in params && params.icon.imageType !== "DYNAMIC") {
+                    if ("icon" in params &&
+                        ((params.turnIcon.imageType !== "DYNAMIC") && (params.turnIcon.imageType !== "STATIC"))) {
                         this.resultStruct = {
                             "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
                             "resultMessage": "Unsupported image type!"
@@ -1413,7 +1373,7 @@ SDL.RPCController = Em.Object
                         }
                     }
                     if ("graphic" in params
-                        && params.graphic.imageType !== "DYNAMIC") {
+                        && ((params.graphic.imageType !== "DYNAMIC") && (params.graphic.imageType !== "STATIC"))) {
                         this.resultStruct = {
                             "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
                             "resultMessage": "Unsupported image type!"
@@ -2091,7 +2051,7 @@ SDL.RPCController = Em.Object
                         return this.resultStruct;
                     }
                     if ("syncFileName" in params
-                        && params.syncFileName.imageType !== "DYNAMIC") {
+                        && ((params.syncFileName.imageType !== "DYNAMIC") && (params.syncFileName.imageType !== "STATIC"))) {
                         this.resultStruct = {
                             "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
                             "resultMessage": "Unsupported image type!"
@@ -2811,24 +2771,6 @@ SDL.RPCController = Em.Object
 
                         return this.resultStruct;
                     }
-                    if (params.grammarID == null) {
-
-                        this.resultStruct = {
-                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
-                            "resultMessage": "Parameter 'grammarID' does not exists!"
-                        };
-
-                        return this.resultStruct;
-                    }
-                    if (typeof params.grammarID.length < 1) {
-
-                        this.resultStruct = {
-                            "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
-                            "resultMessage": "Wrong type of parameter 'grammarID'!"
-                        };
-
-                        return this.resultStruct;
-                    }
                     if (params.timeout == null) {
 
                         this.resultStruct = {
index d05604f..fd7d4c3 100644 (file)
@@ -79,6 +79,13 @@ SDL.SDLAppModel = Em.Object.extend({
         deviceName: '',
 
         /**
+         * Chosen device id
+         *
+         * @type {String}
+         */
+        deviceID: null,
+
+        /**
          * Global properties for current application
          *
          * @type {Object}
@@ -126,6 +133,13 @@ SDL.SDLAppModel = Em.Object.extend({
         softButtons: [],
 
         /**
+         * Array of Soft Buttons
+         *
+         * @type {Array}
+         */
+        turnListSoftButtons: [],
+
+        /**
          * Array of Objects for TBTTurnList
          *
          * @type {Array}
index 821c449..ce7a771 100644 (file)
@@ -336,18 +336,14 @@ SDL.SDLMediaModel = SDL.SDLAppModel.extend({
 
             this.updateSoftButtons(params.softButtons);
 
-            // Magic number is a count of Preset Buttons on HMI = 6
-            if (params.customPresets) {
-                for (var i = 0; i < 8; i++) {
-                    if (params.customPresets[i] != '' || params.customPresets[i] != null) {
-                        this.appInfo.set('customPresets.' + i, params.customPresets[i]);
-                    } else {
-                        this.appInfo.set('customPresets.' + i, 'Preset' + i);
-                    }
+            // Magic number is a count of Preset Buttons on HMI = 8
+            for (var i = 0; i < 8; i++) {
+                if (!params.customPresets || (params.customPresets[i] == '' || params.customPresets[i] == null)) {
+                    this.appInfo.set('customPresets.' + i, 'PRESET_' + i);
+                } else {
+                    this.appInfo.set('customPresets.' + i, params.customPresets[i]);
                 }
-                this.set('mediaPreset', true);
-            } else {
-                this.set('mediaPreset', false);
             }
+            this.set('mediaPreset', true);
         }
     });
index 23a9bf6..49105d8 100644 (file)
@@ -379,6 +379,14 @@ SDL.SDLModel = Em.Object.create({
      */
     registeredApps: [],
 
+
+    /**
+     * List of objects with params for connected devices
+     *
+     * @type object
+     */
+    connectedDevices: {},
+
     /**
      * List of devices with registered applications
      *
@@ -464,7 +472,7 @@ SDL.SDLModel = Em.Object.create({
      *
      * @type {Boolean}
      */
-    performInteractionSession: null,
+    performInteractionSession: [],
 
 /**
      * Array with app permissions
@@ -623,7 +631,7 @@ SDL.SDLModel = Em.Object.create({
 
         var result = false;
 
-        if (params.fileType === "GRAPHIC_PNG" && SDL.SDLController.getApplicationModel(params.appID)) {
+        if ((params.fileType === "GRAPHIC_PNG" || params.fileType === "GRAPHIC_BMP" || params.fileType === "GRAPHIC_JPEG") && SDL.SDLController.getApplicationModel(params.appID)) {
             result = SDL.SDLController.getApplicationModel(params.appID).onImageRemoved(params.fileName);
 
             if (SDL.SDLController.getApplicationModel(params.appID).appIcon.indexOf(params.fileName) != -1) {
@@ -632,12 +640,16 @@ SDL.SDLModel = Em.Object.create({
 
             if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams) {
 
-                if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon.indexOf(params.fileName) != -1) {
-                    SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.set('turnIcon', SDL.SDLModel.defaultListOfIcons.command);
+                if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon
+                    && SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon.value.indexOf(params.fileName) != -1) {
+                    SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon.value = SDL.SDLModel.defaultListOfIcons.command;
+                    SDL.TurnByTurnView.activate(params.appID);
                 }
 
-                if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon.indexOf(params.fileName) != -1) {
-                    SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.set('nextTurnIcon', SDL.SDLModel.defaultListOfIcons.command);
+                if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon
+                    && SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon.value.indexOf(params.fileName) != -1) {
+                    SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon.value = SDL.SDLModel.defaultListOfIcons.command;
+                    SDL.TurnByTurnView.activate(params.appID);
                 }
             }
 
@@ -651,16 +663,22 @@ SDL.SDLModel = Em.Object.create({
 
             var len = SDL.SDLController.getApplicationModel(params.appID).turnList.length;
             for (var i = 0; i < len; i++) {
-                if (SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon.indexOf(params.fileName) != -1) {
-                    SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon = SDL.SDLModel.defaultListOfIcons.command;
+                if (!SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon) {
+                    continue;
+                }
+                if (SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon.value.indexOf(params.fileName) != -1) {
+                    SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon.value = SDL.SDLModel.defaultListOfIcons.command;
                 }
             }
 
             SDL.TBTTurnList.updateList(params.appID);
 
             if (SDL.SDLController.getApplicationModel(params.appID).softButtons) {
-                var len = SDL.SDLController.getApplicationModel(params.appID).softButtons;
+                var len = SDL.SDLController.getApplicationModel(params.appID).softButtons.length;
                 for (var i = 0; i < len; i++) {
+                    if (!SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image) {
+                        continue;
+                    }
                     if (SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image.value.indexOf(params.fileName) != -1) {
                         SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image.value = SDL.SDLModel.defaultListOfIcons.command;
                     }
@@ -671,6 +689,42 @@ SDL.SDLModel = Em.Object.create({
                 }
             }
 
+            var len = SDL.VRHelpListView.helpList.items.length;
+            for (var i = 0; i < len; i++) {
+                if (!SDL.VRHelpListView.helpList.items[i].params.icon) {
+                    continue;
+                }
+                if (SDL.VRHelpListView.helpList.items[i].params.icon.indexOf(params.fileName) != -1) {
+                    SDL.VRHelpListView.helpList.items[i].params.icon = SDL.SDLModel.defaultListOfIcons.command;
+                }
+            }
+
+            SDL.VRHelpListView.helpList.list.refresh();
+
+            var len = SDL.InteractionChoicesView.listOfChoices.items.length;
+            for (var i = 0; i < len; i++) {
+                if (!SDL.InteractionChoicesView.listOfChoices.items[i].params.icon) {
+                    continue;
+                }
+                if (SDL.InteractionChoicesView.listOfChoices.items[i].params.icon.indexOf(params.fileName) != -1) {
+                    SDL.InteractionChoicesView.listOfChoices.items[i].params.icon = SDL.SDLModel.defaultListOfIcons.command;
+                }
+            }
+
+            SDL.InteractionChoicesView.listOfChoices.list.refresh();
+
+            var len = SDL.InteractionChoicesView.listWrapper.naviChoises._childViews.length;
+            for (var i = 0; i < len; i++) {
+                if (!SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon) {
+                    continue;
+                }
+                if (SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon.indexOf(params.fileName) != -1) {
+                    SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon = SDL.SDLModel.defaultListOfIcons.command;
+                }
+            }
+
+            SDL.InteractionChoicesView.listWrapper.naviChoises.rerender();
+
         }
 
 
@@ -784,8 +838,8 @@ SDL.SDLModel = Em.Object.create({
      */
     tbtTurnListUpdate: function(params) {
 
-        SDL.SDLController.getApplicationModel(params.appID).turnList = params.turnList;
-        SDL.SDLController.getApplicationModel(params.appID).turnListSoftButtons = params.softButtons;
+        SDL.SDLController.getApplicationModel(params.appID).turnList = params.turnList ? params.turnList : [];
+        SDL.SDLController.getApplicationModel(params.appID).turnListSoftButtons = params.softButtons ? params.softButtons : [];
         SDL.TBTTurnList.updateList(params.appID);
     },
 
@@ -841,8 +895,10 @@ SDL.SDLModel = Em.Object.create({
         }
 
         if (params.ttsName) {
-            var message = {"cmdID": 0, "vrCommands": [params.ttsName.text], "appID": params.application.appID, "type": "Application"};
-            this.addCommandVR(message);
+            for (var i = 0; i < params.ttsName.length; i++) {
+                var message = {"cmdID": 0, "vrCommands": [params.ttsName[i].text], "appID": params.application.appID, "type": "Application"};
+                this.addCommandVR(message);
+            }
         }
 
         if (params.vrSynonyms) {
@@ -934,33 +990,54 @@ SDL.SDLModel = Em.Object.create({
     },
 
     /**
-     * Method to call handler from model to show list of avaliable
-     * applications
+     * Method to call function from DeviceListView to show list of connected
+     * devices
      *
      * @param {Object}
-     *            appList
+     *            params
      */
-    onGetAppList: function (appList) {
+    onGetDeviceList: function (params) {
+
+        //SDL.SDLModel.set('connectedDevices', params.deviceList);
+        var exist = false;
+
+        for (var i = 0; i < params.deviceList.length; i++) {
+
+            if (params.deviceList[i].id in SDL.SDLModel.connectedDevices) {
+                exist = true;
+            }
+
+            if (!exist) {
+                SDL.SDLModel.connectedDevices[params.deviceList[i].id] = {
+                    "name": params.deviceList[i].name,
+                    "id": params.deviceList[i].id,
+                    "sdlFunctionality": {
+                        "popUpId": null,
+                        "allowed": false
+                    }
+                }
+            } else {
 
-        var i = 0, len = appList.length;
-        for (i = 0; i < len; i++) {
-            if (appList[i]) {
-                SDL.SDLModel.onAppRegistered(appList[i]);
+                exist = false;
             }
         }
 
-    },
+        var dev = SDL.SDLModel.connectedDevices;
+        for (var key in dev) {
 
-    /**
-     * Method to call function from DeviceListView to show list of connected
-     * devices
-     *
-     * @param {Object}
-     *            params
-     */
-    onGetDeviceList: function (params) {
+            if (dev.hasOwnProperty(key)) {
+                if (params.deviceList.filterProperty("id", parseInt(key)).length == 0) {
+
+                    if (SDL.PopUp.popUpId == dev[key].sdlFunctionality.popUpId) {
+                        SDL.PopUp.deactivate();
+                    }
 
-        if (SDL.States.info.devicelist.active && params.deviceList && params.deviceList.length) {
+                    delete dev[key];
+                }
+            }
+        }
+
+        if (SDL.States.info.devicelist.active) {
             SDL.DeviceListView.ShowDeviceList(params);
         }
 
@@ -1039,9 +1116,10 @@ SDL.SDLModel = Em.Object.create({
             SDL.SDLModel.set('interactionData.vrHelp', message.params.vrHelp);
         }
 
-        SDL.InteractionChoicesView.activate(message);
-
-        SDL.SDLController.VRMove();
+       // if (message.params.choiceSet || message.params.interactionLayout == "KEYBOARD") {
+            SDL.InteractionChoicesView.activate(message);
+            SDL.SDLController.VRMove();
+        //}
     },
 
     /**
@@ -1055,28 +1133,41 @@ SDL.SDLModel = Em.Object.create({
         if (!SDL.SDLAppController.model.activeRequests.vrPerformInteraction) {
             SDL.SDLAppController.model.activeRequests.vrPerformInteraction = message.id;
         } else {
-            SDL.SDLController.vrInteractionResponse(message.params.appID, SDL.SDLModel.resultCode['REJECTED']);
+            SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['REJECTED']);
             return;
         }
 
+        setTimeout(function(){
+            if (SDL.SDLAppController.model.activeRequests.vrPerformInteraction) {
+                SDL.SDLModel.onPrompt(message.params.timeoutPrompt);
+                SDL.SDLModel.interactionData.helpPrompt = null;
+            }
+        }, message.params.timeout - 2000); //Magic numer is a platform depended HMI behavior: -2 seconds for timeout prompt
+
+        SDL.SDLModel.onPrompt(message.params.initialPrompt);
+
+        SDL.SDLModel.interactionData.helpPrompt = message.params.helpPrompt;
+
         if (message.params.grammarID) {
 
             this.set('performInteractionSession', message.params.grammarID);
             SDL.SDLModel.set('VRActive', true);
-        }
 
-        SDL.SDLModel.onPrompt(message.params.initialPrompt);
+            setTimeout(function(){
+                if (SDL.SDLModel.VRActive) {
+                    if (SDL.SDLAppController.model && SDL.SDLAppController.model.activeRequests.vrPerformInteraction) {
+                        SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['TIMED_OUT']);
+                    }
 
-        SDL.SDLModel.interactionData.helpPrompt = message.params.helpPrompt;
+                    SDL.SDLModel.set('VRActive', false);
+                }
+            }, message.params.timeout);
 
-        var messageLocal = message;
+            SDL.InteractionChoicesView.timerUpdate();
+        } else {
 
-        setTimeout(function(){
-            if (SDL.SDLAppController.model.activeRequests.vrPerformInteraction) {
-                SDL.SDLModel.onPrompt(messageLocal.params.timeoutPrompt);
-                SDL.SDLModel.interactionData.helpPrompt = null;
-            }
-        }, messageLocal.params.timeout - 2000); //Magic numer is a platform depended HMI behavior: -2 seconds for timeout prompt
+            SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['SUCCESS']);
+        }
     },
 
     /**
index c8aa2a9..79c7bbd 100644 (file)
@@ -187,15 +187,13 @@ SDL.SDLNonMediaModel = SDL.SDLAppModel.extend({
                 this.appInfo.set('mainImage', 'images/sdl/audio_icon.jpg');
             }
 
-            // Magic number is a count of Preset Buttons on HMI = 6
-            if (params.customPresets) {
-                this.appInfo.set('customPresets', []);
-                for (var i = 0; i < 8; i++) {
-                    if (params.customPresets[i] != '' || params.customPresets[i] != null) {
-                        this.appInfo.get('customPresets').pushObject(params.customPresets[i]);
-                    } else {
-                        this.appInfo.get('customPresets').pushObject('Preset' + i);
-                    }
+            // Magic number is a count of Preset Buttons on HMI = 8
+            this.appInfo.set('customPresets', []);
+            for (var i = 0; i < 8; i++) {
+                if (!params.customPresets || (params.customPresets[i] == '' || params.customPresets[i] == null)) {
+                    this.appInfo.get('customPresets').pushObject('PRESET_' + i);
+                } else {
+                    this.appInfo.get('customPresets').pushObject(params.customPresets[i]);
                 }
             }
 
index 76de5fa..1266f05 100644 (file)
@@ -238,7 +238,6 @@ SDL.AlertPopUp = Em.ContainerView.create({
         
         this.set('active', true);
         this.set('timeout', message.duration);
-        SDL.SDLController.onSystemContextChange();
 
         clearTimeout(this.timer);
         this.timer = setTimeout(function() {
index 3900ee3..2954a2f 100644 (file)
@@ -171,8 +171,8 @@ SDL.AudioPassThruPopUp = Em.ContainerView.create( {
             if( this.timer ){
                 clearTimeout( this.timer );
             }
-        }
 
-        SDL.SDLController.onSystemContextChange();
+            SDL.SDLController.onSystemContextChange();
+        }
     }.observes( 'activate' )
 } );
\ No newline at end of file
index c877d81..0b6e589 100644 (file)
@@ -49,6 +49,8 @@ SDL.PopUp = Em.ContainerView.create({
         'this.active:active_state:inactive_state'
     ],
 
+    popUpId: 0,
+
     /**
      * Callback function to return result of made action by user
      */
@@ -95,7 +97,7 @@ SDL.PopUp = Em.ContainerView.create({
     deactivate: function(event) {
         this.set('active', false);
 
-        if (this.callback) {
+        if (this.callback && event) {
             this.callback(event.buttonAction);
         }
 
@@ -112,11 +114,13 @@ SDL.PopUp = Em.ContainerView.create({
         } else {
             this.set('buttons', true);
             setTimeout(function(){
-                SDL.PopUp.deactivate()
+                SDL.PopUp.deactivate();
             },
             3000);
         }
 
         this.set('content', message);
+
+        return ++this.popUpId;
     }
 });
\ No newline at end of file
index 4e6dd6e..a8433c9 100644 (file)
@@ -52,7 +52,6 @@ SDL.VRHelpListView = SDL.SDLAbstractView.create( {
 
         this._super();
 
-
         if (SDL.SDLAppController.model && SDL.SDLAppController.model.activeRequests.vrPerformInteraction) {
             SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['ABORTED']);
         }
index 47ded44..e2d1b26 100644 (file)
@@ -102,9 +102,9 @@ SDL.VRPopUp = Em.ContainerView.create( {
                     text: vrCommands[j],
                     type: type,
                     hideButtons: function() {
-                        if (this.type == "Command" && !SDL.SDLModel.performInteractionSession) {
+                        if (this.type == "Command" && SDL.SDLModel.performInteractionSession.length == 0) {
                             return false;
-                        } else if (SDL.SDLModel.performInteractionSession && this.grammarID == SDL.SDLModel.performInteractionSession) {
+                        } else if (SDL.SDLModel.performInteractionSession && SDL.SDLModel.performInteractionSession.indexOf(this.grammarID) >= 0) {
                             return false;
                         } else {
                             return true;
@@ -206,11 +206,14 @@ SDL.VRPopUp = Em.ContainerView.create( {
 
     onActivate: function() {
         SDL.SDLController.VRMove();
-       SDL.SDLController.onSystemContextChange();
        if (this.VRActive) {
+
                FFW.VR.Started();
+            SDL.SDLController.onSystemContextChange();
        } else {
+
                FFW.VR.Stopped();
+            SDL.SDLController.onSystemContextChange();
        }
     }.observes('this.VRActive'),
     
index 35499a5..9ebd5d5 100644 (file)
@@ -171,7 +171,6 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
                     this.set('list', false);
                     this.set('icon', true);
                     this.set('active', true);
-                    SDL.SDLController.onSystemContextChange();
                     break;
                 }
                 case "ICON_WITH_SEARCH" : {
@@ -182,7 +181,6 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
                     this.set('search', true);
                     this.set('list', false);
                     this.set('active', true);
-                    SDL.SDLController.onSystemContextChange();
                     break;
                 }
                 case "LIST_ONLY" : {
@@ -193,7 +191,6 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
                     this.set('icon', false);
                     this.set('search', false);
                     this.set('active', true);
-                    SDL.SDLController.onSystemContextChange();
                     break;
                 }
                 case "LIST_WITH_SEARCH" : {
@@ -232,7 +229,6 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
                 this.set('icon', false);
                 this.set('search', false);
                 this.set('active', true);
-                SDL.SDLController.onSystemContextChange();
             } else {
 
                 this.timer = setTimeout(function () {
@@ -248,36 +244,41 @@ SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
      */
     deactivate: function (result, choiceID) {
 
-        clearTimeout(this.timer);
-        this.set('active', false);
-        SDL.SDLController.VRMove();
-        SDL.Keyboard.deactivate();
-
-        switch (result) {
-            case "ABORTED":
-            {
-                SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["ABORTED"]);
-                break;
-            }
-            case "TIMED_OUT":
-            {
-                SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["TIMED_OUT"]);
-                break;
-            }
-            case "SUCCESS":
-            {
-                SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["SUCCESS"], choiceID, this.input.value);
-                break;
-            }
-            default:
-            {
-                // default action
+        if (SDL.SDLModel.performInteractionSession.length > 0 && result != "ABORTED") {
+            this.timerUpdate();
+        } else {
+
+            clearTimeout(this.timer);
+            this.set('active', false);
+            SDL.SDLController.VRMove();
+            SDL.Keyboard.deactivate();
+
+            switch (result) {
+                case "ABORTED":
+                {
+                    SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["ABORTED"]);
+                    break;
+                }
+                case "TIMED_OUT":
+                {
+                    SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["TIMED_OUT"]);
+                    break;
+                }
+                case "SUCCESS":
+                {
+                    SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["SUCCESS"], choiceID, this.input.value);
+                    break;
+                }
+                default:
+                {
+                    // default action
+                }
             }
-        }
 
-        this.appID = null;
+            this.appID = null;
 
-        SDL.SDLController.onSystemContextChange();
+            SDL.SDLController.onSystemContextChange();
+        }
     },
 
     /**
index 1cc1c2d..3c42378 100644 (file)
@@ -97,8 +97,6 @@ SDL.ScrollableMessage = SDL.SDLAbstractView.create({
             this.timer = setTimeout(function () {
                 self.deactivate();
             }, params.timeout);
-
-            SDL.SDLController.onSystemContextChange();
         }
     },
 
index aedb2cb..a39f2cf 100644 (file)
@@ -93,8 +93,6 @@ SDL.SliderView = SDL.SDLAbstractView.create( {
 
         this.set('timeout', timeout);
 
-        SDL.SDLController.onSystemContextChange();
-
         this.timer = setTimeout(function () {
             if (SDL.SliderView.active) {
                 SDL.SliderView.deactivate(true);
index 3e46d94..6c5a558 100644 (file)
@@ -100,13 +100,10 @@ SDL.TBTTurnList = SDL.SDLAbstractView.create({
                         templateName: turnListArray[i].turnIcon ? 'icon' : ''
                     }));
             }
-            if (SDL.SDLController.getApplicationModel(appID).turnListSoftButtons) {
-                turnListArray = SDL.SDLController.getApplicationModel(appID).turnListSoftButtons;
-                length = turnListArray.length;
-            } else {
-                length = null;
-                turnListArray = [];
-            }
+
+            turnListArray = SDL.SDLController.getApplicationModel(appID).turnListSoftButtons;
+            length = turnListArray.length;
+            
             for (var i = 0; i < length; i++) {
                 this.get('tbtTurnListList.list.childViews').pushObject(SDL.Button.create(SDL.PresetEventsCustom, {
                         systemAction     : turnListArray[i].systemAction,
index 072c428..a05e8ef 100644 (file)
@@ -64,13 +64,13 @@ SDL.AppPermissionsView = Em.ContainerView.create( {
             [
                 'backButton'
             ],
-        action: function(){
+        action: function(element){
 
-            SDL.SettingsController.onState(this);
+            SDL.SettingsController.onState(element);
 
-            FFW.BasicCommunication.OnAppPermissionConsent(SDL.SDLController.getApplicationModel(this.currentAppId).allowedFunctions, "GUI", this.currentAppId.appID);
+            FFW.BasicCommunication.OnAppPermissionConsent(SDL.SDLController.getApplicationModel(SDL.AppPermissionsView.currentAppId).allowedFunctions, "GUI", SDL.AppPermissionsView.currentAppId);
 
-            this.currentAppId = null;
+            SDL.AppPermissionsView.currentAppId = null;
         },
         goToState: 'policies',
         icon: 'images/media/ico_back.png',
index 6fcc987..37cb33d 100644 (file)
@@ -100,20 +100,23 @@ SDL.DeviceConfigView = Em.ContainerView.create( {
             }
         });
 
-        var i, dev = SDL.SDLModel.conectedDevices;
-
-        for (i = 0; i < dev.length; i++) {
-
-            this.listOfDevices.items.push({
-                type: SDL.Button,
-                params: {
-                    action: 'changeDeviceAccess',
-                    target: 'SDL.SettingsController',
-                    text: dev[i].allowed ? dev[i].name + " - Allowed" : dev[i].name + " - Not allowed",
-                    name: dev[i].name,
-                    id: dev[i].id
-                }
-            });
+        var dev = SDL.SDLModel.connectedDevices;
+
+        for (var key in dev) {
+
+            if (dev.hasOwnProperty(key)) {
+
+                this.listOfDevices.items.push({
+                    type: SDL.Button,
+                    params: {
+                        action: 'changeDeviceAccess',
+                        target: 'SDL.SettingsController',
+                        text: dev[key].allowed ? dev[key].name + " - Allowed" : dev[key].name + " - Not allowed",
+                        name: dev[key].name,
+                        id: dev[key].id
+                    }
+                });
+            }
         }
 
         this.listOfDevices.list.refresh();
diff --git a/src/components/HMI/app/view/settings/policies/deviceStateChangeView.js b/src/components/HMI/app/view/settings/policies/deviceStateChangeView.js
new file mode 100644 (file)
index 0000000..44e6106
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: Â·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. Â· Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. Â· Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.DeviceConfigView
+ * @desc Info Apps visual representation
+ * @category View
+ * @filesource app/view/settings/policies/deviceConfigView.js
+ * @version 1.0
+ */
+
+SDL.DeviceStateChangeView = Em.ContainerView.create( {
+
+    elementId: 'policies_settings_deviceStateChange',
+
+    classNames: 'in_settings_separate_view',
+
+    classNameBindings: [
+        'SDL.States.settings.policies.deviceStateChange.active:active_state:inactive_state'
+    ],
+
+    childViews: [
+        'backButton',
+        'listOfDevices',
+        'label'
+    ],
+
+    /**
+     * Label in title
+     */
+    label: SDL.Label.extend( {
+
+        elementId: 'label',
+
+        classNames: 'label',
+
+        content: 'Choose devices to be Unpaired:'
+    }),
+
+    backButton: SDL.Button.extend( {
+        classNames:
+            [
+                'backButton'
+            ],
+        action: 'onState',
+        target: 'SDL.SettingsController',
+        goToState: 'policies',
+        icon: 'images/media/ico_back.png',
+        onDown: false
+    } ),
+
+    /**
+     * Function to add application to application list
+     */
+    showDeviceList: function() {
+
+        this.listOfDevices.items = [];
+
+        var dev = SDL.SDLModel.connectedDevices;
+
+        for (var key in dev) {
+
+            if (dev.hasOwnProperty(key)) {
+
+                this.listOfDevices.items.push({
+                    type: SDL.Button,
+                    params: {
+                        action: 'OnDeviceStateChanged',
+                        target: 'FFW.BasicCommunication',
+                        text: dev[key].name,
+                        deviceName: dev[key].name,
+                        deviceID: dev[key].id
+                    }
+                });
+            }
+        }
+
+        this.listOfDevices.list.refresh();
+
+    },
+
+    listOfDevices: SDL.List.extend( {
+
+        elementId: 'polocies_device_list',
+
+        itemsOnPage: 5,
+
+        /** Items */
+        items: new Array()
+    })
+});
\ No newline at end of file
index 2c44751..68efb72 100644 (file)
@@ -114,6 +114,17 @@ SDL.PoliciesView = Em.ContainerView.create( {
                     goToState: 'policies.appPermissionsList',
                     onDown: false
                 }
+            },
+            {
+                type: SDL.Button,
+                params: {
+                    text: 'Device state change',
+                    action: 'onState',
+                    target: 'SDL.SettingsController',
+                    templateName: 'arrow',
+                    goToState: 'policies.deviceStateChange',
+                    onDown: false
+                }
             }
         ]
     })
index 2afb895..237cd53 100644 (file)
@@ -43,6 +43,7 @@ SDL.SettingsView = Em.ContainerView.create( {
     childViews:
         [
             'leftMenu',
+            SDL.DeviceStateChangeView,
             SDL.PoliciesView,
             SDL.AppPermissionsListView,
             SDL.AppPermissionsView,
index 5c8c3cb..fd1627b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013, Ford Motor Company All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met: Â·
  * Redistributions of source code must retain the above copyright notice, this
@@ -10,7 +10,7 @@
  * with the distribution. Â· Neither the name of the Ford Motor Company nor the
  * names of its contributors may be used to endorse or promote products derived
  * from this software without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -45,8 +45,6 @@ FFW.BasicCommunication = FFW.RPCObserver
 
 
         onPutFileSubscribeRequestID: -1,
-allowSDLFunctionalityRequestID: -1,
-
         onSystemErrorSubscribeRequestID: -1,
         onStatusUpdateSubscribeRequestID: -1,
         onAppPermissionChangedSubscribeRequestID: -1,
@@ -55,10 +53,11 @@ allowSDLFunctionalityRequestID: -1,
         onAppUnregisteredSubscribeRequestID: -1,
         onPlayToneSubscribeRequestID: -1,
         onSDLCloseSubscribeRequestID: -1,
-onSDLConsentNeededSubscribeRequestID: -1,
+        onSDLConsentNeededSubscribeRequestID: -1,
+        onResumeAudioSourceSubscribeRequestID: -1,
 
         onPutFileUnsubscribeRequestID: -1,
-onSystemErrorUnsubscribeRequestID: -1,
+        onSystemErrorUnsubscribeRequestID: -1,
         onStatusUpdateUnsubscribeRequestID: -1,
         onAppPermissionChangedUnsubscribeRequestID: -1,
         onFileRemovedUnsubscribeRequestID: -1,
@@ -66,7 +65,8 @@ onSystemErrorUnsubscribeRequestID: -1,
         onAppUnregisteredUnsubscribeRequestID: -1,
         onPlayToneUnsubscribeRequestID: -1,
         onSDLCloseUnsubscribeRequestID: -1,
-onSDLConsentNeededUnsubscribeRequestID: -1,
+        onSDLConsentNeededUnsubscribeRequestID: -1,
+        onResumeAudioSourceUnsubscribeRequestID: -1,
 
         // const
         onSystemErrorNotification: "SDL.OnSystemError",
@@ -78,7 +78,9 @@ onSDLConsentNeededUnsubscribeRequestID: -1,
         onAppUnregisteredNotification: "BasicCommunication.OnAppUnregistered",
         onPlayToneNotification: "BasicCommunication.PlayTone",
         onSDLCloseNotification: "BasicCommunication.OnSDLClose",
-onSDLConsentNeededNotification: "SDL.OnSDLConsentNeeded",
+        onSDLConsentNeededNotification: "SDL.OnSDLConsentNeeded",
+        onResumeAudioSourceNotification: "BasicCommunication.OnResumeAudioSource",
+
 
         /**
          * init object
@@ -116,7 +118,7 @@ onSDLConsentNeededNotification: "SDL.OnSDLConsentNeeded",
             // subscribe to notifications
             this.onPutFileSubscribeRequestID = this.client
                 .subscribeToNotification(this.onPutFileNotification);
-this.onSystemErrorSubscribeRequestID = this.client
+            this.onSystemErrorSubscribeRequestID = this.client
                 .subscribeToNotification(this.onSystemErrorNotification);
             this.onStatusUpdateSubscribeRequestID = this.client
                 .subscribeToNotification(this.onStatusUpdateNotification);
@@ -132,9 +134,10 @@ this.onSystemErrorSubscribeRequestID = this.client
                 .subscribeToNotification(this.onPlayToneNotification);
             this.onSDLCloseSubscribeRequestID = this.client
                 .subscribeToNotification(this.onSDLCloseNotification);
-this.onSDLConsentNeededSubscribeRequestID = this.client
+            this.onSDLConsentNeededSubscribeRequestID = this.client
                 .subscribeToNotification(this.onSDLConsentNeededNotification);
-
+            this.onResumeAudioSourceSubscribeRequestID = this.client
+                .subscribeToNotification(this.onResumeAudioSourceNotification);
         },
 
         /**
@@ -149,7 +152,7 @@ this.onSDLConsentNeededSubscribeRequestID = this.client
 
             this.onPutFileUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onPutFileNotification);
-this.onSystemErrorUnsubscribeRequestID = this.client
+            this.onSystemErrorUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onSystemErrorNotification);
             this.onStatusUpdateUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onStatusUpdateNotification);
@@ -165,8 +168,10 @@ this.onSystemErrorUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onPlayToneUpdatedNotification);
             this.onSDLCloseUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onSDLCloseNotification);
-this.onSDLConsentNeededUnsubscribeRequestID = this.client
+            this.onSDLConsentNeededUnsubscribeRequestID = this.client
                 .unsubscribeFromNotification(this.onSDLConsentNeededNotification);
+            this.onResumeAudioSourceUnsubscribeRequestID = this.client
+                .unsubscribeFromNotification(this.onResumeAudioSourceNotification);
         },
 
         /**
@@ -196,8 +201,8 @@ this.onSDLConsentNeededUnsubscribeRequestID = this.client
 
                 if (response.id in SDL.SDLModel.userFriendlyMessagePull) {
                     var callbackObj = SDL.SDLModel.userFriendlyMessagePull[response.id];
-                    callbackObj.callback(response.result.message, callbackObj.appID);
-                    SDL.SDLModel.userFriendlyMessagePull.remove(response.id);
+                    callbackObj.callbackFunc(response.result.message, callbackObj.appID);
+                    delete SDL.SDLModel.userFriendlyMessagePull[response.id];
                 }
             }
 
@@ -230,15 +235,15 @@ this.onSDLConsentNeededUnsubscribeRequestID = this.client
 
                         this.GetListOfPermissions(appID);
 
-                        this.OnAppPermissionConsent(response.result.allowedFunctions, "GUI", appID);
+                        //this.OnAppPermissionConsent(response.result.allowedFunctions, "GUI", appID);
                     }
 
                     if (response.result.isAppPermissionsRevoked) {
 
-                        SDL.SettingsController.userFriendlyMessagePopUp();
+                        SDL.SettingsController.userFriendlyMessagePopUp(appID, response.result.appRevokedPermissions);
 
                         //deleted array
-                        SDL.SDLModel.setAppPermissions(params.appRevokedPermissions);
+                        SDL.SDLModel.setAppPermissions(response.result.appRevokedPermissions);
                     }
 
                     if (response.result.isAppRevoked) {
@@ -250,7 +255,17 @@ this.onSDLConsentNeededUnsubscribeRequestID = this.client
                         });
                     } else {
 
-                        SDL.SDLController.getApplicationModel(appID).turnOnSDL();
+                        SDL.SDLController.getApplicationModel(appID).deviceID = response.result.device ? response.result.device.id : null;
+
+                        if ( SDL.SDLAppController.model && SDL.SDLAppController.model.appID != appID) {
+                            SDL.States.goToStates('info.apps');
+                        }
+
+                        if (SDL.SDLModel.stateLimited == appID) {
+                            SDL.SDLModel.stateLimited = null;
+                        }
+
+                        SDL.SDLController.getApplicationModel(appID).turnOnSDL(appID);
                     }
 
                     delete SDL.SDLModel.activateAppRequestsList[response.id];
@@ -275,7 +290,12 @@ this.onSDLConsentNeededUnsubscribeRequestID = this.client
 
                 SDL.SDLModel.set('policyURLs', response.result.urls);
 
-                this.OnSystemRequest("PROPRIETARY", response.result.urls[0].policyAppId, SDL.SettingsController.policyUpdateFile, response.result.urls[0].url);
+                if (response.result.urls.length) {
+                    this.OnSystemRequest("PROPRIETARY", response.result.urls[0].policyAppId, SDL.SettingsController.policyUpdateFile, response.result.urls[0].url);
+                } else {
+                    this.OnSystemRequest("PROPRIETARY");
+                }
+
             }
         },
 
@@ -300,7 +320,7 @@ this.onSDLConsentNeededUnsubscribeRequestID = this.client
                 SDL.SDLModel.onFileRemoved(notification.params);
             }
 
-if (notification.method == this.onSystemErrorNotification) {
+            if (notification.method == this.onSystemErrorNotification) {
 
                 var message = "Undefined";
 
@@ -316,7 +336,6 @@ if (notification.method == this.onSystemErrorNotification) {
             if (notification.method == this.onStatusUpdateNotification) {
 
                 //SDL.PopUp.popupActivate(notification.status);
-
                 SDL.TTSPopUp.ActivateTTS(notification.params.status);
             }
 
@@ -342,12 +361,17 @@ if (notification.method == this.onSystemErrorNotification) {
             if (notification.method == this.onSDLCloseNotification) {
                 //notification handler method
             }
-if (notification.method == this.onSDLConsentNeededNotification) {
+            if (notification.method == this.onSDLConsentNeededNotification) {
 
                 //Show popUp
                 SDL.SettingsController.AllowSDLFunctionality(notification.params.device);
 
             }
+            if (notification.method == this.onResumeAudioSourceNotification) {
+
+                SDL.SDLModel.stateLimited = notification.params.device;
+                SDL.VRPopUp.updateVR();
+            }
         },
 
         /**
@@ -372,24 +396,23 @@ if (notification.method == this.onSDLConsentNeededNotification) {
                 if (request.method == "BasicCommunication.AllowDeviceToConnect") {
                     this.AllowDeviceToConnect(request.id, request.method, allow);
                 }
-                if (request.method == "BasicCommunication.UpdateAppList") {
-                    if (SDL.States.info.active) {
-                        SDL.SDLController
-                            .onGetAppList(request.params.applications);
-                    }
+                if (request.method == "BasicCommunication.UpdateDeviceList") {
+                    SDL.SDLModel.onGetDeviceList(request.params);
                     this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"],
                         request.id,
                         request.method);
                 }
-                if (request.method == "BasicCommunication.UpdateDeviceList") {
-                    SDL.SDLModel.onGetDeviceList(request.params);
+                if (request.method == "BasicCommunication.UpdateAppList") {
+                    if (SDL.States.info.active) {
+                        SDL.SDLController.onGetAppList(request.params.applications);
+                    }
                     this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"],
                         request.id,
                         request.method);
                 }
                 if (request.method == "BasicCommunication.SystemRequest") {
 
-                    this.OnReceivedPolicyUpdate(SDL.SettingsController.policyUpdateFile);
+                    this.OnReceivedPolicyUpdate(request.params.fileName);
 
                     SDL.SettingsController.policyUpdateFile = null;
 
@@ -403,12 +426,14 @@ if (notification.method == this.onSDLConsentNeededNotification) {
                         SDL.States.goToStates('info.apps');
                     }
 
-                    SDL.SDLModel.stateLimited = null;
+                    if (SDL.SDLModel.stateLimited == request.params.appID) {
+                        SDL.SDLModel.stateLimited = null;
+                    }
 
                     SDL.SDLController.getApplicationModel(request.params.appID).turnOnSDL(request.params.appID);
                     this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
                 }
-if (request.method == "BasicCommunication.GetSystemInfo") {
+                if (request.method == "BasicCommunication.GetSystemInfo") {
 
                     Em.Logger.log("BasicCommunication.GetSystemInfo Response");
 
@@ -580,7 +605,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
 
         /**
          * send response from onRPCRequest
-         * 
+         *
          * @param {Number}
          *            resultCode
          * @param {Number}
@@ -717,7 +742,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
 
         /**
          * send response from onRPCRequest
-         * 
+         *
          * @param {Number}
          *            id
          * @param {String}
@@ -776,7 +801,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
 
         /**
          * Send request if application was activated
-         * 
+         *
          * @param {number} appID
          */
         OnAppActivated: function(appID) {
@@ -795,6 +820,31 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
         },
 
         /**
+         * Send request if device was unpaired from HMI
+         *
+         * @param {number} appID
+         */
+        OnDeviceStateChanged: function(elemet) {
+
+            Em.Logger.log("FFW.SDL.OnDeviceStateChanged");
+
+            // send notification
+            var JSONMessage = {
+                "jsonrpc": "2.0",
+                "method": "SDL.OnDeviceStateChanged",
+                "params": {
+                    "deviceState": "UNPAIRED",
+                    "deviceInternalId": "",
+                    "deviceId": {
+                        "name": elemet.deviceName,
+                        "id": elemet.deviceID
+                    }
+                }
+            };
+            this.client.send(JSONMessage);
+        },
+
+        /**
          * This methos is request to get list of registered apps.
          */
         OnFindApplications: function() {
@@ -855,7 +905,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
         /**
          * Invoked by UI component when user switches to any functionality which
          * is not other mobile application.
-         * 
+         *
          * @params {String}
          * @params {Number}
          */
@@ -895,7 +945,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
 
         /**
          * Used by HMI when User chooses to exit application.
-         * 
+         *
          * @params {Number}
          */
         ExitApplication: function(appID) {
@@ -916,7 +966,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
 
         /**
          * Sent by HMI to SDL to close all registered applications.
-         * 
+         *
          * @params {String}
          */
         ExitAllApplications: function(reason) {
@@ -938,7 +988,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
         /**
          * Response with params of the last one supports mixing audio (ie
          * recording TTS command and playing audio).
-         * 
+         *
          * @params {Number}
          */
         MixingAudioSupported: function(attenuatedSupported) {
@@ -962,7 +1012,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
         /**
          * Response with Results by user/HMI allowing SDL functionality or
          * disallowing access to all mobile apps.
-         * 
+         *
          * @params {Number}
          */
         AllowAllApps: function(allowed) {
@@ -985,7 +1035,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
 
         /**
          * Response with result of allowed application
-         * 
+         *
          * @params {Number}
          */
         AllowApp: function(request) {
@@ -1019,7 +1069,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
 
         /**
          * Notifies if device was choosed
-         * 
+         *
          * @param {String}
          *            deviceName
          * @param {Number}
@@ -1045,7 +1095,7 @@ if (request.method == "BasicCommunication.GetSystemInfo") {
 
         /**
          * Send error response from onRPCRequest
-         * 
+         *
          * @param {Number}
          *            resultCode
          * @param {Number}
index 42227d7..f046524 100644 (file)
@@ -82,7 +82,8 @@ FFW.RPCObserver = Em.Object
                 var parsedMethod = request.method.split(/[.]/), validateFunc, result;\r
 \r
                 //if (request.params && "appID" in request.params && SDL.SDLModel.registeredApps.filterProperty('appID', request.params.appID).length > 0) {\r
-                if (request.params && "appID" in request.params && SDL.SDLModel.registeredApps.filterProperty('appID', request.params.appID).length <= 0) {\r
+\r
+                if (request.params && "appID" in request.params && typeof(request.params.appID) == "number" && SDL.SDLModel.registeredApps.filterProperty('appID', request.params.appID).length <= 0) {\r
                     Em.Logger.error('No application registered with current appID!');\r
                     return false;\r
                 }\r
index 143357b..68f4a08 100644 (file)
@@ -53,14 +53,11 @@ FFW.UI = FFW.RPCObserver.create({
     appID: 1,
 
     onRecordStartSubscribeRequestID: -1,
-    onShowNotificationSubscribeRequestID: -1,
 
     onRecordStartUnsubscribeRequestID: -1,
-    onShowNotificationUnsubscribeRequestID: -1,
 
     // const
     onRecordStartNotification: "UI.OnRecordStart",
-    onShowNotificationNotification: "UI.ShowNotification",
 
     /**
      * ids for requests AudioPassThru
@@ -95,7 +92,6 @@ FFW.UI = FFW.RPCObserver.create({
         this._super();
 
         // subscribe to notifications
-        this.onShowNotificationSubscribeRequestID = this.client.subscribeToNotification(this.onShowNotificationNotification);
         this.onRecordStartSubscribeRequestID = this.client.subscribeToNotification(this.onRecordStartNotification);
     },
 
@@ -108,7 +104,6 @@ FFW.UI = FFW.RPCObserver.create({
         this._super();
 
         // unsubscribe from notifications
-        this.onShowNotificationUnsubscribeRequestID = this.client.unsubscribeFromNotification(this.onShowNotificationNotification);
         this.onRecordStartUnsubscribeRequestID = this.client.unsubscribeFromNotification(this.onRecordStartNotification);
     },
 
@@ -148,10 +143,6 @@ FFW.UI = FFW.RPCObserver.create({
         Em.Logger.log("FFW.UI.onRPCNotification");
         this._super();
 
-        if (notification.method == this.onShowNotificationNotification) {
-            // to do
-        }
-
         if (notification.method == this.onRecordStartNotification) {
             // to do
         }
@@ -172,6 +163,8 @@ FFW.UI = FFW.RPCObserver.create({
 
                     SDL.SDLModel.onUIAlert(request.params, request.id);
 
+                    SDL.SDLController.onSystemContextChange(request.params.appID);
+
                     break;
                 }
                 case "UI.Show":
@@ -232,6 +225,8 @@ FFW.UI = FFW.RPCObserver.create({
 
                     SDL.SDLModel.uiPerformInteraction(request);
 
+                    SDL.SDLController.onSystemContextChange();
+
                     break;
                 }
                 case "UI.SetMediaClockTimer":
@@ -251,6 +246,8 @@ FFW.UI = FFW.RPCObserver.create({
 
                     SDL.SDLModel.uiSlider(request);
 
+                    SDL.SDLController.onSystemContextChange();
+
                     break;
                 }
                 case "UI.ScrollableMessage":
@@ -258,6 +255,8 @@ FFW.UI = FFW.RPCObserver.create({
 
                     SDL.SDLModel.onSDLScrolableMessage(request, request.id);
 
+                    SDL.SDLController.onSystemContextChange();
+
                     break;
                 }
                 case "UI.ChangeRegistration":
@@ -315,34 +314,174 @@ FFW.UI = FFW.RPCObserver.create({
                             "result": {
                                 "displayCapabilities": {
                                     "displayType": "GEN2_8_DMA",
-                                    "textFields": [
-                                        "mainField1",
-                                        "mainField2",
-                                        "mainField3",
-                                        "mainField4",
-                                        "statusBar",
-                                        "mediaClock",
-                                        "mediaTrack",
-                                        "alertText1",
-                                        "alertText2",
-                                        "alertText3",
-                                        "scrollableMessageBody",
-                                        "initialInteractionText",
-                                        "navigationText1",
-                                        "navigationText2",
-                                        "ETA",
-                                        "totalDistance",
-                                        "navigationText",
-                                        "audioPassThruDisplayText1",
-                                        "audioPassThruDisplayText2",
-                                        "sliderHeader",
-                                        "sliderFooter",
-                                        "notificationText",
-                                        "menuName",
-                                        "secondaryText",
-                                        "tertiaryText",
-                                        "timeToDestination",
-                                        "turnText"
+                                    "textFields": [{
+                                            "name": "mainField1",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "mainField2",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "mainField3",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "mainField4",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "statusBar",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "mediaClock",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "mediaTrack",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "alertText1",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "alertText2",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "alertText3",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "scrollableMessageBody",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "initialInteractionText",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "navigationText1",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "navigationText2",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "ETA",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "totalDistance",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "navigationText",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "audioPassThruDisplayText1",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "audioPassThruDisplayText2",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "sliderHeader",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "sliderFooter",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "notificationText",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "menuName",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "secondaryText",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "tertiaryText",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "timeToDestination",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "turnText",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        },
+                                        {
+                                            "name": "menuTitle",
+                                            "characterSet": "TYPE2SET",
+                                            "width": 500,
+                                            "rows": 1
+                                        }
                                     ],
                                     "imageFields": [
                                         {
@@ -505,7 +644,7 @@ FFW.UI = FFW.RPCObserver.create({
                                     ],
                                     "graphicSupported": true,
                                     "imageCapabilities": ["DYNAMIC", "STATIC"],
-                                    "templatesAvailable": ["TEMPLATE"],
+                                    "templatesAvailable": [request.params.displayLayout],
                                     "screenParams": {
                                         "resolution": {
                                             "resolutionWidth": 800,
@@ -632,6 +771,8 @@ FFW.UI = FFW.RPCObserver.create({
                     this.performAudioPassThruRequestID = request.id;
                     SDL.SDLModel.UIPerformAudioPassThru(request.params);
 
+                    SDL.SDLController.onSystemContextChange();
+
                     break;
                 }
                 case "UI.EndAudioPassThru":
@@ -696,34 +837,174 @@ FFW.UI = FFW.RPCObserver.create({
                         "result": {
                             "displayCapabilities": {
                                 "displayType": "GEN2_8_DMA",
-                                "textFields": [
-                                    "mainField1",
-                                    "mainField2",
-                                    "mainField3",
-                                    "mainField4",
-                                    "statusBar",
-                                    "mediaClock",
-                                    "mediaTrack",
-                                    "alertText1",
-                                    "alertText2",
-                                    "alertText3",
-                                    "scrollableMessageBody",
-                                    "initialInteractionText",
-                                    "navigationText1",
-                                    "navigationText2",
-                                    "ETA",
-                                    "totalDistance",
-                                    "navigationText",
-                                    "audioPassThruDisplayText1",
-                                    "audioPassThruDisplayText2",
-                                    "sliderHeader",
-                                    "sliderFooter",
-                                    "notificationText",
-                                    "menuName",
-                                    "secondaryText",
-                                    "tertiaryText",
-                                    "timeToDestination",
-                                    "turnText"
+                                "textFields": [{
+                                        "name": "mainField1",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "mainField2",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "mainField3",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "mainField4",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "statusBar",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "mediaClock",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "mediaTrack",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "alertText1",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "alertText2",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "alertText3",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "scrollableMessageBody",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "initialInteractionText",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "navigationText1",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "navigationText2",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "ETA",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "totalDistance",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "navigationText",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "audioPassThruDisplayText1",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "audioPassThruDisplayText2",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "sliderHeader",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "sliderFooter",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "notificationText",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "menuName",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "secondaryText",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "tertiaryText",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "timeToDestination",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "turnText",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    },
+                                    {
+                                        "name": "menuTitle",
+                                        "characterSet": "TYPE2SET",
+                                        "width": 500,
+                                        "rows": 1
+                                    }
                                 ],
                                 "imageFields": [
                                     {
@@ -943,7 +1224,7 @@ FFW.UI = FFW.RPCObserver.create({
                 case "UI.ClosePopUp":
                 {
 
-                    SDL.SDLController.closePopUp();
+                    SDL.SDLController.closePopUp(request.params.methodName);
 
 
                     Em.Logger.log("FFW." + request.method + "Response");
@@ -970,15 +1251,6 @@ FFW.UI = FFW.RPCObserver.create({
 
                     break;
                 }
-                case "UI.ShowKeyboard":
-                {
-
-                    SDL.SDLModel.uiShowKeyboard(request.params);
-
-                    this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
-
-                    break;
-                }
                 default:
                 {
                     // statements_def
@@ -1264,8 +1536,6 @@ FFW.UI = FFW.RPCObserver.create({
             };
         }
 
-        SDL.SDLModel.set('performInteractionSession', null);
-
         this.client.send(JSONMessage);
     },
 
@@ -1296,7 +1566,7 @@ FFW.UI = FFW.RPCObserver.create({
      * @param {String}
      *            systemContextValue
      */
-    OnSystemContext: function (systemContextValue) {
+    OnSystemContext: function (systemContextValue, appID) {
 
         Em.Logger.log("FFW.UI.OnSystemContext");
 
@@ -1308,6 +1578,11 @@ FFW.UI = FFW.RPCObserver.create({
                 "systemContext": systemContextValue
             }
         };
+
+        if (appID) {
+            JSONMessage.params.appID = appID;
+        }
+
         this.client.send(JSONMessage);
     },
 
index 4a53335..2bb3425 100644 (file)
@@ -341,7 +341,7 @@ FFW.VR = FFW.RPCObserver.create( {
             };
         }
 
-        SDL.SDLModel.set('performInteractionSession', null);
+        SDL.SDLModel.set('performInteractionSession', []);
 
         this.client.send(JSONMessage);
     },
index f28a949..8702711 100644 (file)
         <script type="text/javascript" src="app/view/settings/policies/appPermissionsListView.js"></script>\r
         <script type="text/javascript" src="app/view/settings/policies/appPermissionsView.js"></script>\r
         <script type="text/javascript" src="app/view/settings/policies/deviceConfigView.js"></script>\r
+        <script type="text/javascript" src="app/view/settings/policies/deviceStateChangeView.js"></script>\r
         <script type="text/javascript" src="app/view/settings/policies/statisticsInfoView.js"></script>\r
         <script type="text/javascript" src="app/view/settings/policiesView.js"></script>\r
 \r