\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
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
},\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
\r
SDL.SettingsController.userFriendlyMessagePopUp();\r
\r
- SDL.SDLModel.getListOfPermissionsPull.remove(message.id);\r
+ delete SDL.SDLModel.getListOfPermissionsPull[message.id];\r
}\r
},\r
\r
\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
\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
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
\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
}
}
}
- 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'),
/**
* 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();
+// }
},
/**
*/
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);
}
},
SDL.SDLAppController.model.activeRequests.vrPerformInteraction = null;
SDL.SDLModel.set('VRActive', false);
+
+ SDL.InteractionChoicesView.timerUpdate();
},
/**
* Method to sent notification for Alert
*/
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,
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() {
/**
* Send system context
*/
- onSystemContextChange: function() {
+ onSystemContextChange: function(appID) {
- FFW.UI.OnSystemContext(this.get('sysContext'));
+ FFW.UI.OnSystemContext(this.get('sysContext'), appID);
}
});
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;
}
}
}
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
*
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
*
},
/**
- * 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}
}
}
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!"
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!"
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"],
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!"
}
}
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!"
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!"
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 = {
deviceName: '',
/**
+ * Chosen device id
+ *
+ * @type {String}
+ */
+ deviceID: null,
+
+ /**
* Global properties for current application
*
* @type {Object}
softButtons: [],
/**
+ * Array of Soft Buttons
+ *
+ * @type {Array}
+ */
+ turnListSoftButtons: [],
+
+ /**
* Array of Objects for TBTTurnList
*
* @type {Array}
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);
}
});
*/
registeredApps: [],
+
+ /**
+ * List of objects with params for connected devices
+ *
+ * @type object
+ */
+ connectedDevices: {},
+
/**
* List of devices with registered applications
*
*
* @type {Boolean}
*/
- performInteractionSession: null,
+ performInteractionSession: [],
/**
* Array with app permissions
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) {
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);
}
}
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;
}
}
}
+ 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();
+
}
*/
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);
},
}
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) {
},
/**
- * 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);
}
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();
+ //}
},
/**
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']);
+ }
},
/**
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]);
}
}
this.set('active', true);
this.set('timeout', message.duration);
- SDL.SDLController.onSystemContextChange();
clearTimeout(this.timer);
this.timer = setTimeout(function() {
if( this.timer ){
clearTimeout( this.timer );
}
- }
- SDL.SDLController.onSystemContextChange();
+ SDL.SDLController.onSystemContextChange();
+ }
}.observes( 'activate' )
} );
\ No newline at end of file
'this.active:active_state:inactive_state'
],
+ popUpId: 0,
+
/**
* Callback function to return result of made action by user
*/
deactivate: function(event) {
this.set('active', false);
- if (this.callback) {
+ if (this.callback && event) {
this.callback(event.buttonAction);
}
} 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
this._super();
-
if (SDL.SDLAppController.model && SDL.SDLAppController.model.activeRequests.vrPerformInteraction) {
SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['ABORTED']);
}
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;
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'),
this.set('list', false);
this.set('icon', true);
this.set('active', true);
- SDL.SDLController.onSystemContextChange();
break;
}
case "ICON_WITH_SEARCH" : {
this.set('search', true);
this.set('list', false);
this.set('active', true);
- SDL.SDLController.onSystemContextChange();
break;
}
case "LIST_ONLY" : {
this.set('icon', false);
this.set('search', false);
this.set('active', true);
- SDL.SDLController.onSystemContextChange();
break;
}
case "LIST_WITH_SEARCH" : {
this.set('icon', false);
this.set('search', false);
this.set('active', true);
- SDL.SDLController.onSystemContextChange();
} else {
this.timer = setTimeout(function () {
*/
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();
+ }
},
/**
this.timer = setTimeout(function () {
self.deactivate();
}, params.timeout);
-
- SDL.SDLController.onSystemContextChange();
}
},
this.set('timeout', timeout);
- SDL.SDLController.onSystemContextChange();
-
this.timer = setTimeout(function () {
if (SDL.SliderView.active) {
SDL.SliderView.deactivate(true);
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,
[
'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',
}
});
- 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();
--- /dev/null
+/*
+ * 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
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
+ }
}
]
})
childViews:
[
'leftMenu',
+ SDL.DeviceStateChangeView,
SDL.PoliciesView,
SDL.AppPermissionsListView,
SDL.AppPermissionsView,
/*
* 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
* 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
onPutFileSubscribeRequestID: -1,
-allowSDLFunctionalityRequestID: -1,
-
onSystemErrorSubscribeRequestID: -1,
onStatusUpdateSubscribeRequestID: -1,
onAppPermissionChangedSubscribeRequestID: -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,
onAppUnregisteredUnsubscribeRequestID: -1,
onPlayToneUnsubscribeRequestID: -1,
onSDLCloseUnsubscribeRequestID: -1,
-onSDLConsentNeededUnsubscribeRequestID: -1,
+ onSDLConsentNeededUnsubscribeRequestID: -1,
+ onResumeAudioSourceUnsubscribeRequestID: -1,
// const
onSystemErrorNotification: "SDL.OnSystemError",
onAppUnregisteredNotification: "BasicCommunication.OnAppUnregistered",
onPlayToneNotification: "BasicCommunication.PlayTone",
onSDLCloseNotification: "BasicCommunication.OnSDLClose",
-onSDLConsentNeededNotification: "SDL.OnSDLConsentNeeded",
+ onSDLConsentNeededNotification: "SDL.OnSDLConsentNeeded",
+ onResumeAudioSourceNotification: "BasicCommunication.OnResumeAudioSource",
+
/**
* init object
// 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);
.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);
},
/**
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);
.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);
},
/**
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];
}
}
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) {
});
} 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];
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");
+ }
+
}
},
SDL.SDLModel.onFileRemoved(notification.params);
}
-if (notification.method == this.onSystemErrorNotification) {
+ if (notification.method == this.onSystemErrorNotification) {
var message = "Undefined";
if (notification.method == this.onStatusUpdateNotification) {
//SDL.PopUp.popupActivate(notification.status);
-
SDL.TTSPopUp.ActivateTTS(notification.params.status);
}
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();
+ }
},
/**
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;
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");
/**
* send response from onRPCRequest
- *
+ *
* @param {Number}
* resultCode
* @param {Number}
/**
* send response from onRPCRequest
- *
+ *
* @param {Number}
* id
* @param {String}
/**
* Send request if application was activated
- *
+ *
* @param {number} appID
*/
OnAppActivated: function(appID) {
},
/**
+ * 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() {
/**
* Invoked by UI component when user switches to any functionality which
* is not other mobile application.
- *
+ *
* @params {String}
* @params {Number}
*/
/**
* Used by HMI when User chooses to exit application.
- *
+ *
* @params {Number}
*/
ExitApplication: function(appID) {
/**
* Sent by HMI to SDL to close all registered applications.
- *
+ *
* @params {String}
*/
ExitAllApplications: function(reason) {
/**
* Response with params of the last one supports mixing audio (ie
* recording TTS command and playing audio).
- *
+ *
* @params {Number}
*/
MixingAudioSupported: function(attenuatedSupported) {
/**
* Response with Results by user/HMI allowing SDL functionality or
* disallowing access to all mobile apps.
- *
+ *
* @params {Number}
*/
AllowAllApps: function(allowed) {
/**
* Response with result of allowed application
- *
+ *
* @params {Number}
*/
AllowApp: function(request) {
/**
* Notifies if device was choosed
- *
+ *
* @param {String}
* deviceName
* @param {Number}
/**
* Send error response from onRPCRequest
- *
+ *
* @param {Number}
* resultCode
* @param {Number}
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
appID: 1,
onRecordStartSubscribeRequestID: -1,
- onShowNotificationSubscribeRequestID: -1,
onRecordStartUnsubscribeRequestID: -1,
- onShowNotificationUnsubscribeRequestID: -1,
// const
onRecordStartNotification: "UI.OnRecordStart",
- onShowNotificationNotification: "UI.ShowNotification",
/**
* ids for requests AudioPassThru
this._super();
// subscribe to notifications
- this.onShowNotificationSubscribeRequestID = this.client.subscribeToNotification(this.onShowNotificationNotification);
this.onRecordStartSubscribeRequestID = this.client.subscribeToNotification(this.onRecordStartNotification);
},
this._super();
// unsubscribe from notifications
- this.onShowNotificationUnsubscribeRequestID = this.client.unsubscribeFromNotification(this.onShowNotificationNotification);
this.onRecordStartUnsubscribeRequestID = this.client.unsubscribeFromNotification(this.onRecordStartNotification);
},
Em.Logger.log("FFW.UI.onRPCNotification");
this._super();
- if (notification.method == this.onShowNotificationNotification) {
- // to do
- }
-
if (notification.method == this.onRecordStartNotification) {
// to do
}
SDL.SDLModel.onUIAlert(request.params, request.id);
+ SDL.SDLController.onSystemContextChange(request.params.appID);
+
break;
}
case "UI.Show":
SDL.SDLModel.uiPerformInteraction(request);
+ SDL.SDLController.onSystemContextChange();
+
break;
}
case "UI.SetMediaClockTimer":
SDL.SDLModel.uiSlider(request);
+ SDL.SDLController.onSystemContextChange();
+
break;
}
case "UI.ScrollableMessage":
SDL.SDLModel.onSDLScrolableMessage(request, request.id);
+ SDL.SDLController.onSystemContextChange();
+
break;
}
case "UI.ChangeRegistration":
"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": [
{
],
"graphicSupported": true,
"imageCapabilities": ["DYNAMIC", "STATIC"],
- "templatesAvailable": ["TEMPLATE"],
+ "templatesAvailable": [request.params.displayLayout],
"screenParams": {
"resolution": {
"resolutionWidth": 800,
this.performAudioPassThruRequestID = request.id;
SDL.SDLModel.UIPerformAudioPassThru(request.params);
+ SDL.SDLController.onSystemContextChange();
+
break;
}
case "UI.EndAudioPassThru":
"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": [
{
case "UI.ClosePopUp":
{
- SDL.SDLController.closePopUp();
+ SDL.SDLController.closePopUp(request.params.methodName);
Em.Logger.log("FFW." + request.method + "Response");
break;
}
- case "UI.ShowKeyboard":
- {
-
- SDL.SDLModel.uiShowKeyboard(request.params);
-
- this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
-
- break;
- }
default:
{
// statements_def
};
}
- SDL.SDLModel.set('performInteractionSession', null);
-
this.client.send(JSONMessage);
},
* @param {String}
* systemContextValue
*/
- OnSystemContext: function (systemContextValue) {
+ OnSystemContext: function (systemContextValue, appID) {
Em.Logger.log("FFW.UI.OnSystemContext");
"systemContext": systemContextValue
}
};
+
+ if (appID) {
+ JSONMessage.params.appID = appID;
+ }
+
this.client.send(JSONMessage);
},
};
}
- SDL.SDLModel.set('performInteractionSession', null);
+ SDL.SDLModel.set('performInteractionSession', []);
this.client.send(JSONMessage);
},
<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