summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Melnik <AMelnik@luxoft.com>2014-03-25 15:17:36 +0200
committerJustin Dickow <jjdickow@gmail.com>2014-07-08 15:56:25 -0400
commit665b1029e3cd21be7b1f82aec7c9e42461b8836e (patch)
tree03ba8c64db88895746e0e8d6935a365a61f48128
parent7130f57ed8a113c78195d22eab179ebf5f7be22c (diff)
downloadsmartdevicelink-665b1029e3cd21be7b1f82aec7c9e42461b8836e.tar.gz
APPLINK-6249: HMI API Does Not Specify Interaction Mode
Signed-off-by: Justin Dickow <jjdickow@gmail.com> Conflicts: src/components/HMI/ffw/BasicCommunicationRPC.js
-rw-r--r--src/components/HMI/app/StateManager.js1
-rw-r--r--src/components/HMI/app/model/sdl/Model.js16
-rw-r--r--src/components/HMI/app/view/sdl/VRPopUp.js15
-rw-r--r--src/components/HMI/ffw/BasicCommunicationRPC.js9
4 files changed, 32 insertions, 9 deletions
diff --git a/src/components/HMI/app/StateManager.js b/src/components/HMI/app/StateManager.js
index 000ab8dc3..f0083bf33 100644
--- a/src/components/HMI/app/StateManager.js
+++ b/src/components/HMI/app/StateManager.js
@@ -187,6 +187,7 @@ var StateManager = Em.StateManager.extend({
this._super();
+ SDL.SDLModel.stateLimited = SDL.SDLAppController.model.appID;
SDL.SDLAppController.deactivateApp();
}
diff --git a/src/components/HMI/app/model/sdl/Model.js b/src/components/HMI/app/model/sdl/Model.js
index e29c80359..eac343f01 100644
--- a/src/components/HMI/app/model/sdl/Model.js
+++ b/src/components/HMI/app/model/sdl/Model.js
@@ -44,6 +44,11 @@ SDL.SDLModel = Em.Object.create({
},
/**
+ * ID of app in LIMITED HMI state
+ */
+ stateLimited: null,
+
+ /**
* IScroll object to manage scroll on PerformInteraction view
*
* @type {Object}
@@ -1032,25 +1037,22 @@ SDL.SDLModel = Em.Object.create({
*/
addCommandVR: function (message) {
- var appID = 0;
if (message.type == "Application") {
SDL.SDLModel.VRCommands.push(message);
SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, message.appID, message.type);
} else if ("appID" in message) {
- appID = message.appID;
-
- SDL.SDLController.getApplicationModel(appID).VRCommands.push(message);
+ SDL.SDLController.getApplicationModel(message.appID).VRCommands.push(message);
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.appID) {
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.appID == message.appID) {
- SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, appID, message.type);
+ SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, message.appID, message.type);
}
} else {
SDL.SDLModel.VRCommands.push(message);
- SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, appID, message.type);
+ SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, 0, message.type);
}
},
diff --git a/src/components/HMI/app/view/sdl/VRPopUp.js b/src/components/HMI/app/view/sdl/VRPopUp.js
index 0db7d85e2..435b43505 100644
--- a/src/components/HMI/app/view/sdl/VRPopUp.js
+++ b/src/components/HMI/app/view/sdl/VRPopUp.js
@@ -128,7 +128,20 @@ SDL.VRPopUp = Em.ContainerView.create( {
len = SDL.SDLAppController.model.VRCommands.length;
for (var i = 0; i < len; i++) {
- this.AddCommand(SDL.SDLAppController.model.VRCommands[i].cmdID, SDL.SDLAppController.model.VRCommands[i].vrCommands, SDL.SDLAppController.model.VRCommands[i].appID, SDL.SDLAppController.model.VRCommands[i].type);
+ this.AddCommand(SDL.SDLAppController.model.VRCommands[i].cmdID,
+ SDL.SDLAppController.model.VRCommands[i].vrCommands,
+ SDL.SDLAppController.model.VRCommands[i].appID,
+ SDL.SDLAppController.model.VRCommands[i].type);
+ }
+ }
+
+ if (SDL.SDLModel.stateLimited) {
+ len = SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands.length;
+ for (var i = 0; i < len; i++) {
+ this.AddCommand(SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].cmdID,
+ SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].vrCommands,
+ SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].appID,
+ SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].type);
}
}
diff --git a/src/components/HMI/ffw/BasicCommunicationRPC.js b/src/components/HMI/ffw/BasicCommunicationRPC.js
index 80d7fdbeb..be2eaa71b 100644
--- a/src/components/HMI/ffw/BasicCommunicationRPC.js
+++ b/src/components/HMI/ffw/BasicCommunicationRPC.js
@@ -229,7 +229,14 @@ FFW.BasicCommunication = FFW.RPCObserver
request.method);
}
if (request.method == "BasicCommunication.ActivateApp") {
- SDL.SDLController.getApplicationModel(request.params.appID).turnOnSDL();
+
+ if ( SDL.SDLAppController.model && SDL.SDLAppController.model.appID != request.params.appID) {
+ SDL.States.goToStates('info.apps');
+ }
+
+ SDL.SDLModel.stateLimited = null;
+
+ SDL.SDLController.getApplicationModel(request.params.appID).turnOnSDL(request.params.appID);
this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
}
}