' +
'
shift ' +
@@ -655,7 +655,6 @@ CustomApplicationsHandler.register("app.terminal", new CustomApplication({
}.bind(this), 5000);
}.bind(this);
this.wsonmessage = function(event) {
- AIO_SBN(JSON.stringify(event));
if (event.data.substr(0, this.asklistnumber.length) == this.asklistnumber) {
this.fileslist = event.data.substr(this.asklistnumber.length);
//fileslist = event.data.substr(asklistnumber.length).split("\n");
@@ -738,12 +737,14 @@ CustomApplicationsHandler.register("app.terminal", new CustomApplication({
* MultiController was moved up
*/
case this.UP:
+ this.screen.get(0).scrollTop -= 100;
break;
/*
* MultiController was moved down
*/
case this.DOWN:
+ this.screen.get(0).scrollTop += 100;
break;
/*
@@ -766,13 +767,14 @@ CustomApplicationsHandler.register("app.terminal", new CustomApplication({
* MultiController's center was pushed down
*/
case this.SELECT:
-
+ $('[function*=return]').click();
break;
/*
* MultiController hot key "back" was pushed
*/
case this.BACK:
+ this.screen.get(0).scrollTop -= 100;
break;
}
diff --git a/app/files/tweaks/casdk/apps/app.tetris/app.css b/app/files/tweaks/casdk/apps/app.tetris/app.css
new file mode 100644
index 0000000..d50c9f0
--- /dev/null
+++ b/app/files/tweaks/casdk/apps/app.tetris/app.css
@@ -0,0 +1,114 @@
+/**
+ * Custom Applications SDK for Mazda Connect Infotainment System
+ *
+ * A mini framework that allows to write custom applications for the Mazda Connect Infotainment System
+ * that includes an easy to use abstraction layer to the JCI system.
+ *
+ * Written by Andreas Schwarz (http://github.com/flyandi/mazda-custom-applications-sdk)
+ * Copyright (c) 2016. All rights reserved.
+ *
+ * WARNING: The installation of this application requires modifications to your Mazda Connect system.
+ * If you don't feel comfortable performing these changes, please do not attempt to install this. You might
+ * be ending up with an unusuable system that requires reset by your Dealer. You were warned!
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program.
+ * If not, see http://www.gnu.org/licenses/
+ *
+ */
+
+/**
+ * NOTICE: It's important that you target your application with the [app] attribute
+ */
+
+[app="app.tetris"] {
+ background: url(images/background.jpg) no-repeat center center #101010;
+}
+[app="app.tetris"] span, [app="app.tetris"] label {
+ position: absolute;
+ font-size: 17px;
+ letter-spacing: 4px;
+ text-transform: uppercase;
+ text-shadow: #000 2px 0 0;
+ width: 200px;
+ text-align: center;
+}
+[app="app.tetris"] label {
+ color: rgba(255, 255, 255, 0.75);
+}
+[app="app.tetris"] span {
+ font-size: 40px;
+ background: rgba(0, 0, 0, 0.25);
+}
+[app="app.tetris"] label.score {
+ right: 45px;
+ top: 40px;
+}
+[app="app.tetris"] span.score {
+ right: 45px;
+ top: 70px;
+}
+[app="app.tetris"] label.highScore {
+ right: 45px;
+ top: 150px;
+}
+[app="app.tetris"] span.highScore {
+ right: 45px;
+ top: 180px;
+}
+[app="app.tetris"] label.gamelabel {
+ left: 0;
+ width: 800px;
+ top: 50%;
+ margin-top: -5px;
+ text-align: center;
+ text-shadow: #000 0 0 15px;
+ font-size: 20px;
+ display: none;
+}
+[app="app.tetris"] .gameBoard {
+ border: 1px solid #ccc;
+ border-radius: .4em;
+ position: absolute;
+ top: 15px;
+ left: 50%;
+ margin-left: -100px;
+ background: rgba(255, 255, 255, 0.05);
+ overflow: hidden;
+}
+[app="app.tetris"] .gameBoard .tile {
+ border-radius: 2px;
+ position: absolute;
+ width: 19px;
+ height: 19px;
+ border: 1px solid #101010;
+}
+[app="app.tetris"] .gameBoard .type-I {
+ background-color: #FF73FF;
+}
+[app="app.tetris"] .gameBoard .type-O {
+ background-color: #FFFF73;
+}
+[app="app.tetris"] .gameBoard .type-T {
+ background-color: #B973FF;
+}
+[app="app.tetris"] .gameBoard .type-S {
+ background-color: #73FF73;
+}
+[app="app.tetris"] .gameBoard .type-Z {
+ background-color: #FF7373;
+}
+[app="app.tetris"] .gameBoard .type-J {
+ background-color: #73B9FF;
+}
+[app="app.tetris"] .gameBoard .type-L {
+ background-color: #FFA64D;
+}
+[app="app.tetris"] .gameBoard .frozen {}
diff --git a/app/files/tweaks/casdk/apps/app.tetris/app.js b/app/files/tweaks/casdk/apps/app.tetris/app.js
new file mode 100644
index 0000000..fd0e87e
--- /dev/null
+++ b/app/files/tweaks/casdk/apps/app.tetris/app.js
@@ -0,0 +1,262 @@
+/**
+ * Custom Applications SDK for Mazda Connect Infotainment System
+ *
+ * A mini framework that allows to write custom applications for the Mazda Connect Infotainment System
+ * that includes an easy to use abstraction layer to the JCI system.
+ *
+ * Written by Andreas Schwarz (http://github.com/flyandi/mazda-custom-applications-sdk)
+ * Copyright (c) 2016. All rights reserved.
+ *
+ * WARNING: The installation of this application requires modifications to your Mazda Connect system.
+ * If you don't feel comfortable performing these changes, please do not attempt to install this. You might
+ * be ending up with an unusuable system that requires reset by your Dealer. You were warned!
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program.
+ * If not, see http://www.gnu.org/licenses/
+ *
+ */
+
+/**
+ * Tetris
+ *
+ * First game ever written for the Mazda Infotainment System
+ *
+ */
+
+
+CustomApplicationsHandler.register("app.tetris", new CustomApplication({
+
+ /**
+ * (require)
+ *
+ * An object array that defines resources to be loaded such as javascript's, css's, images, etc
+ *
+ * All resources are relative to the applications root path
+ */
+
+ require: {
+
+ /**
+ * (js) defines javascript includes
+ */
+
+ js: ['tetris.js'],
+
+ /**
+ * (css) defines css includes
+ */
+
+ css: ['app.css'],
+
+ /**
+ * (images) defines images that are being preloaded
+ *
+ * Images are assigned to an id
+ */
+
+ images: {},
+
+ },
+
+ /**
+ * (settings)
+ *
+ * An object that defines application settings
+ */
+
+ settings: {
+
+ /**
+ * (title) The title of the application in the Application menu
+ */
+
+ title: 'Tetris',
+
+ /**
+ * (statusbar) Defines if the statusbar should be shown
+ */
+
+ statusbar: false,
+
+ /**
+ * (statusbarIcon) defines the status bar icon
+ *
+ * Set to true to display the default icon app.png or set a string to display
+ * a fully custom icon.
+ *
+ * Icons need to be 37x37
+ */
+
+ statusbarIcon: false,
+
+ /**
+ * (statusbarTitle) overrides the statusbar title, otherwise title is used
+ */
+
+ statusbarTitle: false,
+
+
+ /**
+ * (hasLeftButton) indicates if the UI left button / return button should be shown
+ */
+
+ hasLeftButton: false,
+
+ /**
+ * (hasMenuCaret) indicates if the menu item should be displayed with an caret
+ */
+
+ hasMenuCaret: false,
+
+ /**
+ * (hasRightArc) indicates if the standard right car should be displayed
+ */
+
+ hasRightArc: false,
+
+ },
+
+
+ /***
+ *** User Interface Life Cycles
+ ***/
+
+ /**
+ * (created)
+ *
+ * Executed when the application gets initialized
+ *
+ * Add any content that will be static here
+ */
+
+ created: function() {
+ // speed restriction
+ this.speedRestrict = true;
+
+ // score for this drive
+ this.__score = 0;
+ this.__highscore = this.get("highscore");
+
+ // init tetris
+ this.initializeGameBoard();
+
+ // vehicle speed
+ this.subscribe(VehicleData.vehicle.speed, function(value) {
+
+ if (this.speedRestrict && value > 15) {
+ this.gamelabel.html("Driving").fadeIn();
+ this.gameBoard.data('tetris').pause();
+ } else {
+ this.gamelabel.fadeOut();
+ this.gameBoard.data('tetris').start();
+ }
+ }.bind(this));
+ },
+
+ /**
+ * (focused)
+ */
+
+ focused: function() {
+
+ this.gameBoard.data('tetris').start();
+ },
+
+ /**
+ * (lost)
+ */
+
+ lost: function() {
+
+ this.gameBoard.data('tetris').pause();
+
+ },
+
+ /***
+ *** Events
+ ***/
+
+ /**
+ * (event) onControllerEvent
+ *
+ * Called when a new (multi)controller event is available
+ */
+
+ onControllerEvent: function(eventId) {
+
+ this.gameBoard.data('tetris').handle(eventId);
+
+ },
+
+
+ /***
+ *** Applicaton specific methods
+ ***/
+
+ initializeGameBoard: function() {
+
+ this.gameBoard = $("
").addClass("gameBoard").appendTo(this.canvas);
+
+ $("
").addClass("score").append("This Drive").appendTo(this.canvas);
+ this.score = $("
").addClass("score").append("0").appendTo(this.canvas);
+
+ $("
").addClass("highScore").append("High Score").appendTo(this.canvas);
+ this.highScore = $("
").addClass("highScore").append(this.__highscore || '0').appendTo(this.canvas);
+
+ this.gamelabel = $("
").addClass("gamelabel").append("GAME OVER").appendTo(this.canvas);
+
+ this.gameBoard.tetris({
+ tileSize: 20,
+ }).on({
+
+ rowCompleted: function() {
+ this.__score++;
+
+ this.score.html(this.__score);
+
+ if (!this.__highscore) this.__highscore = 0;
+
+ if (this.__score > this.__highscore) {
+
+ this.__highscore = this.__score;
+
+ this.highScore.html(this.__highscore);
+
+ this.set("highscore", this.__highscore);
+ }
+
+ }.bind(this),
+
+ gameOver: function() {
+
+ this.gameBoard.data('tetris').pause();
+
+ this.gamelabel.html("Game Over").fadeIn();
+
+
+ }.bind(this),
+
+ restartGame: function() {
+ this.__score = 0;
+ this.score.html(this.__score);
+ this.gamelabel.fadeOut();
+
+ }.bind(this)
+ });
+ this.score.on('click', function() {
+ this.gamelabel.html("Speed Restriction " + (this.speedRestrict ? "Disabled": "Enabled")).fadeIn(100).delay(1000).fadeOut(1000);
+ return this.speedRestrict = !this.speedRestrict;
+ }.bind(this));
+ },
+
+
+
+}));
diff --git a/app/files/tweaks/casdk/apps/app.tetris/app.png b/app/files/tweaks/casdk/apps/app.tetris/app.png
new file mode 100644
index 0000000..5dc5466
Binary files /dev/null and b/app/files/tweaks/casdk/apps/app.tetris/app.png differ
diff --git a/app/files/tweaks/casdkapps/app.tetris/images/background.jpg b/app/files/tweaks/casdk/apps/app.tetris/images/background.jpg
similarity index 100%
rename from app/files/tweaks/casdkapps/app.tetris/images/background.jpg
rename to app/files/tweaks/casdk/apps/app.tetris/images/background.jpg
diff --git a/app/files/tweaks/casdk/apps/app.tetris/tetris.js b/app/files/tweaks/casdk/apps/app.tetris/tetris.js
new file mode 100644
index 0000000..af612cb
--- /dev/null
+++ b/app/files/tweaks/casdk/apps/app.tetris/tetris.js
@@ -0,0 +1,433 @@
+// jQuery Tetris plug-in
+// by Alexander Gyoshev (http://blog.gyoshev.net/)
+// licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. (http://creativecommons.org/licenses/by-sa/3.0/)
+
+// Modified for use with Mazda Infotainment System
+
+(function($) {
+ var extend = $.extend,
+ proxy = $.proxy,
+ keys = {
+ left: 37,
+ up: 38,
+ right: 39,
+ down: 40
+ },
+
+ // jQuery plug-in
+ tetris = $.fn.tetris = function(options) {
+ options = extend($.fn.tetris.defaults, options);
+
+ return this.each(function() {
+ var $this = $(this),
+ instance;
+ if (!$this.data("tetris")) {
+ instance = new impl(this, options);
+ $this.data("tetris", instance);
+ }
+ });
+ },
+
+ // Tetris implementation
+ impl = tetris.implementation = function(element, options) {
+ var $element = $(element),
+ that = this;
+
+ extend(that, {
+ element: element,
+ $element: $element,
+ frozen: {}
+ }, options);
+
+ that.currentTile = that.generateTile();
+
+ $element
+ .css({
+ width: that.cols * that.tileSize,
+ height: that.rows * that.tileSize
+ })
+ .bind({
+ repaint: proxy(that.repaint, that),
+ tick: proxy(that.tick, that),
+ tileDrop: proxy(that.tileDrop, that),
+ rowCompleted: proxy(that.rowCompleted, that)
+ /// TODO: handle gameOver event with dignity
+ })
+ .trigger('repaint');
+ };
+
+
+ tetris.defaults = {
+ rows: 22,
+ cols: 10,
+ tileSize: 16
+ };
+
+ impl.prototype = {
+ handle: function(eventId) {
+
+ if (this.isGameOver) {
+
+ if (eventId == "selectStart") {
+ this.restartGame();
+ }
+
+ } else {
+
+ switch (eventId) {
+
+ case "upStart":
+ case "ccw":
+ case "cw":
+ this.rotate();
+ break;
+
+ case "leftStart":
+ this.move(-1);
+ break;
+
+ case "rightStart":
+ this.move(1);
+ break;
+
+ case "downStart":
+ this.down();
+ break;
+ }
+ }
+ },
+ tick: function() {
+ this.down();
+ this.$element.trigger('repaint');
+ },
+ tileDrop: function() {
+ var that = this;
+
+ that.freeze(that.currentTile);
+
+ that.$element.find('.current').remove();
+
+ that.currentTile = that.generateTile();
+
+ if (!that.isValidLocation(that.currentTile.shape)) {
+ this.gameover();
+ }
+ },
+ rowCompleted: function(e, rowStart) {
+ var that = this,
+ i,
+ cols = that.cols,
+ tileSize = that.tileSize;
+
+ that.$element.find('.frozen')
+ .filter(function() {
+ var index = $(this).data('index');
+ return index - (index % cols) == rowStart;
+ })
+ .remove()
+ .end()
+ .filter(function() {
+ var index = $(this).data('index');
+ if (index - (index % cols) < rowStart)
+ return index - (index % cols) < rowStart;
+ })
+ .css('top', function() {
+ return parseInt($(this).css('top')) + tileSize;
+ })
+ .each(function() {
+ var t = $(this);
+ t.data('index', t.data('index') + cols);
+ });
+
+ for (i = rowStart; i < rowStart + cols; i++) {
+ delete that.frozen[i];
+ }
+
+ for (i = rowStart - 1; i >= 0; i--) {
+ if (that.frozen[i]) {
+ that.frozen[i + cols] = true;
+ delete that.frozen[i];
+ }
+ }
+ },
+ isValidLocation: function(location) {
+ var i, j,
+ cols = this.cols,
+ maxStageIndex = cols * this.rows;
+
+ for (i = 0; i < location.length; i++) {
+ if (location[i] < 0 || location[i] >= maxStageIndex ||
+ this.frozen[location[i]]) {
+ return false;
+ }
+
+ for (j = 0; j < i; j++) {
+ if (((location[i] % cols == 0) && (location[j] % cols == cols - 1)) ||
+ ((location[i] % cols == cols - 1) && (location[j] % cols == 0)))
+ return false;
+ }
+ }
+
+ return true;
+ },
+ move: function(modifier) {
+ var that = this,
+ i,
+ cols = that.cols,
+ shape = that.currentTile.shape,
+ newLocation = $.map(shape, function(x) {
+ return x + modifier;
+ }),
+ hitsEdge = false;
+
+ for (i = 0; i < shape.length; i++) {
+ if ((modifier < 0 && shape[i] % cols == 0) ||
+ (modifier > 0 && shape[i] % cols == cols - 1)) {
+ hitsEdge = true;
+ }
+ }
+
+ if (!hitsEdge && that.isValidLocation(newLocation)) {
+ that.currentTile.shape = newLocation;
+ that.$element.trigger('repaint');
+ }
+ },
+ rotate: function() {
+ var that = this,
+ currentTile = that.currentTile,
+ newLocation = currentTile.shape.slice(),
+ rotation;
+
+ if (currentTile.shapeStates) {
+ rotation = currentTile.shapeStates[currentTile.shapeStateIndex];
+
+ newLocation = $.map(newLocation, function(x, index) { return x + rotation[index]; });
+
+ } else if (currentTile.shapeRotation) {
+ newLocation = currentTile.shapeRotation(newLocation);
+ }
+
+ if (that.isValidLocation(newLocation)) {
+ currentTile.shape = newLocation;
+ if (currentTile.shapeStates) {
+ currentTile.shapeStateIndex = (++currentTile.shapeStateIndex) % currentTile.shapeStates.length;
+ }
+ }
+
+ that.$element.trigger('repaint');
+ },
+ down: function() {
+ var that = this,
+ cols = that.cols,
+ maxStageIndex = cols * that.rows,
+ shape = that.currentTile.shape,
+ newLocation = $.map(shape, function(x) { return x + cols; });
+
+ if (that.isValidLocation(newLocation)) {
+ that.currentTile.shape = newLocation;
+ that.$element.trigger('repaint');
+ } else {
+ that.$element.trigger('tileDrop');
+ }
+ },
+ generateTile: function(type) {
+ // build shape cache
+ var cols = this.cols,
+ center = Math.floor(cols / 2) + cols,
+ direction = [-cols, +1, +cols, -1];
+
+ function squareRotation(shape) {
+ var directions = [-cols - 1, -cols, -cols + 1, -1, 0, +1, +cols - 1, +cols, +cols + 1],
+ rotation = [-cols + 1, +1, +cols + 1, -cols, 0, +cols, -cols - 1, -1, +cols - 1],
+ center = shape[0];
+
+ return $.map(shape, function(coord) {
+ for (var i = 0; i < directions.length; i++) {
+ if (coord == center + directions[i]) {
+ return center + rotation[i];
+ }
+ }
+ });
+ }
+
+ if (!this.tileCache) {
+ /// TODO: allow extensibility for custom tiles
+ /// TODO: move this somewhere else
+ this.tileCache = [{
+ type: 'O',
+ shape: [center, center + 1, center + direction[0], center + direction[0] + 1]
+ },
+ {
+ type: 'J',
+ shape: [center, center - 1, center + 1, center - 1 + direction[0]],
+ shapeRotation: squareRotation
+ },
+ {
+ type: 'L',
+ shape: [center, center - 1, center + 1, center + 1 + direction[0]],
+ shapeRotation: squareRotation
+ },
+ {
+ type: 'I',
+ shape: [center - 1, center, center + 1, center + 2],
+ shapeStates: [
+ [+2 - cols, +1, +cols, +2 * cols - 1],
+ [+1 + 2 * cols, +cols, -1, -2 - cols],
+ [-2 + cols, -1, -cols, -2 * cols + 1],
+ [-1 - 2 * cols, -cols, +1, +2 + cols]
+ ],
+ shapeStateIndex: 0
+ },
+ {
+ type: 'S',
+ shape: [center, center - 1, center + direction[0], center + direction[0] + 1],
+ shapeRotation: squareRotation
+ },
+ {
+ type: 'Z',
+ shape: [center, center + 1, center + direction[0], center + direction[0] - 1],
+ shapeRotation: squareRotation
+ },
+ {
+ type: 'T',
+ shape: [center, center - 1, center + 1, center + direction[0]],
+ shapeRotation: squareRotation
+ }
+ ];
+ }
+
+ if (typeof type != 'undefined') {
+ for (var i = 0; i < this.tileCache.length; i++) {
+ if (this.tileCache[i].type == type) {
+ tileIndex = i;
+ break;
+ }
+ }
+ } else {
+ // Random Generator using Knuth shuffle (http://tetris.wikia.com/wiki/Random_Generator)
+ if (!this.randomBag || this.randomBag.length == 0) {
+ var tilesCount = this.tileCache.length;
+ this.randomBag = [];
+
+ for (var i = 0; i < tilesCount; i++) {
+ this.randomBag[i] = i;
+ }
+
+ for (var i = tilesCount - 1; i > 0; i--) {
+ var rand = Math.floor(Math.random() * i),
+ tmp = this.randomBag[rand];
+ this.randomBag[rand] = this.randomBag[i];
+ this.randomBag[i] = tmp;
+ }
+ }
+
+ tileIndex = this.randomBag.shift();
+ }
+
+ return extend({}, this.tileCache[tileIndex], { shapeLocation: squareRotation });
+ },
+ freeze: function(tile) {
+ var frozenTilesHtml = [],
+ shape = tile.shape,
+ tileSize = this.tileSize,
+ cols = this.cols,
+ rowsToCheck = [];
+
+ for (var i = 0; i < shape.length; i++) {
+ if ($.inArray(shape[i] - (shape[i] % cols), rowsToCheck) === -1) {
+ rowsToCheck.push(shape[i] - (shape[i] % cols));
+ }
+
+ this.frozen[shape[i]] = true;
+ frozenTilesHtml.push('
');
+ }
+
+ $(frozenTilesHtml.join(''))
+ .each(function(i) {
+ $(this).css({
+ left: (shape[i] % cols) * tileSize,
+ top: Math.floor(shape[i] / cols) * tileSize
+ })
+ .data('index', shape[i]);
+ })
+ .appendTo(this.element);
+
+ while (rowsToCheck.length) {
+ var rowStart = rowsToCheck.shift(),
+ broken = false;
+
+ for (var i = rowStart; i < rowStart + cols; i++) {
+ if (!this.frozen[i])
+ broken = true;
+ }
+
+ if (!broken) {
+ this.$element.trigger('rowCompleted', rowStart);
+ }
+ }
+ },
+ repaint: function() {
+ var cols = this.cols,
+ tileSize = this.tileSize,
+ shape = this.currentTile.shape,
+ currentTile = this.$element.find('.current');
+
+ if (currentTile.length == 0) {
+ // render new tile
+ var currentTileHtml = [];
+
+ for (var h = 0; h < shape.length; h++) {
+ currentTileHtml.push('
');
+ }
+
+ currentTile = this.$element.append(currentTileHtml.join('')).find('.current');
+ }
+
+ // position shape
+ for (var i = 0; i < shape.length; i++) {
+ currentTile.eq(i).css({
+ left: (shape[i] % cols) * tileSize,
+ top: Math.floor(shape[i] / cols) * tileSize
+ });
+ }
+ },
+ start: function() {
+ if (this.isStarted) return;
+ this.isStarted = true;
+ var $element = this.$element;
+
+ if (!this.isValidLocation(this.currentTile.shape)) {
+ this.gameover();
+ }
+
+ /// TODO: improve timer
+ this.timer = setInterval(function() {
+ $element.trigger('tick');
+ }, 600);
+
+ },
+ pause: function() {
+ this.isStarted = false;
+ if (this.timer) {
+ window.clearInterval(this.timer);
+ this.timer = null;
+ }
+ },
+ gameover: function() {
+ this.isStarted = false;
+ this.isGameOver = true;
+ this.$element.trigger('gameOver');
+ },
+ restartGame: function() {
+ this.$element.empty();
+ this.$element.trigger('restartGame');
+ this.isStarted = false;
+ this.isGameOver = false;
+
+ this.frozen = {};
+
+ this.start();
+
+ }
+ };
+})(jQuery);
diff --git a/app/files/tweaks/casdk/apps/app.vdd/app.css b/app/files/tweaks/casdk/apps/app.vdd/app.css
index 6ddcad3..992db17 100644
--- a/app/files/tweaks/casdk/apps/app.vdd/app.css
+++ b/app/files/tweaks/casdk/apps/app.vdd/app.css
@@ -29,141 +29,122 @@
*/
[app="app.vdd"] {
- background: #0E0F0F;
+ background: #0E0F0F;
}
-
[app="app.vdd"] .tabs {
- background: #272D33;
- color: #ADB0B3;
- position: absolute;
- top:0;
- left:0;
- right:0;
- height:36px;
- overflow: hidden;
+ background: #272D33;
+ color: #ADB0B3;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 36px;
+ overflow: hidden;
+}
+[app="app.vdd"] .tabs span {
+ float: left;
+ padding: 0;
+ margin: 0;
+}
+[app="app.vdd"] .tabs span.divider {
+ border-left: 1px solid #0E0F0F;
+ height: 100%;
+ width: 0px;
+}
+[app="app.vdd"] .tabs span.tab {
+ font-size: 25px;
+ text-transform: uppercase;
+ text-align: center;
+ border-bottom: 5px solid #272D33;
+}
+[app="app.vdd"] .tabs span.tab[context="focused"] {
+ border-bottom-color: #3E7ED1;
}
-
- [app="app.vdd"] .tabs span {
- float:left;
- padding: 0;
- margin: 0;
- }
-
- [app="app.vdd"] .tabs span.divider {
- border-left: 1px solid #0E0F0F;
- height:100%;
- width:0px;
- }
-
-
- [app="app.vdd"] .tabs span.tab {
- font-size: 25px;
- text-transform: uppercase;
- text-align: center;
- border-bottom:5px solid #272D33;
- }
-
-
- [app="app.vdd"] .tabs span.tab[context="focused"] {
- border-bottom-color: #3E7ED1;
- }
-
[app="app.vdd"] .panel {
- background: #333940;
- position: absolute;
- top: 37px;
- left:0;
- bottom:0;
- right:0;
- overflow:hidden;
+ background: #333940;
+ position: absolute;
+ top: 37px;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ overflow: hidden;
+}
+[app="app.vdd"] .panel div.section {
+ padding: 2px;
+ display: block;
+ font-size: 14px;
+ font-weight: bold;
+ text-transform: uppercase;
+ background: #272D33;
+ padding: 5px;
+ border-bottom: 1px solid #0E0F0F;
+ padding-left: 15px;
+ color: #ADB0B3;
+}
+[app="app.vdd"] .panel div.item {
+ background: #333940;
+ border-bottom: 1px solid #0E0F0F;
+ padding-top: 8px;
+ padding-left: 10px;
+ height: 40px;
+ position: relative;
+ overflow: hidden;
+ width: 100%;
+}
+[app="app.vdd"] .panel div.item span {
+ display: inline-block;
+ margin-top: 2px;
+ float: left;
+}
+[app="app.vdd"] .panel div.item span:nth-child(1) {
+ padding: 3px;
+ color: #fff;
+ border-radius: 2px;
+ font-size: 18px;
+ text-transform: uppercase;
+ font-weight: normal;
+ margin-right: 15px;
+ text-align: center;
+ width: 60px;
+ background: #777;
+}
+[app="app.vdd"] .panel div.item span:nth-child(2) {
+ padding: 3px;
+ color: #fff;
+ border-radius: 2px;
+ font-size: 18px;
+ text-transform: uppercase;
+ font-weight: normal;
+ margin-right: 15px;
+ text-align: center;
+ width: 40px;
+}
+[app="app.vdd"] .panel div.item span:nth-child(2).string {
+ background: #0059B2;
+}
+[app="app.vdd"] .panel div.item span:nth-child(2).int {
+ background: #468C00;
+}
+[app="app.vdd"] .panel div.item span:nth-child(2).double {
+ background: #FF9326;
+}
+[app="app.vdd"] .panel div.item span:nth-child(3) {
+ font-size: 20px;
+ padding: 2px;
+ text-overflow: ellipsis;
+ width: 350px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+[app="app.vdd"] .panel div.item span:nth-child(4) {
+ position: absolute;
+ top: 2px;
+ right: 20px;
+ padding: 4px 10px;
+ background: #1E252B;
+ color: #fff;
+ font-size: 25px;
+ width: 200px;
+ border-radius: 3px;
+ min-height: 20px;
}
-
- [app="app.vdd"] .panel div.section {
- padding:2px;
- display:block;
- font-size:14px;
- font-weight: bold;
- text-transform: uppercase;
- background:#272D33;
- padding:5px;
- border-bottom:1px solid #0E0F0F;
- padding-left:15px;
- color:#ADB0B3;
- }
-
- [app="app.vdd"] .panel div.item {
- background:#333940;
- border-bottom:1px solid #0E0F0F;
- padding-top:8px;
- padding-left:10px;
- height:40px;
- position:relative;
- overflow:hidden;
- width: 100%;
- }
-
- [app="app.vdd"] .panel div.item span {
- display:inline-block;
- margin-top:2px;
- float:left;
- }
-
- [app="app.vdd"] .panel div.item span:nth-child(1) {
- padding:3px;
- color:#fff;
- border-radius:2px;
- font-size:18px;
- text-transform: uppercase;
- font-weight:normal;
- margin-right:15px;
- text-align:center;
- width:60px;
- background:#777;
- }
-
- [app="app.vdd"] .panel div.item span:nth-child(2) {
- padding:3px;
- color:#fff;
- border-radius:2px;
- font-size:18px;
- text-transform: uppercase;
- font-weight:normal;
- margin-right:15px;
- text-align:center;
- width:40px;
- }
-
- [app="app.vdd"] .panel div.item span:nth-child(2).string {
- background:#0059B2;
-
- }
-
- [app="app.vdd"] .panel div.item span:nth-child(2).int {
- background:#468C00;
- }
-
- [app="app.vdd"] .panel div.item span:nth-child(2).double {
- background:#FF9326;
- }
-
- [app="app.vdd"] .panel div.item span:nth-child(3) {
- font-size:20px;
- padding:2px;
- text-overflow: ellipsis;
- width: 350px;
- white-space: nowrap;
- overflow: hidden;
- }
-
- [app="app.vdd"] .panel div.item span:nth-child(4) {
- position:absolute;
- top:2px;
- right:20px;
- padding:4px 10px;
- background:#1E252B;
- color:#fff;
- font-size:25px;
- width:200px;
- border-radius:3px;
- min-height:20px;
- }
diff --git a/app/files/tweaks/casdk/apps/app.vdd/app.js b/app/files/tweaks/casdk/apps/app.vdd/app.js
index f0cbef0..e014672 100644
--- a/app/files/tweaks/casdk/apps/app.vdd/app.js
+++ b/app/files/tweaks/casdk/apps/app.vdd/app.js
@@ -34,405 +34,424 @@
CustomApplicationsHandler.register("app.vdd", new CustomApplication({
+ /**
+ * (require)
+ *
+ * An object array that defines resources to be loaded such as javascript's, css's, images, etc
+ *
+ * All resources are relative to the applications root path
+ */
+
+ require: {
+
/**
- * (require)
- *
- * An object array that defines resources to be loaded such as javascript's, css's, images, etc
+ * (js) defines javascript includes
+ */
+
+ js: [],
+
+ /**
+ * (css) defines css includes
+ */
+
+ css: ['app.css'],
+
+ /**
+ * (images) defines images that are being preloaded
*
- * All resources are relative to the applications root path
+ * Images are assigned to an id
*/
- require: {
+ images: {},
- /**
- * (js) defines javascript includes
- */
+ },
- js: [],
+ /**
+ * (settings)
+ *
+ * An object that defines application settings
+ */
- /**
- * (css) defines css includes
- */
+ settings: {
- css: ['app.css'],
+ /**
+ * (title) The title of the application in the Application menu
+ */
- /**
- * (images) defines images that are being preloaded
- *
- * Images are assigned to an id
- */
+ title: 'Vehicle Data Diagnostic',
- images: {},
+ /**
+ * (statusbar) Defines if the statusbar should be shown
+ */
- },
+ statusbar: true,
/**
- * (settings)
+ * (statusbarIcon) defines the status bar icon
+ *
+ * Set to true to display the default icon app.png or set a string to display
+ * a fully custom icon.
*
- * An object that defines application settings
+ * Icons need to be 37x37
*/
- settings: {
+ statusbarIcon: true,
- /**
- * (title) The title of the application in the Application menu
- */
+ /**
+ * (statusbarTitle) overrides the statusbar title, otherwise title is used
+ */
- title: 'Vehicle Data Diagnostic',
+ statusbarTitle: false,
- /**
- * (statusbar) Defines if the statusbar should be shown
- */
- statusbar: true,
+ /**
+ * (hasLeftButton) indicates if the UI left button / return button should be shown
+ */
- /**
- * (statusbarIcon) defines the status bar icon
- *
- * Set to true to display the default icon app.png or set a string to display
- * a fully custom icon.
- *
- * Icons need to be 37x37
- */
+ hasLeftButton: false,
- statusbarIcon: true,
+ /**
+ * (hasMenuCaret) indicates if the menu item should be displayed with an caret
+ */
- /**
- * (statusbarTitle) overrides the statusbar title, otherwise title is used
- */
+ hasMenuCaret: false,
- statusbarTitle: false,
+ /**
+ * (hasRightArc) indicates if the standard right car should be displayed
+ */
+ hasRightArc: false,
- /**
- * (hasLeftButton) indicates if the UI left button / return button should be shown
- */
+ },
- hasLeftButton: false,
+ /**
+ * (DataGroups)
+ */
- /**
- * (hasMenuCaret) indicates if the menu item should be displayed with an caret
- */
+ dataGroups: [{
+ name: 'Main',
+ items: [
+ { name: 'General', mapping: VehicleData.general },
+ { name: 'Vehicle Data', mapping: VehicleData.vehicle },
+ { name: 'Vehicle Fuel', mapping: VehicleData.fuel },
+ { name: 'Vehicle Temperatures', mapping: VehicleData.temperature },
+ { name: 'GPS', mapping: VehicleData.gps },
+ ]
+ },
+ { prefix: 'VDT', title: 'Vehicle Driving Data' },
+ { prefix: 'GPS', title: 'Global Positioning System' },
+ { prefix: 'PID', title: 'Vehicle Data PID' },
+ { prefix: 'VDTC', title: 'Vehicle Data Current' },
+ { prefix: 'VDM', title: 'ECO and Energy Management' },
+ { prefix: 'VDMH', title: 'ECO and Energy History' },
+ { prefix: 'VDS', title: 'Vehicle Settings' },
+ { prefix: 'IDM', title: 'Ignition Diagnostic Monitor' },
+ { prefix: 'IDMH', title: 'Ignition Diagnostic History' },
+ { prefix: 'VDTH', title: 'Vehicle Data Transfer History' }
+ ],
- hasMenuCaret: false,
- /**
- * (hasRightArc) indicates if the standard right car should be displayed
- */
+ /***
+ *** User Interface Life Cycles
+ ***/
- hasRightArc: false,
+ /**
+ * (created)
+ *
+ * Executed when the application gets initialized
+ *
+ * Add any content that will be static here
+ */
- },
+ created: function() {
- /**
- * (DataGroups)
- */
+ this.createInterface();
- dataGroups: [
- {name: 'Main', items: [
- {name: 'General', mapping: VehicleData.general},
- {name: 'Vehicle Data', mapping: VehicleData.vehicle},
- {name: 'Vehicle Fuel', mapping: VehicleData.fuel},
- {name: 'Vehicle Temperatures', mapping: VehicleData.temperature},
- {name: 'GPS', mapping: VehicleData.gps},
- ]},
- {prefix: 'VDT', title: 'Vehicle Driving Data' },
- {prefix: 'GPS', title: 'Global Positioning System'},
- {prefix: 'PID', title: 'Vehicle Data PID'},
- {prefix: 'VDTC', title: 'Vehicle Data Current'},
- {prefix: 'VDM', title: 'ECO and Energy Management'},
- {prefix: 'VDMH', title: 'ECO and Energy History'},
- {prefix: 'VDTS', title: 'Vehicle Settings'},
- {prefix: 'IDM', title: 'Ignition Diagnostic Monitor'},
- {prefix: 'IDMH', title: 'Ignition Diagnostic History'},
- {prefix: 'VDTH', title: 'Vehicle Data Transfer History'}
- ],
-
-
- /***
- *** User Interface Life Cycles
- ***/
+ },
- /**
- * (created)
- *
- * Executed when the application gets initialized
- *
- * Add any content that will be static here
- */
+ /**
+ * (focused)
+ */
- created: function() {
+ focused: function() {
- this.createInterface();
+ //this.update();
+ },
- },
+ /***
+ *** Events
+ ***/
- /**
- * (focused)
- */
+ /**
+ * (event) onControllerEvent
+ *
+ * Called when a new (multi)controller event is available
+ */
- focused: function() {
+ onControllerEvent: function(eventId) {
- //this.update();
- },
+ var itemHeight = this.canvas.find(".panel div.item").outerHeight(true) * 2;
- /***
- *** Events
- ***/
+ switch (eventId) {
- /**
- * (event) onControllerEvent
- *
- * Called when a new (multi)controller event is available
- */
+ /**
+ * Scroll Down
+ */
- onControllerEvent: function(eventId) {
+ case "cw":
- var itemHeight = this.canvas.find(".panel div.item").outerHeight(true) * 2;
+ this.scrollElement(this.canvas.find(".panel"), itemHeight);
- switch(eventId) {
+ break;
- /**
- * Scroll Down
- */
+ /**
+ * Scroll Up
+ */
- case "cw":
+ case "ccw":
- this.scrollElement(this.canvas.find(".panel"), itemHeight);
+ this.scrollElement(this.canvas.find(".panel"), -1 * itemHeight);
- break;
+ break;
- /**
- * Scroll Up
- */
+ case "up":
- case "ccw":
+ this.scrollElement(this.canvas.find(".panel"), -1 * $('.panel').height());
- this.scrollElement(this.canvas.find(".panel"), -1 * itemHeight);
+ break;
+ case "down":
- break;
+ this.scrollElement(this.canvas.find(".panel"), $('.panel').height());
- }
+ break;
- },
+ }
- /**
- * (event) onContextEvent
- *
- * Called when the context of an element was changed
- */
+ },
- onContextEvent: function(eventId, context, element) {
+ /**
+ * (event) onContextEvent
+ *
+ * Called when the context of an element was changed
+ */
- // remember the scrolling position
- var active = this.canvas.find(".panel.active");
- if(active.length) {
- this.panelScrollPositions[active.attr("index")] = active.scrollTop();
- }
+ onContextEvent: function(eventId, context, element) {
- // continue
- this.canvas.find(".panel").removeClass("active").hide();
+ // remember the scrolling position
+ var active = this.canvas.find(".panel.active");
+ if (active.length) {
+ this.panelScrollPositions[active.attr("index")] = active.scrollTop();
+ }
- var active = this.canvas.find(".panel[name=" + element.attr("name") + "]").addClass("active").show();
+ // continue
+ this.canvas.find(".panel").removeClass("active").hide();
- // create items
- this.createPanel(element.attr("index"));
+ var active = this.canvas.find(".panel[name=" + element.attr("name") + "]").addClass("active").show();
- // set position
- if(this.panelScrollPositions[active.attr("index")]) {
- active.scrollTop(this.panelScrollPositions[active.attr("index")]);
- }
- },
+ // create items
+ this.createPanel(element.attr("index"));
+ // set position
+ if (this.panelScrollPositions[active.attr("index")]) {
+ active.scrollTop(this.panelScrollPositions[active.attr("index")]);
+ }
+ },
- /***
- *** Applicaton specific methods
- ***/
- /**
- * (createInterface)
- *
- * This method creates the interface
- */
+ /***
+ *** Applicaton specific methods
+ ***/
- createInterface: function() {
- // create tabbed menu
- this.menu = $("
").addClass("tabs").appendTo(this.canvas);
+ /**
+ * (createInterface)
+ *
+ * This method creates the interface
+ */
- // create tabs
- this.panelData = [];
- this.panelScrollPositions = [];
- $.each(this.dataGroups, function(index, group) {
+ createInterface: function() {
+ // create tabbed menu
+ this.menu = $("
").addClass("tabs").appendTo(this.canvas);
- // set enabled
- var enabled = true;
+ // create tabs
+ this.panelData = [];
+ this.panelScrollPositions = [];
+ $.each(this.dataGroups, function(index, group) {
- // get data table
- if(!group.items) {
+ // set enabled
+ var enabled = true;
- var table = CustomApplicationDataHandler.getTableByPrefix(group.prefix);
+ // get data table
+ if (!group.items) {
- enabled = table && table.enabled || false;
- }
+ var table = CustomApplicationDataHandler.getTableByPrefix(group.prefix);
- // set group id
- group.id = group.name || group.prefix
+ enabled = table && table.enabled || false;
+ }
- // add to menu if enabled
- if(enabled) {
- // add to menu
- this.menu.append(this.addContext($("
").attr({name: group.id, index: this.panelData.length}).addClass("tab").append(group.name || group.prefix)));
+ // set group id
+ group.id = group.name || group.prefix
- // add divider
- this.menu.append($("
").addClass("divider"));
+ // add to menu if enabled
+ if (enabled) {
+ // add to menu
+ this.menu.append(this.addContext($("
").attr({ name: group.id, index: this.panelData.length }).addClass("tab").append(group.name || group.prefix)));
- // add to panel
- this.panelData.push(group);
+ // add divider
+ this.menu.append($("
").addClass("divider"));
- this.panelScrollPositions.push(0);
+ // add to panel
+ this.panelData.push(group);
- }
+ this.panelScrollPositions.push(0);
- }.bind(this));
+ }
- // calculate size
- var tabWidth = Math.round((800 - this.panelData.length) / this.panelData.length);
+ }.bind(this));
- this.menu.find("span.tab").css("width", tabWidth);
+ // calculate size
+ var tabWidth = Math.round((795 - this.panelData.length) / this.panelData.length);
- // remove last divider
- this.menu.find("span.divider:last-of-type").remove();
+ this.menu.find("span.tab").css("width", tabWidth);
- },
+ // remove last divider
+ this.menu.find("span.divider:last-of-type").remove();
+ },
- /**
- * createPanel
- */
- createPanel: function(index) {
+ /**
+ * createPanel
+ */
+ createPanel: function(index) {
- // create panels
- if(!this.panelData[index]) return;
- // flush
- this.removeSubscriptions();
+ // create panels
+ if (!this.panelData[index]) return;
- this.canvas.find(".panel").remove();
+ // flush
+ this.removeSubscriptions();
- // create panel
- var panelDom = $("
").addClass("panel").appendTo(this.canvas),
- panel = this.panelData[index];
+ this.canvas.find(".panel").remove();
- // create items in panel
- switch(true) {
+ // create panel
+ var panelDom = $("
").addClass("panel").appendTo(this.canvas),
+ panel = this.panelData[index];
- case this.is.array(panel.items):
+ // create items in panel
+ switch (true) {
- // create sectionalized view
- panel.items.forEach(function(section) {
+ case this.is.array(panel.items):
- // add header
- panelDom.append($("
").addClass("section").append(section.name));
+ // create sectionalized view
+ panel.items.forEach(function(section) {
- // add items
- this.createItems(panelDom, section);
+ // add header
+ panelDom.append($("
").addClass("section").append(section.name));
- }.bind(this));
+ // add items
+ this.createItems(panelDom, section);
- break;
+ }.bind(this));
- default:
- // create description
- panelDom.append($("
").addClass("section").append(panel.title));
+ break;
- // create items
+ default:
+ // create description
+ panelDom.append($("
").addClass("section").append(panel.title));
- this.createItems(panelDom, panel);
- break;
+ // create items
+ this.createItems(panelDom, panel);
+ break;
- }
- },
+ }
- /**
- * (createItems)
- *
- * This method adds items to the panel
- */
+ },
+
+ /**
+ * (createItems)
+ *
+ * This method adds items to the panel
+ */
- createItems: function(panelDom, group) {
+ createItems: function(panelDom, group) {
- // initialize
- var values = [];
+ // initialize
+ var values = [];
- // prepare mapping to value table
- if(group.mapping) {
+ // prepare mapping to value table
+ if (group.mapping) {
- // get actual values
- $.each(group.mapping, function(id, params) {
+ // get actual values
+ $.each(group.mapping, function(id, params) {
- if(params.id) {
- var tmp = CustomApplicationDataHandler.get(params.id);
- if(tmp) {
- params.value = tmp.value;
- values.push($.extend(params, tmp));
- }
- }
- });
+ if (params.id) {
+ var tmp = CustomApplicationDataHandler.get(params.id);
+ if (tmp) {
+ params.value = tmp.value;
+ values.push($.extend(params, tmp));
+ }
+ }
+ });
- } else {
+ } else {
- // build data array
- values = $.map(CustomApplicationDataHandler.data, function(value) {
- if(value.prefix == group.prefix) {
- return value;
- }
- });
+ // build data array
+ values = $.map(CustomApplicationDataHandler.data, function(value) {
+ if (value.prefix == group.prefix) {
+ return value;
}
+ });
+ }
- // sort by name
- values.sort(function(a, b) {
- return a.name > b.name ? 1 : -1;
- });
+ // sort by name
+ values.sort(function(a, b) {
+ return a.name > b.name ? 1 : -1;
+ });
- // get data handler
- values.forEach(function(value) {
+ // get data handler
+ values.forEach(function(value) {
- // check prefix
- var item = $("
").addClass("item").appendTo(panelDom);
+ // check prefix
+ var item = $("
").addClass("item").appendTo(panelDom);
- var typeLabel = value.type;
- switch(typeLabel) {
- case "string": typeLabel= "str"; break;
- case "double": typeLabel = "dbl"; break;
- default: typeLabel = "int"; break;
- }
+ var typeLabel = value.type;
+ switch (typeLabel) {
+ case "string":
+ typeLabel = "str";
+ break;
+ case "double":
+ typeLabel = "dbl";
+ break;
+ default:
+ typeLabel = "int";
+ break;
+ }
- // add fields
- $("
").append(value.prefix ? value.prefix : "DATA").addClass(value.prefix).appendTo(item);
- $("
").append(typeLabel).addClass(value.type).appendTo(item);
- $("
").append(value.friendlyName ? value.friendlyName : value.name).appendTo(item);
- $("
").attr("data", value.id).append(value.value).appendTo(item);
+ // add fields
+ $("
").append(value.prefix ? value.prefix : "DATA").addClass(value.prefix).appendTo(item);
+ $("
").append(typeLabel).addClass(value.type).appendTo(item);
+ $("
").append(value.friendlyName ? value.friendlyName : value.name).appendTo(item);
+ $("
").attr("data", value.id).append(value.value).appendTo(item);
- // create subscription
- this.subscribe(value.id, this.valueCallback.bind(this));
+ // create subscription
+ this.subscribe(value.id, this.valueCallback.bind(this));
- }.bind(this));
+ }.bind(this));
- },
+ },
- /**
- * (valueCallback)
- */
+ /**
+ * (valueCallback)
+ */
- valueCallback: function(value, payload) {
+ valueCallback: function(value, payload) {
- this.canvas.find("span[data=" + payload.id + "]").html(value);
+ this.canvas.find("span[data=" + payload.id + "]").html(value);
- },
+ },
-}));
\ No newline at end of file
+}));
diff --git a/app/files/tweaks/casdk/apps/apps.js b/app/files/tweaks/casdk/apps/apps.js
index d07b4e4..198b61e 100644
--- a/app/files/tweaks/casdk/apps/apps.js
+++ b/app/files/tweaks/casdk/apps/apps.js
@@ -33,10 +33,4 @@
*/
var CustomApplications = [
- "app.simpledashboard",
- "app.multidash",
- "app.gpsspeed",
- "app.vdd",
- "app.devtools",
- "app.terminal",
];
diff --git a/app/files/tweaks/casdk/jci/stage_wifi.sh b/app/files/tweaks/casdk/jci/stage_wifi.sh
deleted file mode 100644
index ef2402b..0000000
--- a/app/files/tweaks/casdk/jci/stage_wifi.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-#
-# Custom Applications SDK for Mazda Connect Infotainment System
-#
-# A mini framework that allows to write custom applications for the Mazda Connect Infotainment System
-# that includes an easy to use abstraction layer to the JCI system.
-#
-# Written by Andreas Schwarz (http://github.com/flyandi/mazda-custom-application-sdk)
-# Copyright (c) 2016. All rights reserved.
-#
-# WARNING: The installation of this application requires modifications to your Mazda Connect system.
-# If you don't feel comfortable performing these changes, please do not attempt to install this. You might
-# be ending up with an unusuable system that requires reset by your Dealer. You were warned!
-#
-# This program is free software: you can redistribute it and/or modify it under the terms of the
-# GNU General Public License as published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-# License for more details.
-#
-# You should have received a copy of the GNU General Public License along with this program.
-# If not, see http://www.gnu.org/licenses/
-#
-
-#
-# Data Gathering Script
-#
-
-# one time run
-./jci/casdk/vdtol.sh &
-
-# 1s update rate
-watch -n 1 /jci/casdk/vdt1s.sh &
-
-# 60s update rate
-watch -n 60 /jci/casdk/vdt60s.sh &
-
-# 300s update rate
-watch -n 300 /jci/casdk/vdt300s.sh &
-
diff --git a/app/files/tweaks/casdk/patch/systemApp.70.js b/app/files/tweaks/casdk/patch/systemApp.70.js
new file mode 100644
index 0000000..38464c7
--- /dev/null
+++ b/app/files/tweaks/casdk/patch/systemApp.70.js
@@ -0,0 +1,2128 @@
+/*
+ Patched for AIO + CASDK apps ~Trez 06.21.2018
+ Copyright 2012 by Johnson Controls
+ __________________________________________________________________________
+ Filename: systemApp.js
+ __________________________________________________________________________
+ Project: JCI-IHU
+ Language: EN
+ Author: awoodhc
+ Date: 05.7.2012
+ __________________________________________________________________________
+ Description: IHU GUI System App
+ Revisions:
+ v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
+ v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
+ v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between contexts.
+ v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
+ v0.5 - 14-June-2012 Language Localization added to ListCtrls
+ v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
+ v0.7 - 22-June-2012 Code review changes and reworked context handling
+ v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
+ v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
+ v1.0 - 31-July-2012 Updated Multicontroller behavior.
+ v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
+ v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
+ v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
+ v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
+ v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
+ v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
+ v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
+ v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
+ v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
+ v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
+ v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
+ v2.2 (20-Nov-2012) Stitcher enabled
+ v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
+ v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
+ v2.5 (17-Jan-2013) Changed one event name
+ v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
+ v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
+ v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
+ v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
+ __________________________________________________________________________
+ */
+log.addSrcFile("systemApp.js", "system");
+/**********************************************
+ * Start of Base App Implementation
+ *
+ * Code in this section should not be modified
+ * except for function names based on the appname
+ *********************************************/
+function systemApp(uiaId) {
+ log.debug("constructor called...");
+ // Base application functionality is provided in a common location via this call to baseApp.init().
+ // See framework/js/BaseApp.js for details.
+ baseApp.init(this, uiaId);
+ // All feature-specific initialization is done in appInit()
+}
+/*
+ * Called just after the app is instantiated by framework.
+ * App-specific variables should be declared here.
+ */
+systemApp.prototype.appInit = function() {
+ if (framework.debugMode) {
+ utility.loadScript("apps/system/test/systemAppTest.js");
+ }
+ //@formatter:off
+ this._initEntertainmentDataList();
+ this._initApplicationsDataList();
+ this._initCommunicationsDataList();
+ this._contextTable = {
+ "HomeScreen": {
+ "hideHomeBtn": true,
+ "template": "MainMenuTmplt",
+ "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
+ "controlProperties": {
+ "MainMenuCtrl": {
+ "selectCallback": this._selectCallbackHomeScreen.bind(this),
+ } // end of properties for "MainMenuCtrl"
+ }, // end of list of controlProperties
+ }, // end of "systemAppContext1"
+ "Communication": {
+ "leftBtnStyle": "goBack",
+ "sbNameId": "Communication",
+ "template": "List2Tmplt",
+ "controlProperties": {
+ "List2Ctrl": {
+ "dataList": this._communicationsDataList,
+ titleConfiguration: 'noTitle',
+ numberedList: false,
+ selectCallback: this._menuItemSelectCallback.bind(this),
+ } // end of properties for "List2Ctrl"
+ }, // end of list of controlProperties
+ "readyFunction": this._readyCommunication.bind(this),
+ "contextInFunction": this._CommCtxtContextIn.bind(this),
+ }, // end of "Communication"
+ "Entertainment": {
+ "leftBtnStyle": "goBack",
+ "sbNameId": "Entertainment",
+ "template": "List2Tmplt",
+ "controlProperties": {
+ "List2Ctrl": {
+ "dataList": null,
+ titleConfiguration: 'noTitle',
+ numberedList: false,
+ selectCallback: this._menuItemSelectCallback.bind(this),
+ } // end of properties for "List2Ctrl"
+ }, // end of list of controlProperties
+ "readyFunction": this._readyEntertainment.bind(this),
+ }, // end of "Entertainment"
+ "Applications": {
+ "leftBtnStyle": "goBack",
+ "sbNameId": "Applications",
+ "template": "List2Tmplt",
+ "controlProperties": {
+ "List2Ctrl": {
+ "dataList": null,
+ titleConfiguration: 'noTitle',
+ numberedList: true,
+ selectCallback: this._menuItemSelectCallback.bind(this),
+ } // end of properties for "List2Ctrl"
+ }, // end of list of controlProperties
+ "readyFunction": this._readyApplications.bind(this),
+ }, // end of "Applications"
+ "VehicleStatusMonitor": {
+ "leftBtnStyle": "goBack",
+ "sbNameId": "VehicleStatusMonitor",
+ "template": "List2Tmplt",
+ "controlProperties": {
+ "List2Ctrl": {
+ "dataList": null,
+ titleConfiguration: 'noTitle',
+ numberedList: true,
+ selectCallback: this._menuItemSelectCallback.bind(this),
+ } // end of properties for "List2Ctrl"
+ }, // end of list of controlProperties
+ "readyFunction": this._readyApplications.bind(this),
+ }, // end of "VehicleStatusMonitor"
+ "NoConnectionNotify": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ contentStyle: "style13",
+ defaultSelectCallback: this._selectCallbackNoConnectionNotify.bind(this),
+ buttonCount: 2,
+ initialFocus: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.No",
+ appData: "Global.No"
+ },
+ button2: {
+ labelId: "Connect",
+ appData: "SelectConnect"
+ },
+ },
+ text1Id: 'NoConnectionNotifyTitle',
+ text2Id: 'NoConnectionNotifyText',
+ } // end of properties for "DialogCtrl"
+ }, // end of list of controlProperties
+ }, // end of "NoConnectionNotify"
+ "NotifyDialog": {
+ "template": "Dialog3Tmplt",
+ "sbNameId": null,
+ "readyFunction": this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
+ "displayedFunction": this._NotifyDialogCtxtTmpltDisplayed.bind(this),
+ "noLongerDisplayedFunction": this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ "defaultSelectCallback": this._selectCallbackNotifyDialog.bind(this),
+ "contentStyle": "style17",
+ "buttonCount": 3,
+ "initialFocus": 2,
+ "buttonConfig": {
+ "button1": {
+ labelId: "NotifyOff",
+ appData: "SelectNotifyOff",
+ },
+ "button2": {
+ labelId: "NotifyIgnore",
+ appData: "Global.No",
+ },
+ "button3": {
+ labelId: "NotifyRead",
+ appData: "SelectNotifyMessage"
+ }
+ }, // end of buttonConfig
+ "text1Id": "NotifyIncomingMsg",
+ "text2": "",
+ "text3Id": "NotifyReadNow",
+ } // end of properties for dialog
+ }, // end of controlProperties
+ }, // end of "NotifyDialog"
+ "NotificationList": {
+ "leftBtnStyle": "goBack",
+ "template": "List2Tmplt",
+ "sbNameId": "Notifications",
+ "readyFunction": this._readyNotificationList.bind(this),
+ "noLongerDisplayedFunction": this._noLongerDisplayedNotificationList.bind(this),
+ "controlProperties": {
+ "List2Ctrl": {
+ titleConfiguration: "noTitle",
+ numberedList: true,
+ selectCallback: this._selectNotificationListItem.bind(this),
+ title: null,
+ dataList: null,
+ },
+ }, // end of controlProperties
+ }, // end of "NotificationList"
+ "NotificationListRetry": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ contentStyle: "style02",
+ defaultSelectCallback: this._selectCallbackNotificationListRetry.bind(this),
+ buttonCount: 2,
+ initialFocus: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.Cancel",
+ appData: "Global.Cancel"
+ },
+ button2: {
+ labelId: "RetryLabel",
+ appData: "SelectRetry"
+ },
+ },
+ text1Id: 'FailedNotificationRetrieval',
+ } // end of properties for "DialogCtrl"
+ }, // end of list of controlProperties
+ }, // end of NotificationListRetry
+ "NoDevice": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ contentStyle: "style13",
+ defaultSelectCallback: this._selectCallbackNoDevice.bind(this),
+ buttonCount: 2,
+ initialFocus: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.No",
+ appData: "Global.GoBack"
+ },
+ button2: {
+ labelId: "Connect",
+ appData: "SelectConnect"
+ },
+ },
+ text1Id: 'NoDeviceTitle',
+ text2Id: 'NoDeviceText',
+ } // end of properties for "DialogCtrl"
+ }, // end of list of controlProperties
+ }, // end of "NoConnectionNotify"
+ "DisplayOff": {
+ "hideHomeBtn": true,
+ "template": "OffScreenTmplt",
+ "templatePath": "apps/system/templates/OffScreen",
+ "controlProperties": {
+ "OffScreenCtrl": {
+ userActivityCallback: this._displayOffUserActivity.bind(this),
+ showClock: true,
+ }
+ },
+ }, // end of "DisplayOff"
+ "Disclaimer": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ titleStyle: "titleStyle01",
+ titleId: "WarningTitle",
+ contentStyle: "style02",
+ fullScreen: true,
+ defaultSelectCallback: this._selectCallbackDisclaimer.bind(this),
+ buttonCount: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "agree",
+ appData: "Global.Yes"
+ },
+ },
+ text1Id: 'DisclaimerText',
+ }
+ },
+ "displayedFunction": this._displayedDisclaimer.bind(this),
+ "noLongerDisplayedFunction": this._noLongerDisplayedDisclaimer.bind(this),
+ "contextOutFunction": this._displayedDisclaimerOut.bind(this),
+ }, // end of Disclaimer
+ "SystemWarning": {
+ "hideHomeBtn": true,
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ titleStyle: "titleStyle01",
+ titleId: "TempWarning",
+ contentStyle: "style02",
+ defaultSelectCallback: this._selectCallbackSystemWarning.bind(this),
+ buttonCount: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.Ok",
+ appData: "Global.Yes"
+ },
+ },
+ text1Id: "TempWarningText",
+ }
+ },
+ },
+ "SourceReconnect": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ "defaultSelectCallback": this._selectSourceReconnect.bind(this),
+ "contentStyle": "style14",
+ "fullScreen": false,
+ "text1Id": null,
+ "meter": { "meterType": "indeterminate", "meterPath": "common/images/IndeterminateMeter_2.png" },
+ "buttonCount": 1,
+ "buttonConfig": {
+ button1: {
+ labelId: "ReconnectEntMenuButton",
+ appData: "SelectEntertainmentMenu"
+ },
+ },
+ }
+ },
+ "readyFunction": this._readySourceReconnect.bind(this),
+ },
+ "SourceReconnectFailed": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ "defaultSelectCallback": this._selectSourceReconnectFailed.bind(this),
+ "contentStyle": "style02",
+ "fullScreen": false,
+ "text1Id": null,
+ "buttonCount": 1,
+ "buttonConfig": {
+ button1: {
+ labelId: "common.Ok",
+ appData: "Global.Yes"
+ },
+ },
+ }
+ },
+ "readyFunction": this._readySourceReconnectFailed.bind(this),
+ },
+ "IntroAnimation": {
+ "hideHomeBtn": true,
+ "template": "NoCtrlTmplt",
+ "properties": {
+ "visibleSurfaces": ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
+ "statusBarVisible": false,
+ "customBgImage": "common/images/FullTransparent.png",
+ },
+ },
+ "QuickStartLoop": {
+ "hideHomeBtn": true,
+ "template": "NoCtrlTmplt",
+ "properties": {
+ "visibleSurfaces": ["QUICKTRANLOGO_SURFACE"],
+ "statusBarVisible": false,
+ "customBgImage": "common/images/FullTransparent.png",
+ },
+ },
+ "PowerDownAnimation": {
+ "hideHomeBtn": true,
+ "template": "NoCtrlTmplt",
+ "properties": {
+ "visibleSurfaces": ["EXITLOGO_SURFACE"],
+ "statusBarVisible": false,
+ "customBgImage": "common/images/FullTransparent.png",
+ },
+ },
+ "IdleStandby": {
+ "hideHomeBtn": true,
+ "template": "OffScreenTmplt",
+ "templatePath": "apps/system/templates/OffScreen",
+ "controlProperties": {
+ "OffScreenCtrl": {
+ userActivityCallback: null,
+ showClock: false,
+ }
+ },
+ },
+ "WaitForEnding": {
+ "hideHomeBtn": true,
+ "template": "OffScreenTmplt",
+ "templatePath": "apps/system/templates/OffScreen",
+ "controlProperties": {
+ "OffScreenCtrl": {
+ userActivityCallback: null,
+ showClock: false,
+ }
+ },
+ },
+ "EnableRVR": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ contentStyle: "style02",
+ defaultSelectCallback: this._selectCallbackEnableRVR.bind(this),
+ buttonCount: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.Ok",
+ appData: "Global.Yes"
+ },
+ },
+ text1Id: "SiriDisabled",
+ }
+ },
+ "readyFunction": this._readyEnableRVR.bind(this),
+ },
+ "RVRInstructions": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ contentStyle: "style02",
+ defaultSelectCallback: this._selectCallbackRVRInstructions.bind(this),
+ buttonCount: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.Ok",
+ appData: "Global.Yes"
+ },
+ },
+ text1Id: "InitiateSiri",
+ }
+ },
+ },
+ "SiriInSession": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ titleStyle: "titleStyle01",
+ titleId: "Siri",
+ contentStyle: "style14",
+ "meter": { "meterType": "indeterminate", "meterPath": "apps/system/images/IcnSiri.png" }
+ }
+ },
+ },
+ "SiriLaunchingError": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ //titleStyle : "titleStyle01",
+ // titleId : "Siri",
+ contentStyle: "style02",
+ defaultSelectCallback: this._selectCallbackRVRInstructions.bind(this),
+ buttonCount: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.Ok",
+ appData: "Global.Yes"
+ },
+ },
+ text1Id: "DisconnectThenReconnect",
+ }
+ },
+ "readyFunction": this._readySiriLaunchingError.bind(this),
+ },
+ }; // end of this._contextTable object
+ //@formatter:off
+ this._messageTable = {
+ // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
+ "StatusMenu": this._StatusMenuMsgHandler.bind(this),
+ // Add or remove certain menu items.
+ "StatusMenuVisible": this._StatusMenuVisibleMsgHandler.bind(this),
+ // Indicates Available / Unavailable and device name for USB1 and USB2 audio
+ "StatusMenuUSBAudio": this._StatusMenuUSBAudioMsgHandler.bind(this),
+ // Indicates Available / Unavailable and device name for BTAudio
+ "StatusMenuBTAudio": this._StatusMenuBTAudioMsgHandler.bind(this),
+ // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
+ "StatusUpdateEcoEnergy": this._StatusUpdateEcoEnergyMsgHandler.bind(this),
+ // Updates the number of notifications for missed sms and emails.
+ "StatusUpdateNotifications": this._StatusUpdateNotificationsHandler.bind(this),
+ // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
+ "StatusPhoneCall": this._StatusPhoneCallMsgHandler.bind(this),
+ // Show an Audio SourceNotAvailable SBN
+ "TimedSBN_SourceNotAvailable": this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
+ // Update the current audio source icon in the Entertainment menu
+ "StatusUpdateAudioSource": this._StatusUpdateAudioSourceMsgHandler.bind(this),
+ // Update the number of missed calls
+ "StatusUpdateMissedCallCount": this._StatusUpdateMissedCallCountMsgHandler.bind(this),
+ // Update the number of warnings displayed apps men
+ "WarningStatusCount": this._WarningStatusCountMsgHandler.bind(this),
+ // Update whether scheduled maintenance is due
+ "StatusUpdateSchedMaint": this._StatusUpdateSchedMaintHandler.bind(this),
+ // Show an Siri SBN
+ "ShowStateSBN_SiriActive": this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
+ // Show an Siri Error SBN
+ "TimedSBN_SiriError": this._TimedSBN_SiriErrorMsgHandler.bind(this),
+ // Remove an Siri SBN
+ "RemoveStateSBN_SiriActive": this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
+ //Show timed SBN Voice not supported
+ "TimedSBN_VoiceNotSupported": this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
+ //Show timed SBN Voice Recognition Loading
+ "TimedSBN_VRLoading": this._TimedSBN_VRLoadingMsgHandler.bind(this),
+ //At Speed Restriction
+ "Global.AtSpeed": this._AtSpeedMsgHandler.bind(this),
+ //At No Speed
+ "Global.NoSpeed": this._NoSpeedMsgHandler.bind(this),
+ };
+ //@formatter:on
+ // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
+ // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
+ // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
+ // so the remaining time must be restarted when this happens.
+ this._disclaimerTime = {
+ // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
+ // flag is set true after a the timer times out or the user hits the OK button.
+ reset: true,
+ // (Number) Milliseconds remaining to show the Disclaimer.
+ remaining: 0,
+ // (Number) Millisecond timestamp when the Disclaimer was first shown.
+ whenStarted: 0,
+ // (Handle) setTimeout ID
+ timeoutId: null
+ };
+ // Array containing the appName of the list which supports Speed Restriction.
+ //@appName = appName of the item , @status = default value of disabled property for particular appName
+ this._SpeedRestrictedApps = [{ appName: "vdt_settings", status: true }];
+};
+/**************************
+ * Set Wink Properties *
+ **************************/
+systemApp.prototype.getWinkProperties = function(alert, params) {
+ log.info("setting wink properties for: ", alert, params);
+ var winkProperties = null;
+ switch (alert) {
+ case "System_RVR_NOT_ACTIVE":
+ case "System_RVR_EFM_ERROR":
+ case "System_RVR_ACTIVATE_ERROR":
+ winkProperties = {
+ "style": "style03",
+ "text1Id": "ErrorWhileStartingSiri"
+ };
+ break;
+ case "System_RVR_ACTIVE":
+ case "System_RVR_ACTIVE_WITH_EFM":
+ case "System_RVR_ACTIVE_NO_EFM":
+ winkProperties = {
+ "style": "style03",
+ "text1Id": "Siri"
+ };
+ break;
+ default:
+ // Display default Wink
+ log.debug("No properties found for wink: " + alert);
+ break;
+ }
+ // return the properties to Common
+ return winkProperties;
+};
+///////////////////////////////////////////////////////////////////////////////
+// Initialize various menu data lists
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._initEntertainmentDataList = function() {
+ var items = [];
+ if (framework.localize.getRegion() === framework.localize.REGIONS.Japan) {
+ // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
+ // add it if the region is Japan.
+ items.push({ appData: { appName: 'amradio', isVisible: true, audioSourceId: 'TrafficInfo', mmuiEvent: 'SelectTrafficAlert' }, text1Id: 'TrafficAlertsItem', disabled: true, itemStyle: 'style01', hasCaret: false });
+ }
+
+ items.push(
+ { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'xmaudio', isVisible : false, audioSourceId : 'XmAudio', mmuiEvent : 'SelectXmAudio' }, text1Id : 'XMAudio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'carplay', isVisible : false, audioSourceId : 'CarPlay', mmuiEvent : 'SelectCarPlay' }, text1Id : 'USB1CarPlay', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'androidauto', isVisible : false, audioSourceId : 'AndroidAuto', mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'USB1AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false }
+ );
+
+ // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
+ //
+ // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
+ // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
+ this._masterEntertainmentDataList = {
+ items: items
+ };
+ // TODO:set this._USB1AAIndex and this._USB1CPIndex values like this._USB1EntIndex
+ for (i = 0; i < this._masterEntertainmentDataList.items.length; i++) {
+ if (this._masterEntertainmentDataList.items[i].appData.audioSourceId == 'USB_A') {
+ this._USB1EntIndex = i;
+ }
+ if (this._masterEntertainmentDataList.items[i].appData.audioSourceId == 'USB_B') {
+ this._USB2EntIndex = i;
+ }
+ }
+ if (this._masterEntertainmentDataList.items[this._USB1EntIndex].text1Id != "UsbAudioA") {
+ log.error("Wrong index stored for USB1. TextId at the index " + this._USB1EntIndex + " is " + this._masterEntertainmentDataList.items[this._USB1EntIndex].text1Id);
+ }
+ if (this._masterEntertainmentDataList.items[this._USB2EntIndex].text1Id != "UsbAudioB") {
+ log.error("Wrong index stored for USB2. TextId at the index " + this._USB2EntIndex + " is " + this._masterEntertainmentDataList.items[this._USB2EntIndex].text1Id);
+ }
+};
+systemApp.prototype._initApplicationsDataList = function() {
+ var items = [];
+ this._vehicleConfigurationType = null;
+ this._vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ log.info("this._vehicleConfigurationType " + this._vehicleConfigurationType);
+ items.push(
+ { appData : { appName : 'xmdata', isVisible : false, audioSourceId : 'None', mmuiEvent : 'SelectXmData' }, text1Id : 'XMData', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'hdtrafficimage', isVisible : false, audioSourceId : 'None', mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'idm', isVisible : false, audioSourceId : 'None', mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'ecoenergy', isVisible : true, audioSourceId : 'None', mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'driverid', isVisible : false, audioSourceId : 'None', mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'warnguide', isVisible : true, audioSourceId : 'None', mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
+ { appData : { appName : 'vsm', isVisible : false, audioSourceId : 'None', mmuiEvent : 'SelectEngineOilLevel' }, text1Id : 'EngineOilLevel', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'schedmaint', isVisible : true, audioSourceId : 'None', mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
+ { appData : { appName : 'vehicleStatus', isVisible : false, audioSourceId : 'None', mmuiEvent : 'SelectVehicleStatusMonitor' }, text1Id : 'VehicleStatusMonitor', disabled : false, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
+ { appData : { appName : 'vdt_settings', isVisible : false, audioSourceId : 'None', mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'vdt', isVisible : false, audioSourceId : 'None', mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'carplay', isVisible : false, audioSourceId : 'CarPlay', mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'androidauto', isVisible : false, audioSourceId : 'AndroidAuto', mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
+ );
+
+ // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
+ //
+ // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
+ // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
+ this._masterApplicationDataList = {
+ items: items
+ };
+ this._updateApplicationStructure(this._vehicleConfigurationType);
+ // Keep the index of vehicleStatus ready to be used during enable/disable and visible/hidden of this item.
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if (this._masterApplicationDataList.items[i].appData.appName === "vehicleStatus") {
+ this._indexOfVSMApp = i;
+ }
+ }
+};
+systemApp.prototype._initCommunicationsDataList = function() {
+ var items = [];
+
+ items.push(
+ { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
+ { appData : { appName : 'notifications', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
+ { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
+ { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
+ { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
+ { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
+ );
+
+ // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
+ //
+ // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
+ // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
+ this._communicationsDataList = {
+ items: items
+ };
+};
+///////////////////////////////////////////////////////////////////////////////
+// Message handlers, helpers
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._StatusPhoneCallMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus) {
+ // Add or remove the Active Call item in the communications menu
+ var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
+ var dirty = false;
+ if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall') {
+ this._communicationsDataList.items[0].appData.isVisible = true;
+ dirty = true;
+ } else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall' &&
+ this._communicationsDataList.items[0].appData.isVisible === true) {
+ this._communicationsDataList.items[0].appData.isVisible = false;
+ dirty = true;
+ }
+ // If it changed, and we are in the Comm ctxt, update the list shown
+ if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate) {
+ //build list (which will exclude isVisible==false items)
+ var dataList = this._buildCommunicationDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ }
+};
+systemApp.prototype._StatusMenuMsgHandler = function(msg) {
+ log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
+ // Update menu items associated with the given appName of the message. Menu items can appear
+ // in several different contexts or appear multiple times: this function searches all those places.
+ var appName = msg.params.payload.statusMenu.appName;
+ var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
+ //Update the Availability Status of Speed Restricted Apps
+ this._StatusMenuChanged(appName, isDisabled);
+ // Update the static menu lists so they are correctly enable next time the context is shown
+ this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
+ this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
+ this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
+
+ // check if we should worry about speed restriction for carplay/androidauto icon
+ //For car play/android auto app _setRemoteButtonIcon is called to display or hide car play/android auto icon in status bar
+ if (appName === "carplay" || appName === "androidauto") {
+ this._setRemoteUIButton(appName,!isDisabled);
+ }
+
+ // Update the menu list in the current context if needed
+ if (this._currentContext) {
+ switch (this._currentContext.ctxtId) {
+ case "Communication":
+ case "Entertainment":
+ case "Applications":
+ case "VehicleStatusMonitor":
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ var dataList = this._currentContextTemplate.list2Ctrl.dataList;
+ for (var i = 0; i < dataList.items.length; ++i) {
+ var updateListForCarPlay = false;
+ // change only for entertainment list // make better change later
+ if ((appName === "carplay" && (dataList.items[i].text1Id == 'USB1CarPlay' || dataList.items[i].text1Id == 'UsbAudioA')) ||
+ (appName === "androidauto" && (dataList.items[i].text1Id == 'USB1AndroidAuto' || dataList.items[i].text1Id == 'UsbAudioA'))) {
+ updateListForCarPlay = true;
+ // if carplay is available change state of USB1 (carPlay disabled -> USB enabled and vice-a-versa)
+ if (isDisabled) {
+ // replace ietm with USB. Master list is already upto date. Updated with _enableAppListItem()
+ dataList.items[i] = this._masterEntertainmentDataList.items[this._USB1EntIndex];
+ // retain usb state
+ isDisabled = this._masterEntertainmentDataList.items[this._USB1EntIndex].disabled;
+ } else {
+ // TODO:refer to this._USB1AAIndex and this._USB1CPIndex values
+ var CPorAAIndex = this._USB1EntIndex - 2;
+ if (appName == "androidauto") {
+ CPorAAIndex = this._USB1EntIndex - 1;
+ }
+ dataList.items[i] = this._masterEntertainmentDataList.items[CPorAAIndex];
+ // code below will take care of updating disable/enable status
+ }
+ }
+ if (dataList.items[i].appData.appName.indexOf(appName) === 0 || updateListForCarPlay) {
+ if (this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
+ {
+ var speedRestrictedAppName = null;
+ var isNoAppAtSpeed = true;
+ for (var j = 0; j < this._SpeedRestrictedApps.length; ++j) {
+ speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
+ log.info("speedRestrictedAppName : " + speedRestrictedAppName + " checking for AppName : " + dataList.items[i].appData.appName);
+ if (speedRestrictedAppName === dataList.items[i].appData.appName) {
+ isNoAppAtSpeed = false; // App found with At Speed
+ break;
+ }
+ }
+ if (isNoAppAtSpeed) {
+ dataList.items[i].disabled = isDisabled;
+ if (isDisabled) {
+ // Clear nowplaying icon just in case it was still shown for this now unavailable item
+ dataList.items[i].image1 = "";
+ }
+ this._currentContextTemplate.list2Ctrl.updateItems(i, i);
+ }
+ } else {
+ dataList.items[i].disabled = isDisabled;
+ if (isDisabled) {
+ // Clear nowplaying icon just in case it was still shown for this now unavailable item
+ dataList.items[i].image1 = "";
+ }
+ this._currentContextTemplate.list2Ctrl.updateItems(i, i);
+ }
+ log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
+ }
+ }
+ }
+ break;
+ }
+ }
+};
+systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList) {
+ for (var i = 0; i < dataList.items.length; ++i) {
+ if (dataList.items[i].appData.appName.indexOf(appName) === 0) {
+ if (this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
+ {
+ var speedRestrictedAppName = null;
+ var isNoAppAtSpeed = true;
+ for (var j = 0; j < this._SpeedRestrictedApps.length; ++j) {
+ speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
+ log.info("speedRestrictedAppName : " + speedRestrictedAppName + " checking for AppName : " + dataList.items[i].appData.appName);
+ if (speedRestrictedAppName === dataList.items[i].appData.appName) {
+ isNoAppAtSpeed = false; // App found with At Speed
+ break;
+ }
+ }
+ if (isNoAppAtSpeed) {
+ dataList.items[i].disabled = isDisabled;
+ }
+ } else {
+ dataList.items[i].disabled = isDisabled;
+ }
+ // change only for entertainment list // make better change later
+ if (dataList.items[i].text1Id == 'USB1CarPlay' || dataList.items[i].text1Id == 'USB1AndroidAuto') {
+ // if carplay is available change state of USB1 (carPlay disabled -> USB enabled and vice-a-versa)
+ dataList.items[i].appData.isVisible = !isDisabled;
+ // next one should be usb1Audio.
+ // bad practive - hardcoded values
+ dataList.items[this._USB1EntIndex].appData.isVisible = isDisabled;
+ }
+ log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
+ }
+ }
+ //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
+ //Reading the value again and checking the same with existing one.
+ var vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
+ if (vehicleConfigurationType !== this._vehicleConfigurationType) {
+ log.info("VehicleConfigurationType is changed to " + vehicleConfigurationType);
+ this._vehicleConfigurationType = vehicleConfigurationType;
+ this._updateApplicationStructure(vehicleConfigurationType);
+ }
+};
+systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList) {
+ for (var i = 0; i < dataList.items.length; ++i) {
+ if (dataList.items[i].appData.appName === appName) {
+ log.info("AppName : " + appName + " is found for making it disabled : " + isDisabled);
+ dataList.items[i].disabled = isDisabled;
+ log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
+ }
+ }
+};
+systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
+ var appName = msg.params.payload.appName;
+ var isVisible = msg.params.payload.state === "Visible";
+ // Search entertainment items
+ var isEntertainmentDirty = false;
+ for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i) {
+ if (this._masterEntertainmentDataList.items[i].appData.appName === appName &&
+ this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible) {
+ isEntertainmentDirty = true;
+ if (appName != "carplay" && appName != "androidauto") {
+ this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
+ } else {
+ // visibility does not depend on this flag. // using status menu msg
+ this._masterEntertainmentDataList.items[i].appData.isVisible = false;
+ }
+ }
+ }
+ // Update the Entertainment context if it is currently displayed.
+ if (isEntertainmentDirty &&
+ this._currentContext &&
+ this._currentContext.ctxtId === "Entertainment" &&
+ this._currentContextTemplate) {
+ var dataList = this._buildEntertainmentDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ // Search application items
+ var isApplicationsDirty = false;
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if (this._masterApplicationDataList.items[i].appData.appName === appName &&
+ this._masterApplicationDataList.items[i].appData.isVisible != isVisible) {
+ isApplicationsDirty = true;
+ this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
+ }
+ }
+ //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
+ //Reading the value again and checking the same with existing one.
+ var vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
+ if (vehicleConfigurationType !== this._vehicleConfigurationType) {
+ log.info("VehicleConfigurationType is changed to " + vehicleConfigurationType);
+ this._vehicleConfigurationType = vehicleConfigurationType;
+ this._updateApplicationStructure(vehicleConfigurationType);
+ }
+ //If any app inside the VehicleStatusMonitor context is visible then VehicleStatusMonitor will also be visible in Application.
+ var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames["VehicleStatusMonitor"];
+ var isVehicleStatusMonitorVisible = false;
+ for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j) {
+ var applicationsCtxtWiseAppName = applicationsCtxtWiseAppNames[j];
+ for (var k = 0; k < this._masterApplicationDataList.items.length; ++k) {
+ if ((this._masterApplicationDataList.items[k].appData.appName === applicationsCtxtWiseAppName) &&
+ this._masterApplicationDataList.items[k].appData.isVisible) {
+ isApplicationsDirty = true;
+ isVehicleStatusMonitorVisible = this._masterApplicationDataList.items[k].appData.isVisible;
+ break;
+ }
+ }
+ }
+ //update the visiblity of VehicleStatusMonitor on basis of visible status of application(s) inside VehicleStatusMonitor context.
+ this._masterApplicationDataList.items[this._indexOfVSMApp].appData.isVisible = isVehicleStatusMonitorVisible;
+ // Update the Applications context or VehicleStatusMonitor context if it is currently displayed.
+ if (isApplicationsDirty &&
+ this._currentContext &&
+ (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
+ this._currentContextTemplate) {
+ var dataList = this._buildApplicationsDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ // Now that we are listening to StatusMenuVisible for Comm items (for email only)
+ // we want to ensure any messages sent by other apps that were previously ignored are still ignored
+ // Shoki6 ONLY
+ if (appName === "email" || appName === "sms" || appName === "notifications") {
+ // Search communication items - avalajh
+ var isCommunicationDirty = false;
+ for (var i = 0; i < this._communicationsDataList.items.length; ++i) {
+ if (this._communicationsDataList.items[i].appData.appName === appName &&
+ this._communicationsDataList.items[i].appData.isVisible != isVisible) {
+ isCommunicationDirty = true;
+ this._communicationsDataList.items[i].appData.isVisible = isVisible;
+ }
+ }
+ // Update the Communication context if it is currently displayed.
+ if (isCommunicationDirty &&
+ this._currentContext &&
+ this._currentContext.ctxtId === "Communication" &&
+ this._currentContextTemplate) {
+ var dataList = this._buildCommunicationDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ }
+ }
+};
+systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio) {
+ // Update cached values for the USB device status
+ var status = msg.params.payload.statusMenuUSBAudio;
+ var mmuiEvent = "";
+ var textIdWithDevice = "";
+ var textIdWithoutDevice = "";
+ var masterIndex = -1;
+ if (status.usbAB === "USB_A") {
+ mmuiEvent = "SelectUSBA";
+ textIdWithDevice = "UsbAudioAWithDevice";
+ textIdWithoutDevice = "UsbAudioA";
+ } else if (status.usbAB === "USB_B") {
+ mmuiEvent = "SelectUSBB";
+ textIdWithDevice = "UsbAudioBWithDevice";
+ textIdWithoutDevice = "UsbAudioB";
+ }
+ // Update the master entertainment data list which contains all items
+ for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i) {
+ if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent) {
+ masterIndex = i;
+ var isAvailable = status.statusMenu.appStatus === "Available";
+ var name = status.displayName;
+ this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
+ if (isAvailable && typeof name === 'string' && name.length > 0) {
+ this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
+ this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
+ } else {
+ this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
+ this._masterEntertainmentDataList.items[i].text1SubMap = null;
+ }
+ if (!isAvailable) {
+ // Clear nowplaying icon just in case it was still shown for this now unavailable item
+ this._masterEntertainmentDataList.items[i].image1 = "";
+ }
+ }
+ }
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ for (var i = 0; i < list.dataList.items.length; ++i) {
+ if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent) {
+ list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
+ list.updateItems(i, i);
+ }
+ }
+ }
+ }
+};
+/*
+ * Sets the remote UI button
+ * @param msg object
+ */
+systemApp.prototype._setRemoteUIButton = function(appName, enabled) {
+ var config = {
+ "ctxtList": ['HomeScreen'],
+ "iconPath": null,
+ "selectCallback": this._remoteUIButtonSelected.bind(this),
+ "onFocusCallback": this._remoteUIButtonFocused.bind(this),
+ "appData": null,
+ "appName": null
+ };
+ log.debug("_setRemoteUIButton: appName=" + appName + ", enabled=" + enabled);
+ // set CarPlay image path, event and name.
+ if (appName === "carplay") {
+ config.iconPath = "apps/system/images/AppleCP_Active.png";
+ config.appData = "SelectCarPlay";
+ config.appName = "carplay";
+ }
+ // set AndroidAuto image path, event and name.
+ else if (appName === "androidauto") {
+ config.iconPath = "apps/system/images/Android_Auto_Active.png";
+ config.appData = "SelectAndroidAuto";
+ config.appName = "androidauto";
+ }
+ framework.common.setRemoteUiButton(this.uiaId, enabled, config);
+ // TODO: Workaround: Add better logic involving common. Focus should not be gained by app iteself mutually. Can be given by common (handleControllerEvents) or stolen (stealFocus).
+ this._sendRemoteUiButtonStatus(enabled);
+};
+/*
+ * Callback for the remote UI button
+ * @param ctrlObj (Object) Reference to the remote button
+ * @param appData (Object) Data passed in by the app
+ * @param params (Object) params contains label for the selected button
+ */
+systemApp.prototype._remoteUIButtonSelected = function(ctrlObj, appData, params) {
+ /*
+ if(!params)
+ {
+ log.warn("_remoteUIButtonSelected: params value is null");
+ return;
+ }
+ */
+ // log.debug("_remoteUIButtonSelected: params.statusBtn=" + params.statusBtn + ", appData=" + appData + ", uiaId=" + this.uiaId);
+ log.debug("_remoteUIButtonSelected: appData=" + appData + ", uiaId=" + this.uiaId);
+ // if(params.statusBtn == "carplay" || params.statusBtn == "androidauto")
+ if (appData == "SelectCarPlay" || appData == "SelectAndroidAuto") {
+ framework.sendEventToMmui(this.uiaId, appData);
+ }
+};
+/*
+ * FocusCallback for the remote UI button.
+ * @param ctrlObj (Object) Reference to the remote button
+ * @param appData (Object) App specific data Data passed to control in button config
+ * @param params (Object) params contains label for the selected button
+ */
+systemApp.prototype._remoteUIButtonFocused = function(ctrlObj, appData, params) {
+ /*
+ if(!params)
+ {
+ log.warn("_remoteUIButtonFocused: params value is null");
+ return;
+ }
+ */
+ // if((params.statusBtn == "carplay" || params.statusBtn == "androidauto") && this._currentContext && this._currentContext.ctxtId === "HomeScreen" && this._currentContextTemplate)
+ if ((appData == "SelectCarPlay" || appData == "SelectAndroidAuto") && this._currentContext && this._currentContext.ctxtId === "HomeScreen" && this._currentContextTemplate) {
+ var text = null;
+ // if(params.statusBtn == "carplay")
+ if (appData == "SelectCarPlay") {
+ text = framework.localize.getLocStr("common", "AppleCarPlay");
+ }
+ // else if(params.statusBtn == "androidauto")
+ else if (appData == "SelectAndroidAuto") {
+ text = framework.localize.getLocStr("common", "AndroidAuto");
+ }
+ this._currentContextTemplate.mainMenuControl.setText(text);
+ }
+};
+// TODO: Workaround: Add better logic involving common. Focus should not be gained by app iteself mutually. Can be given by common (handleControllerEvents) or stolen (stealFocus).
+// It sends remoteUiButton enable/disable status to mainMenuCtrl
+systemApp.prototype._sendRemoteUiButtonStatus = function(enabled) {
+ if (this._currentContext && this._currentContext.ctxtId === "HomeScreen" && this._currentContextTemplate) {
+ this._currentContextTemplate.mainMenuControl.getRemoteUiButtonStatus(enabled);
+ }
+};
+systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ var masterIndex = -1;
+ // Update the master entertainment data list which contains all items
+ for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i) {
+ if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio") {
+ masterIndex = i;
+ var isAvailable = msg.params.payload.appStatus === "Available";
+ var deviceName = msg.params.payload.deviceName;
+ // NOTE: This message does not enable/disable the BTAudio menu item.
+ // (The StatusMenu message will enable it on startup.)
+ if (isAvailable && typeof deviceName === "string" && deviceName.length > 0) {
+ this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
+ this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
+ } else {
+ this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
+ this._masterEntertainmentDataList.items[i].text1SubMap = null;
+ }
+ if (!isAvailable) {
+ // Clear nowplaying icon just in case it was still shown for this now unavailable item
+ this._masterEntertainmentDataList.items[i].image1 = "";
+ }
+ }
+ }
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ for (var i = 0; i < list.dataList.items.length; ++i) {
+ if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio") {
+ list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
+ list.updateItems(i, i);
+ }
+ }
+ }
+ }
+};
+systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
+ // Determine correct text ID, based on vehicle fuel type
+ var fuelType = msg.params.payload.fuelType;
+ var newText1Id;
+ switch (fuelType) {
+ case "HEV":
+ newText1Id = "EcoenergyAppHEV";
+ break;
+ case "GAS":
+ default:
+ newText1Id = "EcoenergyApp";
+ break;
+ }
+ // Search application items for the "ecoenergy" application
+ var isApplicationsDirty = false;
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
+ (this._masterApplicationDataList.items[i].text1Id != newText1Id)) {
+ // Found the app, and it's text ID needs to change, so change it
+ isApplicationsDirty = true;
+ this._masterApplicationDataList.items[i].text1Id = newText1Id;
+ }
+ }
+ // Update the Applications context if it is currently displayed.
+ if (isApplicationsDirty &&
+ this._currentContext &&
+ (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
+ this._currentContextTemplate) {
+ var dataList = this._buildApplicationsDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ }
+};
+// Handle message to update the notification counts in the Communication context.
+systemApp.prototype._StatusUpdateNotificationsHandler = function(msg) {
+ if (msg.params && msg.params.payload && msg.params.payload.messageCounts) {
+ // Update message counts and the notifications list item displayed in the Communication menu
+ var countEmail = msg.params.payload.messageCounts.countEmail;
+ var countSMS = msg.params.payload.messageCounts.countSMS;
+ var total = countEmail + countSMS;
+ var showMessageIcon = total > 0;
+ framework.common.setSbIcon("Message", showMessageIcon);
+ for (var i = 0; i < this._communicationsDataList.items.length; ++i) {
+ switch (this._communicationsDataList.items[i].appData.mmuiEvent) {
+ case 'SelectNotifications':
+ this._communicationsDataList.items[i].disabled = (total === 0);
+ this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
+ break;
+ case 'SelectSms':
+ this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
+ break;
+ case 'SelectEmail':
+ this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
+ break;
+ }
+ }
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate) {
+ var dataList = this._buildCommunicationDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ }
+};
+systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function() {
+ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
+ var params = {
+ sbnStyle: 'Style02',
+ text1Id: 'VoiceRecognition',
+ imagePath1: 'apps/system/images/IcnSiriSBN.png'
+ };
+ framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
+};
+systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function() {
+ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
+ var params = {
+ sbnStyle: 'Style01',
+ text1Id: 'ErrorWhileStartingSiri',
+ };
+ framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
+};
+//If VR is not ready after Disclaimer then display SBN
+systemApp.prototype._TimedSBN_VRLoadingMsgHandler = function() {
+ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
+ var params = {
+ sbnStyle: 'Style02',
+ text1Id: 'common.SbnVoiceLoading',
+ imagePath1: 'common/images/icons/IcnSbnMicUnavail.png'
+ };
+ framework.common.startTimedSbn(this.uiaId, 'VoiceRecoLoading', "vrStatus", params);
+};
+systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function() {
+ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
+ var params = {
+ sbnStyle: 'Style02',
+ text1Id: 'VoiceNotSupported',
+ imagePath1: 'common/images/icons/IcnSbnMicUnavail.png'
+ };
+ framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
+};
+systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function() {
+ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
+};
+systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ var params = {
+ sbnStyle: 'Style02',
+ imagePath1: 'common/images/icons/IcnListBtConnType_Music.png'
+ };
+ switch (msg.params.payload.audioSource) {
+ case "BTAudio":
+ case "Pandora":
+ case "Stitcher":
+ case "AhaRadio":
+ params.text1Id = "AudioSourceNotAvailableBTAudio";
+ break;
+ case "USBAudio":
+ case "USB_A":
+ case "USB_B":
+ params.text1Id = "AudioSourceNotAvailableUSB";
+ break;
+ case "CD":
+ params.text1Id = "AudioSourceNotAvailableCD";
+ break;
+ case "DVD":
+ params.text1Id = "AudioSourceNotAvailableDVD";
+ break;
+ case "TV":
+ params.text1Id = "AudioSourceNotAvailableTV";
+ break;
+ }
+ framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
+ }
+};
+systemApp.prototype._updateApplicationsNowPlayingIcon = function(audioSource, isPlaying, dataList) {
+ for (var i = 0; i < dataList.items.length; ++i) {
+ if (isPlaying) {
+ // Set the icon on the audioSource item and clearing it on all other items
+ dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
+ } else {
+ // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
+ // "Off" and "Play" messages do not necessarily come in that order.
+ if (dataList.items[i].appData.audioSourceId === audioSource) {
+ dataList.items[i].image1 = "";
+ }
+ }
+ }
+};
+systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList) {
+ for (var i = 0; i < dataList.items.length; ++i) {
+ if (isPlaying) {
+ // Set the icon on the audioSource item and clearing it on all other items
+ dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
+ } else {
+ // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
+ // "Off" and "Play" messages do not necessarily come in that order.
+ if (dataList.items[i].appData.audioSourceId === audioSource) {
+ dataList.items[i].image1 = "";
+ }
+ }
+ }
+};
+systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ var audioSource = msg.params.payload.statusAudio.audioSource;
+ var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
+ // Set the icon in the masterEntertainment data list so it is persisted between template instances
+ this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
+ list.updateItems(0, list.dataList.items.length - 1);
+ }
+ // Set the icon in the masterApplications data list so it is persisted between template instances
+ this._updateApplicationsNowPlayingIcon(audioSource, isPlaying, this._masterApplicationDataList);
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Applications" && this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ this._updateApplicationsNowPlayingIcon(audioSource, isPlaying, list.dataList);
+ list.updateItems(0, list.dataList.items.length - 1);
+ }
+ }
+};
+systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg) {
+ var count = "";
+ if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0) {
+ count = msg.params.payload.missedCallCount.toString();
+ }
+ // Update this._communicationsDataList
+ for (var i = 0; i < this._communicationsDataList.items.length; ++i) {
+ if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory") {
+ this._communicationsDataList.items[i].label1 = count;
+ }
+ }
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ for (var i = 0; i < list.dataList.items.length; ++i) {
+ if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory") {
+ list.dataList.items[i].label1 = count;
+ list.updateItems(i, i);
+ }
+ }
+ }
+};
+systemApp.prototype._WarningStatusCountMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ var count = "";
+ var icon = "";
+ if (msg.params.payload.warningcount > 0) {
+ count = msg.params.payload.warningcount.toString();
+ icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
+ }
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide") {
+ this._masterApplicationDataList.items[i].label1 = count;
+ this._masterApplicationDataList.items[i].image2 = icon;
+ }
+ // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
+ this._vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New") {
+ //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
+ if (this._SchedMaintDueStatus) {
+ this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
+ } else {
+ this._masterApplicationDataList.items[i].image2 = icon;
+ }
+ }
+ }
+ // Update current context if needed
+ if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
+ this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ for (var i = 0; i < list.dataList.items.length; ++i) {
+ if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide") {
+ list.dataList.items[i].label1 = count;
+ list.dataList.items[i].image2 = icon;
+ list.updateItems(i, i);
+ }
+ if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New") {
+ //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
+ if (this._SchedMaintDueStatus) {
+ icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
+ }
+ list.dataList.items[i].image2 = icon;
+ list.updateItems(i, i);
+ }
+ }
+ }
+ }
+};
+systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ var isDue = msg.params.payload.due;
+ var warningCountValue = null;
+ //Caching the Due Status to be used in _WarningStatusCountMsgHandler.
+ this._SchedMaintDueStatus = isDue;
+ this._vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ // Update the master list
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint") {
+ if (isDue) {
+ this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
+ } else {
+ this._masterApplicationDataList.items[i].image2 = "";
+ }
+ }
+ // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
+ else if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New") {
+ var WarnGuidanceAppItem = utility.getArrayItemByPropertyValue(this._masterApplicationDataList.items, "text1Id", "WarnGuidanceApp");
+ if (WarnGuidanceAppItem && WarnGuidanceAppItem.item && WarnGuidanceAppItem.item.label1) {
+ warningCountValue = WarnGuidanceAppItem.item.label1;
+ }
+ //IF is Due is true and not having any image in image2 then need to show Amber icon.
+ if (isDue && !this._masterApplicationDataList.items[i].image2) {
+ this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
+ }
+ //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
+ else if (!isDue && !warningCountValue) {
+ this._masterApplicationDataList.items[i].image2 = "";
+ } else {
+ //DO nothing
+ }
+ }
+ }
+ // Update the current context if needed
+ if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
+ this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ for (var i = 0; i < list.dataList.items.length; ++i) {
+ if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint") {
+ if (isDue) {
+ list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
+ } else {
+ list.dataList.items[i].image2 = "";
+ }
+ list.updateItems(i, i);
+ }
+ // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
+ else if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New") {
+ //IF is Due is true and not having any image in image2 then need to show Amber icon.
+ if (isDue && !list.dataList.items[i].image2) {
+ list.dataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
+ }
+ //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
+ else if (!isDue && !warningCountValue) {
+ list.dataList.items[i].image2 = "";
+ } else {
+ //Do Nothing
+ }
+ list.updateItems(i, i);
+ }
+ }
+ }
+ }
+};
+systemApp.prototype._AtSpeedMsgHandler = function(msg) {
+ //At speed will disable the speed Restricted items
+ this._AtSpeedDisabled = true;
+ this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
+};
+systemApp.prototype._NoSpeedMsgHandler = function(msg) {
+ //At speed will Enable the speed Restricted items
+ this._AtSpeedDisabled = false;
+ this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
+};
+/**************************
+ * Control callbacks
+ **************************/
+/*
+ * Callback for the Main Menu Context icon button clicks
+ * @param mainMenuObj (Object) Reference to the MainMenuCtrl
+ * @param appData (Object) Data passed in by the app when the control was instantiated
+ * @param params (Object) Contains label for the selected icon
+ */
+systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params) {
+ log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
+ var icon = params.icon;
+ switch (icon) {
+ case "app":
+ framework.sendEventToMmui(this.uiaId, "SelectApplications");
+ break;
+ case "com":
+ framework.sendEventToMmui(this.uiaId, "SelectCommunication");
+ break;
+ case "ent":
+ framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
+ break;
+ case "nav":
+ framework.sendEventToMmui(this.uiaId, "SelectNavigation");
+ break;
+ case "set":
+ framework.sendEventToMmui(this.uiaId, "SelectSettings");
+ break;
+ }
+};
+/*
+ * Select callback for Applications, Communication, and Entertainment contexts.
+ * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
+ */
+systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params) {
+ framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
+};
+///////////////////////////////////////////////////////////////////////////////
+// Communication
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._CommCtxtContextIn = function() {
+ var scrollTo = 0;
+ // We cannot use the data list in the current context here, becuase it doesn't exist yet
+ // so we use _buildCommunicationDataList() just like _readyCommunications() will
+ var dataList = this._buildCommunicationDataList();
+ // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
+ var any = false;
+ for (var i = 0; i < dataList.items.length - 1; ++i) {
+ if (dataList.items[i].disabled === false) {
+ any = true;
+ }
+ }
+ if (any === false) {
+ var lastIndex = dataList.items.length - 1;
+ if (dataList.items[lastIndex].disabled === false) {
+ scrollTo = lastIndex;
+ }
+ }
+ this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
+ this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
+};
+///////////////////////////////////////////////////////////////////////////////
+// Applications
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readyApplications = function() {
+ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
+ if (this._currentContext && this._currentContextTemplate) {
+ this._AtSpeedDisabled = framework.common.getAtSpeedValue();
+ var dataList = this._buildApplicationsDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ // Checking for Speed Restricted Items For Applications Screen
+ this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
+ }
+};
+// Build list data from this._masterApplicationDataList based on the currently visible items.
+systemApp.prototype._buildApplicationsDataList = function() {
+ var dataList = {
+ itemCountKnown: true,
+ itemCount: 0,
+ items: [],
+ vuiSupport: true
+ };
+ //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
+ //Reading the value again and checking the same with existing one.
+ var vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
+ if (vehicleConfigurationType !== this._vehicleConfigurationType) {
+ log.info("VehicleConfigurationType is changed to " + vehicleConfigurationType);
+ this._updateApplicationStructure(vehicleConfigurationType);
+ }
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if (this._masterApplicationDataList.items[i].appData.isVisible) {
+ var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames[this._currentContext.ctxtId];
+ for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j) {
+ if (applicationsCtxtWiseAppNames[j] === this._masterApplicationDataList.items[i].appData.appName) {
+ dataList.items.push(this._masterApplicationDataList.items[i]);
+ }
+ }
+ }
+ }
+ dataList.itemCount = dataList.items.length;
+ return dataList;
+};
+///////////////////////////////////////////////////////////////////////////////
+// Entertainment
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readyEntertainment = function() {
+ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
+ if (this._currentContext && this._currentContextTemplate) {
+ this._AtSpeedDisabled = framework.common.getAtSpeedValue();
+ var dataList = this._buildEntertainmentDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ // Checking for Speed Restricted Items For Entertainment Screen
+ this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
+ }
+};
+// Build list data from this._masterEntertainmentDataList based on the currently visible items.
+systemApp.prototype._buildEntertainmentDataList = function() {
+ var dataList = {
+ itemCountKnown: true,
+ itemCount: 0,
+ items: [],
+ vuiSupport: true
+ };
+ for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i) {
+ if (this._masterEntertainmentDataList.items[i].appData.isVisible) {
+ dataList.items.push(this._masterEntertainmentDataList.items[i]);
+ }
+ }
+ dataList.itemCount = dataList.items.length;
+ return dataList;
+};
+///////////////////////////////////////////////////////////////////////////////
+// Communication - avalajh
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readyCommunication = function() {
+ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
+ if (this._currentContext && this._currentContextTemplate) {
+ this._AtSpeedDisabled = framework.common.getAtSpeedValue();
+ var dataList = this._buildCommunicationDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ // Checking for Speed Restricted Items For Communication Screen
+ this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
+ }
+};
+// Build list data from this._communicationsDataList based on the currently visible items.
+systemApp.prototype._buildCommunicationDataList = function() {
+ var dataList = {
+ itemCountKnown: true,
+ itemCount: 0,
+ items: [],
+ vuiSupport: true
+ };
+ for (var i = 0; i < this._communicationsDataList.items.length; ++i) {
+ if (this._communicationsDataList.items[i].appData.isVisible) {
+ dataList.items.push(this._communicationsDataList.items[i]);
+ }
+ }
+ dataList.itemCount = dataList.items.length;
+ return dataList;
+};
+///////////////////////////////////////////////////////////////////////////////
+// NoConnectionNotify
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params) {
+ switch (this._currentContext.ctxtId) {
+ case 'NoConnectionNotify':
+ switch (appData) {
+ case 'SelectConnect':
+ framework.sendEventToMmui("system", appData);
+ break;
+ case 'Global.No':
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// NotifyDialog
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function() {
+ if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData) {
+ this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
+ }
+};
+systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function() {
+ // Start timer to dismiss the notification if the user doesn't respond
+ var self = this;
+ this._NotifyDialogTimeoutId = setTimeout(function() {
+ this._NotifyDialogTimeoutId = null;
+ framework.sendEventToMmui(self.uiaId, "Timeout");
+ }, 10000);
+};
+systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function() {
+ if (this._NotifyDialogTimeoutId !== null) {
+ clearTimeout(this._NotifyDialogTimeoutId);
+ this._NotifyDialogTimeoutId = null;
+ }
+};
+systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params) {
+ if (this._NotifyDialogTimeoutId !== null) {
+ clearTimeout(this._NotifyDialogTimeoutId);
+ this._NotifyDialogTimeoutId = null;
+ }
+ switch (appData) {
+ case "Global.No":
+ framework.sendEventToMmui("common", appData);
+ break;
+ case "SelectNotifyOff":
+ framework.sendEventToMmui(this.uiaId, appData);
+ break;
+ case "SelectNotifyMessage":
+ if (this._currentContext.params && this._currentContext.params.payload) {
+ var paramsData = {
+ payload: {
+ messageId: this._currentContext.params.payload.messageNotifyData.messageId,
+ messageNotifyType: this._currentContext.params.payload.messageNotifyData.messageNotifyType
+ }
+ };
+ framework.sendEventToMmui(this.uiaId, appData, paramsData);
+ }
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// NotificationListRetry
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Cancel":
+ framework.sendEventToMmui("common", appData);
+ break;
+ case "SelectRetry":
+ framework.sendEventToMmui(this.uiaId, appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// NotificationList
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readyNotificationList = function(readyParams) {
+ log.debug("_readyNotificationList called...");
+ if (readyParams) {
+ readyParams.skipRestore = true;
+ }
+ var params = {
+ "context_in": 0,
+ // typedef enum MSG_client_type_e
+ // {
+ // /// Used for min valid values range check
+ // MSG_CLIENT_MIN = 0,
+ // /// Invalid value of 0
+ // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
+ // /// Email client
+ // MSG_CLIENT_EMAIL,
+ // /// SMS/MMS client
+ // MSG_CLIENT_SMS,
+ // /// Settings client
+ // MSG_CLIENT_SETTINGS,
+ // /// Notifications client
+ // MSG_CLIENT_NOTIFICATIONS,
+ // /// Used for max valid values range check
+ // MSG_CLIENT_MAX
+ // } MSG_client_type_t;
+ "client_type_in": 4,
+ "callbacks_in": 0
+ };
+ framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
+};
+systemApp.prototype._noLongerDisplayedNotificationList = function() {
+ this._closeMsgApiConnection();
+};
+systemApp.prototype._msgConnectCallback = function(msg) {
+ if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100) {
+ this._msgApiConnection = msg.params.connection;
+ var params = {
+ "connection_in": this._msgApiConnection,
+ "context_in": 0,
+ "request_type": 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
+ };
+ framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
+ } else {
+ log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
+ framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
+ this._closeMsgApiConnection();
+ }
+};
+systemApp.prototype._msgGetNewMessagesListCallback = function(msg) {
+ if (msg && msg.msgType === "methodResponse" && msg.params) {
+ switch (msg.params.status) {
+ // Successful retrieval w/ messages
+ case 100:
+ {
+ log.info("####AppSDK Success####");
+ this._closeMsgApiConnection();
+ var messages = msg.params.message_list.messages;
+ var dataList = {
+ itemCountKnown: true,
+ itemCount: 0,
+ items: [],
+ vuiSupport: true
+ };
+ for (var i = 0; i < messages.length; i++) {
+ var item = {
+ appData: { messageId: messages[i].id, name: messages[i].sender },
+ itemStyle: 'style07',
+ styleMod: 'bold',
+ hasCaret: false,
+ text1: messages[i].sender,
+ image1: '',
+ label1: utility.formatSmartDateTime(messages[i].datetime, false),
+ label2: '', // label2 is only set for email's below and left blank for sms.
+ labelWidth: 'wide',
+ };
+ // Set image1 and set appData event name.
+ switch (messages[i].clientType) {
+ // MSG_CLIENT_EMAIL
+ case 1:
+ item.appData.eventId = 'SelectMessageEmail';
+ item.image1 = 'common/images/icons/IcnListEmail_En.png';
+ item.label2 = messages[i].instance;
+ break;
+ // MSG_CLIENT_SMS
+ case 2:
+ item.appData.eventId = 'SelectMessageSMS';
+ item.image1 = 'common/images/icons/IcnListSms_En.png';
+ break;
+ }
+ dataList.items.push(item);
+ }
+ dataList.itemCount = dataList.items.length;
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
+ }
+ break;
+ }
+ // Empty list returned
+ case 107:
+ {
+ log.info("AppSDK returned empty message.");
+ this._closeMsgApiConnection();
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ this._currentContextTemplate.list2Ctrl.setLoading(false);
+ }
+ break;
+ }
+ // Unrecognized status code
+ default:
+ {
+ log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ this._currentContextTemplate.list2Ctrl.setLoading(false);
+ }
+ framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
+ this._closeMsgApiConnection();
+ break;
+ }
+ }
+ } else {
+ log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ this._currentContextTemplate.list2Ctrl.setLoading(false);
+ }
+ framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
+ this._closeMsgApiConnection();
+ }
+};
+systemApp.prototype._closeMsgApiConnection = function() {
+ if (this._msgApiConnection) {
+ var params = {
+ "connection_in": this._msgApiConnection,
+ "context_in": 0,
+ };
+ framework.sendRequestToAppsdk(this.uiaId, function() {}, "msg", "Disconnect", params);
+ this._msgApiConnection = null;
+ }
+};
+systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params) {
+ if (appData && appData.eventId) {
+ switch (appData.eventId) {
+ case 'SelectMessageEmail':
+ var stuff = {
+ payload: {
+ messageId: appData.messageId,
+ }
+ };
+ framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
+ break;
+ case 'SelectMessageSMS':
+ var stuff = {
+ payload: {
+ messageId: appData.messageId,
+ }
+ };
+ framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
+ break;
+ case 'SelectMissedCall':
+ var stuff = {
+ payload: {
+ messageId: appData.messageId,
+ }
+ };
+ framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
+ break;
+ }
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// NoDevice
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.GoBack":
+ framework.sendEventToMmui("common", appData);
+ break;
+ case "SelectConnect":
+ framework.sendEventToMmui(this.uiaId, appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// DisplayOff
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params) {
+ framework.sendEventToMmui("system", "DisplayOffGUIActivity");
+};
+///////////////////////////////////////////////////////////////////////////////
+// Disclaimer
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._displayedDisclaimer = function() {
+ framework.sendEventToMmui("system", "DisposeIntroVideo");
+ if (this._disclaimerTime.reset) {
+ this._disclaimerTime.reset = false;
+ this._disclaimerTime.remaining = 500;
+ }
+ if (this._disclaimerTime.remaining < 0) {
+ this._disclaimerTime.reset = true;
+ framework.sendEventToMmui(this.uiaId, "Timeout");
+ } else {
+ log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
+ this._disclaimerTime.whenStarted = Date.now();
+ this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
+ }
+};
+systemApp.prototype._selectCallbackDisclaimer = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Yes":
+ clearTimeout(this._disclaimerTime.timeoutId);
+ this._disclaimerTime.timeoutId = null;
+ this._disclaimerTime.reset = true;
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+};
+systemApp.prototype._disclaimerTimedout = function() {
+ this._disclaimerTime.timeoutId = null;
+ this._disclaimerTime.reset = true;
+ if (this._currentContext && this._currentContext.ctxtId === "Disclaimer") {
+ framework.sendEventToMmui(this.uiaId, "Timeout");
+ }
+ //Incase after Timeout Disclaimer screen didnt remove then sends start the timer again
+ if (this._disclaimerTime.reset) {
+ this._disclaimerTime.reset = false;
+ this._disclaimerTime.remaining = 500;
+ }
+ if (this._disclaimerTime.remaining < 0) {
+ this._disclaimerTime.reset = true;
+ framework.sendEventToMmui(this.uiaId, "Timeout");
+ } else if (this._currentContext && this._currentContext.ctxtId === "Disclaimer") {
+ log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
+ this._disclaimerTime.whenStarted = Date.now();
+ this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
+ } else {
+ log.debug("No need to restart the timer again as context is not of Disclaimer");
+ }
+};
+systemApp.prototype._noLongerDisplayedDisclaimer = function() {
+ // Note: The template is transitioning away either because of a Timeout, the user hit OK or an interrupting context change.
+ var elapsed = Date.now() - this._disclaimerTime.whenStarted;
+ this._disclaimerTime.remaining = this._disclaimerTime.remaining - elapsed;
+ if (this._disclaimerTime.timeoutId) {
+ clearTimeout(this._disclaimerTime.timeoutId);
+ this._disclaimerTime.timeoutId = null;
+ }
+};
+systemApp.prototype._displayedDisclaimerOut = function() {
+ // Note: Stopped display Disclaimer surface
+ framework.sendEventToMmui("system", "NotifyDisclaimerEnd");
+};
+///////////////////////////////////////////////////////////////////////////////
+// SystemWarning
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Yes":
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// EnableRVR
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Yes":
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// RVRInstructions
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Yes":
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// SourceReconnect
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readySourceReconnect = function() {
+ if (this._currentContext.params &&
+ this._currentContext.params.payload &&
+ this._currentContextTemplate &&
+ this._currentContextTemplate.dialog3Ctrl) {
+ switch (this._currentContext.params.payload.audioSource) {
+ case "BTAudio":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
+ break;
+ case "Pandora":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
+ break;
+ case "Stitcher":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
+ break;
+ case "AhaRadio":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
+ break;
+ case "USB_A":
+ case "USB_B":
+ case "USBAudio":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
+ break;
+ case "CD":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
+ break;
+ case "DVD":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
+ break;
+ case "TV":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
+ break;
+ default:
+ break;
+ }
+ }
+};
+systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params) {
+ switch (appData) {
+ case "SelectEntertainmentMenu":
+ framework.sendEventToMmui(this.uiaId, appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// SourceReconnectFailed
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readySourceReconnectFailed = function() {
+ if (this._currentContext.params &&
+ this._currentContext.params.payload &&
+ this._currentContextTemplate &&
+ this._currentContextTemplate.dialog3Ctrl) {
+ switch (this._currentContext.params.payload.audioSource) {
+ case "BTAudio":
+ case "Pandora":
+ case "Stitcher":
+ case "AhaRadio":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
+ break;
+ case "USB_A":
+ case "USB_B":
+ case "USBAudio":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
+ break;
+ case "CD":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
+ break;
+ case "DVD":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
+ break;
+ case "TV":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
+ break;
+ default:
+ break;
+ }
+ }
+};
+//Siri EnableRVR context ready to Display Function
+systemApp.prototype._readyEnableRVR = function() {
+ if (this._currentContext.params &&
+ this._currentContext.params.payload &&
+ this._currentContextTemplate &&
+ this._currentContextTemplate.dialog3Ctrl) {
+ this._CachedDeviceName = this._currentContext.params.payload.deviceName;
+ var subMapObj = { nameOfDevice: this._CachedDeviceName };
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled", subMapObj);
+ }
+};
+//Siri SiriLaunchingError context ready to Display Function
+systemApp.prototype._readySiriLaunchingError = function() {
+ if (this._currentContext.params &&
+ this._currentContext.params.payload &&
+ this._currentContextTemplate &&
+ this._currentContextTemplate.dialog3Ctrl) {
+ this._CachedDeviceName = this._currentContext.params.payload.deviceName;
+ var subMapObj = { nameOfDevice: this._CachedDeviceName };
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect", subMapObj);
+ }
+};
+systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Yes":
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+};
+// Store the Availability Status of Speed Restricted Apps
+systemApp.prototype._StatusMenuChanged = function(appName, isDisabled) {
+ for (var i = 0; i < this._SpeedRestrictedApps.length; ++i) {
+ var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
+ if (speedRestrictedAppName.indexOf(appName) === 0) {
+ this._SpeedRestrictedApps[i].status = isDisabled;
+ }
+ }
+};
+// Update the items for Speed Restricted Message
+systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled) {
+ var status = null;
+ var appName = null;
+ for (var i = 0; i < this._SpeedRestrictedApps.length; ++i) {
+ appName = this._SpeedRestrictedApps[i].appName;
+ status = this._SpeedRestrictedApps[i].status;
+ log.info("AppName : " + appName + " is available or unavailable - (true/false)" + status);
+ //Checks for Status Availability for the respective AppName
+ if (!status) {
+ this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
+ }
+ // Update the menu list in the current context if needed
+ if (this._currentContext && !status) {
+ switch (this._currentContext.ctxtId) {
+ case "Communication":
+ case "Entertainment":
+ case "Applications":
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ var dataList = this._currentContextTemplate.list2Ctrl.dataList;
+ for (var j = 0; j < dataList.items.length; ++j) {
+ if (dataList.items[j].appData.appName === appName) {
+ log.info("AppName : " + appName + " is found for making it disabled : " + isDisabled);
+ dataList.items[j].disabled = isDisabled;
+ if (isDisabled) {
+ // Clear nowplaying icon just in case it was still shown for this now unavailable item
+ dataList.items[j].image1 = "";
+ }
+ this._currentContextTemplate.list2Ctrl.updateItems(j, j);
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+};
+// Update the Applications structure based on vehicle configuration(Old or New)
+systemApp.prototype._updateApplicationStructure = function(vehicleConfiguration) {
+ if (vehicleConfiguration === "Old") {
+ //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
+ this._applicationsCtxtWiseAppNames = {
+ //Context Name : // [appName,appName....]
+ "Applications": ["xmdata", "hdtrafficimage", "idm", "ecoenergy", "driverid", "warnguide", "schedmaint", "vehicleStatus", "vdt_settings", "vdt", "carplay", "androidauto", "_androidauto", "_videoplayer", "_aiotweaks", "_speedometer", "app.background", "app.devtools", "app.gpsspeed", "app.multidash", "app.simpledashboard", "app.terminal", "app.vdd", "app.tetris", "app.breakout", "app.2048", "app.aio", "app.android", "app.myapp", "app.helloworld", "app.marketapps", "app.multicontroller", "app.snake", "app.speedometer", "app.androidauto", "app.aiotweaks", "app.youtube", "app.speed", "app.hello", "app.help", "app.myapp", "app.videoplayer", "app.video", "app.horloge", "app.clock", "app.sbspeedo", "app.statusbar", "app.simple", "app.simplespeedo", "app.analog", "app.casdkapps"],
+ "VehicleStatusMonitor": ["vsm"]
+ };
+ } else {
+ //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
+ this._applicationsCtxtWiseAppNames = {
+ //Context Name : // [appName,appName....]
+ "Applications": ["xmdata", "hdtrafficimage", "idm", "ecoenergy", "driverid", "vehicleStatus", "vdt_settings", "vdt", "carplay", "androidauto", "_androidauto", "_videoplayer", "_aiotweaks", "_speedometer", "app.background", "app.devtools", "app.gpsspeed", "app.multidash", "app.simpledashboard", "app.terminal", "app.vdd", "app.tetris", "app.breakout", "app.2048", "app.aio", "app.android", "app.myapp", "app.helloworld", "app.marketapps", "app.multicontroller", "app.snake", "app.speedometer", "app.androidauto", "app.aiotweaks", "app.youtube", "app.speed", "app.hello", "app.help", "app.myapp", "app.videoplayer", "app.video", "app.horloge", "app.clock", "app.sbspeedo", "app.statusbar", "app.simple", "app.simplespeedo", "app.analog", "app.casdkapps"],
+ "VehicleStatusMonitor": ["warnguide", "vsm", "schedmaint"]
+ };
+ }
+};
+// Tell framework that system app has finished loading
+framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/casdk/patch/systemApp.js b/app/files/tweaks/casdk/patch/systemApp.js
new file mode 100644
index 0000000..6b47558
--- /dev/null
+++ b/app/files/tweaks/casdk/patch/systemApp.js
@@ -0,0 +1,1955 @@
+/*
+ Patched for AIO + CASDK apps ~Trez 06.21.2018
+ Copyright 2012 by Johnson Controls
+ __________________________________________________________________________
+ Filename: systemApp.js
+ __________________________________________________________________________
+ Project: JCI-IHU
+ Language: EN
+ Author: awoodhc
+ Date: 05.7.2012
+ __________________________________________________________________________
+ Description: IHU GUI System App
+ Revisions:
+ v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
+ v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
+ v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between contexts.
+ v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
+ v0.5 - 14-June-2012 Language Localization added to ListCtrls
+ v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
+ v0.7 - 22-June-2012 Code review changes and reworked context handling
+ v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
+ v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
+ v1.0 - 31-July-2012 Updated Multicontroller behavior.
+ v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
+ v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
+ v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
+ v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
+ v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
+ v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
+ v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
+ v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
+ v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
+ v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
+ v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
+ v2.2 (20-Nov-2012) Stitcher enabled
+ v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
+ v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
+ v2.5 (17-Jan-2013) Changed one event name
+ v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
+ v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
+ v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
+ v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
+ __________________________________________________________________________
+ */
+log.addSrcFile("systemApp.js", "system");
+/**********************************************
+ * Start of Base App Implementation
+ *
+ * Code in this section should not be modified
+ * except for function names based on the appname
+ *********************************************/
+function systemApp(uiaId) {
+ log.debug("constructor called...");
+ // Base application functionality is provided in a common location via this call to baseApp.init().
+ // See framework/js/BaseApp.js for details.
+ baseApp.init(this, uiaId);
+ // All feature-specific initialization is done in appInit()
+}
+/*
+ * Called just after the app is instantiated by framework.
+ * App-specific variables should be declared here.
+ */
+systemApp.prototype.appInit = function() {
+ if (framework.debugMode) {
+ utility.loadScript("apps/system/test/systemAppTest.js");
+ }
+ //@formatter:off
+ this._initEntertainmentDataList();
+ this._initApplicationsDataList();
+ this._initCommunicationsDataList();
+ this._contextTable = {
+ "HomeScreen": {
+ "hideHomeBtn": true,
+ "template": "MainMenuTmplt",
+ "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
+ "controlProperties": {
+ "MainMenuCtrl": {
+ "selectCallback": this._selectCallbackHomeScreen.bind(this),
+ } // end of properties for "MainMenuCtrl"
+ }, // end of list of controlProperties
+ }, // end of "systemAppContext1"
+ "Communication": {
+ "leftBtnStyle": "goBack",
+ "sbNameId": "Communication",
+ "template": "List2Tmplt",
+ "controlProperties": {
+ "List2Ctrl": {
+ "dataList": this._communicationsDataList,
+ titleConfiguration: 'noTitle',
+ numberedList: false,
+ selectCallback: this._menuItemSelectCallback.bind(this),
+ } // end of properties for "List2Ctrl"
+ }, // end of list of controlProperties
+ "readyFunction": this._readyCommunication.bind(this),
+ "contextInFunction": this._CommCtxtContextIn.bind(this),
+ }, // end of "Communication"
+ "Entertainment": {
+ "leftBtnStyle": "goBack",
+ "sbNameId": "Entertainment",
+ "template": "List2Tmplt",
+ "controlProperties": {
+ "List2Ctrl": {
+ "dataList": null,
+ titleConfiguration: 'noTitle',
+ numberedList: false,
+ selectCallback: this._menuItemSelectCallback.bind(this),
+ } // end of properties for "List2Ctrl"
+ }, // end of list of controlProperties
+ "readyFunction": this._readyEntertainment.bind(this),
+ }, // end of "Entertainment"
+ "Applications": {
+ "leftBtnStyle": "goBack",
+ "sbNameId": "Applications",
+ "template": "List2Tmplt",
+ "controlProperties": {
+ "List2Ctrl": {
+ "dataList": null,
+ titleConfiguration: 'noTitle',
+ numberedList: true,
+ selectCallback: this._menuItemSelectCallback.bind(this),
+ } // end of properties for "List2Ctrl"
+ }, // end of list of controlProperties
+ "readyFunction": this._readyApplications.bind(this),
+ }, // end of "Applications"
+ "VehicleStatusMonitor": {
+ "leftBtnStyle": "goBack",
+ "sbNameId": "VehicleStatusMonitor",
+ "template": "List2Tmplt",
+ "controlProperties": {
+ "List2Ctrl": {
+ "dataList": null,
+ titleConfiguration: 'noTitle',
+ numberedList: true,
+ selectCallback: this._menuItemSelectCallback.bind(this),
+ } // end of properties for "List2Ctrl"
+ }, // end of list of controlProperties
+ "readyFunction": this._readyApplications.bind(this),
+ }, // end of "VehicleStatusMonitor"
+ "NoConnectionNotify": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ contentStyle: "style13",
+ defaultSelectCallback: this._selectCallbackNoConnectionNotify.bind(this),
+ buttonCount: 2,
+ initialFocus: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.No",
+ appData: "Global.No"
+ },
+ button2: {
+ labelId: "Connect",
+ appData: "SelectConnect"
+ },
+ },
+ text1Id: 'NoConnectionNotifyTitle',
+ text2Id: 'NoConnectionNotifyText',
+ } // end of properties for "DialogCtrl"
+ }, // end of list of controlProperties
+ }, // end of "NoConnectionNotify"
+ "NotifyDialog": {
+ "template": "Dialog3Tmplt",
+ "sbNameId": null,
+ "readyFunction": this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
+ "displayedFunction": this._NotifyDialogCtxtTmpltDisplayed.bind(this),
+ "noLongerDisplayedFunction": this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ "defaultSelectCallback": this._selectCallbackNotifyDialog.bind(this),
+ "contentStyle": "style17",
+ "buttonCount": 3,
+ "initialFocus": 2,
+ "buttonConfig": {
+ "button1": {
+ labelId: "NotifyOff",
+ appData: "SelectNotifyOff",
+ },
+ "button2": {
+ labelId: "NotifyIgnore",
+ appData: "Global.No",
+ },
+ "button3": {
+ labelId: "NotifyRead",
+ appData: "SelectNotifyMessage"
+ }
+ }, // end of buttonConfig
+ "text1Id": "NotifyIncomingMsg",
+ "text2": "",
+ "text3Id": "NotifyReadNow",
+ } // end of properties for dialog
+ }, // end of controlProperties
+ }, // end of "NotifyDialog"
+ "NotificationList": {
+ "leftBtnStyle": "goBack",
+ "template": "List2Tmplt",
+ "sbNameId": "Notifications",
+ "readyFunction": this._readyNotificationList.bind(this),
+ "noLongerDisplayedFunction": this._noLongerDisplayedNotificationList.bind(this),
+ "controlProperties": {
+ "List2Ctrl": {
+ titleConfiguration: "noTitle",
+ numberedList: true,
+ selectCallback: this._selectNotificationListItem.bind(this),
+ title: null,
+ dataList: null,
+ },
+ }, // end of controlProperties
+ }, // end of "NotificationList"
+ "NotificationListRetry": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ contentStyle: "style02",
+ defaultSelectCallback: this._selectCallbackNotificationListRetry.bind(this),
+ buttonCount: 2,
+ initialFocus: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.Cancel",
+ appData: "Global.Cancel"
+ },
+ button2: {
+ labelId: "RetryLabel",
+ appData: "SelectRetry"
+ },
+ },
+ text1Id: 'FailedNotificationRetrieval',
+ } // end of properties for "DialogCtrl"
+ }, // end of list of controlProperties
+ }, // end of NotificationListRetry
+ "NoDevice": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ contentStyle: "style13",
+ defaultSelectCallback: this._selectCallbackNoDevice.bind(this),
+ buttonCount: 2,
+ initialFocus: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.No",
+ appData: "Global.GoBack"
+ },
+ button2: {
+ labelId: "Connect",
+ appData: "SelectConnect"
+ },
+ },
+ text1Id: 'NoDeviceTitle',
+ text2Id: 'NoDeviceText',
+ } // end of properties for "DialogCtrl"
+ }, // end of list of controlProperties
+ }, // end of "NoConnectionNotify"
+ "DisplayOff": {
+ "hideHomeBtn": true,
+ "template": "OffScreenTmplt",
+ "templatePath": "apps/system/templates/OffScreen",
+ "controlProperties": {
+ "OffScreenCtrl": {
+ userActivityCallback: this._displayOffUserActivity.bind(this),
+ showClock: true,
+ }
+ },
+ }, // end of "DisplayOff"
+ "Disclaimer": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ titleStyle: "titleStyle01",
+ titleId: "WarningTitle",
+ contentStyle: "style02",
+ fullScreen: true,
+ defaultSelectCallback: this._selectCallbackDisclaimer.bind(this),
+ buttonCount: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "agree",
+ appData: "Global.Yes"
+ },
+ },
+ text1Id: 'DisclaimerText',
+ }
+ },
+ "displayedFunction": this._displayedDisclaimer.bind(this),
+ "noLongerDisplayedFunction": this._noLongerDisplayedDisclaimer.bind(this),
+ "contextOutFunction": this._displayedDisclaimerOut.bind(this),
+ }, // end of Disclaimer
+ "SystemWarning": {
+ "hideHomeBtn": true,
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ titleStyle: "titleStyle01",
+ titleId: "TempWarning",
+ contentStyle: "style02",
+ defaultSelectCallback: this._selectCallbackSystemWarning.bind(this),
+ buttonCount: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.Ok",
+ appData: "Global.Yes"
+ },
+ },
+ text1Id: "TempWarningText",
+ }
+ },
+ },
+ "SourceReconnect": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ "defaultSelectCallback": this._selectSourceReconnect.bind(this),
+ "contentStyle": "style14",
+ "fullScreen": false,
+ "text1Id": null,
+ "meter": { "meterType": "indeterminate", "meterPath": "common/images/IndeterminateMeter_2.png" },
+ "buttonCount": 1,
+ "buttonConfig": {
+ button1: {
+ labelId: "ReconnectEntMenuButton",
+ appData: "SelectEntertainmentMenu"
+ },
+ },
+ }
+ },
+ "readyFunction": this._readySourceReconnect.bind(this),
+ },
+ "SourceReconnectFailed": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ "defaultSelectCallback": this._selectSourceReconnectFailed.bind(this),
+ "contentStyle": "style02",
+ "fullScreen": false,
+ "text1Id": null,
+ "buttonCount": 1,
+ "buttonConfig": {
+ button1: {
+ labelId: "common.Ok",
+ appData: "Global.Yes"
+ },
+ },
+ }
+ },
+ "readyFunction": this._readySourceReconnectFailed.bind(this),
+ },
+ "IntroAnimation": {
+ "hideHomeBtn": true,
+ "template": "NoCtrlTmplt",
+ "properties": {
+ "visibleSurfaces": ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
+ "statusBarVisible": false,
+ "customBgImage": "common/images/FullTransparent.png",
+ },
+ },
+ "QuickStartLoop": {
+ "hideHomeBtn": true,
+ "template": "NoCtrlTmplt",
+ "properties": {
+ "visibleSurfaces": ["QUICKTRANLOGO_SURFACE"],
+ "statusBarVisible": false,
+ "customBgImage": "common/images/FullTransparent.png",
+ },
+ },
+ "PowerDownAnimation": {
+ "hideHomeBtn": true,
+ "template": "NoCtrlTmplt",
+ "properties": {
+ "visibleSurfaces": ["EXITLOGO_SURFACE"],
+ "statusBarVisible": false,
+ "customBgImage": "common/images/FullTransparent.png",
+ },
+ },
+ "IdleStandby": {
+ "hideHomeBtn": true,
+ "template": "OffScreenTmplt",
+ "templatePath": "apps/system/templates/OffScreen",
+ "controlProperties": {
+ "OffScreenCtrl": {
+ userActivityCallback: null,
+ showClock: false,
+ }
+ },
+ },
+ "WaitForEnding": {
+ "hideHomeBtn": true,
+ "template": "OffScreenTmplt",
+ "templatePath": "apps/system/templates/OffScreen",
+ "controlProperties": {
+ "OffScreenCtrl": {
+ userActivityCallback: null,
+ showClock: false,
+ }
+ },
+ },
+ "EnableRVR": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ contentStyle: "style02",
+ defaultSelectCallback: this._selectCallbackEnableRVR.bind(this),
+ buttonCount: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.Ok",
+ appData: "Global.Yes"
+ },
+ },
+ text1Id: "SiriDisabled",
+ }
+ },
+ "readyFunction": this._readyEnableRVR.bind(this),
+ },
+ "RVRInstructions": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ contentStyle: "style02",
+ defaultSelectCallback: this._selectCallbackRVRInstructions.bind(this),
+ buttonCount: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.Ok",
+ appData: "Global.Yes"
+ },
+ },
+ text1Id: "InitiateSiri",
+ }
+ },
+ },
+ "SiriInSession": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ titleStyle: "titleStyle01",
+ titleId: "Siri",
+ contentStyle: "style14",
+ "meter": { "meterType": "indeterminate", "meterPath": "apps/system/images/IcnSiri.png" }
+ }
+ },
+ },
+ "SiriLaunchingError": {
+ "template": "Dialog3Tmplt",
+ "controlProperties": {
+ "Dialog3Ctrl": {
+ //titleStyle : "titleStyle01",
+ // titleId : "Siri",
+ contentStyle: "style02",
+ defaultSelectCallback: this._selectCallbackRVRInstructions.bind(this),
+ buttonCount: 1,
+ buttonConfig: {
+ button1: {
+ labelId: "common.Ok",
+ appData: "Global.Yes"
+ },
+ },
+ text1Id: "DisconnectThenReconnect",
+ }
+ },
+ "readyFunction": this._readySiriLaunchingError.bind(this),
+ },
+ }; // end of this._contextTable object
+ //@formatter:off
+ this._messageTable = {
+ // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
+ "StatusMenu": this._StatusMenuMsgHandler.bind(this),
+ // Add or remove certain menu items.
+ "StatusMenuVisible": this._StatusMenuVisibleMsgHandler.bind(this),
+ // Indicates Available / Unavailable and device name for USB1 and USB2 audio
+ "StatusMenuUSBAudio": this._StatusMenuUSBAudioMsgHandler.bind(this),
+ // Indicates Available / Unavailable and device name for BTAudio
+ "StatusMenuBTAudio": this._StatusMenuBTAudioMsgHandler.bind(this),
+ // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
+ "StatusUpdateEcoEnergy": this._StatusUpdateEcoEnergyMsgHandler.bind(this),
+ // Updates the number of notifications for missed sms and emails.
+ "StatusUpdateNotifications": this._StatusUpdateNotificationsHandler.bind(this),
+ // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
+ "StatusPhoneCall": this._StatusPhoneCallMsgHandler.bind(this),
+ // Show an Audio SourceNotAvailable SBN
+ "TimedSBN_SourceNotAvailable": this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
+ // Update the current audio source icon in the Entertainment menu
+ "StatusUpdateAudioSource": this._StatusUpdateAudioSourceMsgHandler.bind(this),
+ // Update the number of missed calls
+ "StatusUpdateMissedCallCount": this._StatusUpdateMissedCallCountMsgHandler.bind(this),
+ // Update the number of warnings displayed apps men
+ "WarningStatusCount": this._WarningStatusCountMsgHandler.bind(this),
+ // Update whether scheduled maintenance is due
+ "StatusUpdateSchedMaint": this._StatusUpdateSchedMaintHandler.bind(this),
+ // Show an Siri SBN
+ "ShowStateSBN_SiriActive": this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
+ // Show an Siri Error SBN
+ "TimedSBN_SiriError": this._TimedSBN_SiriErrorMsgHandler.bind(this),
+ // Remove an Siri SBN
+ "RemoveStateSBN_SiriActive": this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
+ //Show timed SBN Voice not supported
+ "TimedSBN_VoiceNotSupported": this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
+ //Show timed SBN Voice Recognition Loading
+ "TimedSBN_VRLoading": this._TimedSBN_VRLoadingMsgHandler.bind(this),
+ //At Speed Restriction
+ "Global.AtSpeed": this._AtSpeedMsgHandler.bind(this),
+ //At No Speed
+ "Global.NoSpeed": this._NoSpeedMsgHandler.bind(this),
+ };
+ //@formatter:on
+ // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
+ // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
+ // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
+ // so the remaining time must be restarted when this happens.
+ this._disclaimerTime = {
+ // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
+ // flag is set true after a the timer times out or the user hits the OK button.
+ reset: true,
+ // (Number) Milliseconds remaining to show the Disclaimer.
+ remaining: 0,
+ // (Number) Millisecond timestamp when the Disclaimer was first shown.
+ whenStarted: 0,
+ // (Handle) setTimeout ID
+ timeoutId: null
+ };
+ // Array containing the appName of the list which supports Speed Restriction.
+ //@appName = appName of the item , @status = default value of disabled property for particular appName
+ this._SpeedRestrictedApps = [{ appName: "vdt_settings", status: true }];
+};
+/**************************
+ * Set Wink Properties *
+ **************************/
+systemApp.prototype.getWinkProperties = function(alert, params) {
+ log.info("setting wink properties for: ", alert, params);
+ var winkProperties = null;
+ switch (alert) {
+ case "System_RVR_NOT_ACTIVE":
+ case "System_RVR_EFM_ERROR":
+ case "System_RVR_ACTIVATE_ERROR":
+ winkProperties = {
+ "style": "style03",
+ "text1Id": "ErrorWhileStartingSiri"
+ };
+ break;
+ case "System_RVR_ACTIVE":
+ case "System_RVR_ACTIVE_WITH_EFM":
+ case "System_RVR_ACTIVE_NO_EFM":
+ winkProperties = {
+ "style": "style03",
+ "text1Id": "Siri"
+ };
+ break;
+ default:
+ // Display default Wink
+ log.debug("No properties found for wink: " + alert);
+ break;
+ }
+ // return the properties to Common
+ return winkProperties;
+};
+///////////////////////////////////////////////////////////////////////////////
+// Initialize various menu data lists
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._initEntertainmentDataList = function() {
+ var items = [];
+ if (framework.localize.getRegion() === framework.localize.REGIONS.Japan) {
+ // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
+ // add it if the region is Japan.
+ items.push({ appData: { appName: 'amradio', isVisible: true, audioSourceId: 'TrafficInfo', mmuiEvent: 'SelectTrafficAlert' }, text1Id: 'TrafficAlertsItem', disabled: true, itemStyle: 'style01', hasCaret: false });
+ }
+ items.push(
+ { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false },
+ { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false }
+ );
+ // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
+ //
+ // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
+ // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
+ this._masterEntertainmentDataList = {
+ items: items
+ };
+};
+systemApp.prototype._initApplicationsDataList = function() {
+ var items = [];
+ this._vehicleConfigurationType = null;
+ this._vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ log.info("this._vehicleConfigurationType " + this._vehicleConfigurationType);
+ items.push(
+ { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
+ { appData : { appName : 'vsm', isVisible : false, mmuiEvent : 'SelectEngineOilLevel' }, text1Id : 'EngineOilLevel', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
+ { appData : { appName : 'vehicleStatus', isVisible : false, mmuiEvent : 'SelectVehicleStatusMonitor' }, text1Id : 'VehicleStatusMonitor', disabled : false, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
+ { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
+ );
+ // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
+ //
+ // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
+ // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
+ this._masterApplicationDataList = {
+ items: items
+ };
+ this._updateApplicationStructure(this._vehicleConfigurationType);
+ // Keep the index of vehicleStatus ready to be used during enable/disable and visible/hidden of this item.
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if (this._masterApplicationDataList.items[i].appData.appName === "vehicleStatus") {
+ this._indexOfVSMApp = i;
+ }
+ }
+};
+systemApp.prototype._initCommunicationsDataList = function() {
+ var items = [];
+ items.push(
+ { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
+ { appData : { appName : 'notifications', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
+ { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
+ { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
+ { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
+ { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
+ { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
+ );
+ // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
+ //
+ // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
+ // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
+ this._communicationsDataList = {
+ items: items
+ };
+};
+///////////////////////////////////////////////////////////////////////////////
+// Message handlers, helpers
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._StatusPhoneCallMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus) {
+ // Add or remove the Active Call item in the communications menu
+ var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
+ var dirty = false;
+ if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall') {
+ this._communicationsDataList.items[0].appData.isVisible = true;
+ dirty = true;
+ } else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall' &&
+ this._communicationsDataList.items[0].appData.isVisible === true) {
+ this._communicationsDataList.items[0].appData.isVisible = false;
+ dirty = true;
+ }
+ // If it changed, and we are in the Comm ctxt, update the list shown
+ if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate) {
+ //build list (which will exclude isVisible==false items)
+ var dataList = this._buildCommunicationDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ }
+};
+systemApp.prototype._StatusMenuMsgHandler = function(msg) {
+ log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
+ // Update menu items associated with the given appName of the message. Menu items can appear
+ // in several different contexts or appear multiple times: this function searches all those places.
+ var appName = msg.params.payload.statusMenu.appName;
+ var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
+ //Update the Availability Status of Speed Restricted Apps
+ this._StatusMenuChanged(appName, isDisabled);
+ // Update the static menu lists so they are correctly enable next time the context is shown
+ this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
+ this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
+ this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
+ // Update the menu list in the current context if needed
+ if (this._currentContext) {
+ switch (this._currentContext.ctxtId) {
+ case "Communication":
+ case "Entertainment":
+ case "Applications":
+ case "VehicleStatusMonitor":
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ var dataList = this._currentContextTemplate.list2Ctrl.dataList;
+ for (var i = 0; i < dataList.items.length; ++i) {
+ if (dataList.items[i].appData.appName.indexOf(appName) === 0) {
+ if (this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
+ {
+ var speedRestrictedAppName = null;
+ var isNoAppAtSpeed = true;
+ for (var j = 0; j < this._SpeedRestrictedApps.length; ++j) {
+ speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
+ log.info("speedRestrictedAppName : " + speedRestrictedAppName + " checking for AppName : " + dataList.items[i].appData.appName);
+ if (speedRestrictedAppName === dataList.items[i].appData.appName) {
+ isNoAppAtSpeed = false; // App found with At Speed
+ break;
+ }
+ }
+ if (isNoAppAtSpeed) {
+ dataList.items[i].disabled = isDisabled;
+ if (isDisabled) {
+ // Clear nowplaying icon just in case it was still shown for this now unavailable item
+ dataList.items[i].image1 = "";
+ }
+ this._currentContextTemplate.list2Ctrl.updateItems(i, i);
+ }
+ } else {
+ dataList.items[i].disabled = isDisabled;
+ if (isDisabled) {
+ // Clear nowplaying icon just in case it was still shown for this now unavailable item
+ dataList.items[i].image1 = "";
+ }
+ this._currentContextTemplate.list2Ctrl.updateItems(i, i);
+ }
+ log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
+ }
+ }
+ }
+ break;
+ }
+ }
+};
+systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList) {
+ for (var i = 0; i < dataList.items.length; ++i) {
+ if (dataList.items[i].appData.appName.indexOf(appName) === 0) {
+ if (this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
+ {
+ var speedRestrictedAppName = null;
+ var isNoAppAtSpeed = true;
+ for (var j = 0; j < this._SpeedRestrictedApps.length; ++j) {
+ speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
+ log.info("speedRestrictedAppName : " + speedRestrictedAppName + " checking for AppName : " + dataList.items[i].appData.appName);
+ if (speedRestrictedAppName === dataList.items[i].appData.appName) {
+ isNoAppAtSpeed = false; // App found with At Speed
+ break;
+ }
+ }
+ if (isNoAppAtSpeed) {
+ dataList.items[i].disabled = isDisabled;
+ }
+ } else {
+ dataList.items[i].disabled = isDisabled;
+ }
+ log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
+ }
+ }
+ //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
+ //Reading the value again and checking the same with existing one.
+ var vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
+ if (vehicleConfigurationType !== this._vehicleConfigurationType) {
+ log.info("VehicleConfigurationType is changed to " + vehicleConfigurationType)
+ this._vehicleConfigurationType = vehicleConfigurationType;
+ this._updateApplicationStructure(vehicleConfigurationType);
+ }
+};
+systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList) {
+ for (var i = 0; i < dataList.items.length; ++i) {
+ if (dataList.items[i].appData.appName === appName) {
+ log.info("AppName : " + appName + " is found for making it disabled : " + isDisabled);
+ dataList.items[i].disabled = isDisabled;
+ log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
+ }
+ }
+};
+systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
+ var appName = msg.params.payload.appName;
+ var isVisible = msg.params.payload.state === "Visible";
+ // Search entertainment items
+ var isEntertainmentDirty = false;
+ for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i) {
+ if (this._masterEntertainmentDataList.items[i].appData.appName === appName &&
+ this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible) {
+ isEntertainmentDirty = true;
+ this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
+ }
+ }
+ // Update the Entertainment context if it is currently displayed.
+ if (isEntertainmentDirty &&
+ this._currentContext &&
+ this._currentContext.ctxtId === "Entertainment" &&
+ this._currentContextTemplate) {
+ var dataList = this._buildEntertainmentDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ // Search application items
+ var isApplicationsDirty = false;
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if (this._masterApplicationDataList.items[i].appData.appName === appName &&
+ this._masterApplicationDataList.items[i].appData.isVisible != isVisible) {
+ isApplicationsDirty = true;
+ this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
+ }
+ }
+ //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
+ //Reading the value again and checking the same with existing one.
+ var vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
+ if (vehicleConfigurationType !== this._vehicleConfigurationType) {
+ log.info("VehicleConfigurationType is changed to " + vehicleConfigurationType);
+ this._vehicleConfigurationType = vehicleConfigurationType;
+ this._updateApplicationStructure(vehicleConfigurationType);
+ }
+ //If any app inside the VehicleStatusMonitor context is visible then VehicleStatusMonitor will also be visible in Application.
+ var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames["VehicleStatusMonitor"];
+ var isVehicleStatusMonitorVisible = false;
+ for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j) {
+ var applicationsCtxtWiseAppName = applicationsCtxtWiseAppNames[j];
+ for (var k = 0; k < this._masterApplicationDataList.items.length; ++k) {
+ if ((this._masterApplicationDataList.items[k].appData.appName === applicationsCtxtWiseAppName) &&
+ this._masterApplicationDataList.items[k].appData.isVisible) {
+ isApplicationsDirty = true;
+ isVehicleStatusMonitorVisible = this._masterApplicationDataList.items[k].appData.isVisible;
+ break;
+ }
+ }
+ }
+ //update the visiblity of VehicleStatusMonitor on basis of visible status of application(s) inside VehicleStatusMonitor context.
+ this._masterApplicationDataList.items[this._indexOfVSMApp].appData.isVisible = isVehicleStatusMonitorVisible;
+ // Update the Applications context or VehicleStatusMonitor context if it is currently displayed.
+ if (isApplicationsDirty &&
+ this._currentContext &&
+ (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
+ this._currentContextTemplate) {
+ var dataList = this._buildApplicationsDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ // Now that we are listening to StatusMenuVisible for Comm items (for email only)
+ // we want to ensure any messages sent by other apps that were previously ignored are still ignored
+ // Shoki6 ONLY
+ if (appName === "email" || appName === "sms" || appName === "notifications") {
+ // Search communication items - avalajh
+ var isCommunicationDirty = false;
+ for (var i = 0; i < this._communicationsDataList.items.length; ++i) {
+ if (this._communicationsDataList.items[i].appData.appName === appName &&
+ this._communicationsDataList.items[i].appData.isVisible != isVisible) {
+ isCommunicationDirty = true;
+ this._communicationsDataList.items[i].appData.isVisible = isVisible;
+ }
+ }
+ // Update the Communication context if it is currently displayed.
+ if (isCommunicationDirty &&
+ this._currentContext &&
+ this._currentContext.ctxtId === "Communication" &&
+ this._currentContextTemplate) {
+ var dataList = this._buildCommunicationDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ }
+ }
+};
+systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio) {
+ // Update cached values for the USB device status
+ var status = msg.params.payload.statusMenuUSBAudio;
+ var mmuiEvent = "";
+ var textIdWithDevice = "";
+ var textIdWithoutDevice = "";
+ var masterIndex = -1;
+ if (status.usbAB === "USB_A") {
+ mmuiEvent = "SelectUSBA";
+ textIdWithDevice = "UsbAudioAWithDevice";
+ textIdWithoutDevice = "UsbAudioA";
+ } else if (status.usbAB === "USB_B") {
+ mmuiEvent = "SelectUSBB";
+ textIdWithDevice = "UsbAudioBWithDevice";
+ textIdWithoutDevice = "UsbAudioB";
+ }
+ // Update the master entertainment data list which contains all items
+ for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i) {
+ if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent) {
+ masterIndex = i;
+ var isAvailable = status.statusMenu.appStatus === "Available";
+ var name = status.displayName;
+ this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
+ if (isAvailable && typeof name === 'string' && name.length > 0) {
+ this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
+ this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
+ } else {
+ this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
+ this._masterEntertainmentDataList.items[i].text1SubMap = null;
+ }
+ if (!isAvailable) {
+ // Clear nowplaying icon just in case it was still shown for this now unavailable item
+ this._masterEntertainmentDataList.items[i].image1 = "";
+ }
+ }
+ }
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ for (var i = 0; i < list.dataList.items.length; ++i) {
+ if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent) {
+ list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
+ list.updateItems(i, i);
+ }
+ }
+ }
+ }
+};
+systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ var masterIndex = -1;
+ // Update the master entertainment data list which contains all items
+ for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i) {
+ if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio") {
+ masterIndex = i;
+ var isAvailable = msg.params.payload.appStatus === "Available";
+ var deviceName = msg.params.payload.deviceName;
+ // NOTE: This message does not enable/disable the BTAudio menu item.
+ // (The StatusMenu message will enable it on startup.)
+ if (isAvailable && typeof deviceName === "string" && deviceName.length > 0) {
+ this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
+ this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
+ } else {
+ this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
+ this._masterEntertainmentDataList.items[i].text1SubMap = null;
+ }
+ if (!isAvailable) {
+ // Clear nowplaying icon just in case it was still shown for this now unavailable item
+ this._masterEntertainmentDataList.items[i].image1 = "";
+ }
+ }
+ }
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ for (var i = 0; i < list.dataList.items.length; ++i) {
+ if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio") {
+ list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
+ list.updateItems(i, i);
+ }
+ }
+ }
+ }
+};
+systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
+ // Determine correct text ID, based on vehicle fuel type
+ var fuelType = msg.params.payload.fuelType;
+ var newText1Id;
+ switch (fuelType) {
+ case "HEV":
+ newText1Id = "EcoenergyAppHEV";
+ break;
+ case "GAS":
+ default:
+ newText1Id = "EcoenergyApp";
+ break;
+ }
+ // Search application items for the "ecoenergy" application
+ var isApplicationsDirty = false;
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
+ (this._masterApplicationDataList.items[i].text1Id != newText1Id)) {
+ // Found the app, and it's text ID needs to change, so change it
+ isApplicationsDirty = true;
+ this._masterApplicationDataList.items[i].text1Id = newText1Id;
+ }
+ }
+ // Update the Applications context if it is currently displayed.
+ if (isApplicationsDirty &&
+ this._currentContext &&
+ (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
+ this._currentContextTemplate) {
+ var dataList = this._buildApplicationsDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ }
+};
+// Handle message to update the notification counts in the Communication context.
+systemApp.prototype._StatusUpdateNotificationsHandler = function(msg) {
+ if (msg.params && msg.params.payload && msg.params.payload.messageCounts) {
+ // Update message counts and the notifications list item displayed in the Communication menu
+ var countEmail = msg.params.payload.messageCounts.countEmail;
+ var countSMS = msg.params.payload.messageCounts.countSMS;
+ var total = countEmail + countSMS;
+ var showMessageIcon = total > 0;
+ framework.common.setSbIcon("Message", showMessageIcon);
+ for (var i = 0; i < this._communicationsDataList.items.length; ++i) {
+ switch (this._communicationsDataList.items[i].appData.mmuiEvent) {
+ case 'SelectNotifications':
+ this._communicationsDataList.items[i].disabled = (total === 0);
+ this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
+ break;
+ case 'SelectSms':
+ this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
+ break;
+ case 'SelectEmail':
+ this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
+ break;
+ }
+ }
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate) {
+ var dataList = this._buildCommunicationDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ }
+ }
+};
+systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function() {
+ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
+ var params = {
+ sbnStyle: 'Style02',
+ text1Id: 'VoiceRecognition',
+ imagePath1: 'apps/system/images/IcnSiriSBN.png'
+ };
+ framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
+};
+systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function() {
+ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
+ var params = {
+ sbnStyle: 'Style01',
+ text1Id: 'ErrorWhileStartingSiri',
+ };
+ framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
+};
+//If VR is not ready after Disclaimer then display SBN
+systemApp.prototype._TimedSBN_VRLoadingMsgHandler = function() {
+ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
+ var params = {
+ sbnStyle: 'Style02',
+ text1Id: 'common.SbnVoiceLoading',
+ imagePath1: 'common/images/icons/IcnSbnMicUnavail.png'
+ };
+ framework.common.startTimedSbn(this.uiaId, 'VoiceRecoLoading', "vrStatus", params);
+};
+systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function() {
+ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
+ var params = {
+ sbnStyle: 'Style02',
+ text1Id: 'VoiceNotSupported',
+ imagePath1: 'common/images/icons/IcnSbnMicUnavail.png'
+ };
+ framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
+};
+systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function() {
+ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
+};
+systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ var params = {
+ sbnStyle: 'Style02',
+ imagePath1: 'common/images/icons/IcnListBtConnType_Music.png'
+ };
+ switch (msg.params.payload.audioSource) {
+ case "BTAudio":
+ case "Pandora":
+ case "Stitcher":
+ case "AhaRadio":
+ params.text1Id = "AudioSourceNotAvailableBTAudio";
+ break;
+ case "USBAudio":
+ case "USB_A":
+ case "USB_B":
+ params.text1Id = "AudioSourceNotAvailableUSB";
+ break;
+ case "CD":
+ params.text1Id = "AudioSourceNotAvailableCD";
+ break;
+ case "DVD":
+ params.text1Id = "AudioSourceNotAvailableDVD";
+ break;
+ case "TV":
+ params.text1Id = "AudioSourceNotAvailableTV";
+ break;
+ }
+ framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
+ }
+};
+systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList) {
+ for (var i = 0; i < dataList.items.length; ++i) {
+ if (isPlaying) {
+ // Set the icon on the audioSource item and clearing it on all other items
+ dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
+ } else {
+ // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
+ // "Off" and "Play" messages do not necessarily come in that order.
+ if (dataList.items[i].appData.audioSourceId === audioSource) {
+ dataList.items[i].image1 = "";
+ }
+ }
+ }
+};
+systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ var audioSource = msg.params.payload.statusAudio.audioSource;
+ var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
+ // Set the icon in the masterEntertainment data list so it is persisted between template instances
+ this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
+ list.updateItems(0, list.dataList.items.length - 1);
+ }
+ }
+};
+systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg) {
+ var count = "";
+ if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0) {
+ count = msg.params.payload.missedCallCount.toString();
+ }
+ // Update this._communicationsDataList
+ for (var i = 0; i < this._communicationsDataList.items.length; ++i) {
+ if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory") {
+ this._communicationsDataList.items[i].label1 = count;
+ }
+ }
+ // Update current context if needed
+ if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ for (var i = 0; i < list.dataList.items.length; ++i) {
+ if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory") {
+ list.dataList.items[i].label1 = count;
+ list.updateItems(i, i);
+ }
+ }
+ }
+};
+systemApp.prototype._WarningStatusCountMsgHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ var count = "";
+ var icon = "";
+ if (msg.params.payload.warningcount > 0) {
+ count = msg.params.payload.warningcount.toString();
+ icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
+ }
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide") {
+ this._masterApplicationDataList.items[i].label1 = count;
+ this._masterApplicationDataList.items[i].image2 = icon;
+ }
+ // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
+ this._vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New") {
+ //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
+ if (this._SchedMaintDueStatus) {
+ this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
+ } else {
+ this._masterApplicationDataList.items[i].image2 = icon;
+ }
+ }
+ }
+ // Update current context if needed
+ if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
+ this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ for (var i = 0; i < list.dataList.items.length; ++i) {
+ if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide") {
+ list.dataList.items[i].label1 = count;
+ list.dataList.items[i].image2 = icon;
+ list.updateItems(i, i);
+ }
+ if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New") {
+ //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
+ if (this._SchedMaintDueStatus) {
+ icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
+ }
+ list.dataList.items[i].image2 = icon;
+ list.updateItems(i, i);
+ }
+ }
+ }
+ }
+};
+systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg) {
+ if (msg.params && msg.params.payload) {
+ var isDue = msg.params.payload.due;
+ var warningCountValue = null;
+ //Caching the Due Status to be used in _WarningStatusCountMsgHandler.
+ this._SchedMaintDueStatus = isDue;
+ this._vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ // Update the master list
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint") {
+ if (isDue) {
+ this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
+ } else {
+ this._masterApplicationDataList.items[i].image2 = "";
+ }
+ }
+ // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
+ else if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New") {
+ var WarnGuidanceAppItem = utility.getArrayItemByPropertyValue(this._masterApplicationDataList.items, "text1Id", "WarnGuidanceApp");
+ if (WarnGuidanceAppItem && WarnGuidanceAppItem.item && WarnGuidanceAppItem.item.label1) {
+ warningCountValue = WarnGuidanceAppItem.item.label1;
+ }
+ //IF is Due is true and not having any image in image2 then need to show Amber icon.
+ if (isDue && !this._masterApplicationDataList.items[i].image2) {
+ this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
+ }
+ //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
+ else if (!isDue && !warningCountValue) {
+ this._masterApplicationDataList.items[i].image2 = "";
+ } else {
+ //DO nothing
+ }
+ }
+ }
+ // Update the current context if needed
+ if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
+ this._currentContextTemplate) {
+ var list = this._currentContextTemplate.list2Ctrl;
+ for (var i = 0; i < list.dataList.items.length; ++i) {
+ if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint") {
+ if (isDue) {
+ list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
+ } else {
+ list.dataList.items[i].image2 = "";
+ }
+ list.updateItems(i, i);
+ }
+ // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
+ else if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New") {
+ //IF is Due is true and not having any image in image2 then need to show Amber icon.
+ if (isDue && !list.dataList.items[i].image2) {
+ list.dataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
+ }
+ //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
+ else if (!isDue && !warningCountValue) {
+ list.dataList.items[i].image2 = "";
+ } else {
+ //Do Nothing
+ }
+ list.updateItems(i, i);
+ }
+ }
+ }
+ }
+};
+systemApp.prototype._AtSpeedMsgHandler = function(msg) {
+ //At speed will disable the speed Restricted items
+ this._AtSpeedDisabled = true;
+ this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
+};
+systemApp.prototype._NoSpeedMsgHandler = function(msg) {
+ //At speed will Enable the speed Restricted items
+ this._AtSpeedDisabled = false;
+ this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
+};
+/**************************
+ * Control callbacks
+ **************************/
+/*
+ * Callback for the Main Menu Context icon button clicks
+ * @param mainMenuObj (Object) Reference to the MainMenuCtrl
+ * @param appData (Object) Data passed in by the app when the control was instantiated
+ * @param params (Object) Contains label for the selected icon
+ */
+systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params) {
+ log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
+ var icon = params.icon;
+ switch (icon) {
+ case "app":
+ framework.sendEventToMmui(this.uiaId, "SelectApplications");
+ break;
+ case "com":
+ framework.sendEventToMmui(this.uiaId, "SelectCommunication");
+ break;
+ case "ent":
+ framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
+ break;
+ case "nav":
+ framework.sendEventToMmui(this.uiaId, "SelectNavigation");
+ break;
+ case "set":
+ framework.sendEventToMmui(this.uiaId, "SelectSettings");
+ break;
+ }
+};
+/*
+ * Select callback for Applications, Communication, and Entertainment contexts.
+ * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
+ */
+systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params) {
+ framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
+};
+///////////////////////////////////////////////////////////////////////////////
+// Communication
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._CommCtxtContextIn = function() {
+ var scrollTo = 0;
+ // We cannot use the data list in the current context here, becuase it doesn't exist yet
+ // so we use _buildCommunicationDataList() just like _readyCommunications() will
+ var dataList = this._buildCommunicationDataList();
+ // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
+ var any = false;
+ for (var i = 0; i < dataList.items.length - 1; ++i) {
+ if (dataList.items[i].disabled === false) {
+ any = true;
+ }
+ }
+ if (any === false) {
+ var lastIndex = dataList.items.length - 1;
+ if (dataList.items[lastIndex].disabled === false) {
+ scrollTo = lastIndex;
+ }
+ }
+ this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
+ this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
+};
+///////////////////////////////////////////////////////////////////////////////
+// Applications
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readyApplications = function() {
+ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
+ if (this._currentContext && this._currentContextTemplate) {
+ this._AtSpeedDisabled = framework.common.getAtSpeedValue();
+ var dataList = this._buildApplicationsDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ // Checking for Speed Restricted Items For Applications Screen
+ this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
+ }
+};
+// Build list data from this._masterApplicationDataList based on the currently visible items.
+systemApp.prototype._buildApplicationsDataList = function() {
+ var dataList = {
+ itemCountKnown: true,
+ itemCount: 0,
+ items: [],
+ vuiSupport: true
+ };
+ //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
+ //Reading the value again and checking the same with existing one.
+ var vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData");
+ //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
+ if (vehicleConfigurationType !== this._vehicleConfigurationType) {
+ log.info("VehicleConfigurationType is changed to " + vehicleConfigurationType);
+ this._updateApplicationStructure(vehicleConfigurationType);
+ }
+ for (var i = 0; i < this._masterApplicationDataList.items.length; ++i) {
+ if (this._masterApplicationDataList.items[i].appData.isVisible) {
+ var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames[this._currentContext.ctxtId];
+ for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j) {
+ if (applicationsCtxtWiseAppNames[j] === this._masterApplicationDataList.items[i].appData.appName) {
+ dataList.items.push(this._masterApplicationDataList.items[i]);
+ }
+ }
+ }
+ }
+ dataList.itemCount = dataList.items.length;
+ return dataList;
+};
+///////////////////////////////////////////////////////////////////////////////
+// Entertainment
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readyEntertainment = function() {
+ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
+ if (this._currentContext && this._currentContextTemplate) {
+ this._AtSpeedDisabled = framework.common.getAtSpeedValue();
+ var dataList = this._buildEntertainmentDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ // Checking for Speed Restricted Items For Entertainment Screen
+ this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
+ }
+};
+// Build list data from this._masterEntertainmentDataList based on the currently visible items.
+systemApp.prototype._buildEntertainmentDataList = function() {
+ var dataList = {
+ itemCountKnown: true,
+ itemCount: 0,
+ items: [],
+ vuiSupport: true
+ };
+ for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i) {
+ if (this._masterEntertainmentDataList.items[i].appData.isVisible) {
+ dataList.items.push(this._masterEntertainmentDataList.items[i]);
+ }
+ }
+ dataList.itemCount = dataList.items.length;
+ return dataList;
+};
+///////////////////////////////////////////////////////////////////////////////
+// Communication - avalajh
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readyCommunication = function() {
+ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
+ if (this._currentContext && this._currentContextTemplate) {
+ this._AtSpeedDisabled = framework.common.getAtSpeedValue();
+ var dataList = this._buildCommunicationDataList();
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
+ // Checking for Speed Restricted Items For Communication Screen
+ this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
+ }
+};
+// Build list data from this._communicationsDataList based on the currently visible items.
+systemApp.prototype._buildCommunicationDataList = function() {
+ var dataList = {
+ itemCountKnown: true,
+ itemCount: 0,
+ items: [],
+ vuiSupport: true
+ };
+ for (var i = 0; i < this._communicationsDataList.items.length; ++i) {
+ if (this._communicationsDataList.items[i].appData.isVisible) {
+ dataList.items.push(this._communicationsDataList.items[i]);
+ }
+ }
+ dataList.itemCount = dataList.items.length;
+ return dataList;
+};
+///////////////////////////////////////////////////////////////////////////////
+// NoConnectionNotify
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params) {
+ switch (this._currentContext.ctxtId) {
+ case 'NoConnectionNotify':
+ switch (appData) {
+ case 'SelectConnect':
+ framework.sendEventToMmui("system", appData);
+ break;
+ case 'Global.No':
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// NotifyDialog
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function() {
+ if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData) {
+ this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
+ }
+};
+systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function() {
+ // Start timer to dismiss the notification if the user doesn't respond
+ var self = this;
+ this._NotifyDialogTimeoutId = setTimeout(function() {
+ this._NotifyDialogTimeoutId = null;
+ framework.sendEventToMmui(self.uiaId, "Timeout");
+ }, 10000);
+};
+systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function() {
+ if (this._NotifyDialogTimeoutId !== null) {
+ clearTimeout(this._NotifyDialogTimeoutId);
+ this._NotifyDialogTimeoutId = null;
+ }
+};
+systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params) {
+ if (this._NotifyDialogTimeoutId !== null) {
+ clearTimeout(this._NotifyDialogTimeoutId);
+ this._NotifyDialogTimeoutId = null;
+ }
+ switch (appData) {
+ case "Global.No":
+ framework.sendEventToMmui("common", appData);
+ break;
+ case "SelectNotifyOff":
+ framework.sendEventToMmui(this.uiaId, appData);
+ break;
+ case "SelectNotifyMessage":
+ if (this._currentContext.params && this._currentContext.params.payload) {
+ var paramsData = {
+ payload: {
+ messageId: this._currentContext.params.payload.messageNotifyData.messageId,
+ messageNotifyType: this._currentContext.params.payload.messageNotifyData.messageNotifyType
+ }
+ };
+ framework.sendEventToMmui(this.uiaId, appData, paramsData);
+ }
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// NotificationListRetry
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Cancel":
+ framework.sendEventToMmui("common", appData);
+ break;
+ case "SelectRetry":
+ framework.sendEventToMmui(this.uiaId, appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// NotificationList
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readyNotificationList = function(readyParams) {
+ log.debug("_readyNotificationList called...");
+ if (readyParams) {
+ readyParams.skipRestore = true;
+ }
+ var params = {
+ "context_in": 0,
+ // typedef enum MSG_client_type_e
+ // {
+ // /// Used for min valid values range check
+ // MSG_CLIENT_MIN = 0,
+ // /// Invalid value of 0
+ // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
+ // /// Email client
+ // MSG_CLIENT_EMAIL,
+ // /// SMS/MMS client
+ // MSG_CLIENT_SMS,
+ // /// Settings client
+ // MSG_CLIENT_SETTINGS,
+ // /// Notifications client
+ // MSG_CLIENT_NOTIFICATIONS,
+ // /// Used for max valid values range check
+ // MSG_CLIENT_MAX
+ // } MSG_client_type_t;
+ "client_type_in": 4,
+ "callbacks_in": 0
+ };
+ framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
+};
+systemApp.prototype._noLongerDisplayedNotificationList = function() {
+ this._closeMsgApiConnection();
+};
+systemApp.prototype._msgConnectCallback = function(msg) {
+ if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100) {
+ this._msgApiConnection = msg.params.connection;
+ var params = {
+ "connection_in": this._msgApiConnection,
+ "context_in": 0,
+ "request_type": 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
+ };
+ framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
+ } else {
+ log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
+ framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
+ this._closeMsgApiConnection();
+ }
+};
+systemApp.prototype._msgGetNewMessagesListCallback = function(msg) {
+ if (msg && msg.msgType === "methodResponse" && msg.params) {
+ switch (msg.params.status) {
+ // Successful retrieval w/ messages
+ case 100:
+ {
+ log.info("####AppSDK Success####");
+ this._closeMsgApiConnection();
+ var messages = msg.params.message_list.messages;
+ var dataList = {
+ itemCountKnown: true,
+ itemCount: 0,
+ items: [],
+ vuiSupport: true
+ };
+ for (var i = 0; i < messages.length; i++) {
+ var item = {
+ appData: { messageId: messages[i].id, name: messages[i].sender },
+ itemStyle: 'style07',
+ styleMod: 'bold',
+ hasCaret: false,
+ text1: messages[i].sender,
+ image1: '',
+ label1: utility.formatSmartDateTime(messages[i].datetime, false),
+ label2: '', // label2 is only set for email's below and left blank for sms.
+ labelWidth: 'wide',
+ };
+ // Set image1 and set appData event name.
+ switch (messages[i].clientType) {
+ // MSG_CLIENT_EMAIL
+ case 1:
+ item.appData.eventId = 'SelectMessageEmail';
+ item.image1 = 'common/images/icons/IcnListEmail_En.png';
+ item.label2 = messages[i].instance;
+ break;
+ // MSG_CLIENT_SMS
+ case 2:
+ item.appData.eventId = 'SelectMessageSMS';
+ item.image1 = 'common/images/icons/IcnListSms_En.png';
+ break;
+ }
+ dataList.items.push(item);
+ }
+ dataList.itemCount = dataList.items.length;
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ this._currentContextTemplate.list2Ctrl.setDataList(dataList);
+ this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
+ }
+ break;
+ }
+ // Empty list returned
+ case 107:
+ {
+ log.info("AppSDK returned empty message.");
+ this._closeMsgApiConnection();
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ this._currentContextTemplate.list2Ctrl.setLoading(false);
+ }
+ break;
+ }
+ // Unrecognized status code
+ default:
+ {
+ log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ this._currentContextTemplate.list2Ctrl.setLoading(false);
+ }
+ framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
+ this._closeMsgApiConnection();
+ break;
+ }
+ }
+ } else {
+ log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ this._currentContextTemplate.list2Ctrl.setLoading(false);
+ }
+ framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
+ this._closeMsgApiConnection();
+ }
+};
+systemApp.prototype._closeMsgApiConnection = function() {
+ if (this._msgApiConnection) {
+ var params = {
+ "connection_in": this._msgApiConnection,
+ "context_in": 0,
+ };
+ framework.sendRequestToAppsdk(this.uiaId, function() {}, "msg", "Disconnect", params);
+ this._msgApiConnection = null;
+ }
+};
+systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params) {
+ if (appData && appData.eventId) {
+ switch (appData.eventId) {
+ case 'SelectMessageEmail':
+ var stuff = {
+ payload: {
+ messageId: appData.messageId,
+ }
+ };
+ framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
+ break;
+ case 'SelectMessageSMS':
+ var stuff = {
+ payload: {
+ messageId: appData.messageId,
+ }
+ };
+ framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
+ break;
+ case 'SelectMissedCall':
+ var stuff = {
+ payload: {
+ messageId: appData.messageId,
+ }
+ };
+ framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
+ break;
+ }
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// NoDevice
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.GoBack":
+ framework.sendEventToMmui("common", appData);
+ break;
+ case "SelectConnect":
+ framework.sendEventToMmui(this.uiaId, appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// DisplayOff
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params) {
+ framework.sendEventToMmui("system", "DisplayOffGUIActivity");
+};
+///////////////////////////////////////////////////////////////////////////////
+// Disclaimer
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._displayedDisclaimer = function() {
+ framework.sendEventToMmui("system", "DisposeIntroVideo");
+ if (this._disclaimerTime.reset) {
+ this._disclaimerTime.reset = false;
+ this._disclaimerTime.remaining = 500;
+ }
+ if (this._disclaimerTime.remaining < 0) {
+ this._disclaimerTime.reset = true;
+ framework.sendEventToMmui(this.uiaId, "Timeout");
+ } else {
+ log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
+ this._disclaimerTime.whenStarted = Date.now();
+ this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
+ }
+};
+systemApp.prototype._selectCallbackDisclaimer = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Yes":
+ clearTimeout(this._disclaimerTime.timeoutId);
+ this._disclaimerTime.timeoutId = null;
+ this._disclaimerTime.reset = true;
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+};
+systemApp.prototype._disclaimerTimedout = function() {
+ this._disclaimerTime.timeoutId = null;
+ this._disclaimerTime.reset = true;
+ if (this._currentContext && this._currentContext.ctxtId === "Disclaimer") {
+ framework.sendEventToMmui(this.uiaId, "Timeout");
+ }
+ //Incase after Timeout Disclaimer screen didnt remove then sends start the timer again
+ if (this._disclaimerTime.reset) {
+ this._disclaimerTime.reset = false;
+ this._disclaimerTime.remaining = 500;
+ }
+ if (this._disclaimerTime.remaining < 0) {
+ this._disclaimerTime.reset = true;
+ framework.sendEventToMmui(this.uiaId, "Timeout");
+ } else if (this._currentContext && this._currentContext.ctxtId === "Disclaimer") {
+ log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
+ this._disclaimerTime.whenStarted = Date.now();
+ this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
+ } else {
+ log.debug("No need to restart the timer again as context is not of Disclaimer");
+ }
+};
+systemApp.prototype._noLongerDisplayedDisclaimer = function() {
+ // Note: The template is transitioning away either because of a Timeout, the user hit OK or an interrupting context change.
+ var elapsed = Date.now() - this._disclaimerTime.whenStarted;
+ this._disclaimerTime.remaining = this._disclaimerTime.remaining - elapsed;
+ if (this._disclaimerTime.timeoutId) {
+ clearTimeout(this._disclaimerTime.timeoutId);
+ this._disclaimerTime.timeoutId = null;
+ }
+};
+systemApp.prototype._displayedDisclaimerOut = function() {
+ // Note: Stopped display Disclaimer surface
+ framework.sendEventToMmui("system", "NotifyDisclaimerEnd");
+};
+///////////////////////////////////////////////////////////////////////////////
+// SystemWarning
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Yes":
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// EnableRVR
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Yes":
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// RVRInstructions
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Yes":
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// SourceReconnect
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readySourceReconnect = function() {
+ if (this._currentContext.params &&
+ this._currentContext.params.payload &&
+ this._currentContextTemplate &&
+ this._currentContextTemplate.dialog3Ctrl) {
+ switch (this._currentContext.params.payload.audioSource) {
+ case "BTAudio":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
+ break;
+ case "Pandora":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
+ break;
+ case "Stitcher":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
+ break;
+ case "AhaRadio":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
+ break;
+ case "USB_A":
+ case "USB_B":
+ case "USBAudio":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
+ break;
+ case "CD":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
+ break;
+ case "DVD":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
+ break;
+ case "TV":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
+ break;
+ default:
+ break;
+ }
+ }
+};
+systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params) {
+ switch (appData) {
+ case "SelectEntertainmentMenu":
+ framework.sendEventToMmui(this.uiaId, appData);
+ break;
+ }
+};
+///////////////////////////////////////////////////////////////////////////////
+// SourceReconnectFailed
+///////////////////////////////////////////////////////////////////////////////
+systemApp.prototype._readySourceReconnectFailed = function() {
+ if (this._currentContext.params &&
+ this._currentContext.params.payload &&
+ this._currentContextTemplate &&
+ this._currentContextTemplate.dialog3Ctrl) {
+ switch (this._currentContext.params.payload.audioSource) {
+ case "BTAudio":
+ case "Pandora":
+ case "Stitcher":
+ case "AhaRadio":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
+ break;
+ case "USB_A":
+ case "USB_B":
+ case "USBAudio":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
+ break;
+ case "CD":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
+ break;
+ case "DVD":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
+ break;
+ case "TV":
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
+ break;
+ default:
+ break;
+ }
+ }
+};
+//Siri EnableRVR context ready to Display Function
+systemApp.prototype._readyEnableRVR = function() {
+ if (this._currentContext.params &&
+ this._currentContext.params.payload &&
+ this._currentContextTemplate &&
+ this._currentContextTemplate.dialog3Ctrl) {
+ this._CachedDeviceName = this._currentContext.params.payload.deviceName;
+ var subMapObj = { nameOfDevice: this._CachedDeviceName };
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled", subMapObj);
+ }
+};
+//Siri SiriLaunchingError context ready to Display Function
+systemApp.prototype._readySiriLaunchingError = function() {
+ if (this._currentContext.params &&
+ this._currentContext.params.payload &&
+ this._currentContextTemplate &&
+ this._currentContextTemplate.dialog3Ctrl) {
+ this._CachedDeviceName = this._currentContext.params.payload.deviceName;
+ var subMapObj = { nameOfDevice: this._CachedDeviceName };
+ this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect", subMapObj);
+ }
+};
+systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params) {
+ switch (appData) {
+ case "Global.Yes":
+ framework.sendEventToMmui("common", appData);
+ break;
+ }
+};
+// Store the Availability Status of Speed Restricted Apps
+systemApp.prototype._StatusMenuChanged = function(appName, isDisabled) {
+ for (var i = 0; i < this._SpeedRestrictedApps.length; ++i) {
+ var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
+ if (speedRestrictedAppName.indexOf(appName) === 0) {
+ this._SpeedRestrictedApps[i].status = isDisabled;
+ }
+ }
+};
+// Update the items for Speed Restricted Message
+systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled) {
+ var status = null;
+ var appName = null;
+ for (var i = 0; i < this._SpeedRestrictedApps.length; ++i) {
+ appName = this._SpeedRestrictedApps[i].appName;
+ status = this._SpeedRestrictedApps[i].status;
+ log.info("AppName : " + appName + " is available or unavailable - (true/false)" + status);
+ //Checks for Status Availability for the respective AppName
+ if (!status) {
+ this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
+ }
+ // Update the menu list in the current context if needed
+ if (this._currentContext && !status) {
+ switch (this._currentContext.ctxtId) {
+ case "Communication":
+ case "Entertainment":
+ case "Applications":
+ if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl) {
+ var dataList = this._currentContextTemplate.list2Ctrl.dataList;
+ for (var j = 0; j < dataList.items.length; ++j) {
+ if (dataList.items[j].appData.appName === appName) {
+ log.info("AppName : " + appName + " is found for making it disabled : " + isDisabled);
+ dataList.items[j].disabled = isDisabled;
+ if (isDisabled) {
+ // Clear nowplaying icon just in case it was still shown for this now unavailable item
+ dataList.items[j].image1 = "";
+ }
+ this._currentContextTemplate.list2Ctrl.updateItems(j, j);
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+};
+// Update the Applications structure based on vehicle configuration(Old or New)
+systemApp.prototype._updateApplicationStructure = function(vehicleConfiguration) {
+ if (vehicleConfiguration === "Old") {
+ //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
+ this._applicationsCtxtWiseAppNames = {
+ //Context Name : // [appName,appName....]
+ "Applications": ["xmdata", "hdtrafficimage", "idm", "ecoenergy", "driverid", "warnguide", "schedmaint", "vehicleStatus", "vdt_settings", "vdt", "carplay", "androidauto", "_androidauto", "_videoplayer", "_aiotweaks", "_speedometer", "app.background", "app.devtools", "app.gpsspeed", "app.multidash", "app.simpledashboard", "app.terminal", "app.vdd", "app.tetris", "app.breakout", "app.2048", "app.aio", "app.android", "app.myapp", "app.helloworld", "app.marketapps", "app.multicontroller", "app.snake", "app.speedometer", "app.androidauto", "app.aiotweaks", "app.youtube", "app.speed", "app.hello", "app.help", "app.myapp", "app.videoplayer", "app.video", "app.horloge", "app.clock", "app.sbspeedo", "app.statusbar", "app.simple", "app.simplespeedo", "app.analog", "app.casdkapps"],
+ "VehicleStatusMonitor": ["vsm"]
+ };
+ } else {
+ //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
+ this._applicationsCtxtWiseAppNames = {
+ //Context Name : // [appName,appName....]
+ "Applications": ["xmdata", "hdtrafficimage", "idm", "ecoenergy", "driverid", "vehicleStatus", "vdt_settings", "vdt", "carplay", "androidauto", "_androidauto", "_videoplayer", "_aiotweaks", "_speedometer", "app.background", "app.devtools", "app.gpsspeed", "app.multidash", "app.simpledashboard", "app.terminal", "app.vdd", "app.tetris", "app.breakout", "app.2048", "app.aio", "app.android", "app.myapp", "app.helloworld", "app.marketapps", "app.multicontroller", "app.snake", "app.speedometer", "app.androidauto", "app.aiotweaks", "app.youtube", "app.speed", "app.hello", "app.help", "app.myapp", "app.videoplayer", "app.video", "app.horloge", "app.clock", "app.sbspeedo", "app.statusbar", "app.simple", "app.simplespeedo", "app.analog", "app.casdkapps"],
+ "VehicleStatusMonitor": ["warnguide", "vsm", "schedmaint"]
+ };
+ }
+};
+// Tell framework that system app has finished loading
+framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/casdk/proxy/CustomApplicationsProxy.js b/app/files/tweaks/casdk/proxy/CustomApplicationsProxy.js
index d22333c..31626a6 100644
--- a/app/files/tweaks/casdk/proxy/CustomApplicationsProxy.js
+++ b/app/files/tweaks/casdk/proxy/CustomApplicationsProxy.js
@@ -1,35 +1,34 @@
/**
-* Custom Applications SDK for Mazda Connect Infotainment System
-*
-* A mini framework that allows to write custom applications for the Mazda Connect Infotainment System
-* that includes an easy to use abstraction layer to the JCI system.
-*
-* Written by Andreas Schwarz (http://github.com/flyandi/mazda-custom-applications-sdk)
-* Copyright (c) 2016. All rights reserved.
-*
-* WARNING: The installation of this application requires modifications to your Mazda Connect system.
-* If you don't feel comfortable performing these changes, please do not attempt to install this. You might
-* be ending up with an unusuable system that requires reset by your Dealer. You were warned!
-*
-* This program is free software: you can redistribute it and/or modify it under the terms of the
-* GNU General Public License as published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-* License for more details.
-*
-* You should have received a copy of the GNU General Public License along with this program.
-* If not, see http://www.gnu.org/licenses/
-*
-*/
+ * Custom Applications SDK for Mazda Connect Infotainment System
+ *
+ * A mini framework that allows to write custom applications for the Mazda Connect Infotainment System
+ * that includes an easy to use abstraction layer to the JCI system.
+ *
+ * Written by Andreas Schwarz (http://github.com/flyandi/mazda-custom-applications-sdk)
+ * Copyright (c) 2016. All rights reserved.
+ *
+ * WARNING: The installation of this application requires modifications to your Mazda Connect system.
+ * If you don't feel comfortable performing these changes, please do not attempt to install this. You might
+ * be ending up with an unusuable system that requires reset by your Dealer. You were warned!
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program.
+ * If not, see http://www.gnu.org/licenses/
+ *
+ */
/* *********************** Native apps *********************** */
var nativeApps = [];
var nativeAppsLoc = "apps/";
-var _addAppFilesOverwrite = function(uiaId, mmuiMsgObj)
-{
+var _addAppFilesOverwrite = function(uiaId, mmuiMsgObj) {
log.debug("framework._addAppFiles called for: " + uiaId);
var appName = null;
@@ -40,8 +39,7 @@ var _addAppFilesOverwrite = function(uiaId, mmuiMsgObj)
this._lastAppLoaded = uiaId;
- if (uiaId === "common")
- {
+ if (uiaId === "common") {
this._frameworkState = this._FWK_STATE_LOADING_CMN;
appName = uiaId;
@@ -49,7 +47,7 @@ var _addAppFilesOverwrite = function(uiaId, mmuiMsgObj)
// common is unique. "common" is not a uiaId, but we're using it here for convenience
path = uiaId;
jsPath = "common/js/Common.js";
- } else if (uiaId.substr(0,1) === "_") {
+ } else if (uiaId.substr(0, 1) === "_") {
this._frameworkState = this._FWK_STATE_LOADING_APP;
appName = uiaId + "App";
@@ -76,8 +74,7 @@ var _addAppFilesOverwrite = function(uiaId, mmuiMsgObj)
this._loadingAppJsObj = mmuiMsgObj;
utility.loadCss(cssPath);
- if (this._rtlLanguage)
- {
+ if (this._rtlLanguage) {
utility.loadCss(cssRtlPath);
}
utility.loadScript(jsPath);
@@ -91,8 +88,8 @@ var _addAppFilesOverwrite = function(uiaId, mmuiMsgObj)
/**
-* (GlobalError)
-*/
+ * (GlobalError)
+ */
window.onerror = function() {
console.error(arguments);
@@ -100,16 +97,16 @@ window.onerror = function() {
/**
-* (CustomApplicationsProxy)
-*
-* Registers itself between the JCI system and CustomApplication runtime.
-*/
+ * (CustomApplicationsProxy)
+ *
+ * Registers itself between the JCI system and CustomApplication runtime.
+ */
window.CustomApplicationsProxy = {
/**
- * (locals)
- */
+ * (locals)
+ */
debug: false,
bootstrapped: false,
@@ -126,21 +123,21 @@ window.CustomApplicationsProxy = {
/**
- * (bootstrap)
- *
- * Bootstraps the JCI system
- */
+ * (bootstrap)
+ *
+ * Bootstraps the JCI system
+ */
bootstrap: function() {
// verify that core objects are available
- if(typeof framework === 'object' && framework._currentAppUiaId === this.systemAppId && this.bootstrapped === false) {
+ if (typeof framework === 'object' && framework._currentAppUiaId === this.systemAppId && this.bootstrapped === false) {
// retrieve system app
var systemApp = framework.getAppInstance(this.systemAppId);
// verify bootstrapping - yeah long name
- if(systemApp) {
+ if (systemApp) {
// set to strap - if everything fails - no harm is done :-)
this.bootstrapped = true;
@@ -152,19 +149,19 @@ window.CustomApplicationsProxy = {
systemApp._contextTable[this.systemAppCategory].controlProperties.List2Ctrl.selectCallback = this.menuItemSelectCallback.bind(systemApp);
// for usb changes
- if(typeof(systemApp.overwriteStatusMenuUSBAudioMsgHandler) === "undefined") {
+ if (typeof(systemApp.overwriteStatusMenuUSBAudioMsgHandler) === "undefined") {
systemApp.overwriteStatusMenuUSBAudioMsgHandler = systemApp._StatusMenuUSBAudioMsgHandler;
systemApp._StatusMenuUSBAudioMsgHandler = this.StatusMenuUSBAudioMsgHandler.bind(systemApp);
}
// overwrite framework route handler
- if(typeof(framework.overwriteRouteMmmuiMsg) === "undefined") {
+ if (typeof(framework.overwriteRouteMmmuiMsg) === "undefined") {
framework.overwriteRouteMmmuiMsg = framework.routeMmuiMsg;
framework.routeMmuiMsg = this.routeMmuiMsg.bind(framework);
}
// ovewrite framework MMUI sender
- if(typeof(framework.overwriteSendEventToMmui) === "undefined") {
+ if (typeof(framework.overwriteSendEventToMmui) === "undefined") {
framework.overwriteSendEventToMmui = framework.sendEventToMmui;
framework.sendEventToMmui = this.sendEventToMmui.bind(framework);
}
@@ -175,7 +172,7 @@ window.CustomApplicationsProxy = {
// kick off loader
this.prepareCustomApplications();
- } catch(e) {
+ } catch (e) {
//do nothing
}
}
@@ -184,19 +181,19 @@ window.CustomApplicationsProxy = {
/**
- * (Overwrite) menuItemSelectCallback
- */
+ * (Overwrite) menuItemSelectCallback
+ */
menuItemSelectCallback: function(listCtrlObj, appData, params) {
try {
- if(appData.mmuiEvent === "SelectCustomApplication") {
+ if (appData.mmuiEvent === "SelectCustomApplication") {
/* *********************** Native apps *********************** */
- if ( appData.appId.substr(0,1) === "_" ) {
+ if (appData.appId.substr(0, 1) === "_") {
for (var i = 0; i < additionalApps.length; ++i) {
var additionalApp = additionalApps[i];
- if(additionalApp.name === appData.appName) {
+ if (additionalApp.name === appData.appName) {
framework.additionalAppName = appData.appName;
framework.additionalAppContext = 'Start';
@@ -211,7 +208,7 @@ window.CustomApplicationsProxy = {
}
/* *********************** ~Native apps *********************** */
// launch app or exit if handler is not available
- } else if(typeof(CustomApplicationsHandler) !== "undefined" && CustomApplicationsHandler.launch(appData)) {
+ } else if (typeof(CustomApplicationsHandler) !== "undefined" && CustomApplicationsHandler.launch(appData)) {
CustomApplicationsProxy.targetAppName = 'custom';
CustomApplicationsProxy.targetAppContext = 'Surface';
try {
@@ -219,12 +216,12 @@ window.CustomApplicationsProxy = {
// set app data
appData.appName = CustomApplicationsProxy.proxyAppName;
appData.mmuiEvent = CustomApplicationsProxy.proxyMmuiEvent;
- } catch(e) {
+ } catch (e) {
// do nothing
}
}
}
- } catch(e) {
+ } catch (e) {
// do nothing
}
// pass to original handler
@@ -232,14 +229,14 @@ window.CustomApplicationsProxy = {
},
/**
- * (Overwrite) sendEventToMmui
- */
+ * (Overwrite) sendEventToMmui
+ */
sendEventToMmui: function(uiaId, eventId, params, fromVui) {
var currentUiaId = this.getCurrentApp(),
- currentContextId = this.getCurrCtxtId();
+ currentContextId = this.getCurrCtxtId();
// proxy overwrites
- if(currentUiaId === CustomApplicationsProxy.targetAppName) {
+ if (currentUiaId === CustomApplicationsProxy.targetAppName) {
currentUiaId = CustomApplicationsProxy.proxyAppName;
currentContextId = CustomApplicationsProxy.proxyAppContext;
}
@@ -248,43 +245,43 @@ window.CustomApplicationsProxy = {
},
/**
- * (Overwrite) routeMmuiMsg
- */
+ * (Overwrite) routeMmuiMsg
+ */
routeMmuiMsg: function(jsObject) {
try {
var proxy = CustomApplicationsProxy;
- if(typeof(CustomApplicationsHandler) === 'object') {
+ if (typeof(CustomApplicationsHandler) === 'object') {
// validate routing message
- switch(jsObject.msgType) {
+ switch (jsObject.msgType) {
// magic switch
case 'ctxtChg':
- if(proxy.targetAppName && jsObject.uiaId === proxy.proxyAppName) {
- jsObject.uiaId = proxy.targetAppName;
- jsObject.ctxtId = proxy.targetAppContext;
- }
- break;
- // check if our proxy app is in the focus stack
+ if (proxy.targetAppName && jsObject.uiaId === proxy.proxyAppName) {
+ jsObject.uiaId = proxy.targetAppName;
+ jsObject.ctxtId = proxy.targetAppContext;
+ }
+ break;
+ // check if our proxy app is in the focus stack
case 'focusStack':
- if(jsObject.appIdList && jsObject.appIdList.length) {
- for(var i = 0; i < jsObject.appIdList.length; i++) {
- var appId = jsObject.appIdList[i];
- if(appId.id === proxy.proxyAppName) {
- appId.id = proxy.targetAppName;
+ if (jsObject.appIdList && jsObject.appIdList.length) {
+ for (var i = 0; i < jsObject.appIdList.length; i++) {
+ var appId = jsObject.appIdList[i];
+ if (appId.id === proxy.proxyAppName) {
+ appId.id = proxy.targetAppName;
+ }
}
}
- }
case 'msg':
case 'alert':
- if(jsObject.uiaId === proxy.proxyAppName) {
- jsObject.uiaId = proxy.targetAppName;
- }
- break;
+ if (jsObject.uiaId === proxy.proxyAppName) {
+ jsObject.uiaId = proxy.targetAppName;
+ }
+ break;
default:
- // do nothing
- break;
+ // do nothing
+ break;
}
}
- } catch(e) {
+ } catch (e) {
// do nothing
}
// pass to framework
@@ -292,14 +289,14 @@ window.CustomApplicationsProxy = {
},
/**
- * (Overwrite) StatusMenuUSBAudioMsgHandler
- */
+ * (Overwrite) StatusMenuUSBAudioMsgHandler
+ */
StatusMenuUSBAudioMsgHandler: function(msg) {
- if(typeof(CustomApplicationsHandler) === 'object') {
+ if (typeof(CustomApplicationsHandler) === 'object') {
try {
var proxy = CustomApplicationsProxy;
console.log(JSON.stringify(msg));
- } catch(e) {
+ } catch (e) {
// do nothing
}
}
@@ -308,8 +305,8 @@ window.CustomApplicationsProxy = {
},
/**
- * (prepareCustomApplications)
- */
+ * (prepareCustomApplications)
+ */
prepareCustomApplications: function() {
// load native apps & custom apps separately
this.loadCount = 0;
@@ -320,11 +317,11 @@ window.CustomApplicationsProxy = {
},
/**
- * (loadCustomApplications)
- */
+ * (loadCustomApplications)
+ */
loadCustomApplications: function() {
try {
- if(typeof(CustomApplicationsHandler) === 'undefined') {
+ if (typeof(CustomApplicationsHandler) === 'undefined') {
// clear
clearTimeout(this.loadTimer);
// try to load the runtime script
@@ -334,27 +331,27 @@ window.CustomApplicationsProxy = {
}.bind(this));
// safety timer
this.loadTimer = setTimeout(function() {
- if(typeof(CustomApplicationsHandler) === "undefined") {
+ if (typeof(CustomApplicationsHandler) === "undefined") {
this.loadCount = this.loadCount + 1;
// 20 attempts or we forget it - that's almost 3min
- if(this.loadCount < 20) {
+ if (this.loadCount < 20) {
this.loadCustomApplications();
}
}
}.bind(this), 10000);
}
- } catch(e) {
+ } catch (e) {
//log.error('loadCustomApplications failed, we won\'t attempt again because there could be issues with the actual handler');
}
},
/**
- * (initCustomApplicationsDataList)
- */
+ * (initCustomApplicationsDataList)
+ */
initCustomApplicationsDataList: function() {
// extend with custom applications
try {
- if(typeof(CustomApplicationsHandler) !== "undefined") {
+ if (typeof(CustomApplicationsHandler) !== "undefined") {
CustomApplicationsHandler.retrieve(function(items) {
var systemApp = framework.getAppInstance(this.systemAppId);
items.forEach(function(item) {
@@ -362,50 +359,50 @@ window.CustomApplicationsProxy = {
framework.localize._appDicts[this.systemAppId][item.appData.appName.replace(".", "_")] = item.title;
framework.common._contextCategory._contextCategoryTable[item.appData.appName + '.*'] = 'Applications';
// For v59+ there is an additional list _applicationsCtxtWiseAppNames.Applications
- if(typeof systemApp._applicationsCtxtWiseAppNames !== "undefined" && systemApp._applicationsCtxtWiseAppNames.Applications.indexOf(item.appData.appName) === -1) {
+ if (typeof systemApp._applicationsCtxtWiseAppNames !== "undefined" && systemApp._applicationsCtxtWiseAppNames.Applications.indexOf(item.appData.appName) === -1) {
systemApp._applicationsCtxtWiseAppNames.Applications.push(item.appData.appName);
}
}.bind(this));
}.bind(this));
}
- } catch(e) {
+ } catch (e) {
// do nothing
}
},
/**
- * (initNativeApplicationsDataList)
- */
+ * (initNativeApplicationsDataList)
+ */
initNativeApplicationsDataList: function() {
try {
var systemApp = framework.getAppInstance(this.systemAppId);
var category = 'Applications';
- if(!systemApp.hasAdditionalApps) {
+ if (!systemApp.hasAdditionalApps) {
systemApp.hasAdditionalApps = true; // so we only do this if needed
GuiFramework.prototype._addAppFiles = _addAppFilesOverwrite;
var script = document.createElement('script');
script.type = 'text/javascript';
- script.src = (this.debug) ? 'apps/custom/apps/nativeApps.js':'/jci/opera/opera_dir/userjs/nativeApps.js';
+ script.src = '../opera/opera_dir/userjs/nativeApps.js';
document.head.appendChild(script);
script.onload = function(data) {
- if(typeof additionalApps !== "undefined"){
+ if (typeof additionalApps !== "undefined") {
for (var i = 0; i < additionalApps.length; ++i) {
var additionalApp = additionalApps[i];
- systemApp._masterApplicationDataList.items.push(
- { appData :
- { appName : additionalApp.name,
- isVisible : true,
- appId : additionalApp.name,
- mmuiEvent : "SelectCustomApplication"
- },
- text1Id : additionalApp.name,
- disabled : false,
- itemStyle : 'style01',
- hasCaret : false
- });
+ systemApp._masterApplicationDataList.items.push({
+ appData: {
+ appName: additionalApp.name,
+ isVisible: true,
+ appId: additionalApp.name,
+ mmuiEvent: "SelectCustomApplication"
+ },
+ text1Id: additionalApp.name,
+ disabled: false,
+ itemStyle: 'style01',
+ hasCaret: false
+ });
framework.localize._appDicts['system'][additionalApp.name] = additionalApp.label;
- framework.common._contextCategory._contextCategoryTable[additionalApp.name+'.*'] = category;
+ framework.common._contextCategory._contextCategoryTable[additionalApp.name + '.*'] = category;
// For v59+ there is an additional list _applicationsCtxtWiseAppNames.Applications
- if(typeof systemApp._applicationsCtxtWiseAppNames !== "undefined" && systemApp._applicationsCtxtWiseAppNames.Applications.indexOf(additionalApp.name) === -1) {
+ if (typeof systemApp._applicationsCtxtWiseAppNames !== "undefined" && systemApp._applicationsCtxtWiseAppNames.Applications.indexOf(additionalApp.name) === -1) {
systemApp._applicationsCtxtWiseAppNames.Applications.push(additionalApp.name);
}
if (additionalApp.preload !== undefined) {
@@ -416,7 +413,7 @@ window.CustomApplicationsProxy = {
}
}
}
- } catch(e) {
+ } catch (e) {
// do nothing
}
},
@@ -424,11 +421,11 @@ window.CustomApplicationsProxy = {
/**
-* Runtime Caller
-*/
+ * Runtime Caller
+ */
-if(window.opera) {
- window.opera.addEventListener('AfterEvent.load', function (e) {
+if (window.opera) {
+ window.opera.addEventListener('AfterEvent.load', function(e) {
CustomApplicationsProxy.bootstrap();
});
}
diff --git a/app/files/tweaks/casdk/proxy/additionalApps.js b/app/files/tweaks/casdk/proxy/additionalApps.js
deleted file mode 100644
index 7a1fc04..0000000
--- a/app/files/tweaks/casdk/proxy/additionalApps.js
+++ /dev/null
@@ -1,163 +0,0 @@
-var systemAppId = 'system';
-var additionalAppsConfig = '/jci/gui/apps/custom/apps/additionalApps.json';
-var additionalApps = [];
-
-/**
- * Sets up the additional apps and MMUI message interception magic
- */
-function addAdditionalApps() {
- var category = 'Applications';
-
- // check that we're in the system app
- if(typeof framework === 'object' && framework._currentAppUiaId === systemAppId) {
- var systemApp = framework.getAppInstance(systemAppId);
-
- if(!systemApp.hasAdditionalApps) {
- systemApp.hasAdditionalApps = true; // so we only do this if needed
-
- // load additional app definitions from from
- getJSON('file://localhost' + additionalAppsConfig, function(data) {
- additionalApps = JSON.parse(data);
- }, function(status) {
- framework.log.error('Unable to load additionalApps from ' + additionalAppsConfig);
- });
- // add additional apps to 'Applications' list
- for (var i = 0; i < additionalApps.length; ++i) {
- var additionalApp = additionalApps[i];
- systemApp._masterApplicationDataList.items.push({ appData : { appName : additionalApp.name, isVisible : true, mmuiEvent : 'Select'+additionalApp.name }, text1Id : additionalApp.name, disabled : false, itemStyle : 'style01', hasCaret : false });
- framework.localize._appDicts[systemAppId][additionalApp.name] = additionalApp.label;
- framework.common._contextCategory._contextCategoryTable[additionalApp.name+'.*'] = category;
- }
-
- // intercept app selection from the list to do our magic
- systemApp._contextTable[category].controlProperties.List2Ctrl.selectCallback = additionalAppMenuItemSelectCallback.bind(systemApp);
-
- // intercept MMUI messages in the framework
- framework.origRouteMmuiMsg = framework.routeMmuiMsg;
- framework.routeMmuiMsg = additionalAppRouteMmuiMsg.bind(framework);
- framework.sendEventToMmui = additionalAppSendEventToMmui.bind(framework);
- }
- }
-}
-
-/**
- * Using a disabled app from the list of apps in systemApp.js as a replacement to the MMUI
- */
-var additionalAppReplacedAppName = 'vdt';
-var additionalAppReplacedAppContext = 'DriveChartDetails';
-var additionalAppReplacedMmuiEvent = 'SelectDriveRecord';
-
-/**
- * Interceptor for systemApp._menuItemSelectCallback
- */
-function additionalAppMenuItemSelectCallback(listCtrlObj, appData, params) {
- for (var i = 0; i < additionalApps.length; ++i) {
- var additionalApp = additionalApps[i];
- if(additionalApp.name === appData.appName) {
- framework.additionalAppName = appData.appName;
- framework.additionalAppContext = 'Start';
- appData = JSON.parse(JSON.stringify(appData));
- appData.appName = additionalAppReplacedAppName;
- appData.mmuiEvent = additionalAppReplacedMmuiEvent;
- break;
- }
- }
- this._menuItemSelectCallback(listCtrlObj, appData, params);
-}
-
-/**
- * Interceptor for Framework.routeMmuiMsg
- */
-function additionalAppRouteMmuiMsg(jsObject) {
- switch(jsObject.msgType) {
- case 'ctxtChg':
- if(this.additionalAppName && jsObject.uiaId == additionalAppReplacedAppName) {
- jsObject.uiaId = this.additionalAppName;
- jsObject.ctxtId = this.additionalAppContext;
- }
- break;
- case 'focusStack':
- var additionalAppInFocusStack = false;
- if(this.additionalAppName) {
- for(var i = 0; i < jsObject.appIdList.length; i++) {
- var appId = jsObject.appIdList[i];
- if(appId.id == additionalAppReplacedAppName) {
- appId.id = this.additionalAppName;
- }
- if(appId.id == this.additionalAppName) {
- additionalAppInFocusStack = true;
- }
- }
- }
- if(!additionalAppInFocusStack) {
- this.additionalAppName = null;
- this.additionalAppContext = null;
- }
- case 'msg': // fall-through to alert
- case 'alert':
- if(this.additionalAppName && jsObject.uiaId == additionalAppReplacedAppName) {
- jsObject.uiaId = this.additionalAppName;
- }
- break;
- default:
- // do nothing
- break;
- }
-
- this.origRouteMmuiMsg(jsObject);
-}
-
-/**
- * Interceptor for Framework.sendEventToMmui
- */
-function additionalAppSendEventToMmui(uiaId, eventId, params, fromVui)
-{
- if(uiaId == this.additionalAppName) {
- uiaId = additionalAppReplacedAppName;
- }
-
- var currentUiaId = this.getCurrentApp();
- var currentContextId = this.getCurrCtxtId();
-
- if(currentUiaId == this.additionalAppName) {
- currentUiaId = additionalAppReplacedAppName;
- currentContextId = additionalAppReplacedAppContext;
- }
-
- this.websockets.sendEventMsg(uiaId, eventId, params, fromVui, currentUiaId, currentContextId);
-
- // Let debug know about the message
- this.debug.triggerEvtToMmuiCallbacks(uiaId, eventId, params);
-}
-
-/**
- * Helper function to get JSON data
- */
-function getJSON(url, successHandler, errorHandler) {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, false);
- xhr.timeout = 30000;
- xhr.onload = function() {
- var status = xhr.status;
- if (status == 0) {
- successHandler && successHandler(xhr.response);
- } else {
- errorHandler && errorHandler(status);
- }
- };
- xhr.onerror = function() {
- var status = xhr.status;
- }
- xhr.send();
-}
-
-/**
- * Function to get the whole thing started.
- * Trezdog44:
- * Removing this function allows native apps to run along side CASDK
-(function () {
- window.opera.addEventListener('AfterEvent.load', function (e) {
- addAdditionalApps();
- });
-})();
-*/
diff --git a/app/files/tweaks/casdk/proxy/aio.js b/app/files/tweaks/casdk/proxy/aio.js
index abc3088..74e630c 100644
--- a/app/files/tweaks/casdk/proxy/aio.js
+++ b/app/files/tweaks/casdk/proxy/aio.js
@@ -1,131 +1,144 @@
// aio.js - global helper functions for aio apps (for use with CASDK)
+//console.log("initialize aioMagicRoute - aio.js");
+var aioContextCount = 1;
+
// The magic router from Debug.js - Fakes a context change message
// Switch to any context from any other context
// **Note: Works in the emulator but DOES NOT ALWAYS WORK IN THE CAR
// Example: Switching to speedometer from main menu automatically on boot
// Will flash the speedometer for only a second then switch back.
// ** Needs further investigation **
-if (typeof aioContextCount === "undefined") {
- //console.log("initialize aioMagicRoute - aio.js");
- var aioContextCount = 1;
-
- function aioMagicRoute(uiaId, ctxtId, params, contextSeq) {
- var currAppId = framework.getCurrentApp();
- var transitionTrue = JSON.stringify({ 'msgType': 'transition', 'enabled': true })
- var transitionFalse = JSON.stringify({ 'msgType': 'transition', 'enabled': false })
-
- if (!contextSeq) {
- contextSeq = aioContextCount;
- aioContextCount++;
- }
+function aioMagicRoute(uiaId, ctxtId, params, contextSeq) {
+ var currAppId = framework.getCurrentApp();
+ var transitionTrue = JSON.stringify({ 'msgType': 'transition', 'enabled': true });
+ var transitionFalse = JSON.stringify({ 'msgType': 'transition', 'enabled': false });
- var ctxtChgMsg = JSON.stringify({ "msgType": "ctxtChg", "ctxtId": ctxtId, "uiaId": uiaId, "params": params, "contextSeq": contextSeq });
- var focusStackMsg = JSON.stringify({ "msgType": "focusStack", "appIdList": [{ "id": uiaId }, { "id": currAppId }] });
-
- aioMagicMsg(transitionTrue, ctxtChgMsg, focusStackMsg, transitionFalse);
+ if (!contextSeq) {
+ contextSeq = aioContextCount;
+ aioContextCount++;
}
- function aioMagicMsg(data) {
- if (arguments.length > 1) {
- //is the data a list of objects?
- for (var i = 0; i < arguments.length; i++) {
- log.debug("aioMagicMsg arguments passed as: ", arguments[i]);
- framework.routeMmuiMsg(JSON.parse(arguments[i]));
- }
- return;
- }
+ var ctxtChgMsg = JSON.stringify({ "msgType": "ctxtChg", "ctxtId": ctxtId, "uiaId": uiaId, "params": params, "contextSeq": contextSeq });
+ var focusStackMsg = JSON.stringify({ "msgType": "focusStack", "appIdList": [{ "id": uiaId }, { "id": currAppId }] });
- if (Object.prototype.toString.call(data) == '[object Array]') {
- //is the data an array?
- for (var j = 0; j < data.length; j++) {
- framework.routeMmuiMsg(JSON.parse(data[j]));
- }
- return;
+ aioMagicMsg(transitionTrue, ctxtChgMsg, focusStackMsg, transitionFalse);
+}
+// Change from any context to any other context
+// NOTE: this does not always work in the car system
+function aioMagicMsg(data) {
+ if (arguments.length > 1) {
+ //is the data a list of objects?
+ for (var i = 0; i < arguments.length; i++) {
+ log.debug("aioMagicMsg arguments passed as: ", arguments[i]);
+ framework.routeMmuiMsg(JSON.parse(arguments[i]));
}
- //otherwise we have 1 object to send
- framework.routeMmuiMsg(JSON.parse(data));
- }
-
- function AIO_SBN(message, pathToIcon) {
- framework.common.startTimedSbn(framework.getCurrentApp(), "MzdAioSbn", "typeE", {
- sbnStyle: "Style02",
- imagePath1: pathToIcon,
- text1: message
- });
+ return;
}
- function DOMtoJSON(node) {
- node = node || this;
- var obj = {
- nodeType: node.nodeType
- };
- if (node.tagName) {
- obj.tagName = node.tagName.toLowerCase();
- } else
- if (node.nodeName) {
- obj.nodeName = node.nodeName;
+ if (Object.prototype.toString.call(data) == '[object Array]') {
+ //is the data an array?
+ for (var j = 0; j < data.length; j++) {
+ framework.routeMmuiMsg(JSON.parse(data[j]));
}
- if (node.nodeValue) {
- obj.nodeValue = node.nodeValue;
+ return;
+ }
+ //otherwise we have 1 object to send
+ framework.routeMmuiMsg(JSON.parse(data));
+}
+// StatusBar Notifications
+function AIO_SBN(message, pathToIcon) {
+ framework.common.startTimedSbn(framework.getCurrentApp(), "MzdAioSbn", "typeE", {
+ sbnStyle: "Style02",
+ imagePath1: pathToIcon,
+ text1: message
+ });
+}
+// Turns a DOM element into JSON for saving
+function DOMtoJSON(node) {
+ node = node || this;
+ var obj = {
+ nodeType: node.nodeType
+ };
+ if (node.tagName) {
+ obj.tagName = node.tagName.toLowerCase();
+ } else
+ if (node.nodeName) {
+ obj.nodeName = node.nodeName;
+ }
+ if (node.nodeValue) {
+ obj.nodeValue = node.nodeValue;
+ }
+ var attrs = node.attributes;
+ if (attrs) {
+ var length = attrs.length;
+ var arr = obj.attributes = new Array(length);
+ for (var i = 0; i < length; i++) {
+ var attr = attrs[i];
+ arr[i] = [attr.nodeName, attr.nodeValue];
}
- var attrs = node.attributes;
- if (attrs) {
- var length = attrs.length;
- var arr = obj.attributes = new Array(length);
- for (var i = 0; i < length; i++) {
- var attr = attrs[i];
- arr[i] = [attr.nodeName, attr.nodeValue];
- }
+ }
+ var childNodes = node.childNodes;
+ if (childNodes) {
+ var lengthc = childNodes.length;
+ var arrc = obj.childNodes = new Array(lengthc);
+ for (var j = 0; j < lengthc; j++) {
+ arrc[j] = DOMtoJSON(childNodes[j]);
}
- var childNodes = node.childNodes;
- if (childNodes) {
- var lengthc = childNodes.length;
- var arrc = obj.childNodes = new Array(lengthc);
- for (var j = 0; j < lengthc; j++) {
- arrc[j] = DOMtoJSON(childNodes[j]);
+ }
+ return obj;
+}
+// Creates DOM out of JSON created by DOMtoJSON
+function JSONtoDOM(obj) {
+ if (typeof obj === 'string') {
+ obj = JSON.parse(obj);
+ }
+ var node, nodeType = obj.nodeType;
+ switch (nodeType) {
+ case 1: //ELEMENT_NODE
+ node = document.createElement(obj.tagName);
+ var attributes = obj.attributes || [];
+ for (var i = 0, len = attributes.length; i < len; i++) {
+ var attr = attributes[i];
+ node.setAttribute(attr[0], attr[1]);
}
+ break;
+ case 3: //TEXT_NODE
+ node = document.createTextNode(obj.nodeValue);
+ break;
+ case 8: //COMMENT_NODE
+ node = document.createComment(obj.nodeValue);
+ break;
+ case 9: //DOCUMENT_NODE
+ node = document.implementation.createDocument();
+ break;
+ case 10: //DOCUMENT_TYPE_NODE
+ node = document.implementation.createDocumentType(obj.nodeName);
+ break;
+ case 11: //DOCUMENT_FRAGMENT_NODE
+ node = document.createDocumentFragment();
+ break;
+ default:
+ return node;
+ }
+ if (nodeType === 1 || nodeType === 11) {
+ var childNodes = obj.childNodes || [];
+ for (i = 0, len = childNodes.length; i < len; i++) {
+ node.appendChild(JSONtoDOM(childNodes[i]));
}
- return obj;
}
+ return node;
+}
- function JSONtoDOM(obj) {
- if (typeof obj == 'string') {
- obj = JSON.parse(obj);
- }
- var node, nodeType = obj.nodeType;
- switch (nodeType) {
- case 1: //ELEMENT_NODE
- node = document.createElement(obj.tagName);
- var attributes = obj.attributes || [];
- for (var i = 0, len = attributes.length; i < len; i++) {
- var attr = attributes[i];
- node.setAttribute(attr[0], attr[1]);
- }
- break;
- case 3: //TEXT_NODE
- node = document.createTextNode(obj.nodeValue);
- break;
- case 8: //COMMENT_NODE
- node = document.createComment(obj.nodeValue);
- break;
- case 9: //DOCUMENT_NODE
- node = document.implementation.createDocument();
- break;
- case 10: //DOCUMENT_TYPE_NODE
- node = document.implementation.createDocumentType(obj.nodeName);
- break;
- case 11: //DOCUMENT_FRAGMENT_NODE
- node = document.createDocumentFragment();
- break;
- default:
- return node;
- }
- if (nodeType === 1 || nodeType === 11) {
- var childNodes = obj.childNodes || [];
- for (i = 0, len = childNodes.length; i < len; i++) {
- node.appendChild(JSONtoDOM(childNodes[i]));
- }
+/* Attempt to unmount swapfile on shutdown */
+var UMswap = null;
+
+function swapfileShutdownUnmount() {
+ console.log('swapfileShutdownUnmount');
+ UMswap = setInterval(function() {
+ if (typeof unmounmtSwap !== 'undefined' && (framework.getCurrCtxtId() === 'WaitForEnding' || framework.getCurrCtxtId() === 'PowerDownAnimation')) {
+ clearInterval(UMswap);
+ UMswap = null;
+ unmountSwap();
}
- return node;
- }
+ }, 1000)
}
diff --git a/app/files/tweaks/casdk/resources/aio/mzd-casdk/runtime/runtime.js b/app/files/tweaks/casdk/resources/aio/mzd-casdk/runtime/runtime.js
index 725b490..05457b2 100644
--- a/app/files/tweaks/casdk/resources/aio/mzd-casdk/runtime/runtime.js
+++ b/app/files/tweaks/casdk/resources/aio/mzd-casdk/runtime/runtime.js
@@ -28,7 +28,7 @@
* This is the main mini framework file that contains everything to run the custom application environment
*/
-var CUSTOM_APPLICATION_VERSION = '0.0.4';
+var CUSTOM_APPLICATION_VERSION = '0.0.5';
var CustomApplication = (function() {
@@ -1127,12 +1127,12 @@ var VehicleData = {
vehicle: {
speed: { id: 'VDTVehicleSpeed', friendlyName: 'Vehicle Speed', input: 'range', min: 0, max: 240, factor: 0.01 },
rpm: { id: 'VDTEngineSpeed', friendlyName: 'Engine RPM', input: 'range', min: 0, max: 8000, factor: 2.25 },
- odometer: { id: 'VDCOdocount', friendlyName: 'Odocount' },
- batterylevel: { id: 'VDCBattery_StateOfCharge', friendlyName: 'Battery Level' },
+ odometer: { id: 'VDTCOdocount', friendlyName: 'Odocount' },
+ batterylevel: { id: 'VDTCBattery_StateOfCharge', friendlyName: 'Battery Level' },
//Peter-dk added
- // latAcc: {id: 'VDCLateralAcceleration', friendlyName: 'Lateral acceleration', input: 'range', min: 3000, max: 5000, factor: 1},
- // lonAcc: {id: 'VDCLongitudinalAccelerometer', friendlyName: 'Longitudinal acceleration', input: 'range', min: 3000, max: 5000, factor: 1},
+ // latAcc: {id: 'VDTCLateralAcceleration', friendlyName: 'Lateral acceleration', input: 'range', min: 3000, max: 5000, factor: 1},
+ // lonAcc: {id: 'VDTCLongitudinalAccelerometer', friendlyName: 'Longitudinal acceleration', input: 'range', min: 3000, max: 5000, factor: 1},
startTime: { id: 'PIDGlobalRealTime_Start', friendlyName: 'Start time' },
curTime: { id: 'PIDCrntReadTm', friendlyName: 'Current time' },
drv1dstnc: { id: 'VDTPID_Drv1Dstnc_curr', friendlyName: 'Drive Distance' },
@@ -1144,7 +1144,9 @@ var VehicleData = {
fuel: {
position: { id: 'VDTFuelGaugePosition', friendlyName: 'Fuel Gauge Position' },
+ // fuelconsumption: { id: 'Drv1AvlFuelE', friendlyName: 'Current Fuel Consumption' },
averageconsumption: { id: 'VDTDrv1AvlFuelE', friendlyName: 'Average Fuel Consumption' },
+ // totalconsumption: { id: 'TotAvlFuelE', friendlyName: 'Total Fuel Consumption' },
},
/**
@@ -1285,18 +1287,18 @@ var CustomApplicationDataHandler = {
// Vehicle Data Transfer data
{ table: 'vdtpid', prefix: 'PID', enabled: true, file: true, update: 60 },
- // Vehicle Data Transfer data Trez - changed VDTC to VDC to make it unique from VDT prefix above
- { table: 'vdtcurrent', prefix: 'VDC', enabled: true, file: true, update: 60 },
+ // Vehicle Data Transfer data Current
+ { table: 'vdtcurrent', prefix: 'VDTC', enabled: true, file: true, update: 60 },
/**
* More less frequent updated tables (5min refresh rate)
*/
- // VDM - ECO and Energy Management data (disabled)
- { table: 'vdm', prefix: 'VDM', enabled: false, file: true, update: 300 },
+ // VDM - ECO and Energy Management data
+ { table: 'vdm', prefix: 'VDM', enabled: true, file: true, update: 300 },
- // VDM History - ECO and Energy Management data (disabled)
- { table: 'vdmhistory', prefix: 'VDMH', enabled: false, file: true, update: 300 },
+ // VDM History - ECO and Energy Management data
+ { table: 'vdmhistory', prefix: 'VDMH', enabled: true, file: true, update: 300 },
/**
@@ -1313,7 +1315,7 @@ var CustomApplicationDataHandler = {
{ table: 'idmhistory', prefix: 'IDMH', enabled: true, file: true, update: false },
// Vehicle Data Transfer data (disabled)
- { table: 'vdthistory', prefix: 'VDTH', enabled: false, file: true, update: false },
+ { table: 'vdthistory', prefix: 'VDTH', enabled: true, file: true, update: false },
],
@@ -1516,7 +1518,7 @@ var CustomApplicationDataHandler = {
if (table.update && table.__last && table.update > 1) {
- enabled = (((new Date()) - table.__last) / 1000) > table.update;
+ enabled = (((new Date(framework.common.getCurrentTime())) - table.__last) / 1000) > table.update;
}
@@ -1554,7 +1556,7 @@ var CustomApplicationDataHandler = {
loaded++;
// completed
- this.tables[tableIndex].__last = new Date();
+ this.tables[tableIndex].__last = new Date(framework.common.getCurrentTime());
// continue
finish();
@@ -1584,7 +1586,7 @@ var CustomApplicationDataHandler = {
this.__parseFileData(table, data);
// completed
- this.tables[tableIndex].__last = new Date();
+ this.tables[tableIndex].__last = new Date(framework.common.getCurrentTime());
}.bind(this),
@@ -2079,7 +2081,7 @@ var CustomApplicationLog = {
try {
if (this, enabledConsole) {
console.log(
- CustomApplicationHelpers.sprintr("%c[{0}] [{1}] ", (new Date()).toDateString(), values[0]) +
+ CustomApplicationHelpers.sprintr("%c[{0}] [{1}] ", (new Date(framework.common.getCurrentTime())).toDateString(), values[0]) +
CustomApplicationHelpers.sprintr("%c{0}", msg.join(" ")),
"color:black",
CustomApplicationHelpers.sprintr("color:{0}", color)
diff --git a/app/files/tweaks/casdk/resources/aio/mzd-casdk/runtime/vendor/jquery.js b/app/files/tweaks/casdk/resources/aio/mzd-casdk/runtime/vendor/jquery.js
index 15fa6fa..9b87ef7 100644
--- a/app/files/tweaks/casdk/resources/aio/mzd-casdk/runtime/vendor/jquery.js
+++ b/app/files/tweaks/casdk/resources/aio/mzd-casdk/runtime/vendor/jquery.js
@@ -1278,7 +1278,7 @@ setDocument = Sizzle.setDocument = function( node ) {
}
// Opera 10-11 does not throw on post-comma invalid pseudos
- div.querySelectorAll("*,:x");
+ //div.querySelectorAll("*,:x");
rbuggyQSA.push(",.*:");
});
}
diff --git a/app/files/tweaks/casdk/resources/aio/mzd-casdk/templates/SurfaceTmplt/js/SurfaceTmplt.js b/app/files/tweaks/casdk/resources/aio/mzd-casdk/templates/SurfaceTmplt/js/SurfaceTmplt.js
index 12a4b20..ddbe8d4 100644
--- a/app/files/tweaks/casdk/resources/aio/mzd-casdk/templates/SurfaceTmplt/js/SurfaceTmplt.js
+++ b/app/files/tweaks/casdk/resources/aio/mzd-casdk/templates/SurfaceTmplt/js/SurfaceTmplt.js
@@ -40,6 +40,7 @@ log.addSrcFile("SurfaceTmplt.js", "SurfaceTmpl");
function SurfaceTmplt(uiaId, parentDiv, templateID, controlProperties) {
$('#SbSpeedo, #Sbfuel-bar-wrapper').fadeOut();
+ $('#SbSpeedo').addClass('stayHidden');
// create the div for template
this.divElt = document.createElement('div');
this.divElt.id = templateID;
@@ -137,6 +138,7 @@ SurfaceTmplt.prototype.cleanUp = function() {
// clear app
this.application = null;
+ $('#SbSpeedo').removeClass('stayHidden');
$('#SbSpeedo, #Sbfuel-bar-wrapper').fadeIn();
}
diff --git a/app/files/tweaks/casdk/scripts/casdk.aio b/app/files/tweaks/casdk/scripts/casdk.aio
deleted file mode 100644
index 3f7183d..0000000
--- a/app/files/tweaks/casdk/scripts/casdk.aio
+++ /dev/null
@@ -1,2 +0,0 @@
-AIO_VER=2.7.6
-CASDK_VER=0.0.4
diff --git a/app/files/tweaks/casdk/scripts/vdt1s.sh b/app/files/tweaks/casdk/scripts/vdt1s.sh
index d85b140..db536dc 100644
--- a/app/files/tweaks/casdk/scripts/vdt1s.sh
+++ b/app/files/tweaks/casdk/scripts/vdt1s.sh
@@ -45,4 +45,5 @@ smdb-read -v -n vdm_vdt_current_data -e DR_IntakeAirTemp >> ${OUTPUT}-vdt
smdb-read -v -n vdm_vdt_current_data -e Out-CarTemperature >> ${OUTPUT}-vdt
smdb-read -v -n vdm_vdt_current_data -e EngClnt_Te_Actl >> ${OUTPUT}-vdt
smdb-read -v -n vdm_vdt_current_data -e TransmChangeLeverPosition >> ${OUTPUT}-vdt
+smdb-read -v -n vdm -e PID_Drv1Dstnc_curr >> ${OUTPUT}-vdt
smdb-read -v -n vdm -e Drv1AvlFuelE >> ${OUTPUT}-vdt
diff --git a/app/files/tweaks/casdkapps/app.breakout/app.js b/app/files/tweaks/casdkapps/app.breakout/app.js
deleted file mode 100644
index 552bfc9..0000000
--- a/app/files/tweaks/casdkapps/app.breakout/app.js
+++ /dev/null
@@ -1,245 +0,0 @@
-/**
- * Custom Applications SDK for Mazda Connect Infotainment System
- *
- * A mini framework that allows to write custom applications for the Mazda Connect Infotainment System
- * that includes an easy to use abstraction layer to the JCI system.
- *
- * Written by Andreas Schwarz (http://github.com/flyandi/mazda-custom-applications-sdk)
- * Copyright (c) 2016. All rights reserved.
- *
- * WARNING: The installation of this application requires modifications to your Mazda Connect system.
- * If you don't feel comfortable performing these changes, please do not attempt to install this. You might
- * be ending up with an unusuable system that requires reset by your Dealer. You were warned!
- *
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see http://www.gnu.org/licenses/
- *
- */
-
-/**
- * breakout
- *
- * ?? game ever written for the Mazda Infotainment System
- *
- */
-
-
-CustomApplicationsHandler.register("app.breakout", new CustomApplication({
-
- /**
- * (require)
- *
- * An object array that defines resources to be loaded such as javascript's, css's, images, etc
- *
- * All resources are relative to the applications root path
- */
-
- require: {
-
- /**
- * (js) defines javascript includes
- */
-
- js: ['breakout.js'],
-
- /**
- * (css) defines css includes
- */
-
- css: ['app.css'],
-
- /**
- * (images) defines images that are being preloaded
- *
- * Images are assigned to an id
- */
-
- images: {},
-
- },
-
- /**
- * (settings)
- *
- * An object that defines application settings
- */
-
- settings: {
-
- /**
- * (title) The title of the application in the Application menu
- */
-
- title: 'Breakout',
-
- /**
- * (statusbar) Defines if the statusbar should be shown
- */
-
- statusbar: false,
-
- /**
- * (statusbarIcon) defines the status bar icon
- *
- * Set to true to display the default icon app.png or set a string to display
- * a fully custom icon.
- *
- * Icons need to be 37x37
- */
-
- statusbarIcon: false,
-
- /**
- * (statusbarTitle) overrides the statusbar title, otherwise title is used
- */
-
- statusbarTitle: false,
-
-
- /**
- * (hasLeftButton) indicates if the UI left button / return button should be shown
- */
-
- hasLeftButton: false,
-
- /**
- * (hasMenuCaret) indicates if the menu item should be displayed with an caret
- */
-
- hasMenuCaret: false,
-
- /**
- * (hasRightArc) indicates if the standard right car should be displayed
- */
-
- hasRightArc: false,
-
- },
-
-
- /***
- *** User Interface Life Cycles
- ***/
-
- /**
- * (created)
- *
- * Executed when the application gets initialized
- *
- * Add any content that will be static here
- */
-
- created: function() {
-
- // score for this drive
- this.__highscore = 0;//this.get("highscore");
-
- // init breakout
- this.initializeGameBoard();
-
- // vehicle speed
- this.subscribe(VehicleData.vehicle.speed, function(value) {
-
- if(value > 15) {
- this.gamelabel.html("Driving").fadeIn();
- this.breakout.pause();
- } else {
- this.gamelabel.fadeOut();
- this.breakout.start();
- }
- }.bind(this));
-
-
-
-
- },
-
- /**
- * (focused)
- */
-
- focused: function() {
-
- this.breakout.start();
- },
-
- /**
- * (lost)
- */
-
- lost: function() {
-
- this.breakout.pause();
-
- },
-
- /***
- *** Events
- ***/
-
- /**
- * (event) onControllerEvent
- *
- * Called when a new (multi)controller event is available
- */
-
- onControllerEvent: function(eventId) {
-
- this.breakout.handle(eventId);
-
- },
-
-
- /***
- *** Applicaton specific methods
- ***/
-
- initializeGameBoard: function() {
-
- this.gameBoard = $("
").addClass("gameBoard").appendTo(this.canvas);
-
-
-
-
- $("
").addClass("score").append("This Drive").appendTo(this.canvas);
- this.score = $("
").addClass("score").append("0").appendTo(this.canvas);
-
- $("
").addClass("highScore").append("High Score").appendTo(this.canvas);
- this.highScore = $("
").addClass("highScore").append(this.__highscore || '0').appendTo(this.canvas);
-
- $("
").addClass("lives").append("Lives").appendTo(this.canvas);
- this.lives = $("
").addClass("lives").append("0").appendTo(this.canvas);
-
- this.gamelabel = $("
").addClass("gamelabel").append("GAME OVER").appendTo(this.canvas);
-
- this.highScore.html(this.__highscore);
-
-
- this.breakout = new breakoutboard(this.gameBoard.get(0), function (_score, _lives) {
- this.score.html(_score);
- this.lives.html(_lives)
-
- if (_score > this.__highscore) {
-
- this.__highscore = _score;
-
- this.highScore.html(_score);
-
- //this.set("highscore", _score);
- }
- }.bind(this));
-
-
- },
-
-
-
-}));
diff --git a/app/files/tweaks/casdkapps/app.breakout/breakout.js b/app/files/tweaks/casdkapps/app.breakout/breakout.js
deleted file mode 100644
index 5da306a..0000000
--- a/app/files/tweaks/casdkapps/app.breakout/breakout.js
+++ /dev/null
@@ -1,209 +0,0 @@
-// jQuery Tetris plug-in
-// by Alexander Gyoshev (http://blog.gyoshev.net/)
-// licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. (http://creativecommons.org/licenses/by-sa/3.0/)
-
-// Modified for use with Mazda Infotainment System
-
-function breakoutboard(_canvas, _scorechange ) {
-
- this.canvas = _canvas;
- this.scorechange = _scorechange;
- this.game_loop;
-
- this.ctx;
- this.x;
- this.y;
- this.paddleX;
-
-
- this.ballRadius = 5;
- this.dx = 2;
- this.dy = -2;
- this.paddleHeight = 3;
- this.paddleWidth = 60;
-
- this.brickRowCount = 6;
- this.brickColumnCount = 3;
- this.brickWidth = 35;
- this.brickHeight = 10;
- this.brickPadding = 10;
- this.brickOffsetTop = 30;
- this.brickOffsetLeft = 20;
- this.score = 0;
- this.lives = 3;
- this.bricks = [];
-
- this.buildbrick = function() {
- for(c=0; c
b.x && this.x < b.x+this.brickWidth && this.y > b.y && this.y < b.y+this.brickHeight) {
- this.dy = -this.dy;
- b.status = 0;
- this.score++;
- this.scorechange(this.score, this.lives);
- if(this.score == this.brickRowCount*this.brickColumnCount) {
- //alert("YOU WIN, CONGRATS!");
- //document.location.reload();
- this.score = 0;
- this.lives = 3;
- this.scorechange(this.score,this.lives);
-
- this.paddleX = (this.canvas.width-this.paddleWidth)/2;
- this.drawPaddle();
- this.buildbrick();
- }
- }
- }
- }
- }
- }
-
- this.drawBall = function() {
- this.ctx.beginPath();
- this.ctx.arc(this.x, this.y, this.ballRadius, 0, Math.PI*2);
- this.ctx.fillStyle = "#0095DD";
- this.ctx.fill();
- this.ctx.closePath();
- }
- this.drawPaddle = function() {
- this.ctx.beginPath();
- this.ctx.rect(this.paddleX, this.canvas.height-this.paddleHeight, this.paddleWidth, this.paddleHeight);
- this.ctx.fillStyle = "#0095DD";
- this.ctx.fill();
- this.ctx.closePath();
- }
- this.drawBricks = function() {
- for(c=0; c this.canvas.width-this.ballRadius || this.x + this.dx < this.ballRadius) {
- this.dx = -this.dx;
- }
- if(this.y + this.dy < this.ballRadius) {
- this.dy = -this.dy;
- }
- else if(this.y + this.dy > this.canvas.height-this.ballRadius-this.paddleHeight) {
- if(this.x > this.paddleX && this.x < this.paddleX + this.paddleWidth) {
- this.dy = -this.dy;
- }
- else {
- this.lives--;
- this.scorechange(this.score,this.lives);
- if(!this.lives) {
- //alert("GAME OVER");
- this.score = 0;
- this.lives = 3;
- this.scorechange(this.score,this.lives);
-
- this.paddleX = (this.canvas.width-this.paddleWidth)/2;
- this.drawPaddle();
- this.buildbrick();
-
- }
- else {
- this.x = this.canvas.width/2;
- this.y = this.canvas.height-30;
- this.dx = 3;
- this.dy = -3;
- this.paddleX = (this.canvas.width-this.paddleWidth)/2;
- }
- }
- }
- this.x += this.dx;
- this.y += this.dy;
- }
-
- }
-
-
- this.initdata = function () {
- if (this.ctx === undefined) {
- this.ctx = this.canvas.getContext("2d");
- this.x = this.canvas.width/2;
- this.y = this.canvas.height-30;
- this.paddleX = (this.canvas.width-this.paddleWidth)/2;
- this.drawPaddle();
- this.buildbrick();
- }
- return this.ctx !== undefined;
- }
-
- this.paint = function () {
- if ( this.initdata() ) {
- this.draw();
- }
- }
-
- this.pause = function()
- {
- if( this.game_loop !== undefined) clearInterval(this.game_loop);
- this.game_loop = undefined
- }
-
- this.start = function()
- {
- if (this.game_loop === undefined) {
- this.game_loop = setInterval(function(){
- this.paint();
- }.bind(this), 30);
- }
- }
-
- this.handle = function(eventId)
- {
- if (eventId == "ccw" ) {
- this.paddleX -= 7;
- }
- else if (eventId == "cw" ) {
- this.paddleX += 7;
- }
- }
-
-};
\ No newline at end of file
diff --git a/app/files/tweaks/casdkapps/app.snake/app.js b/app/files/tweaks/casdkapps/app.snake/app.js
deleted file mode 100644
index 68bca1c..0000000
--- a/app/files/tweaks/casdkapps/app.snake/app.js
+++ /dev/null
@@ -1,242 +0,0 @@
-/**
- * Custom Applications SDK for Mazda Connect Infotainment System
- *
- * A mini framework that allows to write custom applications for the Mazda Connect Infotainment System
- * that includes an easy to use abstraction layer to the JCI system.
- *
- * Written by Andreas Schwarz (http://github.com/flyandi/mazda-custom-applications-sdk)
- * Copyright (c) 2016. All rights reserved.
- *
- * WARNING: The installation of this application requires modifications to your Mazda Connect system.
- * If you don't feel comfortable performing these changes, please do not attempt to install this. You might
- * be ending up with an unusuable system that requires reset by your Dealer. You were warned!
- *
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see http://www.gnu.org/licenses/
- *
- */
-
-/**
- * snake
- *
- * Second game ever written for the Mazda Infotainment System
- *
- */
-
-
-CustomApplicationsHandler.register("app.snake", new CustomApplication({
-
- /**
- * (require)
- *
- * An object array that defines resources to be loaded such as javascript's, css's, images, etc
- *
- * All resources are relative to the applications root path
- */
-
- require: {
-
- /**
- * (js) defines javascript includes
- */
-
- js: ['snake.js'],
-
- /**
- * (css) defines css includes
- */
-
- css: ['app.css'],
-
- /**
- * (images) defines images that are being preloaded
- *
- * Images are assigned to an id
- */
-
- images: {},
-
- },
-
- /**
- * (settings)
- *
- * An object that defines application settings
- */
-
- settings: {
-
- /**
- * (title) The title of the application in the Application menu
- */
-
- title: 'Snake',
-
- /**
- * (statusbar) Defines if the statusbar should be shown
- */
-
- statusbar: false,
-
- /**
- * (statusbarIcon) defines the status bar icon
- *
- * Set to true to display the default icon app.png or set a string to display
- * a fully custom icon.
- *
- * Icons need to be 37x37
- */
-
- statusbarIcon: false,
-
- /**
- * (statusbarTitle) overrides the statusbar title, otherwise title is used
- */
-
- statusbarTitle: false,
-
-
- /**
- * (hasLeftButton) indicates if the UI left button / return button should be shown
- */
-
- hasLeftButton: false,
-
- /**
- * (hasMenuCaret) indicates if the menu item should be displayed with an caret
- */
-
- hasMenuCaret: false,
-
- /**
- * (hasRightArc) indicates if the standard right car should be displayed
- */
-
- hasRightArc: false,
-
- },
-
-
- /***
- *** User Interface Life Cycles
- ***/
-
- /**
- * (created)
- *
- * Executed when the application gets initialized
- *
- * Add any content that will be static here
- */
-
- created: function() {
-
- // score for this drive
- this.__highscore = 0;//this.get("highscore");
-
- // init Snake
- this.initializeGameBoard();
-
- // vehicle speed
- this.subscribe(VehicleData.vehicle.speed, function(value) {
-
- if(value > 15) {
- this.gamelabel.html("Driving").fadeIn();
- this.snake.pause();
- } else {
- this.gamelabel.fadeOut();
- this.snake.start();
- }
- }.bind(this));
-
-
-
-
- },
-
- /**
- * (focused)
- */
-
- focused: function() {
-
- this.snake.start();
- },
-
- /**
- * (lost)
- */
-
- lost: function() {
-
- this.snake.pause();
-
- },
-
- /***
- *** Events
- ***/
-
- /**
- * (event) onControllerEvent
- *
- * Called when a new (multi)controller event is available
- */
-
- onControllerEvent: function(eventId) {
-
- this.snake.handle(eventId);
-
- },
-
-
- /***
- *** Applicaton specific methods
- ***/
-
- initializeGameBoard: function() {
-
- this.gameBoard = $(" ").addClass("gameBoard").appendTo(this.canvas);
-
-
-
-
- $(" ").addClass("score").append("This Drive").appendTo(this.canvas);
- this.score = $(" ").addClass("score").append("0").appendTo(this.canvas);
-
- $(" ").addClass("highScore").append("High Score").appendTo(this.canvas);
- this.highScore = $(" ").addClass("highScore").append(this.__highscore || '0').appendTo(this.canvas);
-
- this.gamelabel = $(" ").addClass("gamelabel").append("GAME OVER").appendTo(this.canvas);
-
- this.highScore.html(this.__highscore);
-
-
- this.snake = new snakeboard(this.gameBoard.get(0), function (_score) {
- this.score.html(_score);
-
- if (_score > this.__highscore) {
-
- this.__highscore = _score;
-
- this.highScore.html(_score);
-
- //this.set("highscore", _score);
- }
- }.bind(this));
-
-
-
- },
-
-
-
-}));
\ No newline at end of file
diff --git a/app/files/tweaks/casdkapps/app.snake/snake.js b/app/files/tweaks/casdkapps/app.snake/snake.js
deleted file mode 100644
index 0de8935..0000000
--- a/app/files/tweaks/casdkapps/app.snake/snake.js
+++ /dev/null
@@ -1,211 +0,0 @@
-// jQuery Tetris plug-in
-// by Alexander Gyoshev (http://blog.gyoshev.net/)
-// licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. (http://creativecommons.org/licenses/by-sa/3.0/)
-
-// Modified for use with Mazda Infotainment System
-
-function snakeboard(_canvas, _scorechange ) {
-
- //Canvas stuff
-
- this.canvas = _canvas;
- this.scorechange = _scorechange;
- this.ctx;
- this.w;
- this.h;
-
- //Lets save the cell width in a variable for easy control
- this.cw = 10;
-
- this.d = "right";
- this.food;
- this.score = 0;
- this.game_loop;
-
- //Lets create the snake now
- this.snake_array; //an array of cells to make up the snake
-
-
-
- this.create_snake = function ()
- {
- var length = 5; //Length of the snake
- this.snake_array = []; //Empty array to start with
- for(var i = length-1; i>=0; i--)
- {
- //This will create a horizontal snake starting from the top left
- this.snake_array.push({x: i, y:0});
- }
- }
-
- //Lets create the food now
- this.create_food = function()
- {
- this.food = {
- x: Math.round(Math.random()*(this.w-this.cw)/this.cw),
- y: Math.round(Math.random()*(this.h-this.cw)/this.cw),
- };
- }
-
- this.check_collision = function(x, y, array)
- {
- //This function will check if the provided x/y coordinates exist
- //in an array of cells or not
- for(var i = 0; i < array.length; i++)
- {
- if(array[i].x == x && array[i].y == y)
- return true;
- }
- return false;
- }
-
-
- //Lets paint the snake now
- this.paint = function()
- {
-
- //To avoid the snake trail we need to paint the BG on every frame
- //Lets paint the canvas now
- if (this.ctx === undefined) {
- this.ctx = this.canvas.getContext("2d");
- this.w = this.canvas.width;
- this.h = this.canvas.height;
- this.cw = 10;
- this.create_snake();
- this.create_food();
- }
- if (this.ctx !== undefined) {
-
-
- this.ctx.clearRect(0, 0, this.w, this.h);
-
- //The movement code for the snake to come here.
- //The logic is simple
- //Pop out the tail cell and place it infront of the head cell
- var nx = this.snake_array[0].x;
- var ny = this.snake_array[0].y;
- //These were the position of the head cell.
- //We will increment it to get the new head position
- //Lets add proper direction based movement now
- if(this.d == "right") nx++;
- else if(this.d == "left") nx--;
- else if(this.d == "up") ny--;
- else if(this.d == "down") ny++;
-
- //Lets add the game over clauses now
- //This will restart the game if the snake hits the wall
- //Lets add the code for body collision
- //Now if the head of the snake bumps into its body, the game will restart
- if(nx == -1 || nx == this.w/this.cw || ny == -1 || ny == this.h/this.cw || this.check_collision(nx, ny, this.snake_array))
- {
- //restart game
- this.d = "right"
- this.score = 0;
- this.create_snake();
- this.create_food();
- return;
- }
-
- //Lets write the code to make the snake eat the food
- //The logic is simple
- //If the new head position matches with that of the food,
- //Create a new head instead of moving the tail
- if(nx == this.food.x && ny == this.food.y)
- {
- var tail = {x: nx, y: ny};
- this.score++;
- this.scorechange(this.score);
- //Create new food
- this.create_food();
- }
- else
- {
- var tail = this.snake_array.pop(); //pops out the last cell
- tail.x = nx; tail.y = ny;
- }
- //The snake can now eat the food.
-
- this.snake_array.unshift(tail); //puts back the tail as the first cell
-
- for(var i = 0; i < this.snake_array.length; i++)
- {
- var c = this.snake_array[i];
- //Lets paint 10px wide cells
- this.paint_cell(c.x, c.y);
- }
-
- //Lets paint the food
- this.paint_cell(this.food.x, this.food.y);
- }
- }
-
- //Lets first create a generic function to paint cells
- this.paint_cell = function(x, y)
- {
- this.ctx.fillStyle = "blue";
- this.ctx.fillRect(x*this.cw, y*this.cw, this.cw, this.cw);
- this.ctx.strokeStyle = "white";
- this.ctx.strokeRect(x*this.cw, y*this.cw, this.cw, this.cw);
- }
-
- this.pause = function()
- {
-
- if( this.game_loop !== undefined) clearInterval(this.game_loop);
- this.game_loop = undefined
-
- }
-
- this.start = function()
- {
- //Lets move the snake now using a timer which will trigger the paint function
- //every 60ms
- if (this.game_loop === undefined) {
- this.game_loop = setInterval(function(){
- this.paint();
- }.bind(this), 120);
- }
- }
-
- this.handle = function(eventId)
- {
- //We will add another clause to prevent reverse gear
- if(eventId == "leftStart" && this.d != "right") this.d = "left";
- else if(eventId == "upStart" && this.d != "down") this.d = "up";
- else if(eventId == "rightStart" && this.d != "left") this.d = "right";
- else if(eventId == "downStart" && this.d != "up") this.d = "down";
- else if (eventId == "cw" ) {
- switch (this.d) {
- case "left":
- this.d = "up";
- break;
- case "up":
- this.d = "right";
- break;
- case "right":
- this.d = "down";
- break;
- case "down":
- this.d = "left";
- break;
- }
- }
- else if (eventId == "ccw" ) {
- switch (this.d) {
- case "left":
- this.d = "down";
- break;
- case "up":
- this.d = "left";
- break;
- case "right":
- this.d = "up";
- break;
- case "down":
- this.d = "right";
- break;
- }
- }
-
- }
-};
\ No newline at end of file
diff --git a/app/files/tweaks/casdkapps/app.tetris/app.css b/app/files/tweaks/casdkapps/app.tetris/app.css
deleted file mode 100644
index d778dc7..0000000
--- a/app/files/tweaks/casdkapps/app.tetris/app.css
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Custom Applications SDK for Mazda Connect Infotainment System
- *
- * A mini framework that allows to write custom applications for the Mazda Connect Infotainment System
- * that includes an easy to use abstraction layer to the JCI system.
- *
- * Written by Andreas Schwarz (http://github.com/flyandi/mazda-custom-applications-sdk)
- * Copyright (c) 2016. All rights reserved.
- *
- * WARNING: The installation of this application requires modifications to your Mazda Connect system.
- * If you don't feel comfortable performing these changes, please do not attempt to install this. You might
- * be ending up with an unusuable system that requires reset by your Dealer. You were warned!
- *
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see http://www.gnu.org/licenses/
- *
- */
-
-/**
- * NOTICE: It's important that you target your application with the [app] attribute
- */
-
-[app="app.tetris"] {
- background: url(images/background.jpg) no-repeat center center #101010;
-}
-
- [app="app.tetris"] span,
- [app="app.tetris"] label {
- position:absolute;
- font-size:17px;
- letter-spacing:4px;
- text-transform: uppercase;
- text-shadow:#000 2px 0 0;
- width:200px;
- text-align:center;
- }
-
- [app="app.tetris"] label {
- color: rgba(255, 255, 255, 0.75);
- }
-
- [app="app.tetris"] span {
- font-size:40px;
- background:rgba(0, 0, 0, 0.25);
- }
-
- [app="app.tetris"] label.score {
- right:45px;
- top:40px;
- }
-
- [app="app.tetris"] span.score {
- right:45px;
- top:70px;
- }
-
- [app="app.tetris"] label.highScore {
- right:45px;
- top:150px;
- }
-
- [app="app.tetris"] span.highScore {
- right:45px;
- top:180px;
- }
-
- [app="app.tetris"] label.gamelabel {
- right:50%;
- width:200px;
- top:50%;
- margin-top:-5px;
- margin-right:-100px;
- text-align:center;
- text-shadow:#000 0 0 15px;
- font-size:20px;
- display:none;
- }
-
- [app="app.tetris"] .gameBoard {
- border: 1px solid #ccc;
- border-radius: .4em;
- position:absolute;
- top:15px;
- left:50%;
- margin-left:-100px;
- background:rgba(255, 255, 255, 0.05);
- overflow:hidden;
- }
-
- [app="app.tetris"] .gameBoard .tile {
- border-radius: 2px;
- position: absolute;
- width: 19px;
- height: 19px;
- border: 1px solid #101010;
- }
-
- [app="app.tetris"] .gameBoard .type-I { background-color: #FF73FF; }
- [app="app.tetris"] .gameBoard .type-O { background-color: #FFFF73; }
- [app="app.tetris"] .gameBoard .type-T { background-color: #B973FF; }
- [app="app.tetris"] .gameBoard .type-S { background-color: #73FF73; }
- [app="app.tetris"] .gameBoard .type-Z { background-color: #FF7373; }
- [app="app.tetris"] .gameBoard .type-J { background-color: #73B9FF; }
- [app="app.tetris"] .gameBoard .type-L { background-color: #FFA64D; }
-
- [app="app.tetris"] .gameBoard .frozen {
- }
diff --git a/app/files/tweaks/casdkapps/app.tetris/app.js b/app/files/tweaks/casdkapps/app.tetris/app.js
deleted file mode 100644
index dd67d78..0000000
--- a/app/files/tweaks/casdkapps/app.tetris/app.js
+++ /dev/null
@@ -1,257 +0,0 @@
-/**
- * Custom Applications SDK for Mazda Connect Infotainment System
- *
- * A mini framework that allows to write custom applications for the Mazda Connect Infotainment System
- * that includes an easy to use abstraction layer to the JCI system.
- *
- * Written by Andreas Schwarz (http://github.com/flyandi/mazda-custom-applications-sdk)
- * Copyright (c) 2016. All rights reserved.
- *
- * WARNING: The installation of this application requires modifications to your Mazda Connect system.
- * If you don't feel comfortable performing these changes, please do not attempt to install this. You might
- * be ending up with an unusuable system that requires reset by your Dealer. You were warned!
- *
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see http://www.gnu.org/licenses/
- *
- */
-
-/**
- * Tetris
- *
- * First game ever written for the Mazda Infotainment System
- *
- */
-
-
-CustomApplicationsHandler.register("app.tetris", new CustomApplication({
-
- /**
- * (require)
- *
- * An object array that defines resources to be loaded such as javascript's, css's, images, etc
- *
- * All resources are relative to the applications root path
- */
-
- require: {
-
- /**
- * (js) defines javascript includes
- */
-
- js: ['tetris.js'],
-
- /**
- * (css) defines css includes
- */
-
- css: ['app.css'],
-
- /**
- * (images) defines images that are being preloaded
- *
- * Images are assigned to an id
- */
-
- images: {},
-
- },
-
- /**
- * (settings)
- *
- * An object that defines application settings
- */
-
- settings: {
-
- /**
- * (title) The title of the application in the Application menu
- */
-
- title: 'Tetris',
-
- /**
- * (statusbar) Defines if the statusbar should be shown
- */
-
- statusbar: false,
-
- /**
- * (statusbarIcon) defines the status bar icon
- *
- * Set to true to display the default icon app.png or set a string to display
- * a fully custom icon.
- *
- * Icons need to be 37x37
- */
-
- statusbarIcon: false,
-
- /**
- * (statusbarTitle) overrides the statusbar title, otherwise title is used
- */
-
- statusbarTitle: false,
-
-
- /**
- * (hasLeftButton) indicates if the UI left button / return button should be shown
- */
-
- hasLeftButton: false,
-
- /**
- * (hasMenuCaret) indicates if the menu item should be displayed with an caret
- */
-
- hasMenuCaret: false,
-
- /**
- * (hasRightArc) indicates if the standard right car should be displayed
- */
-
- hasRightArc: false,
-
- },
-
-
- /***
- *** User Interface Life Cycles
- ***/
-
- /**
- * (created)
- *
- * Executed when the application gets initialized
- *
- * Add any content that will be static here
- */
-
- created: function() {
-
- // score for this drive
- this.__score = 0;
- this.__highscore = this.get("highscore");
-
- // init tetris
- this.initializeGameBoard();
-
- // vehicle speed
- this.subscribe(VehicleData.vehicle.speed, function(value) {
-
- if(value > 15) {
- this.gamelabel.html("Driving").fadeIn();
- this.gameBoard.data('tetris').pause();
- } else {
- this.gamelabel.fadeOut();
- this.gameBoard.data('tetris').start();
- }
- }.bind(this));
- },
-
- /**
- * (focused)
- */
-
- focused: function() {
-
- this.gameBoard.data('tetris').start();
- },
-
- /**
- * (lost)
- */
-
- lost: function() {
-
- this.gameBoard.data('tetris').pause();
-
- },
-
- /***
- *** Events
- ***/
-
- /**
- * (event) onControllerEvent
- *
- * Called when a new (multi)controller event is available
- */
-
- onControllerEvent: function(eventId) {
-
- this.gameBoard.data('tetris').handle(eventId);
-
- },
-
-
- /***
- *** Applicaton specific methods
- ***/
-
- initializeGameBoard: function() {
-
- this.gameBoard = $("
").addClass("gameBoard").appendTo(this.canvas);
-
- $(" ").addClass("score").append("This Drive").appendTo(this.canvas);
- this.score = $(" ").addClass("score").append("0").appendTo(this.canvas);
-
- $(" ").addClass("highScore").append("High Score").appendTo(this.canvas);
- this.highScore = $(" ").addClass("highScore").append(this.__highscore || '0').appendTo(this.canvas);
-
- this.gamelabel = $(" ").addClass("gamelabel").append("GAME OVER").appendTo(this.canvas);
-
- this.gameBoard.tetris({
- tileSize: 20,
- }).on({
-
- rowCompleted: function() {
- this.__score++;
-
- this.score.html(this.__score);
-
- if(!this.__highscore) this.__highscore = 0;
-
- if(this.__score > this.__highscore) {
-
- this.__highscore = this.__score;
-
- this.highScore.html(this.__highscore);
-
- this.set("highscore", this.__highscore);
- }
-
- }.bind(this),
-
- gameOver: function() {
-
- this.gameBoard.data('tetris').pause();
-
- this.gamelabel.html("Game Over").fadeIn();
-
-
- }.bind(this),
-
- restartGame: function() {
- this.__score = 0;
- this.score.html(this.__score);
- this.gamelabel.fadeOut();
-
- }.bind(this)
- });
-
- },
-
-
-
-}));
\ No newline at end of file
diff --git a/app/files/tweaks/casdkapps/app.tetris/tetris.js b/app/files/tweaks/casdkapps/app.tetris/tetris.js
deleted file mode 100644
index 1b0173e..0000000
--- a/app/files/tweaks/casdkapps/app.tetris/tetris.js
+++ /dev/null
@@ -1,437 +0,0 @@
-// jQuery Tetris plug-in
-// by Alexander Gyoshev (http://blog.gyoshev.net/)
-// licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. (http://creativecommons.org/licenses/by-sa/3.0/)
-
-// Modified for use with Mazda Infotainment System
-
-(function($) {
- var extend = $.extend,
- proxy = $.proxy,
- keys = {
- left: 37,
- up: 38,
- right: 39,
- down: 40
- },
-
- // jQuery plug-in
- tetris = $.fn.tetris = function(options) {
- options = extend($.fn.tetris.defaults, options);
-
- return this.each(function() {
- var $this = $(this), instance;
- if (!$this.data("tetris")) {
- instance = new impl(this, options);
- $this.data("tetris", instance);
- }
- });
- },
-
- // Tetris implementation
- impl = tetris.implementation = function(element, options) {
- var $element = $(element),
- that = this;
-
- extend(that, {
- element: element,
- $element: $element,
- frozen: {}
- }, options);
-
- that.currentTile = that.generateTile();
-
- $element
- .css({
- width: that.cols * that.tileSize,
- height: that.rows * that.tileSize
- })
- .bind({
- repaint: proxy(that.repaint, that),
- tick: proxy(that.tick, that),
- tileDrop: proxy(that.tileDrop, that),
- rowCompleted: proxy(that.rowCompleted, that)
- /// TODO: handle gameOver event with dignity
- })
- .trigger('repaint');
- };
-
-
- tetris.defaults = {
- rows: 22,
- cols: 10,
- tileSize: 16
- };
-
- impl.prototype = {
- handle: function(eventId) {
-
- if(this.isGameOver) {
-
- if(eventId == "selectStart") {
- this.restartGame();
- }
-
- } else {
-
- switch(eventId) {
-
- case "upStart":
- case "ccw":
- case "cw":
- this.rotate();
- break;
-
- case "leftStart":
- this.move(-1);
- break;
-
- case "rightStart":
- this.move(1);
- break;
-
- case "downStart":
- this.down();
- break;
- }
- }
- },
- tick: function() {
- this.down();
- this.$element.trigger('repaint');
- },
- tileDrop: function() {
- var that = this;
-
- that.freeze(that.currentTile);
-
- that.$element.find('.current').remove();
-
- that.currentTile = that.generateTile();
-
- if (!that.isValidLocation(that.currentTile.shape)) {
- this.gameover();
- }
- },
- rowCompleted: function(e, rowStart) {
- var that = this,
- i,
- cols = that.cols,
- tileSize = that.tileSize;
-
- that.$element.find('.frozen')
- .filter(function() {
- var index = $(this).data('index');
- return index - (index % cols) == rowStart;
- })
- .remove()
- .end()
- .filter(function() {
- var index = $(this).data('index');
- if (index - (index % cols) < rowStart)
- return index - (index % cols) < rowStart;
- })
- .css('top', function() {
- return parseInt($(this).css('top')) + tileSize;
- })
- .each(function() {
- var t = $(this);
- t.data('index', t.data('index') + cols);
- });
-
- for (i = rowStart; i < rowStart + cols; i++) {
- delete that.frozen[i];
- }
-
- for (i = rowStart-1; i >= 0; i--) {
- if (that.frozen[i]) {
- that.frozen[i + cols] = true;
- delete that.frozen[i];
- }
- }
- },
- isValidLocation: function(location) {
- var i, j,
- cols = this.cols,
- maxStageIndex = cols * this.rows;
-
- for (i = 0; i < location.length; i++) {
- if (location[i] < 0 || location[i] >= maxStageIndex
- || this.frozen[location[i]]) {
- return false;
- }
-
- for (j = 0; j < i; j++) {
- if (((location[i] % cols == 0) && (location[j] % cols == cols - 1))
- || ((location[i] % cols == cols - 1) && (location[j] % cols == 0)))
- return false;
- }
- }
-
- return true;
- },
- move: function(modifier) {
- var that = this,
- i,
- cols = that.cols,
- shape = that.currentTile.shape,
- newLocation = $.map(shape, function(x) {
- return x + modifier;
- }),
- hitsEdge = false;
-
- for (i = 0; i < shape.length; i++) {
- if ((modifier < 0 && shape[i] % cols == 0)
- || (modifier > 0 && shape[i] % cols == cols - 1)) {
- hitsEdge = true;
- }
- }
-
- if (!hitsEdge && that.isValidLocation(newLocation)) {
- that.currentTile.shape = newLocation;
- that.$element.trigger('repaint');
- }
- },
- rotate: function() {
- var that = this,
- currentTile = that.currentTile,
- newLocation = currentTile.shape.slice(),
- rotation;
-
- if (currentTile.shapeStates) {
- rotation = currentTile.shapeStates[currentTile.shapeStateIndex];
-
- newLocation = $.map(newLocation, function(x, index) { return x + rotation[index]; });
-
- } else if (currentTile.shapeRotation) {
- newLocation = currentTile.shapeRotation(newLocation);
- }
-
- if (that.isValidLocation(newLocation)) {
- currentTile.shape = newLocation;
- if (currentTile.shapeStates) {
- currentTile.shapeStateIndex = (++currentTile.shapeStateIndex) % currentTile.shapeStates.length;
- }
- }
-
- that.$element.trigger('repaint');
- },
- down: function() {
- var that = this,
- cols = that.cols,
- maxStageIndex = cols * that.rows,
- shape = that.currentTile.shape,
- newLocation = $.map(shape, function(x) { return x + cols; });
-
- if (that.isValidLocation(newLocation)) {
- that.currentTile.shape = newLocation;
- that.$element.trigger('repaint');
- } else {
- that.$element.trigger('tileDrop');
- }
- },
- generateTile: function(type) {
- // build shape cache
- var cols = this.cols,
- center = Math.floor(cols/2) + cols,
- direction = [-cols, +1, +cols, -1];
-
- function squareRotation(shape) {
- var directions = [-cols-1, -cols, -cols+1,
- -1, 0, +1,
- +cols-1, +cols, +cols+1],
- rotation = [-cols+1, +1, +cols+1,
- -cols , 0, +cols,
- -cols-1, -1, +cols-1],
- center = shape[0];
-
- return $.map(shape, function(coord) {
- for (var i = 0; i < directions.length; i++) {
- if (coord == center + directions[i]) {
- return center + rotation[i];
- }
- }
- });
- }
-
- if (!this.tileCache) {
- /// TODO: allow extensibility for custom tiles
- /// TODO: move this somewhere else
- this.tileCache = [
- {
- type: 'O',
- shape: [ center, center+1, center+direction[0], center+direction[0]+1 ]
- },
- {
- type: 'J',
- shape: [ center, center-1, center+1, center-1+direction[0] ],
- shapeRotation: squareRotation
- },
- {
- type: 'L',
- shape: [ center, center-1, center+1, center+1+direction[0] ],
- shapeRotation: squareRotation
- },
- {
- type: 'I',
- shape: [ center-1, center, center+1, center+2 ],
- shapeStates: [
- [+2-cols, +1, +cols, +2*cols-1],
- [+1+2*cols, +cols, -1, -2-cols],
- [-2+cols, -1, -cols, -2*cols+1],
- [-1-2*cols, -cols, +1, +2+cols]
- ],
- shapeStateIndex: 0
- },
- {
- type: 'S',
- shape: [ center, center-1, center+direction[0], center+direction[0]+1 ],
- shapeRotation: squareRotation
- },
- {
- type: 'Z',
- shape: [ center, center+1, center+direction[0], center+direction[0]-1 ],
- shapeRotation: squareRotation
- },
- {
- type: 'T',
- shape: [ center, center-1, center+1, center+direction[0] ],
- shapeRotation: squareRotation
- }
- ];
- }
-
- if (typeof type != 'undefined') {
- for (var i = 0; i < this.tileCache.length; i++) {
- if (this.tileCache[i].type == type) {
- tileIndex = i;
- break;
- }
- }
- } else {
- // Random Generator using Knuth shuffle (http://tetris.wikia.com/wiki/Random_Generator)
- if (!this.randomBag || this.randomBag.length == 0) {
- var tilesCount = this.tileCache.length;
- this.randomBag = [];
-
- for (var i = 0; i < tilesCount; i++) {
- this.randomBag[i] = i;
- }
-
- for (var i = tilesCount - 1; i > 0; i--) {
- var rand = Math.floor(Math.random() * i),
- tmp = this.randomBag[rand];
- this.randomBag[rand] = this.randomBag[i];
- this.randomBag[i] = tmp;
- }
- }
-
- tileIndex = this.randomBag.shift();
- }
-
- return extend({}, this.tileCache[tileIndex], { shapeLocation: squareRotation });
- },
- freeze: function(tile) {
- var frozenTilesHtml = [],
- shape = tile.shape,
- tileSize = this.tileSize,
- cols = this.cols,
- rowsToCheck = [];
-
- for (var i = 0; i < shape.length; i++) {
- if ($.inArray(shape[i] - (shape[i] % cols), rowsToCheck) === -1) {
- rowsToCheck.push(shape[i] - (shape[i] % cols));
- }
-
- this.frozen[shape[i]] = true;
- frozenTilesHtml.push('
');
- }
-
- $(frozenTilesHtml.join(''))
- .each(function(i) {
- $(this).css({
- left: (shape[i] % cols) * tileSize,
- top: Math.floor(shape[i] / cols) * tileSize
- })
- .data('index', shape[i]);
- })
- .appendTo(this.element);
-
- while (rowsToCheck.length) {
- var rowStart = rowsToCheck.shift(),
- broken = false;
-
- for (var i = rowStart; i < rowStart + cols; i++) {
- if (!this.frozen[i])
- broken = true;
- }
-
- if (!broken) {
- this.$element.trigger('rowCompleted', rowStart);
- }
- }
- },
- repaint: function() {
- var cols = this.cols,
- tileSize = this.tileSize,
- shape = this.currentTile.shape,
- currentTile = this.$element.find('.current');
-
- if (currentTile.length == 0) {
- // render new tile
- var currentTileHtml = [];
-
- for (var h = 0; h < shape.length; h++) {
- currentTileHtml.push('
');
- }
-
- currentTile = this.$element.append(currentTileHtml.join('')).find('.current');
- }
-
- // position shape
- for (var i = 0; i < shape.length; i++) {
- currentTile.eq(i).css({
- left: (shape[i] % cols) * tileSize,
- top: Math.floor(shape[i] / cols) * tileSize
- });
- }
- },
- start: function() {
- if(this.isStarted) return;
- this.isStarted = true;
- var $element = this.$element;
-
- if (!this.isValidLocation(this.currentTile.shape)) {
- this.gameover();
- }
-
- /// TODO: improve timer
- this.timer = setInterval(function() {
- $element.trigger('tick');
- }, 600);
-
- },
- pause: function() {
- this.isStarted = false;
- if (this.timer) {
- window.clearInterval(this.timer);
- this.timer = null;
- }
- },
- gameover: function() {
- this.isStarted = false;
- this.isGameOver = true;
- this.$element.trigger('gameOver');
- },
- restartGame: function() {
- this.$element.empty();
- this.$element.trigger('restartGame');
- this.isStarted = false;
- this.isGameOver = false;
-
- this.frozen = {};
-
- this.start();
-
- }
- };
-})(jQuery);
\ No newline at end of file
diff --git a/app/files/tweaks/config/BackgroundRotator/jci/gui/common/css/common.css b/app/files/tweaks/config/BackgroundRotator/jci/gui/common/css/common.css
deleted file mode 100644
index 68f01f6..0000000
--- a/app/files/tweaks/config/BackgroundRotator/jci/gui/common/css/common.css
+++ /dev/null
@@ -1,78 +0,0 @@
-/* CSS Document */
-
-body {
- /* default text color */
- color: white;
- /* default font */
- font-family: "Tipperary", Arial, Helvetica, sans-serif;
- font-weight: normal;
- font-style: normal;
- /* default direction */
- direction: ltr;
- /* default text alignment */
- text-align: left;
-}
-.CommonBgImg {
- background-image: url("../images/background.png");
- background-repeat: no-repeat;
- width: 800px;
- height: 480px;
- position: absolute;
- left: 0px;
- top: 0px;
- z-index: 0;
- background-position: 0;
- animation: slide 600s steps(10, end) infinite;
-}
-.CommonRightChrome {
- background: url("../controls/LeftBtn/images/ChromeArcRight.png") no-repeat;
- position: absolute;
- width: 37px;
- height: 416px;
- top: 64px;
- left: 766px;
- z-index: 8;
-}
-.CommonNonTransparentDiv {
- background-color: #FFF;
- opacity: 0.01;
- position: absolute;
- width: 800px;
- height: 480px;
- top: 0px;
- left: 0px;
- z-index: 0;
-}
-/*Keyframe classes for fade animations (W3 Standard) */
-
-@keyframes opacZeroToFull {
- 0% {
- opacity: 0;
- }
- 100% {
- opacity: 1;
- }
-}
-@keyframes opacFullToZero {
- 0% {
- opacity: 1;
- }
- 100% {
- opacity: 0;
- }
-}
-/*CSS Animation classes for fade animations*/
-
-.FadeOut {
- animation: opacFullToZero 0.3s ease-in-out both;
-}
-.FadeIn {
- animation: opacZeroToFull 0.3s ease-in-out both;
-}
-/*Background switch animation for 10 backgrounds 8000px*/
-
-@keyframes slide {
- to {
- background-position: -8000px;
- }
-}
diff --git a/app/files/tweaks/config/aio-app/autoScreenOff.js b/app/files/tweaks/config/aio-app/autoScreenOff.js
new file mode 100644
index 0000000..84061cf
--- /dev/null
+++ b/app/files/tweaks/config/aio-app/autoScreenOff.js
@@ -0,0 +1,13 @@
+setTimeout(function() {
+ var turnScreenOff = setInterval(function() {
+ if (framework.getCurrCtxtId() === "DisplayOff") {
+ clearInterval(turnScreenOff);
+ turnScreenOff = null;
+ } else {
+ framework.sendEventToMmui("common", "Global.IntentSettingsTab", { payload: { settingsTab: "Display" } });
+ }
+ setTimeout(function() {
+ framework.sendEventToMmui("syssettings", "SelectDisplayOff");
+ }, 1500);
+ }, 3000);
+}, 10000);
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/blank-album-art-frame/jci/gui/common/controls/InCall2/images/NowPlayingImageFrame.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/blank-album-art-frame/jci/gui/common/controls/InCall2/images/NowPlayingImageFrame.png
deleted file mode 100644
index d387b2c..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/blank-album-art-frame/jci/gui/common/controls/InCall2/images/NowPlayingImageFrame.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/blank-album-art-frame/jci/gui/common/controls/NowPlaying4/images/NowPlayingImageFrame.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/blank-album-art-frame/jci/gui/common/controls/NowPlaying4/images/NowPlayingImageFrame.png
deleted file mode 100644
index d387b2c..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/blank-album-art-frame/jci/gui/common/controls/NowPlaying4/images/NowPlayingImageFrame.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/blank-album-art-frame/jci/gui/common/images/no_artwork_icon.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/blank-album-art-frame/jci/gui/common/images/no_artwork_icon.png
deleted file mode 100644
index 9831f17..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/blank-album-art-frame/jci/gui/common/images/no_artwork_icon.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_CN_Croatian.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_CN_Croatian.png
deleted file mode 100644
index 525efb0..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_CN_Croatian.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_CN_French.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_CN_French.png
deleted file mode 100644
index 9728ecc..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_CN_French.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_CZ_Czech.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_CZ_Czech.png
deleted file mode 100644
index cf8a0ef..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_CZ_Czech.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_DA_Danish.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_DA_Danish.png
deleted file mode 100644
index 6d04a9e..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_DA_Danish.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_DE_German.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_DE_German.png
deleted file mode 100644
index 1be21b3..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_DE_German.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_FR_French.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_FR_French.png
deleted file mode 100644
index 9728ecc..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_FR_French.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_HB_Hebrew.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_HB_Hebrew.png
deleted file mode 100644
index a83e436..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_HB_Hebrew.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_IT_Italian.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_IT_Italian.png
deleted file mode 100644
index fae058d..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_IT_Italian.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_KO_Korean.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_KO_Korean.png
deleted file mode 100644
index 23ed7a0..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_KO_Korean.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_NA_Spanish.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_NA_Spanish.png
deleted file mode 100644
index 03d7bfa..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_NA_Spanish.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_NL_Dutch.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_NL_Dutch.png
deleted file mode 100644
index 18da441..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_NL_Dutch.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_PL_Polish.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_PL_Polish.png
deleted file mode 100644
index 24aea4c..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_PL_Polish.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_RU_Russian.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_RU_Russian.png
deleted file mode 100644
index d5fc463..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_RU_Russian.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_SK_Slovak.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_SK_Slovak.png
deleted file mode 100644
index 51643d6..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_SK_Slovak.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_SP_Spanish.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_SP_Spanish.png
deleted file mode 100644
index 03d7bfa..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_SP_Spanish.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_TH_Thai.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_TH_Thai.png
deleted file mode 100644
index ddc6598..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_TH_Thai.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_TR_Turkish.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_TR_Turkish.png
deleted file mode 100644
index c058ce8..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_TR_Turkish.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_UK_English.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_UK_English.png
deleted file mode 100644
index fabdb1f..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_UK_English.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_US_English.png b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_US_English.png
deleted file mode 100644
index 23ed7a0..0000000
Binary files a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/config_org/safety-warning-reverse-camera/jci/nativegui/images/SafetyText_US_English.png and /dev/null differ
diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/restore.sh b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/restore.sh
index 2888cd2..5fc7e8f 100644
--- a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/restore.sh
+++ b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/restore.sh
@@ -8,8 +8,8 @@
hwclock --hctosys
# AIO Variables
-AIO_VER=0.6
-AIO_DATE=2018.01.31
+AIO_VER=0.7
+AIO_DATE=2018.06.01
# TO DELETE ALL BACKUP FILES CHENGE DEL_BAKUPS=0 TO DEL_BAKUPS=1
DEL_BAKUPS=0
diff --git a/app/files/tweaks/config/aio-app/jci/gui/addon-common/jquery.min.js b/app/files/tweaks/config/aio-app/jci/gui/addon-common/jquery.min.js
deleted file mode 100644
index e836475..0000000
--- a/app/files/tweaks/config/aio-app/jci/gui/addon-common/jquery.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML=" ",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML=" ","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML=" ",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0;
-}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" a ",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,""," "],legend:[1,""," "],area:[1,""," "],param:[1,""," "],thead:[1,""],tr:[2,""],col:[2,""],td:[3,""],_default:l.htmlSerialize?[0,"",""]:[1,"X","
"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|?\w+;/,ha=/r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?""!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h ]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/' +
- '';
- /* AIO-remove
- $.getScript("apps/_videoplayer/js/videoplayer-v2.js");
- AIO-remove */
+ '';
+ // Append the control div with black overlay background to body so it overlays everything
+ // this div is removed in the cleanUp() function
+ document.body.appendChild(document.createElement('div')).className = "VPControlOverlay";
+ this.playerControl = '' +
+ '' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ';
+ document.getElementsByClassName('VPControlOverlay')[0].innerHTML = this.playerControl;
+ setTimeout(function() {
+ // We initialize the video player with this function
+ StartVideoPlayerApp();
+ }, 700);
+}
+if (typeof player === "undefined") {
+ player = framework.getAppInstance("_videoplayer");
}
-
/*
* =========================
* Standard Template API functions
* =========================
*/
-
+/*
+ * singleClick - used by handleControllerEvent for short click multicontroller events
+ * @param clickTarget (function) Function to run on a single click
+ * @param eventID (string) event ID to pass to clickTarget
+ *
+ */
+VideoPlayerTmplt.prototype.singleClick = function(clickTarget, eventID) {
+ clearTimeout(this.longholdTimeout);
+ this.longholdTimeout = null;
+ (player.hold) ? player.hold = false: (typeof clickTarget === "function") ? clickTarget(eventID) : null;
+}
+/*
+ * longClick - used by handleControllerEvent for long hold multicontroller events
+ * @param clickFunction (function) Function to run on a long click
+ * @param eventID (string) event ID to passs to clickFunction
+ */
+VideoPlayerTmplt.prototype.longClick = function(clickFunction, eventID) {
+ this.longholdTimeout = setTimeout(function() {
+ player.hold = true;
+ (typeof clickFunction === "function") ? clickFunction(eventID): null;
+ }, 1200);
+}
/* (internal - called by the framework)
* Handles multicontroller events.
* @param eventID (string) any of the Internal event name values in IHU_GUI_MulticontrollerSimulation.docx (e.g. 'cw',
@@ -129,20 +159,25 @@ function VideoPlayerTmplt(uiaId, parentDiv, templateID, controlProperties) {
VideoPlayerTmplt.prototype.handleControllerEvent = function(eventID) {
log.debug("handleController() called, eventID: " + eventID);
- var retValue = handleCommander(eventID);
+ var retValue;
+ if (eventID.indexOf('Start') !== -1) {
+ retValue = this.longClick(handleHoldCommander, eventID);
+ } else {
+ retValue = this.singleClick(handleCommander, eventID);
+ }
//case "down":
//case "up":
- //case "downStart":
- //case "upStart":
//case "ccw":
//case "cw":
- //case "leftStart":
//case "select":
- //case "rightStart":
//case "left":
//case "right":
- //case "selectStart":
+ // case "downStart":
+ // case "upStart":
+ // case "leftStart":
+ // case "rightStart":
+ // case "selectStart":
//case "selectHold":
//case "leftHold":
//case "rightHold":
@@ -159,11 +194,12 @@ VideoPlayerTmplt.prototype.handleControllerEvent = function(eventID) {
* its controls.
*/
VideoPlayerTmplt.prototype.cleanUp = function() {
+ $('#SbSpeedo').removeClass('stayHidden');
var child = document.getElementById(this.divElt.id);
child.parentNode.removeChild(child);
-
this.divElt = null;
child = null;
+ document.getElementsByClassName('VPControlOverlay')[0].parentNode.removeChild(document.getElementsByClassName('VPControlOverlay')[0]);
$('#SbSpeedo, #Sbfuel-bar-wrapper').fadeIn();
};
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/nothing/jci/gui/apps/system/js/systemApp.59.js b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/nothing/jci/gui/apps/system/js/systemApp.59.js
deleted file mode 100644
index ead63e5..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/nothing/jci/gui/apps/system/js/systemApp.59.js
+++ /dev/null
@@ -1,2432 +0,0 @@
-
-/*
- Copyright 2012 by Johnson Controls
- __________________________________________________________________________
-
- Filename: systemApp.js
- __________________________________________________________________________
-
- Project: JCI-IHU
- Language: EN
- Author: awoodhc
- Date: 05.7.2012
- __________________________________________________________________________
-
- Description: IHU GUI System App
-
- Revisions:
- v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
- v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
- v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between contexts.
- v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
- v0.5 - 14-June-2012 Language Localization added to ListCtrls
- v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
- v0.7 - 22-June-2012 Code review changes and reworked context handling
- v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
- v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
- v1.0 - 31-July-2012 Updated Multicontroller behavior.
- v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
- v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
- v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
- v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
- v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
- v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
- v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
- v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
- v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
- v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
- v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
- v2.2 (20-Nov-2012) Stitcher enabled
- v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
- v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
- v2.5 (17-Jan-2013) Changed one event name
- v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
- v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
- v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
- v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
-
- __________________________________________________________________________
-
- */
-
-log.addSrcFile("systemApp.js", "system");
-
-/**********************************************
- * Start of Base App Implementation
- *
- * Code in this section should not be modified
- * except for function names based on the appname
- *********************************************/
-
-function systemApp(uiaId)
-{
- log.debug("constructor called...");
-
- // Base application functionality is provided in a common location via this call to baseApp.init().
- // See framework/js/BaseApp.js for details.
- baseApp.init(this, uiaId);
-
- // All feature-specific initialization is done in appInit()
-}
-
-/*
- * Called just after the app is instantiated by framework.
- * App-specific variables should be declared here.
- */
-systemApp.prototype.appInit = function()
-{
- if (framework.debugMode)
- {
- utility.loadScript("apps/system/test/systemAppTest.js");
- }
-
- //@formatter:off
-
- this._initEntertainmentDataList();
- this._initApplicationsDataList();
- this._initCommunicationsDataList();
-
- this._contextTable = {
-
- "HomeScreen" : {
- "hideHomeBtn" : true,
- "template" : "MainMenuTmplt",
- "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
- "controlProperties": {
- "MainMenuCtrl" : {
- "selectCallback":this._selectCallbackHomeScreen.bind(this),
- } // end of properties for "MainMenuCtrl"
- }, // end of list of controlProperties
- }, // end of "systemAppContext1"
-
- "Communication" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Communication",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": this._communicationsDataList,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyCommunication.bind(this),
- "contextInFunction" : this._CommCtxtContextIn.bind(this),
- }, // end of "Communication"
-
- "Entertainment" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Entertainment",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyEntertainment.bind(this),
- }, // end of "Entertainment"
-
- "Applications" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Applications",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "Applications"
-
- "VehicleStatusMonitor" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "VehicleStatusMonitor",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "VehicleStatusMonitor"
-
- "NoConnectionNotify" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoConnectionNotify.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.No"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoConnectionNotifyTitle',
- text2Id : 'NoConnectionNotifyText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "NotifyDialog" : {
- "template" : "Dialog3Tmplt",
- "sbNameId" : null,
- "readyFunction" : this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
- "displayedFunction" : this._NotifyDialogCtxtTmpltDisplayed.bind(this),
- "noLongerDisplayedFunction" : this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectCallbackNotifyDialog.bind(this),
- "contentStyle" : "style17",
- "buttonCount" : 3,
- "initialFocus" : 2,
- "buttonConfig" : {
- "button1" : {
- labelId : "NotifyOff",
- appData : "SelectNotifyOff",
- },
- "button2" : {
- labelId : "NotifyIgnore",
- appData : "Global.No",
- },
- "button3" : {
- labelId : "NotifyRead",
- appData : "SelectNotifyMessage"
- }
- }, // end of buttonConfig
- "text1Id" : "NotifyIncomingMsg",
- "text2" : "",
- "text3Id" : "NotifyReadNow",
- } // end of properties for dialog
- }, // end of controlProperties
- }, // end of "NotifyDialog"
-
- "NotificationList" : {
- "leftBtnStyle" : "goBack",
- "template" : "List2Tmplt",
- "sbNameId" : "Notifications",
- "readyFunction" : this._readyNotificationList.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedNotificationList.bind(this),
- "controlProperties": {
- "List2Ctrl" : {
- titleConfiguration : "noTitle",
- numberedList : true,
- selectCallback: this._selectNotificationListItem.bind(this),
- title : null,
- dataList : null,
- },
- }, // end of controlProperties
- }, // end of "NotificationList"
-
- "NotificationListRetry" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackNotificationListRetry.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Cancel",
- appData : "Global.Cancel"
- },
- button2 : {
- labelId : "RetryLabel",
- appData : "SelectRetry"
- },
- },
- text1Id : 'FailedNotificationRetrieval',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of NotificationListRetry
-
- "NoDevice" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoDevice.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.GoBack"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoDeviceTitle',
- text2Id : 'NoDeviceText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "DisplayOff" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : this._displayOffUserActivity.bind(this),
- showClock : true,
- }
- },
- }, // end of "DisplayOff"
-
- "Disclaimer" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "WarningTitle",
- contentStyle : "style02",
- fullScreen : true,
- defaultSelectCallback : this._selectCallbackDisclaimer.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "agree",
- appData : "Global.Yes"
- },
- },
- text1Id : 'DisclaimerText',
- }
- },
- "displayedFunction" : this._displayedDisclaimer.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedDisclaimer.bind(this),
- }, // end of Disclaimer
-
- "SystemWarning" : {
- "hideHomeBtn" : true,
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "TempWarning",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackSystemWarning.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "TempWarningText",
- }
- },
- },
-
- "SourceReconnect" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnect.bind(this),
- "contentStyle" : "style14",
- "fullScreen" : false,
- "text1Id" : null,
- "meter" : {"meterType":"indeterminate", "meterPath":"common/images/IndeterminateMeter_2.png"},
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "ReconnectEntMenuButton",
- appData : "SelectEntertainmentMenu"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnect.bind(this),
- },
-
- "SourceReconnectFailed" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnectFailed.bind(this),
- "contentStyle" : "style02",
- "fullScreen" : false,
- "text1Id" : null,
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnectFailed.bind(this),
- },
-
- "IntroAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "QuickStartLoop" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["QUICKTRANLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "PowerDownAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["EXITLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "IdleStandby" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "WaitForEnding" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "EnableRVR" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackEnableRVR.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "SiriDisabled",
- }
- },
- "readyFunction" : this._readyEnableRVR.bind(this),
- },
-
- "RVRInstructions" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "InitiateSiri",
- }
- },
- },
-
- "SiriInSession" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "Siri",
- contentStyle : "style14",
- "meter" : {"meterType":"indeterminate", "meterPath":"apps/system/images/IcnSiri.png"}
- }
- },
- },
-
- "SiriLaunchingError" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- //titleStyle : "titleStyle01",
- // titleId : "Siri",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "DisconnectThenReconnect",
- }
- },
- "readyFunction" : this._readySiriLaunchingError.bind(this),
- },
- }; // end of this._contextTable object
-
- //@formatter:off
- this._messageTable = {
- // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
- "StatusMenu" : this._StatusMenuMsgHandler.bind(this),
-
- // Add or remove certain menu items.
- "StatusMenuVisible" : this._StatusMenuVisibleMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for USB1 and USB2 audio
- "StatusMenuUSBAudio" : this._StatusMenuUSBAudioMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for BTAudio
- "StatusMenuBTAudio" : this._StatusMenuBTAudioMsgHandler.bind(this),
-
- // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
- "StatusUpdateEcoEnergy" : this._StatusUpdateEcoEnergyMsgHandler.bind(this),
-
- // Updates the number of notifications for missed sms and emails.
- "StatusUpdateNotifications" : this._StatusUpdateNotificationsHandler.bind(this),
-
- // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
- "StatusPhoneCall" : this._StatusPhoneCallMsgHandler.bind(this),
-
- // Show an Audio SourceNotAvailable SBN
- "TimedSBN_SourceNotAvailable" : this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
-
- // Update the current audio source icon in the Entertainment menu
- "StatusUpdateAudioSource" : this._StatusUpdateAudioSourceMsgHandler.bind(this),
-
- // Update the number of missed calls
- "StatusUpdateMissedCallCount" : this._StatusUpdateMissedCallCountMsgHandler.bind(this),
-
- // Update the number of warnings displayed apps men
- "WarningStatusCount" : this._WarningStatusCountMsgHandler.bind(this),
-
- // Update whether scheduled maintenance is due
- "StatusUpdateSchedMaint" : this._StatusUpdateSchedMaintHandler.bind(this),
-
- // Show an Siri SBN
- "ShowStateSBN_SiriActive" : this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
-
- // Show an Siri Error SBN
- "TimedSBN_SiriError" : this._TimedSBN_SiriErrorMsgHandler.bind(this),
-
- // Remove an Siri SBN
- "RemoveStateSBN_SiriActive" : this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
-
- //Show timed SBN Voice not supported
- "TimedSBN_VoiceNotSupported" : this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
-
- //Show timed SBN Voice Recognition Loading
- "TimedSBN_VRLoading" : this._TimedSBN_VRLoadingMsgHandler.bind(this),
-
- //At Speed Restriction
- "Global.AtSpeed" : this._AtSpeedMsgHandler.bind(this),
-
- //At No Speed
- "Global.NoSpeed" : this._NoSpeedMsgHandler.bind(this),
- };
- //@formatter:on
-
- // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
- // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
- // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
- // so the remaining time must be restarted when this happens.
- this._disclaimerTime = {
-
- // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
- // flag is set true after a the timer times out or the user hits the OK button.
- reset : true,
-
- // (Number) Milliseconds remaining to show the Disclaimer.
- remaining : 0,
-
- // (Number) Millisecond timestamp when the Disclaimer was first shown.
- whenStarted : 0,
-
- // (Handle) setTimeout ID
- timeoutId : null
- };
-
- // Array containing the appName of the list which supports Speed Restriction.
- //@appName = appName of the item , @status = default value of disabled property for particular appName
- this._SpeedRestrictedApps = [ {appName : "vdt_settings",status : true}];
-};
-
-/**************************
- * Set Wink Properties *
- **************************/
-
-systemApp.prototype.getWinkProperties = function(alert, params)
-{ log.info("setting wink properties for: ", alert, params);
- var winkProperties = null;
- switch(alert)
- {
- case "System_RVR_NOT_ACTIVE":
- case "System_RVR_EFM_ERROR":
- case "System_RVR_ACTIVATE_ERROR":
- winkProperties = {
- "style": "style03",
- "text1Id": "ErrorWhileStartingSiri"
- };
- break;
- case "System_RVR_ACTIVE":
- case "System_RVR_ACTIVE_WITH_EFM":
- case "System_RVR_ACTIVE_NO_EFM":
- winkProperties = {
- "style": "style03",
- "text1Id": "Siri"
- };
- break;
- default:
- // Display default Wink
- log.debug("No properties found for wink: " + alert);
- break;
- }
- // return the properties to Common
- return winkProperties;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Initialize various menu data lists
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._initEntertainmentDataList = function()
-{ var items = [];
-
- if (framework.localize.getRegion() === framework.localize.REGIONS.Japan)
- {
- // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
- // add it if the region is Japan.
- items.push({ appData : { appName : 'amradio', isVisible : true, audioSourceId : 'TrafficInfo' , mmuiEvent : 'SelectTrafficAlert' }, text1Id : 'TrafficAlertsItem', disabled : true, itemStyle : 'style01', hasCaret: false });
- }
-
- items.push(
- { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false }
- );
-
- // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterEntertainmentDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initApplicationsDataList = function()
-{ var items = [];
-
- this._vehicleConfigurationType = null;
- this._vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
-
- log.info("this._vehicleConfigurationType " +this._vehicleConfigurationType);
-
- items.push(
- { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vsm', isVisible : false, mmuiEvent : 'SelectEngineOilLevel' }, text1Id : 'EngineOilLevel', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vehicleStatus', isVisible : false, mmuiEvent : 'SelectVehicleStatusMonitor' }, text1Id : 'VehicleStatusMonitor', disabled : false, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterApplicationDataList = {
- items: items
- };
-
- this._updateApplicationStructure(this._vehicleConfigurationType);
-
- // Keep the index of vehicleStatus ready to be used during enable/disable and visible/hidden of this item.
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if(this._masterApplicationDataList.items[i].appData.appName === "vehicleStatus")
- {
- this._indexOfVSMApp = i;
- }
- }
-
-};
-
-systemApp.prototype._initCommunicationsDataList = function()
-{ var items = [];
-
- items.push(
- { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
- { appData : { appName : '', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._communicationsDataList = {
-
- items: items
-
- };
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers, helpers
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._StatusPhoneCallMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus)
- {
- // Add or remove the Active Call item in the communications menu
- var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
- var dirty = false;
- if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall')
- {
- this._communicationsDataList.items[0].appData.isVisible = true;
- dirty = true;
- }
- else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall'
- && this._communicationsDataList.items[0].appData.isVisible === true)
- {
- this._communicationsDataList.items[0].appData.isVisible = false;
- dirty = true;
- }
-
- // If it changed, and we are in the Comm ctxt, update the list shown
- if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- //build list (which will exclude isVisible==false items)
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusMenuMsgHandler = function(msg)
-{ log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
-
- // Update menu items associated with the given appName of the message. Menu items can appear
- // in several different contexts or appear multiple times: this function searches all those places.
-
- var appName = msg.params.payload.statusMenu.appName;
- var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
-
- //Update the Availability Status of Speed Restricted Apps
- this._StatusMenuChanged(appName,isDisabled);
-
- // Update the static menu lists so they are correctly enable next time the context is shown
- this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
- this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
- this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
-
- // Update the menu list in the current context if needed
- if (this._currentContext)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- case "VehicleStatusMonitor":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled)// At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
-
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
- }
- }
- }
- break;
- }
- }
-};
-
-systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList)
-{ for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- }
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-
- //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
- //Reading the value again and checking the same with existing one.
- var vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
- if (vehicleConfigurationType !== this._vehicleConfigurationType)
- {
- log.info("VehicleConfigurationType is changed to "+vehicleConfigurationType)
- this._vehicleConfigurationType = vehicleConfigurationType;
- this._updateApplicationStructure(vehicleConfigurationType);
- }
-};
-
-systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList)
-{ for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[i].disabled = isDisabled;
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
-
- var appName = msg.params.payload.appName;
- var isVisible = msg.params.payload.state === "Visible";
-
- // Search entertainment items
- var isEntertainmentDirty = false;
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.appName === appName
- && this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible)
- {
- isEntertainmentDirty = true;
- this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Entertainment context if it is currently displayed.
- if (isEntertainmentDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Entertainment"
- && this._currentContextTemplate)
- {
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Search application items
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.appName === appName
- && this._masterApplicationDataList.items[i].appData.isVisible != isVisible)
- {
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
- }
- }
- //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
- //Reading the value again and checking the same with existing one.
- var vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
- if (vehicleConfigurationType !== this._vehicleConfigurationType)
- {
- log.info("VehicleConfigurationType is changed to "+vehicleConfigurationType)
- this._vehicleConfigurationType = vehicleConfigurationType;
- this._updateApplicationStructure(vehicleConfigurationType);
- }
- //If any app inside the VehicleStatusMonitor context is visible then VehicleStatusMonitor will also be visible in Application.
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames["VehicleStatusMonitor"];
- var isVehicleStatusMonitorVisible = false;
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- var applicationsCtxtWiseAppName = applicationsCtxtWiseAppNames[j];
- for (var k = 0; k < this._masterApplicationDataList.items.length; ++k)
- {
- if((this._masterApplicationDataList.items[k].appData.appName === applicationsCtxtWiseAppName) &&
- this._masterApplicationDataList.items[k].appData.isVisible)
- {
- isApplicationsDirty = true;
- isVehicleStatusMonitorVisible = this._masterApplicationDataList.items[k].appData.isVisible;
- break;
- }
- }
- }
-
- //update the visiblity of VehicleStatusMonitor on basis of visible status of application(s) inside VehicleStatusMonitor context.
- this._masterApplicationDataList.items[this._indexOfVSMApp].appData.isVisible = isVehicleStatusMonitorVisible;
-
- // Update the Applications context or VehicleStatusMonitor context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Now that we are listening to StatusMenuVisible for Comm items (for email only)
- // we want to ensure any messages sent by other apps that were previously ignored are still ignored
- // Shoki6 ONLY
- if (appName === "email")
- {
- // Search communication items - avalajh
- var isCommunicationDirty = false;
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.appName === appName
- && this._communicationsDataList.items[i].appData.isVisible != isVisible)
- {
- isCommunicationDirty = true;
- this._communicationsDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Communication context if it is currently displayed.
- if (isCommunicationDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Communication"
- && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- }
-};
-systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio)
- {
- // Update cached values for the USB device status
- var status = msg.params.payload.statusMenuUSBAudio;
- var mmuiEvent = "";
- var textIdWithDevice = "";
- var textIdWithoutDevice = "";
- var masterIndex = -1;
- if (status.usbAB === "USB_A")
- {
- mmuiEvent = "SelectUSBA";
- textIdWithDevice = "UsbAudioAWithDevice";
- textIdWithoutDevice = "UsbAudioA";
- }
- else if (status.usbAB === "USB_B")
- {
- mmuiEvent = "SelectUSBB";
- textIdWithDevice = "UsbAudioBWithDevice";
- textIdWithoutDevice = "UsbAudioB";
- }
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- masterIndex = i;
-
- var isAvailable = status.statusMenu.appStatus === "Available";
- var name = status.displayName;
- this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
- if (isAvailable && typeof name === 'string' && name.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var masterIndex = -1;
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- masterIndex = i;
-
- var isAvailable = msg.params.payload.appStatus === "Available";
- var deviceName = msg.params.payload.deviceName;
-
- // NOTE: This message does not enable/disable the BTAudio menu item.
- // (The StatusMenu message will enable it on startup.)
-
- if (isAvailable && typeof deviceName === "string" && deviceName.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
-
- // Determine correct text ID, based on vehicle fuel type
- var fuelType = msg.params.payload.fuelType;
- var newText1Id;
- switch (fuelType)
- {
- case "HEV":
- newText1Id = "EcoenergyAppHEV";
- break;
-
- case "GAS":
- default:
- newText1Id = "EcoenergyApp";
- break;
- }
-
- // Search application items for the "ecoenergy" application
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
- (this._masterApplicationDataList.items[i].text1Id != newText1Id))
- {
- // Found the app, and it's text ID needs to change, so change it
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].text1Id = newText1Id;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-// Handle message to update the notification counts in the Communication context.
-systemApp.prototype._StatusUpdateNotificationsHandler = function(msg)
-{ if (msg.params && msg.params.payload && msg.params.payload.messageCounts)
- {
- // Update message counts and the notifications list item displayed in the Communication menu
- var countEmail = msg.params.payload.messageCounts.countEmail;
- var countSMS = msg.params.payload.messageCounts.countSMS;
- var total = countEmail + countSMS;
-
- var showMessageIcon = total > 0;
- framework.common.setSbIcon("Message", showMessageIcon);
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- switch (this._communicationsDataList.items[i].appData.mmuiEvent)
- {
- case 'SelectNotifications':
- this._communicationsDataList.items[i].disabled = (total === 0);
- this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
- break;
-
- case 'SelectSms':
- this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
- break;
-
- case 'SelectEmail':
- this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceRecognition',
- imagePath1 : 'apps/system/images/IcnSiriSBN.png'
- };
- framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-};
-
-systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style01',
- text1Id : 'ErrorWhileStartingSiri',
- };
- framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-};
-
-//If VR is not ready after Disclaimer then display SBN
-systemApp.prototype._TimedSBN_VRLoadingMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'common.SbnVoiceLoading',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceRecoLoading', "vrStatus", params);
-};
-
-systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceNotSupported',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
-};
-
-systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
-};
-
-systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var params = {
- sbnStyle : 'Style02',
- imagePath1 : 'common/images/icons/IcnListBtConnType_Music.png'
- };
-
- switch (msg.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- params.text1Id = "AudioSourceNotAvailableBTAudio";
- break;
-
- case "USBAudio":
- case "USB_A":
- case "USB_B":
- params.text1Id = "AudioSourceNotAvailableUSB";
- break;
-
- case "CD":
- params.text1Id = "AudioSourceNotAvailableCD";
- break;
-
- case "DVD":
- params.text1Id = "AudioSourceNotAvailableDVD";
- break;
-
- case "TV":
- params.text1Id = "AudioSourceNotAvailableTV";
- break;
- }
-
- framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
- }
-};
-
-systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList)
-{ for (var i = 0; i < dataList.items.length; ++i)
- {
- if (isPlaying)
- {
- // Set the icon on the audioSource item and clearing it on all other items
- dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
- }
- else
- {
- // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
- // "Off" and "Play" messages do not necessarily come in that order.
- if (dataList.items[i].appData.audioSourceId === audioSource)
- {
- dataList.items[i].image1 = "";
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var audioSource = msg.params.payload.statusAudio.audioSource;
- var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
-
- // Set the icon in the masterEntertainment data list so it is persisted between template instances
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
- list.updateItems(0, list.dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg)
-{ var count = "";
- if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0)
- {
- count = msg.params.payload.missedCallCount.toString();
- }
-
- // Update this._communicationsDataList
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- this._communicationsDataList.items[i].label1 = count;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- list.dataList.items[i].label1 = count;
- list.updateItems(i, i);
- }
- }
- }
-};
-
-systemApp.prototype._WarningStatusCountMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var count = "";
- var icon = "";
- if (msg.params.payload.warningcount > 0)
- {
- count = msg.params.payload.warningcount.toString();
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- this._masterApplicationDataList.items[i].label1 = count;
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
- this._vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- list.dataList.items[i].label1 = count;
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var isDue = msg.params.payload.due;
- var warningCountValue = null;
- //Caching the Due Status to be used in _WarningStatusCountMsgHandler.
- this._SchedMaintDueStatus = isDue;
- this._vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- // Update the master list
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- }
- // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
- else if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- var WarnGuidanceAppItem = utility.getArrayItemByPropertyValue(this._masterApplicationDataList.items,"text1Id","WarnGuidanceApp");
- if(WarnGuidanceAppItem && WarnGuidanceAppItem.item && WarnGuidanceAppItem.item.label1)
- {
- warningCountValue = WarnGuidanceAppItem.item.label1;
- }
-
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !this._masterApplicationDataList.items[i].image2)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- else
- {
- //DO nothing
- }
- }
- }
-
- // Update the current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- list.dataList.items[i].image2 = "";
- }
- list.updateItems(i, i);
- }
- // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
- else if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !list.dataList.items[i].image2)
- {
- list.dataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- list.dataList.items[i].image2 = "";
- }
- else
- {
- //Do Nothing
- }
-
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._AtSpeedMsgHandler = function(msg)
-{ //At speed will disable the speed Restricted items
- this._AtSpeedDisabled = true;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-systemApp.prototype._NoSpeedMsgHandler = function(msg)
-{ //At speed will Enable the speed Restricted items
- this._AtSpeedDisabled = false;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-/**************************
- * Control callbacks
- **************************/
-
-/*
- * Callback for the Main Menu Context icon button clicks
- * @param mainMenuObj (Object) Reference to the MainMenuCtrl
- * @param appData (Object) Data passed in by the app when the control was instantiated
- * @param params (Object) Contains label for the selected icon
- */
-systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params)
-{ log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
-
- var icon = params.icon;
-
- switch(icon)
- {
- case "app":
- framework.sendEventToMmui(this.uiaId, "SelectApplications");
- break;
- case "com":
- framework.sendEventToMmui(this.uiaId, "SelectCommunication");
- break;
- case "ent":
- framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
- break;
- case "nav":
- framework.sendEventToMmui(this.uiaId, "SelectNavigation");
- break;
- case "set":
- framework.sendEventToMmui(this.uiaId, "SelectSettings");
- break;
- }
-};
-
-/*
- * Select callback for Applications, Communication, and Entertainment contexts.
- * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
- */
-systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params)
-{ framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._CommCtxtContextIn = function()
-{ var scrollTo = 0;
-
- // We cannot use the data list in the current context here, becuase it doesn't exist yet
- // so we use _buildCommunicationDataList() just like _readyCommunications() will
- var dataList = this._buildCommunicationDataList();
-
- // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
- var any = false;
- for (var i = 0; i < dataList.items.length - 1; ++i)
- {
- if (dataList.items[i].disabled === false)
- {
- any = true;
- }
- }
-
- if (any === false)
- {
- var lastIndex = dataList.items.length - 1;
- if (dataList.items[lastIndex].disabled === false)
- {
- scrollTo = lastIndex;
- }
- }
-
- this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
- this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Applications
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyApplications = function()
-{ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
-
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Applications Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterApplicationDataList based on the currently visible items.
-systemApp.prototype._buildApplicationsDataList = function()
-{ var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
- //Reading the value again and checking the same with existing one.
- var vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
- if (vehicleConfigurationType !== this._vehicleConfigurationType)
- {
- log.info("VehicleConfigurationType is changed to "+vehicleConfigurationType)
- this._updateApplicationStructure(vehicleConfigurationType);
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.isVisible)
- {
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames[this._currentContext.ctxtId];
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- if(applicationsCtxtWiseAppNames[j] === this._masterApplicationDataList.items[i].appData.appName)
- {
- dataList.items.push(this._masterApplicationDataList.items[i]);
- }
- }
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Entertainment
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyEntertainment = function()
-{ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Entertainment Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterEntertainmentDataList based on the currently visible items.
-systemApp.prototype._buildEntertainmentDataList = function()
-{ var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterEntertainmentDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication - avalajh
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyCommunication = function()
-{ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Communication Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._communicationsDataList based on the currently visible items.
-systemApp.prototype._buildCommunicationDataList = function()
-{ var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._communicationsDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoConnectionNotify
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params)
-{ switch(this._currentContext.ctxtId)
- {
- case 'NoConnectionNotify':
- switch(appData)
- {
- case 'SelectConnect':
- framework.sendEventToMmui("system", appData);
- break;
-
- case 'Global.No':
- framework.sendEventToMmui("common", appData);
- break;
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotifyDialog
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function()
-{ if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData)
- {
- this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
- }
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function()
-{ // Start timer to dismiss the notification if the user doesn't respond
- var self = this;
- this._NotifyDialogTimeoutId = setTimeout(function() {
- this._NotifyDialogTimeoutId = null;
- framework.sendEventToMmui(self.uiaId, "Timeout");
- }, 10000);
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function()
-{ if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-};
-
-systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params)
-{ if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-
- switch (appData)
- {
- case "Global.No":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectNotifyOff":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
-
- case "SelectNotifyMessage":
- if (this._currentContext.params && this._currentContext.params.payload)
- {
- var paramsData = {
- payload : {
- messageId : this._currentContext.params.payload.messageNotifyData.messageId,
- messageNotifyType : this._currentContext.params.payload.messageNotifyData.messageNotifyType
- }
- };
- framework.sendEventToMmui(this.uiaId, appData, paramsData);
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationListRetry
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Cancel":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectRetry":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationList
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyNotificationList = function(readyParams)
-{ log.debug("_readyNotificationList called...");
-
- if (readyParams)
- {
- readyParams.skipRestore = true;
- }
-
- var params = {
- "context_in": 0,
-
- // typedef enum MSG_client_type_e
- // {
- // /// Used for min valid values range check
- // MSG_CLIENT_MIN = 0,
- // /// Invalid value of 0
- // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
- // /// Email client
- // MSG_CLIENT_EMAIL,
- // /// SMS/MMS client
- // MSG_CLIENT_SMS,
- // /// Settings client
- // MSG_CLIENT_SETTINGS,
- // /// Notifications client
- // MSG_CLIENT_NOTIFICATIONS,
- // /// Used for max valid values range check
- // MSG_CLIENT_MAX
- // } MSG_client_type_t;
- "client_type_in": 4,
- "callbacks_in": 0
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
-};
-
-systemApp.prototype._noLongerDisplayedNotificationList = function()
-{ this._closeMsgApiConnection();
-};
-
-systemApp.prototype._msgConnectCallback = function(msg)
-{ if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100)
- {
- this._msgApiConnection = msg.params.connection;
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- "request_type" : 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._msgGetNewMessagesListCallback = function(msg)
-{ if (msg && msg.msgType === "methodResponse" && msg.params)
- {
- switch (msg.params.status)
- {
- // Successful retrieval w/ messages
- case 100:
- {
- log.info("####AppSDK Success####");
- this._closeMsgApiConnection();
-
- var messages = msg.params.message_list.messages;
-
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items: [],
- vuiSupport: true
- };
-
- for (var i = 0; i < messages.length; i++)
- {
- var item = {
- appData: { messageId: messages[i].id, name: messages[i].sender },
- itemStyle : 'style07',
- styleMod : 'bold',
- hasCaret : false,
- text1: messages[i].sender,
- image1 : '',
- label1 : utility.formatSmartDateTime(messages[i].datetime, false),
- label2 : '', // label2 is only set for email's below and left blank for sms.
- labelWidth : 'wide',
- };
-
- // Set image1 and set appData event name.
- switch (messages[i].clientType)
- {
- // MSG_CLIENT_EMAIL
- case 1:
- item.appData.eventId = 'SelectMessageEmail';
- item.image1 = 'common/images/icons/IcnListEmail_En.png';
- item.label2 = messages[i].instance;
- break;
-
- // MSG_CLIENT_SMS
- case 2:
- item.appData.eventId = 'SelectMessageSMS';
- item.image1 = 'common/images/icons/IcnListSms_En.png';
- break;
- }
-
- dataList.items.push(item);
- }
-
- dataList.itemCount = dataList.items.length;
-
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
- }
- break;
- }
-
- // Empty list returned
- case 107:
- {
- log.info("AppSDK returned empty message.");
- this._closeMsgApiConnection();
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- break;
- }
-
- // Unrecognized status code
- default:
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- break;
- }
- }
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._closeMsgApiConnection = function()
-{ if (this._msgApiConnection)
- {
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- };
- framework.sendRequestToAppsdk(this.uiaId, function(){}, "msg", "Disconnect", params);
- this._msgApiConnection = null;
- }
-};
-
-systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params)
-{ if (appData && appData.eventId)
- {
- switch (appData.eventId)
- {
- case 'SelectMessageEmail':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMessageSMS':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMissedCall':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
- }
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoDevice
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.GoBack":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectConnect":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// DisplayOff
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params)
-{ framework.sendEventToMmui("system", "DisplayOffGUIActivity");
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Disclaimer
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayedDisclaimer = function()
-{ framework.sendEventToMmui("system", "DisposeIntroVideo");
-
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
-};
-
-systemApp.prototype._selectCallbackDisclaimer = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-systemApp.prototype._disclaimerTimedout = function()
-{ this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- if (this._currentContext && this._currentContext.ctxtId === "Disclaimer")
- {
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
-
- //Incase after Timeout Disclaimer screen didnt remove then sends start the timer again
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
-};
-
-systemApp.prototype._noLongerDisplayedDisclaimer = function()
-{ // Note: The template is transitioning away either because of a Timeout, the user hit OK or an interrupting context change.
-
- var elapsed = Date.now() - this._disclaimerTime.whenStarted;
- this._disclaimerTime.remaining = this._disclaimerTime.remaining - elapsed;
-
- if (this._disclaimerTime.timeoutId)
- {
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SystemWarning
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// EnableRVR
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// RVRInstructions
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnect
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnect = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
- break;
-
- case "Pandora":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
- break;
-
- case "Stitcher":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
- break;
-
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "SelectEntertainmentMenu":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnectFailed
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnectFailed = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-//Siri EnableRVR context ready to Display Function
-systemApp.prototype._readyEnableRVR = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled",subMapObj);
-
- }
-};
-
-//Siri SiriLaunchingError context ready to Display Function
-systemApp.prototype._readySiriLaunchingError = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect",subMapObj);
-
- }
-};
-
-systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-// Store the Availability Status of Speed Restricted Apps
-systemApp.prototype._StatusMenuChanged = function(appName, isDisabled)
-{ for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
- if(speedRestrictedAppName.indexOf(appName) === 0)
- {
- this._SpeedRestrictedApps[i].status = isDisabled;
- }
- }
-};
-
-// Update the items for Speed Restricted Message
-systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled)
-{ var status = null;
- var appName = null;
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- appName = this._SpeedRestrictedApps[i].appName;
- status = this._SpeedRestrictedApps[i].status;
-
- log.info("AppName : "+appName+" is available or unavailable - (true/false)" +status);
-
- //Checks for Status Availability for the respective AppName
- if(!status)
- {
- this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
- }
- // Update the menu list in the current context if needed
- if (this._currentContext && !status)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var j = 0; j < dataList.items.length; ++j)
- {
- if (dataList.items[j].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[j].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[j].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(j, j);
- }
- }
- }
- break;
- }
- }
- }
-};
-
-// Update the Applications structure based on vehicle configuration(Old or New)
-systemApp.prototype._updateApplicationStructure = function(vehicleConfiguration)
-{ if(vehicleConfiguration === "Old")
- {
- //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
- this._applicationsCtxtWiseAppNames = {
- //Context Name : // [appName,appName....]
- "Applications" : ["hdtrafficimage","idm","ecoenergy","driverid","warnguide","schedmaint","vehicleStatus","vdt_settings","vdt","carplay","androidauto","_androidauto","_videoplayer","_aiotweaks","_speedometer"],
- "VehicleStatusMonitor" : ["vsm"]
- };
-
- }
- else
- {
- //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
- this._applicationsCtxtWiseAppNames = {
- //Context Name : // [appName,appName....]
- "Applications" : ["hdtrafficimage","idm","ecoenergy","driverid","vehicleStatus","vdt_settings","vdt","carplay","androidauto","_androidauto","_videoplayer","_aiotweaks","_speedometer"],
- "VehicleStatusMonitor" : ["warnguide","vsm","schedmaint"]
- };
- }
-}// Tell framework that system app has finished loading
-framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/nothing/jci/gui/apps/system/js/systemApp.js b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/nothing/jci/gui/apps/system/js/systemApp.js
deleted file mode 100644
index a38df32..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/nothing/jci/gui/apps/system/js/systemApp.js
+++ /dev/null
@@ -1,2299 +0,0 @@
-/*
- Copyright 2012 by Johnson Controls
- __________________________________________________________________________
-
- Filename: systemApp.js
- __________________________________________________________________________
-
- Project: JCI-IHU
- Language: EN
- Author: awoodhc
- Date: 05.7.2012
- __________________________________________________________________________
-
- Description: IHU GUI System App
-
- Revisions:
- v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
- v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
- v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between
- contexts.
- v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
- v0.5 - 14-June-2012 Language Localization added to ListCtrls
- v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
- v0.7 - 22-June-2012 Code review changes and reworked context handling
- v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
- v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
- v1.0 - 31-July-2012 Updated Multicontroller behavior.
- v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
- v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
- v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
- v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
- v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
- v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
- v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
- v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
- v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
- v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
- v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
- v2.2 (20-Nov-2012) Stitcher enabled
- v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
- v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
- v2.5 (17-Jan-2013) Changed one event name
- v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
- v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
- v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
- v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
-
- __________________________________________________________________________
-
- */
-
-log.addSrcFile("systemApp.js", "system");
-
-/**********************************************
- * Start of Base App Implementation
- *
- * Code in this section should not be modified
- * except for function names based on the appname
- *********************************************/
-
-function systemApp(uiaId)
-{
- log.debug("constructor called...");
-
- // Base application functionality is provided in a common location via this call to baseApp.init().
- // See framework/js/BaseApp.js for details.
- baseApp.init(this, uiaId);
-
- // All feature-specific initialization is done in appInit()
-}
-
-/*
- * Called just after the app is instantiated by framework.
- * App-specific variables should be declared here.
- */
-systemApp.prototype.appInit = function()
-{
- if (framework.debugMode)
- {
- utility.loadScript("apps/system/test/systemAppTest.js");
- }
-
- //@formatter:off
-
- this._initEntertainmentDataList();
- this._initApplicationsDataList();
- this._initCommunicationsDataList();
-
- this._contextTable = {
-
- "HomeScreen" : {
- "hideHomeBtn" : true,
- "template" : "MainMenuTmplt",
- "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
- "controlProperties": {
- "MainMenuCtrl" : {
- "selectCallback":this._selectCallbackHomeScreen.bind(this),
- } // end of properties for "MainMenuCtrl"
- }, // end of list of controlProperties
- }, // end of "systemAppContext1"
-
- "Communication" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Communication",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": this._communicationsDataList,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyCommunication.bind(this),
- "contextInFunction" : this._CommCtxtContextIn.bind(this),
- }, // end of "Communication"
-
- "Entertainment" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Entertainment",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyEntertainment.bind(this),
- }, // end of "Entertainment"
-
- "Applications" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Applications",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "Applications"
-
- "NoConnectionNotify" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoConnectionNotify.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.No"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoConnectionNotifyTitle',
- text2Id : 'NoConnectionNotifyText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "NotifyDialog" : {
- "template" : "Dialog3Tmplt",
- "sbNameId" : null,
- "readyFunction" : this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
- "displayedFunction" : this._NotifyDialogCtxtTmpltDisplayed.bind(this),
- "noLongerDisplayedFunction" : this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectCallbackNotifyDialog.bind(this),
- "contentStyle" : "style17",
- "buttonCount" : 3,
- "initialFocus" : 2,
- "buttonConfig" : {
- "button1" : {
- labelId : "NotifyOff",
- appData : "SelectNotifyOff",
- },
- "button2" : {
- labelId : "NotifyIgnore",
- appData : "Global.No",
- },
- "button3" : {
- labelId : "NotifyRead",
- appData : "SelectNotifyMessage"
- }
- }, // end of buttonConfig
- "text1Id" : "NotifyIncomingMsg",
- "text2" : "",
- "text3Id" : "NotifyReadNow",
- } // end of properties for dialog
- }, // end of controlProperties
- }, // end of "NotifyDialog"
-
- "NotificationList" : {
- "leftBtnStyle" : "goBack",
- "template" : "List2Tmplt",
- "sbNameId" : "Notifications",
- "readyFunction" : this._readyNotificationList.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedNotificationList.bind(this),
- "controlProperties": {
- "List2Ctrl" : {
- titleConfiguration : "noTitle",
- numberedList : true,
- selectCallback: this._selectNotificationListItem.bind(this),
- title : null,
- dataList : null,
- },
- }, // end of controlProperties
- }, // end of "NotificationList"
-
- "NotificationListRetry" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackNotificationListRetry.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Cancel",
- appData : "Global.Cancel"
- },
- button2 : {
- labelId : "RetryLabel",
- appData : "SelectRetry"
- },
- },
- text1Id : 'FailedNotificationRetrieval',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of NotificationListRetry
-
- "NoDevice" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoDevice.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.GoBack"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoDeviceTitle',
- text2Id : 'NoDeviceText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "DisplayOff" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : this._displayOffUserActivity.bind(this),
- showClock : true,
- }
- },
- }, // end of "DisplayOff"
-
- "Disclaimer" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "WarningTitle",
- contentStyle : "style02",
- fullScreen : true,
- defaultSelectCallback : this._selectCallbackDisclaimer.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "agree",
- appData : "Global.Yes"
- },
- },
- text1Id : 'DisclaimerText',
- }
- },
- "displayedFunction" : this._displayedDisclaimer.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedDisclaimer.bind(this),
- }, // end of Disclaimer
-
- "SystemWarning" : {
- "hideHomeBtn" : true,
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "TempWarning",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackSystemWarning.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "TempWarningText",
- }
- },
- },
-
- "SourceReconnect" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnect.bind(this),
- "contentStyle" : "style14",
- "fullScreen" : false,
- "text1Id" : null,
- "meter" : {"meterType":"indeterminate", "meterPath":"common/images/IndeterminateMeter_2.png"},
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "ReconnectEntMenuButton",
- appData : "SelectEntertainmentMenu"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnect.bind(this),
- },
-
- "SourceReconnectFailed" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnectFailed.bind(this),
- "contentStyle" : "style02",
- "fullScreen" : false,
- "text1Id" : null,
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnectFailed.bind(this),
- },
-
- "IntroAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "QuickStartLoop" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["QUICKTRANLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "PowerDownAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["EXITLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "IdleStandby" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "WaitForEnding" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "EnableRVR" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackEnableRVR.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "SiriDisabled",
- }
- },
- "readyFunction" : this._readyEnableRVR.bind(this),
- },
-
- "RVRInstructions" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "InitiateSiri",
- }
- },
- },
-
- "SiriInSession" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "Siri",
- contentStyle : "style14",
- "meter" : {"meterType":"indeterminate", "meterPath":"apps/system/images/IcnSiri.png"}
- }
- },
- },
-
- "SiriLaunchingError" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- //titleStyle : "titleStyle01",
- // titleId : "Siri",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "DisconnectThenReconnect",
- }
- },
- "readyFunction" : this._readySiriLaunchingError.bind(this),
- },
- }; // end of this._contextTable object
-
- //@formatter:off
- this._messageTable = {
- // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
- "StatusMenu" : this._StatusMenuMsgHandler.bind(this),
-
- // Add or remove certain menu items.
- "StatusMenuVisible" : this._StatusMenuVisibleMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for USB1 and USB2 audio
- "StatusMenuUSBAudio" : this._StatusMenuUSBAudioMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for BTAudio
- "StatusMenuBTAudio" : this._StatusMenuBTAudioMsgHandler.bind(this),
-
- // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
- "StatusUpdateEcoEnergy" : this._StatusUpdateEcoEnergyMsgHandler.bind(this),
-
- // Updates the number of notifications for missed sms and emails.
- "StatusUpdateNotifications" : this._StatusUpdateNotificationsHandler.bind(this),
-
- // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
- "StatusPhoneCall" : this._StatusPhoneCallMsgHandler.bind(this),
-
- // Show an Audio SourceNotAvailable SBN
- "TimedSBN_SourceNotAvailable" : this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
-
- // Update the current audio source icon in the Entertainment menu
- "StatusUpdateAudioSource" : this._StatusUpdateAudioSourceMsgHandler.bind(this),
-
- // Update the number of missed calls
- "StatusUpdateMissedCallCount" : this._StatusUpdateMissedCallCountMsgHandler.bind(this),
-
- // Update the number of warnings displayed apps men
- "WarningStatusCount" : this._WarningStatusCountMsgHandler.bind(this),
-
- // Update whether scheduled maintenance is due
- "StatusUpdateSchedMaint" : this._StatusUpdateSchedMaintHandler.bind(this),
-
- // Show an Siri SBN
- "ShowStateSBN_SiriActive" : this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
-
- // Show an Siri Error SBN
- "TimedSBN_SiriError" : this._TimedSBN_SiriErrorMsgHandler.bind(this),
-
- // Remove an Siri SBN
- "RemoveStateSBN_SiriActive" : this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
-
- //Show timed SBN Voice not supported
- "TimedSBN_VoiceNotSupported" : this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
-
- //At Speed Restriction
- "Global.AtSpeed" : this._AtSpeedMsgHandler.bind(this),
-
- //At No Speed
- "Global.NoSpeed" : this._NoSpeedMsgHandler.bind(this),
- };
- //@formatter:on
-
- // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
- // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
- // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
- // so the remaining time must be restarted when this happens.
- this._disclaimerTime = {
-
- // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
- // flag is set true after a the timer times out or the user hits the OK button.
- reset : true,
-
- // (Number) Milliseconds remaining to show the Disclaimer.
- remaining : 0,
-
- // (Number) Millisecond timestamp when the Disclaimer was first shown.
- whenStarted : 0,
-
- // (Handle) setTimeout ID
- timeoutId : null
- };
-
- // Array containing the appName of the list which supports Speed Restriction.
- //@appName = appName of the item , @status = default value of disabled property for particular appName
- this._SpeedRestrictedApps = [ {appName : "vdt_settings",status : true}];
-};
-
-/**************************
- * Set Wink Properties *
- **************************/
-
-systemApp.prototype.getWinkProperties = function(alert, params)
-{
- log.info("setting wink properties for: ", alert, params);
- var winkProperties = null;
- switch(alert)
- {
- case "System_RVR_NOT_ACTIVE":
- case "System_RVR_EFM_ERROR":
- case "System_RVR_ACTIVATE_ERROR":
- winkProperties = {
- "style": "style03",
- "text1Id": "ErrorWhileStartingSiri"
- };
- break;
- case "System_RVR_ACTIVE":
- case "System_RVR_ACTIVE_WITH_EFM":
- case "System_RVR_ACTIVE_NO_EFM":
- winkProperties = {
- "style": "style03",
- "text1Id": "Siri"
- };
- break;
- default:
- // Display default Wink
- log.debug("No properties found for wink: " + alert);
- break;
- }
- // return the properties to Common
- return winkProperties;
-}
-///////////////////////////////////////////////////////////////////////////////
-// Initialize various menu data lists
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._initEntertainmentDataList = function()
-{
- var items = [];
-
- if (framework.localize.getRegion() === framework.localize.REGIONS.Japan)
- {
- // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
- // add it if the region is Japan.
- items.push({ appData : { appName : 'amradio', isVisible : true, audioSourceId : 'TrafficInfo' , mmuiEvent : 'SelectTrafficAlert' }, text1Id : 'TrafficAlertsItem', disabled : true, itemStyle : 'style01', hasCaret: false });
- }
-
- items.push(
- { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false }
- );
-
- // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterEntertainmentDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initApplicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
-
- );
-
- // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterApplicationDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initCommunicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
- { appData : { appName : '', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._communicationsDataList = {
-
- items: items
-
- };
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers, helpers
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._StatusPhoneCallMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus)
- {
- // Add or remove the Active Call item in the communications menu
- var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
- var dirty = false;
- if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall')
- {
- this._communicationsDataList.items[0].appData.isVisible = true;
- dirty = true;
- }
- else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall'
- && this._communicationsDataList.items[0].appData.isVisible === true)
- {
- this._communicationsDataList.items[0].appData.isVisible = false;
- dirty = true;
- }
-
- // If it changed, and we are in the Comm ctxt, update the list shown
- if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- //build list (which will exclude isVisible==false items)
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusMenuMsgHandler = function(msg)
-{
- log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
-
- // Update menu items associated with the given appName of the message. Menu items can appear
- // in several different contexts or appear multiple times: this function searches all those places.
-
- var appName = msg.params.payload.statusMenu.appName;
- var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
-
- //Update the Availability Status of Speed Restricted Apps
- this._StatusMenuChanged(appName,isDisabled);
-
- // Update the static menu lists so they are correctly enable next time the context is shown
- this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
- this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
- this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
-
- // Update the menu list in the current context if needed
- if (this._currentContext)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled)// At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
-
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
- }
- }
- }
- break;
- }
- }
-};
-
-systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- }
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[i].disabled = isDisabled;
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
-
- var appName = msg.params.payload.appName;
- var isVisible = msg.params.payload.state === "Visible";
-
- // Search entertainment items
- var isEntertainmentDirty = false;
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.appName === appName
- && this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible)
- {
- isEntertainmentDirty = true;
- this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Entertainment context if it is currently displayed.
- if (isEntertainmentDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Entertainment"
- && this._currentContextTemplate)
- {
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Search application items
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.appName === appName
- && this._masterApplicationDataList.items[i].appData.isVisible != isVisible)
- {
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Applications"
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Now that we are listening to StatusMenuVisible for Comm items (for email only)
- // we want to ensure any messages sent by other apps that were previously ignored are still ignored
- // Shoki6 ONLY
- if (appName === "email")
- {
- // Search communication items - avalajh
- var isCommunicationDirty = false;
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.appName === appName
- && this._communicationsDataList.items[i].appData.isVisible != isVisible)
- {
- isCommunicationDirty = true;
- this._communicationsDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Communication context if it is currently displayed.
- if (isCommunicationDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Communication"
- && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- }
-};
-systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio)
- {
- // Update cached values for the USB device status
- var status = msg.params.payload.statusMenuUSBAudio;
- var mmuiEvent = "";
- var textIdWithDevice = "";
- var textIdWithoutDevice = "";
- var masterIndex = -1;
- if (status.usbAB === "USB_A")
- {
- mmuiEvent = "SelectUSBA";
- textIdWithDevice = "UsbAudioAWithDevice";
- textIdWithoutDevice = "UsbAudioA";
- }
- else if (status.usbAB === "USB_B")
- {
- mmuiEvent = "SelectUSBB";
- textIdWithDevice = "UsbAudioBWithDevice";
- textIdWithoutDevice = "UsbAudioB";
- }
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- masterIndex = i;
-
- var isAvailable = status.statusMenu.appStatus === "Available";
- var name = status.displayName;
- this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
- if (isAvailable && typeof name === 'string' && name.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var masterIndex = -1;
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- masterIndex = i;
-
- var isAvailable = msg.params.payload.appStatus === "Available";
- var deviceName = msg.params.payload.deviceName;
-
- // NOTE: This message does not enable/disable the BTAudio menu item.
- // (The StatusMenu message will enable it on startup.)
-
- if (isAvailable && typeof deviceName === "string" && deviceName.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
-
- // Determine correct text ID, based on vehicle fuel type
- var fuelType = msg.params.payload.fuelType;
- var newText1Id;
- switch (fuelType)
- {
- case "HEV":
- newText1Id = "EcoenergyAppHEV";
- break;
-
- case "GAS":
- default:
- newText1Id = "EcoenergyApp";
- break;
- }
-
- // Search application items for the "ecoenergy" application
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
- (this._masterApplicationDataList.items[i].text1Id != newText1Id))
- {
- // Found the app, and it's text ID needs to change, so change it
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].text1Id = newText1Id;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Applications"
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-// Handle message to update the notification counts in the Communication context.
-systemApp.prototype._StatusUpdateNotificationsHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.messageCounts)
- {
- // Update message counts and the notifications list item displayed in the Communication menu
- var countEmail = msg.params.payload.messageCounts.countEmail;
- var countSMS = msg.params.payload.messageCounts.countSMS;
- var total = countEmail + countSMS;
-
- var showMessageIcon = total > 0;
- framework.common.setSbIcon("Message", showMessageIcon);
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- switch (this._communicationsDataList.items[i].appData.mmuiEvent)
- {
- case 'SelectNotifications':
- this._communicationsDataList.items[i].disabled = (total === 0);
- this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
- break;
-
- case 'SelectSms':
- this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
- break;
-
- case 'SelectEmail':
- this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceRecognition',
- imagePath1 : 'apps/system/images/IcnSiriSBN.png'
- };
- framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-}
-
-systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style01',
- text1Id : 'ErrorWhileStartingSiri',
- };
- framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-}
-
-systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceNotSupported',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
-}
-
-systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
-}
-
-systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var params = {
- sbnStyle : 'Style02',
- imagePath1 : 'common/images/icons/IcnListBtConnType_Music.png'
- };
-
- switch (msg.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- params.text1Id = "AudioSourceNotAvailableBTAudio";
- break;
-
- case "USBAudio":
- case "USB_A":
- case "USB_B":
- params.text1Id = "AudioSourceNotAvailableUSB";
- break;
-
- case "CD":
- params.text1Id = "AudioSourceNotAvailableCD";
- break;
-
- case "DVD":
- params.text1Id = "AudioSourceNotAvailableDVD";
- break;
-
- case "TV":
- params.text1Id = "AudioSourceNotAvailableTV";
- break;
- }
-
- framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
- }
-};
-
-systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (isPlaying)
- {
- // Set the icon on the audioSource item and clearing it on all other items
- dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
- }
- else
- {
- // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
- // "Off" and "Play" messages do not necessarily come in that order.
- if (dataList.items[i].appData.audioSourceId === audioSource)
- {
- dataList.items[i].image1 = "";
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var audioSource = msg.params.payload.statusAudio.audioSource;
- var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
-
- // Set the icon in the masterEntertainment data list so it is persisted between template instances
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
- list.updateItems(0, list.dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg)
-{
- var count = "";
- if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0)
- {
- count = msg.params.payload.missedCallCount.toString();
- }
-
- // Update this._communicationsDataList
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- this._communicationsDataList.items[i].label1 = count;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- list.dataList.items[i].label1 = count;
- list.updateItems(i, i);
- }
- }
- }
-};
-
-systemApp.prototype._WarningStatusCountMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var count = "";
- var icon = "";
- if (msg.params.payload.warningcount > 0)
- {
- count = msg.params.payload.warningcount.toString();
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- this._masterApplicationDataList.items[i].label1 = count;
- this._masterApplicationDataList.items[i].image2 = icon;
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Applications" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- list.dataList.items[i].label1 = count;
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var isDue = msg.params.payload.due;
-
- // Update the master list
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- break;
- }
- }
-
- // Update the current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Applications" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- list.dataList.items[i].image2 = "";
- }
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._AtSpeedMsgHandler = function(msg)
-{
- //At speed will disable the speed Restricted items
- this._AtSpeedDisabled = true;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-systemApp.prototype._NoSpeedMsgHandler = function(msg)
-{
- //At speed will Enable the speed Restricted items
- this._AtSpeedDisabled = false;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-/**************************
- * Control callbacks
- **************************/
-
-/*
- * Callback for the Main Menu Context icon button clicks
- * @param mainMenuObj (Object) Reference to the MainMenuCtrl
- * @param appData (Object) Data passed in by the app when the control was instantiated
- * @param params (Object) Contains label for the selected icon
- */
-systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params)
-{
- log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
-
- var icon = params.icon;
-
- switch(icon)
- {
- case "app":
- framework.sendEventToMmui(this.uiaId, "SelectApplications");
- break;
- case "com":
- framework.sendEventToMmui(this.uiaId, "SelectCommunication");
- break;
- case "ent":
- framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
- break;
- case "nav":
- framework.sendEventToMmui(this.uiaId, "SelectNavigation");
- break;
- case "set":
- framework.sendEventToMmui(this.uiaId, "SelectSettings");
- break;
- }
-};
-
-/*
- * Select callback for Applications, Communication, and Entertainment contexts.
- * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
- */
-systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params)
-{
- framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._CommCtxtContextIn = function()
-{
- var scrollTo = 0;
-
- // We cannot use the data list in the current context here, becuase it doesn't exist yet
- // so we use _buildCommunicationDataList() just like _readyCommunications() will
- var dataList = this._buildCommunicationDataList();
-
- // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
- var any = false;
- for (var i = 0; i < dataList.items.length - 1; ++i)
- {
- if (dataList.items[i].disabled === false)
- {
- any = true;
- }
- }
-
- if (any === false)
- {
- var lastIndex = dataList.items.length - 1;
- if (dataList.items[lastIndex].disabled === false)
- {
- scrollTo = lastIndex;
- }
- }
-
- this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
- this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Applications
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyApplications = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
-
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Applications Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterApplicationDataList based on the currently visible items.
-systemApp.prototype._buildApplicationsDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterApplicationDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Entertainment
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyEntertainment = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Entertainment Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterEntertainmentDataList based on the currently visible items.
-systemApp.prototype._buildEntertainmentDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterEntertainmentDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication - avalajh
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyCommunication = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Communication Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._communicationsDataList based on the currently visible items.
-systemApp.prototype._buildCommunicationDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._communicationsDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// NoConnectionNotify
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params)
-{
- switch(this._currentContext.ctxtId)
- {
- case 'NoConnectionNotify':
- switch(appData)
- {
- case 'SelectConnect':
- framework.sendEventToMmui("system", appData);
- break;
-
- case 'Global.No':
- framework.sendEventToMmui("common", appData);
- break;
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotifyDialog
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function()
-{
- if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData)
- {
- this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
- }
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function()
-{
- // Start timer to dismiss the notification if the user doesn't respond
- var self = this;
- this._NotifyDialogTimeoutId = setTimeout(function() {
- this._NotifyDialogTimeoutId = null;
- framework.sendEventToMmui(self.uiaId, "Timeout");
- }, 10000);
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function()
-{
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-};
-
-systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params)
-{
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-
- switch (appData)
- {
- case "Global.No":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectNotifyOff":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
-
- case "SelectNotifyMessage":
- if (this._currentContext.params && this._currentContext.params.payload)
- {
- var paramsData = {
- payload : {
- messageId : this._currentContext.params.payload.messageNotifyData.messageId,
- messageNotifyType : this._currentContext.params.payload.messageNotifyData.messageNotifyType
- }
- };
- framework.sendEventToMmui(this.uiaId, appData, paramsData);
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationListRetry
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Cancel":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectRetry":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationList
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyNotificationList = function(readyParams)
-{
- log.debug("_readyNotificationList called...");
-
- if (readyParams)
- {
- readyParams.skipRestore = true;
- }
-
- var params = {
- "context_in": 0,
-
- // typedef enum MSG_client_type_e
- // {
- // /// Used for min valid values range check
- // MSG_CLIENT_MIN = 0,
- // /// Invalid value of 0
- // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
- // /// Email client
- // MSG_CLIENT_EMAIL,
- // /// SMS/MMS client
- // MSG_CLIENT_SMS,
- // /// Settings client
- // MSG_CLIENT_SETTINGS,
- // /// Notifications client
- // MSG_CLIENT_NOTIFICATIONS,
- // /// Used for max valid values range check
- // MSG_CLIENT_MAX
- // } MSG_client_type_t;
- "client_type_in": 4,
- "callbacks_in": 0
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
-};
-
-systemApp.prototype._noLongerDisplayedNotificationList = function()
-{
- this._closeMsgApiConnection();
-};
-
-systemApp.prototype._msgConnectCallback = function(msg)
-{
- if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100)
- {
- this._msgApiConnection = msg.params.connection;
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- "request_type" : 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._msgGetNewMessagesListCallback = function(msg)
-{
- if (msg && msg.msgType === "methodResponse" && msg.params)
- {
- switch (msg.params.status)
- {
- // Successful retrieval w/ messages
- case 100:
- {
- log.info("####AppSDK Success####");
- this._closeMsgApiConnection();
-
- var messages = msg.params.message_list.messages;
-
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items: [],
- vuiSupport: true
- };
-
- for (var i = 0; i < messages.length; i++)
- {
- var item = {
- appData: { messageId: messages[i].id, name: messages[i].sender },
- itemStyle : 'style07',
- styleMod : 'bold',
- hasCaret : false,
- text1: messages[i].sender,
- image1 : '',
- label1 : utility.formatSmartDateTime(messages[i].datetime, false),
- label2 : '', // label2 is only set for email's below and left blank for sms.
- labelWidth : 'wide',
- };
-
- // Set image1 and set appData event name.
- switch (messages[i].clientType)
- {
- // MSG_CLIENT_EMAIL
- case 1:
- item.appData.eventId = 'SelectMessageEmail';
- item.image1 = 'common/images/icons/IcnListEmail_En.png';
- item.label2 = messages[i].instance;
- break;
-
- // MSG_CLIENT_SMS
- case 2:
- item.appData.eventId = 'SelectMessageSMS';
- item.image1 = 'common/images/icons/IcnListSms_En.png';
- break;
- }
-
- dataList.items.push(item);
- }
-
- dataList.itemCount = dataList.items.length;
-
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
- }
- break;
- }
-
- // Empty list returned
- case 107:
- {
- log.info("AppSDK returned empty message.");
- this._closeMsgApiConnection();
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- break;
- }
-
- // Unrecognized status code
- default:
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- break;
- }
- }
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._closeMsgApiConnection = function()
-{
- if (this._msgApiConnection)
- {
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- };
- framework.sendRequestToAppsdk(this.uiaId, function(){}, "msg", "Disconnect", params);
- this._msgApiConnection = null;
- }
-};
-
-systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params)
-{
- if (appData && appData.eventId)
- {
- switch (appData.eventId)
- {
- case 'SelectMessageEmail':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMessageSMS':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMissedCall':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
- }
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoDevice
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.GoBack":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectConnect":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// DisplayOff
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params)
-{
- framework.sendEventToMmui("system", "DisplayOffGUIActivity");
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Disclaimer
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayedDisclaimer = function()
-{
- framework.sendEventToMmui("system", "DisposeIntroVideo");
-
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
-};
-
-systemApp.prototype._selectCallbackDisclaimer = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-systemApp.prototype._disclaimerTimedout = function()
-{
- this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- if (this._currentContext && this._currentContext.ctxtId === "Disclaimer")
- {
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
-
- //Incase after Timeout Disclaimer screen didnt remove then sends start the timer again
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
-};
-
-systemApp.prototype._noLongerDisplayedDisclaimer = function()
-{
- // Note: The template is transitioning away either because of a Timeout, the user hit OK or an interrupting context change.
-
- var elapsed = Date.now() - this._disclaimerTime.whenStarted;
- this._disclaimerTime.remaining = this._disclaimerTime.remaining - elapsed;
-
- if (this._disclaimerTime.timeoutId)
- {
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SystemWarning
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// EnableRVR
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// RVRInstructions
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnect
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnect = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
- break;
-
- case "Pandora":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
- break;
-
- case "Stitcher":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
- break;
-
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "SelectEntertainmentMenu":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnectFailed
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnectFailed = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-//Siri EnableRVR context ready to Display Function
-systemApp.prototype._readyEnableRVR = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled",subMapObj);
-
- }
-};
-
-//Siri SiriLaunchingError context ready to Display Function
-systemApp.prototype._readySiriLaunchingError = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect",subMapObj);
-
- }
-};
-
-systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-// Store the Availability Status of Speed Restricted Apps
-systemApp.prototype._StatusMenuChanged = function(appName, isDisabled)
-{
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
- if(speedRestrictedAppName.indexOf(appName) === 0)
- {
- this._SpeedRestrictedApps[i].status = isDisabled;
- }
- }
-};
-
-// Update the items for Speed Restricted Message
-systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled)
-{
- var status = null;
- var appName = null;
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- appName = this._SpeedRestrictedApps[i].appName;
- status = this._SpeedRestrictedApps[i].status;
-
- log.info("AppName : "+appName+" is available or unavailable - (true/false)" +status);
-
- //Checks for Status Availability for the respective AppName
- if(!status)
- {
- this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
- }
- // Update the menu list in the current context if needed
- if (this._currentContext && !status)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var j = 0; j < dataList.items.length; ++j)
- {
- if (dataList.items[j].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[j].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[j].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(j, j);
- }
- }
- }
- break;
- }
- }
- }
-};
-
-// Tell framework that system app has finished loading
-framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.58.00.250A-NA.js b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.58.00.250A-NA.js
deleted file mode 100644
index 85142d7..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.58.00.250A-NA.js
+++ /dev/null
@@ -1,2440 +0,0 @@
-// This is a failsafe
-if (typeof FmRadioPos === 'undefined') {
- FmRadioPos = 1;
- AmRadioPos = 2;
- UsbAudioAPos = 4;
- UsbAudioBPos = 5;
- AuxInPos = 6;
- BluetoothPos = 7;
- SdarsRadioPos = 8;
- DabRadioPos = 7;
- AhaRadioPos = 8;
- PandoraPos = 9;
- StitcherItemPos = 10;
- CdPlayerPos = 11;
- DVDItemPos = 12;
- TVItemPos = 13;
-}
-/*
- Copyright 2012 by Johnson Controls
- __________________________________________________________________________
-
- Filename: systemApp.js
- __________________________________________________________________________
-
- Project: JCI-IHU
- Language: EN
- Author: awoodhc
- Date: 05.7.2012
- __________________________________________________________________________
-
- Description: IHU GUI System App
-
- Revisions:
- v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
- v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
- v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between
- contexts.
- v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
- v0.5 - 14-June-2012 Language Localization added to ListCtrls
- v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
- v0.7 - 22-June-2012 Code review changes and reworked context handling
- v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
- v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
- v1.0 - 31-July-2012 Updated Multicontroller behavior.
- v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
- v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
- v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
- v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
- v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
- v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
- v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
- v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
- v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
- v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
- v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
- v2.2 (20-Nov-2012) Stitcher enabled
- v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
- v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
- v2.5 (17-Jan-2013) Changed one event name
- v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
- v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
- v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
- v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
-
- __________________________________________________________________________
-
- */
-
-log.addSrcFile("systemApp.js", "system");
-
-/**********************************************
- * Start of Base App Implementation
- *
- * Code in this section should not be modified
- * except for function names based on the appname
- *********************************************/
-
-function systemApp(uiaId)
-{
- log.debug("constructor called...");
-
- // Base application functionality is provided in a common location via this call to baseApp.init().
- // See framework/js/BaseApp.js for details.
- baseApp.init(this, uiaId);
-
- // All feature-specific initialization is done in appInit()
-}
-
-/*
- * Called just after the app is instantiated by framework.
- * App-specific variables should be declared here.
- */
-systemApp.prototype.appInit = function()
-{
- if (framework.debugMode)
- {
- utility.loadScript("apps/system/test/systemAppTest.js");
- }
-
- //@formatter:off
-
- this._initEntertainmentDataList();
- this._initApplicationsDataList();
- this._initCommunicationsDataList();
-
- this._contextTable = {
-
- "HomeScreen" : {
- "hideHomeBtn" : true,
- "template" : "MainMenuTmplt",
- "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
- "controlProperties": {
- "MainMenuCtrl" : {
- "selectCallback":this._selectCallbackHomeScreen.bind(this),
- } // end of properties for "MainMenuCtrl"
- }, // end of list of controlProperties
- }, // end of "systemAppContext1"
-
- "Communication" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Communication",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": this._communicationsDataList,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyCommunication.bind(this),
- "contextInFunction" : this._CommCtxtContextIn.bind(this),
- }, // end of "Communication"
-
- "Entertainment" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Entertainment",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyEntertainment.bind(this),
- }, // end of "Entertainment"
-
- "Applications" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Applications",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "Applications"
-
- "VehicleStatusMonitor" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "VehicleStatusMonitor",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "VehicleStatusMonitor"
-
- "NoConnectionNotify" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoConnectionNotify.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.No"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoConnectionNotifyTitle',
- text2Id : 'NoConnectionNotifyText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "NotifyDialog" : {
- "template" : "Dialog3Tmplt",
- "sbNameId" : null,
- "readyFunction" : this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
- "displayedFunction" : this._NotifyDialogCtxtTmpltDisplayed.bind(this),
- "noLongerDisplayedFunction" : this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectCallbackNotifyDialog.bind(this),
- "contentStyle" : "style17",
- "buttonCount" : 3,
- "initialFocus" : 2,
- "buttonConfig" : {
- "button1" : {
- labelId : "NotifyOff",
- appData : "SelectNotifyOff",
- },
- "button2" : {
- labelId : "NotifyIgnore",
- appData : "Global.No",
- },
- "button3" : {
- labelId : "NotifyRead",
- appData : "SelectNotifyMessage"
- }
- }, // end of buttonConfig
- "text1Id" : "NotifyIncomingMsg",
- "text2" : "",
- "text3Id" : "NotifyReadNow",
- } // end of properties for dialog
- }, // end of controlProperties
- }, // end of "NotifyDialog"
-
- "NotificationList" : {
- "leftBtnStyle" : "goBack",
- "template" : "List2Tmplt",
- "sbNameId" : "Notifications",
- "readyFunction" : this._readyNotificationList.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedNotificationList.bind(this),
- "controlProperties": {
- "List2Ctrl" : {
- titleConfiguration : "noTitle",
- numberedList : true,
- selectCallback: this._selectNotificationListItem.bind(this),
- title : null,
- dataList : null,
- },
- }, // end of controlProperties
- }, // end of "NotificationList"
-
- "NotificationListRetry" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackNotificationListRetry.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Cancel",
- appData : "Global.Cancel"
- },
- button2 : {
- labelId : "RetryLabel",
- appData : "SelectRetry"
- },
- },
- text1Id : 'FailedNotificationRetrieval',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of NotificationListRetry
-
- "NoDevice" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoDevice.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.GoBack"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoDeviceTitle',
- text2Id : 'NoDeviceText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "DisplayOff" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : this._displayOffUserActivity.bind(this),
- showClock : true,
- }
- },
- }, // end of "DisplayOff"
-
- "Disclaimer" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "WarningTitle",
- contentStyle : "style02",
- fullScreen : true,
- defaultSelectCallback : this._selectCallbackDisclaimer.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "agree",
- appData : "Global.Yes"
- },
- },
- text1Id : 'DisclaimerText',
- }
- },
- "displayedFunction" : this._displayedDisclaimer.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedDisclaimer.bind(this),
- }, // end of Disclaimer
-
- "SystemWarning" : {
- "hideHomeBtn" : true,
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "TempWarning",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackSystemWarning.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "TempWarningText",
- }
- },
- },
-
- "SourceReconnect" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnect.bind(this),
- "contentStyle" : "style14",
- "fullScreen" : false,
- "text1Id" : null,
- "meter" : {"meterType":"indeterminate", "meterPath":"common/images/IndeterminateMeter_2.png"},
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "ReconnectEntMenuButton",
- appData : "SelectEntertainmentMenu"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnect.bind(this),
- },
-
- "SourceReconnectFailed" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnectFailed.bind(this),
- "contentStyle" : "style02",
- "fullScreen" : false,
- "text1Id" : null,
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnectFailed.bind(this),
- },
-
- "IntroAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "QuickStartLoop" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["QUICKTRANLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "PowerDownAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["EXITLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "IdleStandby" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "WaitForEnding" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "EnableRVR" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackEnableRVR.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "SiriDisabled",
- }
- },
- "readyFunction" : this._readyEnableRVR.bind(this),
- },
-
- "RVRInstructions" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "InitiateSiri",
- }
- },
- },
-
- "SiriInSession" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "Siri",
- contentStyle : "style14",
- "meter" : {"meterType":"indeterminate", "meterPath":"apps/system/images/IcnSiri.png"}
- }
- },
- },
-
- "SiriLaunchingError" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- //titleStyle : "titleStyle01",
- // titleId : "Siri",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "DisconnectThenReconnect",
- }
- },
- "readyFunction" : this._readySiriLaunchingError.bind(this),
- },
- }; // end of this._contextTable object
-
- //@formatter:off
- this._messageTable = {
- // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
- "StatusMenu" : this._StatusMenuMsgHandler.bind(this),
-
- // Add or remove certain menu items.
- "StatusMenuVisible" : this._StatusMenuVisibleMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for USB1 and USB2 audio
- "StatusMenuUSBAudio" : this._StatusMenuUSBAudioMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for BTAudio
- "StatusMenuBTAudio" : this._StatusMenuBTAudioMsgHandler.bind(this),
-
- // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
- "StatusUpdateEcoEnergy" : this._StatusUpdateEcoEnergyMsgHandler.bind(this),
-
- // Updates the number of notifications for missed sms and emails.
- "StatusUpdateNotifications" : this._StatusUpdateNotificationsHandler.bind(this),
-
- // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
- "StatusPhoneCall" : this._StatusPhoneCallMsgHandler.bind(this),
-
- // Show an Audio SourceNotAvailable SBN
- "TimedSBN_SourceNotAvailable" : this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
-
- // Update the current audio source icon in the Entertainment menu
- "StatusUpdateAudioSource" : this._StatusUpdateAudioSourceMsgHandler.bind(this),
-
- // Update the number of missed calls
- "StatusUpdateMissedCallCount" : this._StatusUpdateMissedCallCountMsgHandler.bind(this),
-
- // Update the number of warnings displayed apps men
- "WarningStatusCount" : this._WarningStatusCountMsgHandler.bind(this),
-
- // Update whether scheduled maintenance is due
- "StatusUpdateSchedMaint" : this._StatusUpdateSchedMaintHandler.bind(this),
-
- // Show an Siri SBN
- "ShowStateSBN_SiriActive" : this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
-
- // Show an Siri Error SBN
- "TimedSBN_SiriError" : this._TimedSBN_SiriErrorMsgHandler.bind(this),
-
- // Remove an Siri SBN
- "RemoveStateSBN_SiriActive" : this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
-
- //Show timed SBN Voice not supported
- "TimedSBN_VoiceNotSupported" : this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
-
- //At Speed Restriction
- "Global.AtSpeed" : this._AtSpeedMsgHandler.bind(this),
-
- //At No Speed
- "Global.NoSpeed" : this._NoSpeedMsgHandler.bind(this),
- };
- //@formatter:on
-
- // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
- // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
- // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
- // so the remaining time must be restarted when this happens.
- this._disclaimerTime = {
-
- // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
- // flag is set true after a the timer times out or the user hits the OK button.
- reset : true,
-
- // (Number) Milliseconds remaining to show the Disclaimer.
- remaining : 0,
-
- // (Number) Millisecond timestamp when the Disclaimer was first shown.
- whenStarted : 0,
-
- // (Handle) setTimeout ID
- timeoutId : null
- };
-
- // Array containing the appName of the list which supports Speed Restriction.
- //@appName = appName of the item , @status = default value of disabled property for particular appName
- this._SpeedRestrictedApps = [ {appName : "vdt_settings",status : true}];
-};
-
-/**************************
- * Set Wink Properties *
- **************************/
-
-systemApp.prototype.getWinkProperties = function(alert, params)
-{
- log.info("setting wink properties for: ", alert, params);
- var winkProperties = null;
- switch(alert)
- {
- case "System_RVR_NOT_ACTIVE":
- case "System_RVR_EFM_ERROR":
- case "System_RVR_ACTIVATE_ERROR":
- winkProperties = {
- "style": "style03",
- "text1Id": "ErrorWhileStartingSiri"
- };
- break;
- case "System_RVR_ACTIVE":
- case "System_RVR_ACTIVE_WITH_EFM":
- case "System_RVR_ACTIVE_NO_EFM":
- winkProperties = {
- "style": "style03",
- "text1Id": "Siri"
- };
- break;
- default:
- // Display default Wink
- log.debug("No properties found for wink: " + alert);
- break;
- }
- // return the properties to Common
- return winkProperties;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Initialize various menu data lists
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._initEntertainmentDataList = function()
-{
- var items = [];
-
- if (framework.localize.getRegion() === framework.localize.REGIONS.Japan)
- {
- // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
- // add it if the region is Japan.
- items.push({ appData : { appName : 'amradio', isVisible : true, audioSourceId : 'TrafficInfo' , mmuiEvent : 'SelectTrafficAlert' }, text1Id : 'TrafficAlertsItem', disabled : true, itemStyle : 'style01', hasCaret: false });
- }
-
- items.push(
- { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: FmRadioPos },
- { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AmRadioPos },
- { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: DabRadioPos },
- { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: SdarsRadioPos },
- { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AhaRadioPos },
- { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false, pos: PandoraPos },
- { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: StitcherItemPos },
- { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false, pos: BluetoothPos },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false, pos: UsbAudioAPos },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false, pos: UsbAudioBPos },
- { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false, pos: CdPlayerPos },
- { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AuxInPos },
- { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: DVDItemPos },
- { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: TVItemPos }
- );
- items.sort(function(a, b) {
- return a.pos - b.pos;
- })
-
- // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterEntertainmentDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initApplicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vsm', isVisible : true, mmuiEvent : 'SelectEngineOilLevel' }, text1Id : 'EngineOilLevel', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vehicleStatus', isVisible : false, mmuiEvent : 'SelectVehicleStatusMonitor' }, text1Id : 'VehicleStatusMonitor', disabled : false, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterApplicationDataList = {
- items: items
- };
-
- //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
- this._applicationsCtxtWiseAppNames = {
- //Context Name : // [appName,appName....]
- "Applications" : ["hdtrafficimage","idm","ecoenergy","driverid","vehicleStatus","vdt_settings","vdt","carplay","androidauto","_androidauto","_videoplayer","_aiotweaks","_speedometer"],
- "VehicleStatusMonitor" : ["warnguide","vsm","schedmaint"]
- };
-};
-
-systemApp.prototype._initCommunicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
- { appData : { appName : '', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._communicationsDataList = {
-
- items: items
-
- };
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers, helpers
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._StatusPhoneCallMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus)
- {
- // Add or remove the Active Call item in the communications menu
- var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
- var dirty = false;
- if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall')
- {
- this._communicationsDataList.items[0].appData.isVisible = true;
- dirty = true;
- }
- else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall'
- && this._communicationsDataList.items[0].appData.isVisible === true)
- {
- this._communicationsDataList.items[0].appData.isVisible = false;
- dirty = true;
- }
-
- // If it changed, and we are in the Comm ctxt, update the list shown
- if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- //build list (which will exclude isVisible==false items)
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusMenuMsgHandler = function(msg)
-{
- log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
-
- // Update menu items associated with the given appName of the message. Menu items can appear
- // in several different contexts or appear multiple times: this function searches all those places.
-
- var appName = msg.params.payload.statusMenu.appName;
- var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
-
- //Update the Availability Status of Speed Restricted Apps
- this._StatusMenuChanged(appName,isDisabled);
-
- // Update the static menu lists so they are correctly enable next time the context is shown
- this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
- this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
- this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
-
- // Update the menu list in the current context if needed
- if (this._currentContext)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- case "VehicleStatusMonitor":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled)// At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
-
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
- }
- }
- }
- break;
- }
- }
-};
-
-systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- }
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[i].disabled = isDisabled;
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
-
- var appName = msg.params.payload.appName;
- var isVisible = msg.params.payload.state === "Visible";
-
- // Search entertainment items
- var isEntertainmentDirty = false;
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.appName === appName
- && this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible)
- {
- isEntertainmentDirty = true;
- this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Entertainment context if it is currently displayed.
- if (isEntertainmentDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Entertainment"
- && this._currentContextTemplate)
- {
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Search application items
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.appName === appName
- && this._masterApplicationDataList.items[i].appData.isVisible != isVisible)
- {
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
- }
- if(this._masterApplicationDataList.items[i].appData.appName === "vehicleStatus")
- {
- this._indexOfVSMApp = i;
- }
- }
-
- //If any app inside the VehicleStatusMonitor context is visible then VehicleStatusMonitor will also be visible in Application.
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames["VehicleStatusMonitor"];
- var isVehicleStatusMonitorVisible = false;
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- var applicationsCtxtWiseAppName = applicationsCtxtWiseAppNames[j];
- for (var k = 0; k < this._masterApplicationDataList.items.length; ++k)
- {
- if((this._masterApplicationDataList.items[k].appData.appName === applicationsCtxtWiseAppName) &&
- this._masterApplicationDataList.items[k].appData.isVisible)
- {
- isVehicleStatusMonitorVisible = this._masterApplicationDataList.items[k].appData.isVisible;
- break;
- }
- }
- }
-
- //update the visiblity of VehicleStatusMonitor on basis of visible status of application(s) inside VehicleStatusMonitor context.
- this._masterApplicationDataList.items[this._indexOfVSMApp].appData.isVisible = isVehicleStatusMonitorVisible;
-
- // Update the Applications context or VehicleStatusMonitor context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Now that we are listening to StatusMenuVisible for Comm items (for email only)
- // we want to ensure any messages sent by other apps that were previously ignored are still ignored
- // Shoki6 ONLY
- if (appName === "email")
- {
- // Search communication items - avalajh
- var isCommunicationDirty = false;
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.appName === appName
- && this._communicationsDataList.items[i].appData.isVisible != isVisible)
- {
- isCommunicationDirty = true;
- this._communicationsDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Communication context if it is currently displayed.
- if (isCommunicationDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Communication"
- && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- }
-};
-systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio)
- {
- // Update cached values for the USB device status
- var status = msg.params.payload.statusMenuUSBAudio;
- var mmuiEvent = "";
- var textIdWithDevice = "";
- var textIdWithoutDevice = "";
- var masterIndex = -1;
- if (status.usbAB === "USB_A")
- {
- mmuiEvent = "SelectUSBA";
- textIdWithDevice = "UsbAudioAWithDevice";
- textIdWithoutDevice = "UsbAudioA";
- }
- else if (status.usbAB === "USB_B")
- {
- mmuiEvent = "SelectUSBB";
- textIdWithDevice = "UsbAudioBWithDevice";
- textIdWithoutDevice = "UsbAudioB";
- }
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- masterIndex = i;
-
- var isAvailable = status.statusMenu.appStatus === "Available";
- var name = status.displayName;
- this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
- if (isAvailable && typeof name === 'string' && name.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var masterIndex = -1;
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- masterIndex = i;
-
- var isAvailable = msg.params.payload.appStatus === "Available";
- var deviceName = msg.params.payload.deviceName;
-
- // NOTE: This message does not enable/disable the BTAudio menu item.
- // (The StatusMenu message will enable it on startup.)
-
- if (isAvailable && typeof deviceName === "string" && deviceName.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
-
- // Determine correct text ID, based on vehicle fuel type
- var fuelType = msg.params.payload.fuelType;
- var newText1Id;
- switch (fuelType)
- {
- case "HEV":
- newText1Id = "EcoenergyAppHEV";
- break;
-
- case "GAS":
- default:
- newText1Id = "EcoenergyApp";
- break;
- }
-
- // Search application items for the "ecoenergy" application
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
- (this._masterApplicationDataList.items[i].text1Id != newText1Id))
- {
- // Found the app, and it's text ID needs to change, so change it
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].text1Id = newText1Id;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-// Handle message to update the notification counts in the Communication context.
-systemApp.prototype._StatusUpdateNotificationsHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.messageCounts)
- {
- // Update message counts and the notifications list item displayed in the Communication menu
- var countEmail = msg.params.payload.messageCounts.countEmail;
- var countSMS = msg.params.payload.messageCounts.countSMS;
- var total = countEmail + countSMS;
-
- var showMessageIcon = total > 0;
- framework.common.setSbIcon("Message", showMessageIcon);
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- switch (this._communicationsDataList.items[i].appData.mmuiEvent)
- {
- case 'SelectNotifications':
- this._communicationsDataList.items[i].disabled = (total === 0);
- this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
- break;
-
- case 'SelectSms':
- this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
- break;
-
- case 'SelectEmail':
- this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceRecognition',
- imagePath1 : 'apps/system/images/IcnSiriSBN.png'
- };
- framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-};
-
-systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style01',
- text1Id : 'ErrorWhileStartingSiri',
- };
- framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-};
-
-systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceNotSupported',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
-};
-
-systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
-};
-
-systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var params = {
- sbnStyle : 'Style02',
- imagePath1 : 'common/images/icons/IcnListBtConnType_Music.png'
- };
-
- switch (msg.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- params.text1Id = "AudioSourceNotAvailableBTAudio";
- break;
-
- case "USBAudio":
- case "USB_A":
- case "USB_B":
- params.text1Id = "AudioSourceNotAvailableUSB";
- break;
-
- case "CD":
- params.text1Id = "AudioSourceNotAvailableCD";
- break;
-
- case "DVD":
- params.text1Id = "AudioSourceNotAvailableDVD";
- break;
-
- case "TV":
- params.text1Id = "AudioSourceNotAvailableTV";
- break;
- }
-
- framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
- }
-};
-
-systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (isPlaying)
- {
- // Set the icon on the audioSource item and clearing it on all other items
- dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
- }
- else
- {
- // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
- // "Off" and "Play" messages do not necessarily come in that order.
- if (dataList.items[i].appData.audioSourceId === audioSource)
- {
- dataList.items[i].image1 = "";
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var audioSource = msg.params.payload.statusAudio.audioSource;
- var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
-
- // Set the icon in the masterEntertainment data list so it is persisted between template instances
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
- list.updateItems(0, list.dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg)
-{
- var count = "";
- if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0)
- {
- count = msg.params.payload.missedCallCount.toString();
- }
-
- // Update this._communicationsDataList
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- this._communicationsDataList.items[i].label1 = count;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- list.dataList.items[i].label1 = count;
- list.updateItems(i, i);
- }
- }
- }
-};
-
-systemApp.prototype._WarningStatusCountMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var count = "";
- var icon = "";
- if (msg.params.payload.warningcount > 0)
- {
- count = msg.params.payload.warningcount.toString();
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- this._masterApplicationDataList.items[i].label1 = count;
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- list.dataList.items[i].label1 = count;
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var isDue = msg.params.payload.due;
- var warningCountValue = null;
- //Caching the Due Status to be used in _WarningStatusCountMsgHandler.
- this._SchedMaintDueStatus = isDue;
- // Update the master list
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- }
- else if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- var WarnGuidanceAppItem = utility.getArrayItemByPropertyValue(this._masterApplicationDataList.items,"text1Id","WarnGuidanceApp");
- if(WarnGuidanceAppItem && WarnGuidanceAppItem.item && WarnGuidanceAppItem.item.label1)
- {
- warningCountValue = WarnGuidanceAppItem.item.label1;
- }
-
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !this._masterApplicationDataList.items[i].image2)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- else
- {
- //DO nothing
- }
- }
- }
-
- // Update the current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- list.dataList.items[i].image2 = "";
- }
- list.updateItems(i, i);
- }
- else if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !list.dataList.items[i].image2)
- {
- list.dataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- list.dataList.items[i].image2 = "";
- }
- else
- {
- //Do Nothing
- }
-
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._AtSpeedMsgHandler = function(msg)
-{
- //At speed will disable the speed Restricted items
- this._AtSpeedDisabled = true;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-systemApp.prototype._NoSpeedMsgHandler = function(msg)
-{
- //At speed will Enable the speed Restricted items
- this._AtSpeedDisabled = false;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-/**************************
- * Control callbacks
- **************************/
-
-/*
- * Callback for the Main Menu Context icon button clicks
- * @param mainMenuObj (Object) Reference to the MainMenuCtrl
- * @param appData (Object) Data passed in by the app when the control was instantiated
- * @param params (Object) Contains label for the selected icon
- */
-systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params)
-{
- log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
-
- var icon = params.icon;
-
- switch(icon)
- {
- case "app":
- framework.sendEventToMmui(this.uiaId, "SelectApplications");
- break;
- case "com":
- framework.sendEventToMmui(this.uiaId, "SelectCommunication");
- break;
- case "ent":
- framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
- break;
- case "nav":
- framework.sendEventToMmui(this.uiaId, "SelectNavigation");
- break;
- case "set":
- framework.sendEventToMmui(this.uiaId, "SelectSettings");
- break;
- }
-};
-
-/*
- * Select callback for Applications, Communication, and Entertainment contexts.
- * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
- */
-systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params)
-{
- framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._CommCtxtContextIn = function()
-{
- var scrollTo = 0;
-
- // We cannot use the data list in the current context here, becuase it doesn't exist yet
- // so we use _buildCommunicationDataList() just like _readyCommunications() will
- var dataList = this._buildCommunicationDataList();
-
- // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
- var any = false;
- for (var i = 0; i < dataList.items.length - 1; ++i)
- {
- if (dataList.items[i].disabled === false)
- {
- any = true;
- }
- }
-
- if (any === false)
- {
- var lastIndex = dataList.items.length - 1;
- if (dataList.items[lastIndex].disabled === false)
- {
- scrollTo = lastIndex;
- }
- }
-
- this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
- this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Applications
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyApplications = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
-
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Applications Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterApplicationDataList based on the currently visible items.
-systemApp.prototype._buildApplicationsDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.isVisible)
- {
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames[this._currentContext.ctxtId];
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- if(applicationsCtxtWiseAppNames[j] === this._masterApplicationDataList.items[i].appData.appName)
- {
- dataList.items.push(this._masterApplicationDataList.items[i]);
- }
- }
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Entertainment
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyEntertainment = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Entertainment Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterEntertainmentDataList based on the currently visible items.
-systemApp.prototype._buildEntertainmentDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterEntertainmentDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication - avalajh
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyCommunication = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Communication Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._communicationsDataList based on the currently visible items.
-systemApp.prototype._buildCommunicationDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._communicationsDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// NoConnectionNotify
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params)
-{
- switch(this._currentContext.ctxtId)
- {
- case 'NoConnectionNotify':
- switch(appData)
- {
- case 'SelectConnect':
- framework.sendEventToMmui("system", appData);
- break;
-
- case 'Global.No':
- framework.sendEventToMmui("common", appData);
- break;
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotifyDialog
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function()
-{
- if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData)
- {
- this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
- }
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function()
-{
- // Start timer to dismiss the notification if the user doesn't respond
- var self = this;
- this._NotifyDialogTimeoutId = setTimeout(function() {
- this._NotifyDialogTimeoutId = null;
- framework.sendEventToMmui(self.uiaId, "Timeout");
- }, 10000);
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function()
-{
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-};
-
-systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params)
-{
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-
- switch (appData)
- {
- case "Global.No":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectNotifyOff":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
-
- case "SelectNotifyMessage":
- if (this._currentContext.params && this._currentContext.params.payload)
- {
- var paramsData = {
- payload : {
- messageId : this._currentContext.params.payload.messageNotifyData.messageId,
- messageNotifyType : this._currentContext.params.payload.messageNotifyData.messageNotifyType
- }
- };
- framework.sendEventToMmui(this.uiaId, appData, paramsData);
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationListRetry
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Cancel":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectRetry":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationList
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyNotificationList = function(readyParams)
-{
- log.debug("_readyNotificationList called...");
-
- if (readyParams)
- {
- readyParams.skipRestore = true;
- }
-
- var params = {
- "context_in": 0,
-
- // typedef enum MSG_client_type_e
- // {
- // /// Used for min valid values range check
- // MSG_CLIENT_MIN = 0,
- // /// Invalid value of 0
- // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
- // /// Email client
- // MSG_CLIENT_EMAIL,
- // /// SMS/MMS client
- // MSG_CLIENT_SMS,
- // /// Settings client
- // MSG_CLIENT_SETTINGS,
- // /// Notifications client
- // MSG_CLIENT_NOTIFICATIONS,
- // /// Used for max valid values range check
- // MSG_CLIENT_MAX
- // } MSG_client_type_t;
- "client_type_in": 4,
- "callbacks_in": 0
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
-};
-
-systemApp.prototype._noLongerDisplayedNotificationList = function()
-{
- this._closeMsgApiConnection();
-};
-
-systemApp.prototype._msgConnectCallback = function(msg)
-{
- if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100)
- {
- this._msgApiConnection = msg.params.connection;
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- "request_type" : 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._msgGetNewMessagesListCallback = function(msg)
-{
- if (msg && msg.msgType === "methodResponse" && msg.params)
- {
- switch (msg.params.status)
- {
- // Successful retrieval w/ messages
- case 100:
- {
- log.info("####AppSDK Success####");
- this._closeMsgApiConnection();
-
- var messages = msg.params.message_list.messages;
-
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items: [],
- vuiSupport: true
- };
-
- for (var i = 0; i < messages.length; i++)
- {
- var item = {
- appData: { messageId: messages[i].id, name: messages[i].sender },
- itemStyle : 'style07',
- styleMod : 'bold',
- hasCaret : false,
- text1: messages[i].sender,
- image1 : '',
- label1 : utility.formatSmartDateTime(messages[i].datetime, false),
- label2 : '', // label2 is only set for email's below and left blank for sms.
- labelWidth : 'wide',
- };
-
- // Set image1 and set appData event name.
- switch (messages[i].clientType)
- {
- // MSG_CLIENT_EMAIL
- case 1:
- item.appData.eventId = 'SelectMessageEmail';
- item.image1 = 'common/images/icons/IcnListEmail_En.png';
- item.label2 = messages[i].instance;
- break;
-
- // MSG_CLIENT_SMS
- case 2:
- item.appData.eventId = 'SelectMessageSMS';
- item.image1 = 'common/images/icons/IcnListSms_En.png';
- break;
- }
-
- dataList.items.push(item);
- }
-
- dataList.itemCount = dataList.items.length;
-
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
- }
- break;
- }
-
- // Empty list returned
- case 107:
- {
- log.info("AppSDK returned empty message.");
- this._closeMsgApiConnection();
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- break;
- }
-
- // Unrecognized status code
- default:
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- break;
- }
- }
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._closeMsgApiConnection = function()
-{
- if (this._msgApiConnection)
- {
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- };
- framework.sendRequestToAppsdk(this.uiaId, function(){}, "msg", "Disconnect", params);
- this._msgApiConnection = null;
- }
-};
-
-systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params)
-{
- if (appData && appData.eventId)
- {
- switch (appData.eventId)
- {
- case 'SelectMessageEmail':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMessageSMS':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMissedCall':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
- }
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoDevice
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.GoBack":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectConnect":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// DisplayOff
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params)
-{
- framework.sendEventToMmui("system", "DisplayOffGUIActivity");
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Disclaimer
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayedDisclaimer = function()
-{
- framework.sendEventToMmui("system", "DisposeIntroVideo");
-
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
-};
-
-systemApp.prototype._selectCallbackDisclaimer = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-systemApp.prototype._disclaimerTimedout = function()
-{
- this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- if (this._currentContext && this._currentContext.ctxtId === "Disclaimer")
- {
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
-
- //Incase after Timeout Disclaimer screen didnt remove then sends start the timer again
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
-};
-
-systemApp.prototype._noLongerDisplayedDisclaimer = function()
-{
- // Note: The template is transitioning away either because of a Timeout, the user hit OK or an interrupting context change.
-
- var elapsed = Date.now() - this._disclaimerTime.whenStarted;
- this._disclaimerTime.remaining = this._disclaimerTime.remaining - elapsed;
-
- if (this._disclaimerTime.timeoutId)
- {
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SystemWarning
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// EnableRVR
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// RVRInstructions
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnect
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnect = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
- break;
-
- case "Pandora":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
- break;
-
- case "Stitcher":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
- break;
-
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "SelectEntertainmentMenu":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnectFailed
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnectFailed = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-//Siri EnableRVR context ready to Display Function
-systemApp.prototype._readyEnableRVR = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled",subMapObj);
-
- }
-};
-
-//Siri SiriLaunchingError context ready to Display Function
-systemApp.prototype._readySiriLaunchingError = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect",subMapObj);
-
- }
-};
-
-systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-// Store the Availability Status of Speed Restricted Apps
-systemApp.prototype._StatusMenuChanged = function(appName, isDisabled)
-{
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
- if(speedRestrictedAppName.indexOf(appName) === 0)
- {
- this._SpeedRestrictedApps[i].status = isDisabled;
- }
- }
-};
-
-// Update the items for Speed Restricted Message
-systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled)
-{
- var status = null;
- var appName = null;
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- appName = this._SpeedRestrictedApps[i].appName;
- status = this._SpeedRestrictedApps[i].status;
-
- log.info("AppName : "+appName+" is available or unavailable - (true/false)" +status);
-
- //Checks for Status Availability for the respective AppName
- if(!status)
- {
- this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
- }
- // Update the menu list in the current context if needed
- if (this._currentContext && !status)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var j = 0; j < dataList.items.length; ++j)
- {
- if (dataList.items[j].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[j].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[j].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(j, j);
- }
- }
- }
- break;
- }
- }
- }
-};
-
-// Tell framework that system app has finished loading
-framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.59.00.330.js b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.59.00.330.js
deleted file mode 100644
index 93a8b75..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.59.00.330.js
+++ /dev/null
@@ -1,2440 +0,0 @@
-// This is a failsafe
-if (typeof FmRadioPos === 'undefined') {
- FmRadioPos = 1;
- AmRadioPos = 2;
- UsbAudioAPos = 4;
- UsbAudioBPos = 5;
- AuxInPos = 6;
- BluetoothPos = 7;
- SdarsRadioPos = 8;
- DabRadioPos = 7;
- AhaRadioPos = 8;
- PandoraPos = 9;
- StitcherItemPos = 10;
- CdPlayerPos = 11;
- DVDItemPos = 12;
- TVItemPos = 13;
-}
-/*
-Copyright 2012 by Johnson Controls
-__________________________________________________________________________
-
-Filename: systemApp.js
-__________________________________________________________________________
-
-Project: JCI-IHU
-Language: EN
-Author: awoodhc
-Date: 05.7.2012
-__________________________________________________________________________
-
-Description: IHU GUI System App
-
-Revisions:
-v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
-v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
-v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between
-contexts.
-v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
-v0.5 - 14-June-2012 Language Localization added to ListCtrls
-v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
-v0.7 - 22-June-2012 Code review changes and reworked context handling
-v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
-v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
-v1.0 - 31-July-2012 Updated Multicontroller behavior.
-v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
-v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
-v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
-v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
-v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
-v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
-v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
-v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
-v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
-v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
-v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
-v2.2 (20-Nov-2012) Stitcher enabled
-v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
-v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
-v2.5 (17-Jan-2013) Changed one event name
-v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
-v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
-v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
-v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
-
-__________________________________________________________________________
-
-*/
-
-log.addSrcFile("systemApp.js", "system");
-
-/**********************************************
-* Start of Base App Implementation
-*
-* Code in this section should not be modified
-* except for function names based on the appname
-*********************************************/
-
-function systemApp(uiaId)
-{
- log.debug("constructor called...");
-
- // Base application functionality is provided in a common location via this call to baseApp.init().
- // See framework/js/BaseApp.js for details.
- baseApp.init(this, uiaId);
-
- // All feature-specific initialization is done in appInit()
-}
-
-/*
-* Called just after the app is instantiated by framework.
-* App-specific variables should be declared here.
-*/
-systemApp.prototype.appInit = function()
-{
- if (framework.debugMode)
- {
- utility.loadScript("apps/system/test/systemAppTest.js");
- }
-
- //@formatter:off
-
- this._initEntertainmentDataList();
- this._initApplicationsDataList();
- this._initCommunicationsDataList();
-
- this._contextTable = {
-
- "HomeScreen" : {
- "hideHomeBtn" : true,
- "template" : "MainMenuTmplt",
- "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
- "controlProperties": {
- "MainMenuCtrl" : {
- "selectCallback":this._selectCallbackHomeScreen.bind(this),
- } // end of properties for "MainMenuCtrl"
- }, // end of list of controlProperties
- }, // end of "systemAppContext1"
-
- "Communication" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Communication",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": this._communicationsDataList,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyCommunication.bind(this),
- "contextInFunction" : this._CommCtxtContextIn.bind(this),
- }, // end of "Communication"
-
- "Entertainment" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Entertainment",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyEntertainment.bind(this),
- }, // end of "Entertainment"
-
- "Applications" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Applications",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "Applications"
-
- "VehicleStatusMonitor" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "VehicleStatusMonitor",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "VehicleStatusMonitor"
-
- "NoConnectionNotify" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoConnectionNotify.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.No"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoConnectionNotifyTitle',
- text2Id : 'NoConnectionNotifyText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "NotifyDialog" : {
- "template" : "Dialog3Tmplt",
- "sbNameId" : null,
- "readyFunction" : this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
- "displayedFunction" : this._NotifyDialogCtxtTmpltDisplayed.bind(this),
- "noLongerDisplayedFunction" : this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectCallbackNotifyDialog.bind(this),
- "contentStyle" : "style17",
- "buttonCount" : 3,
- "initialFocus" : 2,
- "buttonConfig" : {
- "button1" : {
- labelId : "NotifyOff",
- appData : "SelectNotifyOff",
- },
- "button2" : {
- labelId : "NotifyIgnore",
- appData : "Global.No",
- },
- "button3" : {
- labelId : "NotifyRead",
- appData : "SelectNotifyMessage"
- }
- }, // end of buttonConfig
- "text1Id" : "NotifyIncomingMsg",
- "text2" : "",
- "text3Id" : "NotifyReadNow",
- } // end of properties for dialog
- }, // end of controlProperties
- }, // end of "NotifyDialog"
-
- "NotificationList" : {
- "leftBtnStyle" : "goBack",
- "template" : "List2Tmplt",
- "sbNameId" : "Notifications",
- "readyFunction" : this._readyNotificationList.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedNotificationList.bind(this),
- "controlProperties": {
- "List2Ctrl" : {
- titleConfiguration : "noTitle",
- numberedList : true,
- selectCallback: this._selectNotificationListItem.bind(this),
- title : null,
- dataList : null,
- },
- }, // end of controlProperties
- }, // end of "NotificationList"
-
- "NotificationListRetry" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackNotificationListRetry.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Cancel",
- appData : "Global.Cancel"
- },
- button2 : {
- labelId : "RetryLabel",
- appData : "SelectRetry"
- },
- },
- text1Id : 'FailedNotificationRetrieval',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of NotificationListRetry
-
- "NoDevice" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoDevice.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.GoBack"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoDeviceTitle',
- text2Id : 'NoDeviceText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "DisplayOff" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : this._displayOffUserActivity.bind(this),
- showClock : true,
- }
- },
- }, // end of "DisplayOff"
-
- "Disclaimer" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "WarningTitle",
- contentStyle : "style02",
- fullScreen : true,
- defaultSelectCallback : this._selectCallbackDisclaimer.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "agree",
- appData : "Global.Yes"
- },
- },
- text1Id : 'DisclaimerText',
- }
- },
- "displayedFunction" : this._displayedDisclaimer.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedDisclaimer.bind(this),
- }, // end of Disclaimer
-
- "SystemWarning" : {
- "hideHomeBtn" : true,
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "TempWarning",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackSystemWarning.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "TempWarningText",
- }
- },
- },
-
- "SourceReconnect" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnect.bind(this),
- "contentStyle" : "style14",
- "fullScreen" : false,
- "text1Id" : null,
- "meter" : {"meterType":"indeterminate", "meterPath":"common/images/IndeterminateMeter_2.png"},
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "ReconnectEntMenuButton",
- appData : "SelectEntertainmentMenu"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnect.bind(this),
- },
-
- "SourceReconnectFailed" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnectFailed.bind(this),
- "contentStyle" : "style02",
- "fullScreen" : false,
- "text1Id" : null,
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnectFailed.bind(this),
- },
-
- "IntroAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "QuickStartLoop" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["QUICKTRANLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "PowerDownAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["EXITLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "IdleStandby" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "WaitForEnding" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "EnableRVR" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackEnableRVR.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "SiriDisabled",
- }
- },
- "readyFunction" : this._readyEnableRVR.bind(this),
- },
-
- "RVRInstructions" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "InitiateSiri",
- }
- },
- },
-
- "SiriInSession" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "Siri",
- contentStyle : "style14",
- "meter" : {"meterType":"indeterminate", "meterPath":"apps/system/images/IcnSiri.png"}
- }
- },
- },
-
- "SiriLaunchingError" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- //titleStyle : "titleStyle01",
- // titleId : "Siri",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "DisconnectThenReconnect",
- }
- },
- "readyFunction" : this._readySiriLaunchingError.bind(this),
- },
- }; // end of this._contextTable object
-
- //@formatter:off
- this._messageTable = {
- // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
- "StatusMenu" : this._StatusMenuMsgHandler.bind(this),
-
- // Add or remove certain menu items.
- "StatusMenuVisible" : this._StatusMenuVisibleMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for USB1 and USB2 audio
- "StatusMenuUSBAudio" : this._StatusMenuUSBAudioMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for BTAudio
- "StatusMenuBTAudio" : this._StatusMenuBTAudioMsgHandler.bind(this),
-
- // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
- "StatusUpdateEcoEnergy" : this._StatusUpdateEcoEnergyMsgHandler.bind(this),
-
- // Updates the number of notifications for missed sms and emails.
- "StatusUpdateNotifications" : this._StatusUpdateNotificationsHandler.bind(this),
-
- // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
- "StatusPhoneCall" : this._StatusPhoneCallMsgHandler.bind(this),
-
- // Show an Audio SourceNotAvailable SBN
- "TimedSBN_SourceNotAvailable" : this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
-
- // Update the current audio source icon in the Entertainment menu
- "StatusUpdateAudioSource" : this._StatusUpdateAudioSourceMsgHandler.bind(this),
-
- // Update the number of missed calls
- "StatusUpdateMissedCallCount" : this._StatusUpdateMissedCallCountMsgHandler.bind(this),
-
- // Update the number of warnings displayed apps men
- "WarningStatusCount" : this._WarningStatusCountMsgHandler.bind(this),
-
- // Update whether scheduled maintenance is due
- "StatusUpdateSchedMaint" : this._StatusUpdateSchedMaintHandler.bind(this),
-
- // Show an Siri SBN
- "ShowStateSBN_SiriActive" : this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
-
- // Show an Siri Error SBN
- "TimedSBN_SiriError" : this._TimedSBN_SiriErrorMsgHandler.bind(this),
-
- // Remove an Siri SBN
- "RemoveStateSBN_SiriActive" : this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
-
- //Show timed SBN Voice not supported
- "TimedSBN_VoiceNotSupported" : this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
-
- //At Speed Restriction
- "Global.AtSpeed" : this._AtSpeedMsgHandler.bind(this),
-
- //At No Speed
- "Global.NoSpeed" : this._NoSpeedMsgHandler.bind(this),
- };
- //@formatter:on
-
- // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
- // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
- // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
- // so the remaining time must be restarted when this happens.
- this._disclaimerTime = {
-
- // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
- // flag is set true after a the timer times out or the user hits the OK button.
- reset : true,
-
- // (Number) Milliseconds remaining to show the Disclaimer.
- remaining : 0,
-
- // (Number) Millisecond timestamp when the Disclaimer was first shown.
- whenStarted : 0,
-
- // (Handle) setTimeout ID
- timeoutId : null
- };
-
- // Array containing the appName of the list which supports Speed Restriction.
- //@appName = appName of the item , @status = default value of disabled property for particular appName
- this._SpeedRestrictedApps = [ {appName : "vdt_settings",status : true}];
-};
-
-/**************************
-* Set Wink Properties *
-**************************/
-
-systemApp.prototype.getWinkProperties = function(alert, params)
-{
- log.info("setting wink properties for: ", alert, params);
- var winkProperties = null;
- switch(alert)
- {
- case "System_RVR_NOT_ACTIVE":
- case "System_RVR_EFM_ERROR":
- case "System_RVR_ACTIVATE_ERROR":
- winkProperties = {
- "style": "style03",
- "text1Id": "ErrorWhileStartingSiri"
- };
- break;
- case "System_RVR_ACTIVE":
- case "System_RVR_ACTIVE_WITH_EFM":
- case "System_RVR_ACTIVE_NO_EFM":
- winkProperties = {
- "style": "style03",
- "text1Id": "Siri"
- };
- break;
- default:
- // Display default Wink
- log.debug("No properties found for wink: " + alert);
- break;
- }
- // return the properties to Common
- return winkProperties;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Initialize various menu data lists
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._initEntertainmentDataList = function()
-{
- var items = [];
-
- if (framework.localize.getRegion() === framework.localize.REGIONS.Japan)
- {
- // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
- // add it if the region is Japan.
- items.push({ appData : { appName : 'amradio', isVisible : true, audioSourceId : 'TrafficInfo' , mmuiEvent : 'SelectTrafficAlert' }, text1Id : 'TrafficAlertsItem', disabled : true, itemStyle : 'style01', hasCaret: false });
- }
-
- items.push(
- { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: FmRadioPos },
- { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AmRadioPos },
- { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: DabRadioPos },
- { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: SdarsRadioPos },
- { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AhaRadioPos },
- { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false, pos: PandoraPos },
- { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: StitcherItemPos },
- { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false, pos: BluetoothPos },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false, pos: UsbAudioAPos },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false, pos: UsbAudioBPos },
- { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false, pos: CdPlayerPos },
- { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AuxInPos },
- { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: DVDItemPos },
- { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: TVItemPos }
- );
- items.sort(function(a, b) {
- return a.pos - b.pos;
- })
-
- // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterEntertainmentDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initApplicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vsm', isVisible : true, mmuiEvent : 'SelectEngineOilLevel' }, text1Id : 'EngineOilLevel', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vehicleStatus', isVisible : false, mmuiEvent : 'SelectVehicleStatusMonitor' }, text1Id : 'VehicleStatusMonitor', disabled : false, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterApplicationDataList = {
- items: items
- };
-
- //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
- this._applicationsCtxtWiseAppNames = {
- //Context Name : // [appName,appName....]
- "Applications" : ["hdtrafficimage","idm","ecoenergy","driverid","vehicleStatus","vdt_settings","vdt","carplay","androidauto","_androidauto","_videoplayer","_aiotweaks","_speedometer"],
- "VehicleStatusMonitor" : ["warnguide","vsm","schedmaint"]
- };
-};
-
-systemApp.prototype._initCommunicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
- { appData : { appName : '', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._communicationsDataList = {
-
- items: items
-
- };
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers, helpers
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._StatusPhoneCallMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus)
- {
- // Add or remove the Active Call item in the communications menu
- var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
- var dirty = false;
- if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall')
- {
- this._communicationsDataList.items[0].appData.isVisible = true;
- dirty = true;
- }
- else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall'
- && this._communicationsDataList.items[0].appData.isVisible === true)
- {
- this._communicationsDataList.items[0].appData.isVisible = false;
- dirty = true;
- }
-
- // If it changed, and we are in the Comm ctxt, update the list shown
- if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- //build list (which will exclude isVisible==false items)
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusMenuMsgHandler = function(msg)
-{
- log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
-
- // Update menu items associated with the given appName of the message. Menu items can appear
- // in several different contexts or appear multiple times: this function searches all those places.
-
- var appName = msg.params.payload.statusMenu.appName;
- var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
-
- //Update the Availability Status of Speed Restricted Apps
- this._StatusMenuChanged(appName,isDisabled);
-
- // Update the static menu lists so they are correctly enable next time the context is shown
- this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
- this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
- this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
-
- // Update the menu list in the current context if needed
- if (this._currentContext)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- case "VehicleStatusMonitor":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled)// At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
-
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
- }
- }
- }
- break;
- }
- }
-};
-
-systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- }
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[i].disabled = isDisabled;
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
-
- var appName = msg.params.payload.appName;
- var isVisible = msg.params.payload.state === "Visible";
-
- // Search entertainment items
- var isEntertainmentDirty = false;
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.appName === appName
- && this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible)
- {
- isEntertainmentDirty = true;
- this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Entertainment context if it is currently displayed.
- if (isEntertainmentDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Entertainment"
- && this._currentContextTemplate)
- {
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Search application items
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.appName === appName
- && this._masterApplicationDataList.items[i].appData.isVisible != isVisible)
- {
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
- }
- if(this._masterApplicationDataList.items[i].appData.appName === "vehicleStatus")
- {
- this._indexOfVSMApp = i;
- }
- }
-
- //If any app inside the VehicleStatusMonitor context is visible then VehicleStatusMonitor will also be visible in Application.
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames["VehicleStatusMonitor"];
- var isVehicleStatusMonitorVisible = false;
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- var applicationsCtxtWiseAppName = applicationsCtxtWiseAppNames[j];
- for (var k = 0; k < this._masterApplicationDataList.items.length; ++k)
- {
- if((this._masterApplicationDataList.items[k].appData.appName === applicationsCtxtWiseAppName) &&
- this._masterApplicationDataList.items[k].appData.isVisible)
- {
- isVehicleStatusMonitorVisible = this._masterApplicationDataList.items[k].appData.isVisible;
- break;
- }
- }
- }
-
- //update the visiblity of VehicleStatusMonitor on basis of visible status of application(s) inside VehicleStatusMonitor context.
- this._masterApplicationDataList.items[this._indexOfVSMApp].appData.isVisible = isVehicleStatusMonitorVisible;
-
- // Update the Applications context or VehicleStatusMonitor context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Now that we are listening to StatusMenuVisible for Comm items (for email only)
- // we want to ensure any messages sent by other apps that were previously ignored are still ignored
- // Shoki6 ONLY
- if (appName === "email")
- {
- // Search communication items - avalajh
- var isCommunicationDirty = false;
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.appName === appName
- && this._communicationsDataList.items[i].appData.isVisible != isVisible)
- {
- isCommunicationDirty = true;
- this._communicationsDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Communication context if it is currently displayed.
- if (isCommunicationDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Communication"
- && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- }
- };
- systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio)
- {
- // Update cached values for the USB device status
- var status = msg.params.payload.statusMenuUSBAudio;
- var mmuiEvent = "";
- var textIdWithDevice = "";
- var textIdWithoutDevice = "";
- var masterIndex = -1;
- if (status.usbAB === "USB_A")
- {
- mmuiEvent = "SelectUSBA";
- textIdWithDevice = "UsbAudioAWithDevice";
- textIdWithoutDevice = "UsbAudioA";
- }
- else if (status.usbAB === "USB_B")
- {
- mmuiEvent = "SelectUSBB";
- textIdWithDevice = "UsbAudioBWithDevice";
- textIdWithoutDevice = "UsbAudioB";
- }
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- masterIndex = i;
-
- var isAvailable = status.statusMenu.appStatus === "Available";
- var name = status.displayName;
- this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
- if (isAvailable && typeof name === 'string' && name.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
- };
-
- systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- var masterIndex = -1;
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- masterIndex = i;
-
- var isAvailable = msg.params.payload.appStatus === "Available";
- var deviceName = msg.params.payload.deviceName;
-
- // NOTE: This message does not enable/disable the BTAudio menu item.
- // (The StatusMenu message will enable it on startup.)
-
- if (isAvailable && typeof deviceName === "string" && deviceName.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
- };
-
- systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
-
- // Determine correct text ID, based on vehicle fuel type
- var fuelType = msg.params.payload.fuelType;
- var newText1Id;
- switch (fuelType)
- {
- case "HEV":
- newText1Id = "EcoenergyAppHEV";
- break;
-
- case "GAS":
- default:
- newText1Id = "EcoenergyApp";
- break;
- }
-
- // Search application items for the "ecoenergy" application
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
- (this._masterApplicationDataList.items[i].text1Id != newText1Id))
- {
- // Found the app, and it's text ID needs to change, so change it
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].text1Id = newText1Id;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- };
-
- // Handle message to update the notification counts in the Communication context.
- systemApp.prototype._StatusUpdateNotificationsHandler = function(msg)
- {
- if (msg.params && msg.params.payload && msg.params.payload.messageCounts)
- {
- // Update message counts and the notifications list item displayed in the Communication menu
- var countEmail = msg.params.payload.messageCounts.countEmail;
- var countSMS = msg.params.payload.messageCounts.countSMS;
- var total = countEmail + countSMS;
-
- var showMessageIcon = total > 0;
- framework.common.setSbIcon("Message", showMessageIcon);
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- switch (this._communicationsDataList.items[i].appData.mmuiEvent)
- {
- case 'SelectNotifications':
- this._communicationsDataList.items[i].disabled = (total === 0);
- this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
- break;
-
- case 'SelectSms':
- this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
- break;
-
- case 'SelectEmail':
- this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- };
-
- systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function()
- {
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceRecognition',
- imagePath1 : 'apps/system/images/IcnSiriSBN.png'
- };
- framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
- };
-
- systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function()
- {
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style01',
- text1Id : 'ErrorWhileStartingSiri',
- };
- framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
- };
-
- systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function()
- {
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceNotSupported',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
- };
-
- systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function()
- {
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
- };
-
- systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- var params = {
- sbnStyle : 'Style02',
- imagePath1 : 'common/images/icons/IcnListBtConnType_Music.png'
- };
-
- switch (msg.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- params.text1Id = "AudioSourceNotAvailableBTAudio";
- break;
-
- case "USBAudio":
- case "USB_A":
- case "USB_B":
- params.text1Id = "AudioSourceNotAvailableUSB";
- break;
-
- case "CD":
- params.text1Id = "AudioSourceNotAvailableCD";
- break;
-
- case "DVD":
- params.text1Id = "AudioSourceNotAvailableDVD";
- break;
-
- case "TV":
- params.text1Id = "AudioSourceNotAvailableTV";
- break;
- }
-
- framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
- }
- };
-
- systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList)
- {
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (isPlaying)
- {
- // Set the icon on the audioSource item and clearing it on all other items
- dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
- }
- else
- {
- // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
- // "Off" and "Play" messages do not necessarily come in that order.
- if (dataList.items[i].appData.audioSourceId === audioSource)
- {
- dataList.items[i].image1 = "";
- }
- }
- }
- };
-
- systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- var audioSource = msg.params.payload.statusAudio.audioSource;
- var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
-
- // Set the icon in the masterEntertainment data list so it is persisted between template instances
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
- list.updateItems(0, list.dataList.items.length - 1);
- }
- }
- };
-
- systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg)
- {
- var count = "";
- if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0)
- {
- count = msg.params.payload.missedCallCount.toString();
- }
-
- // Update this._communicationsDataList
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- this._communicationsDataList.items[i].label1 = count;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- list.dataList.items[i].label1 = count;
- list.updateItems(i, i);
- }
- }
- }
- };
-
- systemApp.prototype._WarningStatusCountMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- var count = "";
- var icon = "";
- if (msg.params.payload.warningcount > 0)
- {
- count = msg.params.payload.warningcount.toString();
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- this._masterApplicationDataList.items[i].label1 = count;
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- list.dataList.items[i].label1 = count;
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- }
- }
- }
- };
-
- systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- var isDue = msg.params.payload.due;
- var warningCountValue = null;
- //Caching the Due Status to be used in _WarningStatusCountMsgHandler.
- this._SchedMaintDueStatus = isDue;
- // Update the master list
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- }
- else if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- var WarnGuidanceAppItem = utility.getArrayItemByPropertyValue(this._masterApplicationDataList.items,"text1Id","WarnGuidanceApp");
- if(WarnGuidanceAppItem && WarnGuidanceAppItem.item && WarnGuidanceAppItem.item.label1)
- {
- warningCountValue = WarnGuidanceAppItem.item.label1;
- }
-
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !this._masterApplicationDataList.items[i].image2)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- else
- {
- //DO nothing
- }
- }
- }
-
- // Update the current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- list.dataList.items[i].image2 = "";
- }
- list.updateItems(i, i);
- }
- else if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !list.dataList.items[i].image2)
- {
- list.dataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- list.dataList.items[i].image2 = "";
- }
- else
- {
- //Do Nothing
- }
-
- list.updateItems(i, i);
- }
- }
- }
- }
- };
-
- systemApp.prototype._AtSpeedMsgHandler = function(msg)
- {
- //At speed will disable the speed Restricted items
- this._AtSpeedDisabled = true;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- };
-
- systemApp.prototype._NoSpeedMsgHandler = function(msg)
- {
- //At speed will Enable the speed Restricted items
- this._AtSpeedDisabled = false;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- };
-
- /**************************
- * Control callbacks
- **************************/
-
- /*
- * Callback for the Main Menu Context icon button clicks
- * @param mainMenuObj (Object) Reference to the MainMenuCtrl
- * @param appData (Object) Data passed in by the app when the control was instantiated
- * @param params (Object) Contains label for the selected icon
- */
- systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params)
- {
- log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
-
- var icon = params.icon;
-
- switch(icon)
- {
- case "app":
- framework.sendEventToMmui(this.uiaId, "SelectApplications");
- break;
- case "com":
- framework.sendEventToMmui(this.uiaId, "SelectCommunication");
- break;
- case "ent":
- framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
- break;
- case "nav":
- framework.sendEventToMmui(this.uiaId, "SelectNavigation");
- break;
- case "set":
- framework.sendEventToMmui(this.uiaId, "SelectSettings");
- break;
- }
- };
-
- /*
- * Select callback for Applications, Communication, and Entertainment contexts.
- * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
- */
- systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params)
- {
- framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // Communication
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._CommCtxtContextIn = function()
- {
- var scrollTo = 0;
-
- // We cannot use the data list in the current context here, becuase it doesn't exist yet
- // so we use _buildCommunicationDataList() just like _readyCommunications() will
- var dataList = this._buildCommunicationDataList();
-
- // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
- var any = false;
- for (var i = 0; i < dataList.items.length - 1; ++i)
- {
- if (dataList.items[i].disabled === false)
- {
- any = true;
- }
- }
-
- if (any === false)
- {
- var lastIndex = dataList.items.length - 1;
- if (dataList.items[lastIndex].disabled === false)
- {
- scrollTo = lastIndex;
- }
- }
-
- this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
- this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
- };
- ///////////////////////////////////////////////////////////////////////////////
- // Applications
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readyApplications = function()
- {
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
-
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Applications Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
- };
-
- // Build list data from this._masterApplicationDataList based on the currently visible items.
- systemApp.prototype._buildApplicationsDataList = function()
- {
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.isVisible)
- {
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames[this._currentContext.ctxtId];
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- if(applicationsCtxtWiseAppNames[j] === this._masterApplicationDataList.items[i].appData.appName)
- {
- dataList.items.push(this._masterApplicationDataList.items[i]);
- }
- }
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // Entertainment
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readyEntertainment = function()
- {
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Entertainment Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
- };
-
- // Build list data from this._masterEntertainmentDataList based on the currently visible items.
- systemApp.prototype._buildEntertainmentDataList = function()
- {
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterEntertainmentDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
- };
-
-
- ///////////////////////////////////////////////////////////////////////////////
- // Communication - avalajh
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readyCommunication = function()
- {
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Communication Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
- };
-
- // Build list data from this._communicationsDataList based on the currently visible items.
- systemApp.prototype._buildCommunicationDataList = function()
- {
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._communicationsDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
- };
-
-
- ///////////////////////////////////////////////////////////////////////////////
- // NoConnectionNotify
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params)
- {
- switch(this._currentContext.ctxtId)
- {
- case 'NoConnectionNotify':
- switch(appData)
- {
- case 'SelectConnect':
- framework.sendEventToMmui("system", appData);
- break;
-
- case 'Global.No':
- framework.sendEventToMmui("common", appData);
- break;
- }
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // NotifyDialog
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function()
- {
- if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData)
- {
- this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
- }
- };
-
- systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function()
- {
- // Start timer to dismiss the notification if the user doesn't respond
- var self = this;
- this._NotifyDialogTimeoutId = setTimeout(function() {
- this._NotifyDialogTimeoutId = null;
- framework.sendEventToMmui(self.uiaId, "Timeout");
- }, 10000);
- };
-
- systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function()
- {
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
- };
-
- systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params)
- {
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-
- switch (appData)
- {
- case "Global.No":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectNotifyOff":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
-
- case "SelectNotifyMessage":
- if (this._currentContext.params && this._currentContext.params.payload)
- {
- var paramsData = {
- payload : {
- messageId : this._currentContext.params.payload.messageNotifyData.messageId,
- messageNotifyType : this._currentContext.params.payload.messageNotifyData.messageNotifyType
- }
- };
- framework.sendEventToMmui(this.uiaId, appData, paramsData);
- }
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // NotificationListRetry
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Cancel":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectRetry":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // NotificationList
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readyNotificationList = function(readyParams)
- {
- log.debug("_readyNotificationList called...");
-
- if (readyParams)
- {
- readyParams.skipRestore = true;
- }
-
- var params = {
- "context_in": 0,
-
- // typedef enum MSG_client_type_e
- // {
- // /// Used for min valid values range check
- // MSG_CLIENT_MIN = 0,
- // /// Invalid value of 0
- // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
- // /// Email client
- // MSG_CLIENT_EMAIL,
- // /// SMS/MMS client
- // MSG_CLIENT_SMS,
- // /// Settings client
- // MSG_CLIENT_SETTINGS,
- // /// Notifications client
- // MSG_CLIENT_NOTIFICATIONS,
- // /// Used for max valid values range check
- // MSG_CLIENT_MAX
- // } MSG_client_type_t;
- "client_type_in": 4,
- "callbacks_in": 0
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
- };
-
- systemApp.prototype._noLongerDisplayedNotificationList = function()
- {
- this._closeMsgApiConnection();
- };
-
- systemApp.prototype._msgConnectCallback = function(msg)
- {
- if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100)
- {
- this._msgApiConnection = msg.params.connection;
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- "request_type" : 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
- };
-
- systemApp.prototype._msgGetNewMessagesListCallback = function(msg)
- {
- if (msg && msg.msgType === "methodResponse" && msg.params)
- {
- switch (msg.params.status)
- {
- // Successful retrieval w/ messages
- case 100:
- {
- log.info("####AppSDK Success####");
- this._closeMsgApiConnection();
-
- var messages = msg.params.message_list.messages;
-
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items: [],
- vuiSupport: true
- };
-
- for (var i = 0; i < messages.length; i++)
- {
- var item = {
- appData: { messageId: messages[i].id, name: messages[i].sender },
- itemStyle : 'style07',
- styleMod : 'bold',
- hasCaret : false,
- text1: messages[i].sender,
- image1 : '',
- label1 : utility.formatSmartDateTime(messages[i].datetime, false),
- label2 : '', // label2 is only set for email's below and left blank for sms.
- labelWidth : 'wide',
- };
-
- // Set image1 and set appData event name.
- switch (messages[i].clientType)
- {
- // MSG_CLIENT_EMAIL
- case 1:
- item.appData.eventId = 'SelectMessageEmail';
- item.image1 = 'common/images/icons/IcnListEmail_En.png';
- item.label2 = messages[i].instance;
- break;
-
- // MSG_CLIENT_SMS
- case 2:
- item.appData.eventId = 'SelectMessageSMS';
- item.image1 = 'common/images/icons/IcnListSms_En.png';
- break;
- }
-
- dataList.items.push(item);
- }
-
- dataList.itemCount = dataList.items.length;
-
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
- }
- break;
- }
-
- // Empty list returned
- case 107:
- {
- log.info("AppSDK returned empty message.");
- this._closeMsgApiConnection();
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- break;
- }
-
- // Unrecognized status code
- default:
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- break;
- }
- }
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
- };
-
- systemApp.prototype._closeMsgApiConnection = function()
- {
- if (this._msgApiConnection)
- {
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- };
- framework.sendRequestToAppsdk(this.uiaId, function(){}, "msg", "Disconnect", params);
- this._msgApiConnection = null;
- }
- };
-
- systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params)
- {
- if (appData && appData.eventId)
- {
- switch (appData.eventId)
- {
- case 'SelectMessageEmail':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMessageSMS':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMissedCall':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
- }
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // NoDevice
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.GoBack":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectConnect":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // DisplayOff
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params)
- {
- framework.sendEventToMmui("system", "DisplayOffGUIActivity");
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // Disclaimer
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._displayedDisclaimer = function()
- {
- framework.sendEventToMmui("system", "DisposeIntroVideo");
-
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
- };
-
- systemApp.prototype._selectCallbackDisclaimer = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Yes":
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui("common", appData);
- break;
- }
- };
-
- systemApp.prototype._disclaimerTimedout = function()
- {
- this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- if (this._currentContext && this._currentContext.ctxtId === "Disclaimer")
- {
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
-
- //Incase after Timeout Disclaimer screen didnt remove then sends start the timer again
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
- };
-
- systemApp.prototype._noLongerDisplayedDisclaimer = function()
- {
- // Note: The template is transitioning away either because of a Timeout, the user hit OK or an interrupting context change.
-
- var elapsed = Date.now() - this._disclaimerTime.whenStarted;
- this._disclaimerTime.remaining = this._disclaimerTime.remaining - elapsed;
-
- if (this._disclaimerTime.timeoutId)
- {
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // SystemWarning
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // EnableRVR
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // RVRInstructions
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // SourceReconnect
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readySourceReconnect = function()
- {
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
- break;
-
- case "Pandora":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
- break;
-
- case "Stitcher":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
- break;
-
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
- break;
-
- default:
- break;
- }
- }
- };
-
- systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "SelectEntertainmentMenu":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // SourceReconnectFailed
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readySourceReconnectFailed = function()
- {
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
- break;
-
- default:
- break;
- }
- }
- };
-
- //Siri EnableRVR context ready to Display Function
- systemApp.prototype._readyEnableRVR = function()
- {
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled",subMapObj);
-
- }
- };
-
- //Siri SiriLaunchingError context ready to Display Function
- systemApp.prototype._readySiriLaunchingError = function()
- {
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect",subMapObj);
-
- }
- };
-
- systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
- };
-
- // Store the Availability Status of Speed Restricted Apps
- systemApp.prototype._StatusMenuChanged = function(appName, isDisabled)
- {
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
- if(speedRestrictedAppName.indexOf(appName) === 0)
- {
- this._SpeedRestrictedApps[i].status = isDisabled;
- }
- }
- };
-
- // Update the items for Speed Restricted Message
- systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled)
- {
- var status = null;
- var appName = null;
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- appName = this._SpeedRestrictedApps[i].appName;
- status = this._SpeedRestrictedApps[i].status;
-
- log.info("AppName : "+appName+" is available or unavailable - (true/false)" +status);
-
- //Checks for Status Availability for the respective AppName
- if(!status)
- {
- this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
- }
- // Update the menu list in the current context if needed
- if (this._currentContext && !status)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var j = 0; j < dataList.items.length; ++j)
- {
- if (dataList.items[j].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[j].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[j].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(j, j);
- }
- }
- }
- break;
- }
- }
- }
- };
-
- // Tell framework that system app has finished loading
- framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.59.js b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.59.js
deleted file mode 100644
index 4b2e164..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.59.js
+++ /dev/null
@@ -1,2451 +0,0 @@
-// This is a failsafe
-if (typeof FmRadioPos === 'undefined') {
- FmRadioPos = 1;
- AmRadioPos = 2;
- UsbAudioAPos = 4;
- UsbAudioBPos = 5;
- AuxInPos = 6;
- BluetoothPos = 7;
- SdarsRadioPos = 8;
- DabRadioPos = 7;
- AhaRadioPos = 8;
- PandoraPos = 9;
- StitcherItemPos = 10;
- CdPlayerPos = 11;
- DVDItemPos = 12;
- TVItemPos = 13;
-}
-/*
- Copyright 2012 by Johnson Controls
- __________________________________________________________________________
-
- Filename: systemApp.js
- __________________________________________________________________________
-
- Project: JCI-IHU
- Language: EN
- Author: awoodhc
- Date: 05.7.2012
- __________________________________________________________________________
-
- Description: IHU GUI System App
-
- Revisions:
- v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
- v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
- v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between contexts.
- v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
- v0.5 - 14-June-2012 Language Localization added to ListCtrls
- v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
- v0.7 - 22-June-2012 Code review changes and reworked context handling
- v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
- v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
- v1.0 - 31-July-2012 Updated Multicontroller behavior.
- v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
- v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
- v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
- v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
- v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
- v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
- v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
- v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
- v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
- v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
- v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
- v2.2 (20-Nov-2012) Stitcher enabled
- v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
- v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
- v2.5 (17-Jan-2013) Changed one event name
- v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
- v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
- v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
- v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
-
- __________________________________________________________________________
-
- */
-
-log.addSrcFile("systemApp.js", "system");
-
-/**********************************************
- * Start of Base App Implementation
- *
- * Code in this section should not be modified
- * except for function names based on the appname
- *********************************************/
-
-function systemApp(uiaId)
-{
- log.debug("constructor called...");
-
- // Base application functionality is provided in a common location via this call to baseApp.init().
- // See framework/js/BaseApp.js for details.
- baseApp.init(this, uiaId);
-
- // All feature-specific initialization is done in appInit()
-}
-
-/*
- * Called just after the app is instantiated by framework.
- * App-specific variables should be declared here.
- */
-systemApp.prototype.appInit = function()
-{
- if (framework.debugMode)
- {
- utility.loadScript("apps/system/test/systemAppTest.js");
- }
-
- //@formatter:off
-
- this._initEntertainmentDataList();
- this._initApplicationsDataList();
- this._initCommunicationsDataList();
-
- this._contextTable = {
-
- "HomeScreen" : {
- "hideHomeBtn" : true,
- "template" : "MainMenuTmplt",
- "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
- "controlProperties": {
- "MainMenuCtrl" : {
- "selectCallback":this._selectCallbackHomeScreen.bind(this),
- } // end of properties for "MainMenuCtrl"
- }, // end of list of controlProperties
- }, // end of "systemAppContext1"
-
- "Communication" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Communication",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": this._communicationsDataList,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyCommunication.bind(this),
- "contextInFunction" : this._CommCtxtContextIn.bind(this),
- }, // end of "Communication"
-
- "Entertainment" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Entertainment",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyEntertainment.bind(this),
- }, // end of "Entertainment"
-
- "Applications" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Applications",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "Applications"
-
- "VehicleStatusMonitor" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "VehicleStatusMonitor",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "VehicleStatusMonitor"
-
- "NoConnectionNotify" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoConnectionNotify.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.No"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoConnectionNotifyTitle',
- text2Id : 'NoConnectionNotifyText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "NotifyDialog" : {
- "template" : "Dialog3Tmplt",
- "sbNameId" : null,
- "readyFunction" : this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
- "displayedFunction" : this._NotifyDialogCtxtTmpltDisplayed.bind(this),
- "noLongerDisplayedFunction" : this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectCallbackNotifyDialog.bind(this),
- "contentStyle" : "style17",
- "buttonCount" : 3,
- "initialFocus" : 2,
- "buttonConfig" : {
- "button1" : {
- labelId : "NotifyOff",
- appData : "SelectNotifyOff",
- },
- "button2" : {
- labelId : "NotifyIgnore",
- appData : "Global.No",
- },
- "button3" : {
- labelId : "NotifyRead",
- appData : "SelectNotifyMessage"
- }
- }, // end of buttonConfig
- "text1Id" : "NotifyIncomingMsg",
- "text2" : "",
- "text3Id" : "NotifyReadNow",
- } // end of properties for dialog
- }, // end of controlProperties
- }, // end of "NotifyDialog"
-
- "NotificationList" : {
- "leftBtnStyle" : "goBack",
- "template" : "List2Tmplt",
- "sbNameId" : "Notifications",
- "readyFunction" : this._readyNotificationList.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedNotificationList.bind(this),
- "controlProperties": {
- "List2Ctrl" : {
- titleConfiguration : "noTitle",
- numberedList : true,
- selectCallback: this._selectNotificationListItem.bind(this),
- title : null,
- dataList : null,
- },
- }, // end of controlProperties
- }, // end of "NotificationList"
-
- "NotificationListRetry" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackNotificationListRetry.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Cancel",
- appData : "Global.Cancel"
- },
- button2 : {
- labelId : "RetryLabel",
- appData : "SelectRetry"
- },
- },
- text1Id : 'FailedNotificationRetrieval',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of NotificationListRetry
-
- "NoDevice" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoDevice.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.GoBack"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoDeviceTitle',
- text2Id : 'NoDeviceText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "DisplayOff" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : this._displayOffUserActivity.bind(this),
- showClock : true,
- }
- },
- }, // end of "DisplayOff"
-
- "Disclaimer" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "WarningTitle",
- contentStyle : "style02",
- fullScreen : true,
- defaultSelectCallback : this._selectCallbackDisclaimer.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "agree",
- appData : "Global.Yes"
- },
- },
- text1Id : 'DisclaimerText',
- }
- },
- "displayedFunction" : this._displayedDisclaimer.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedDisclaimer.bind(this),
- }, // end of Disclaimer
-
- "SystemWarning" : {
- "hideHomeBtn" : true,
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "TempWarning",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackSystemWarning.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "TempWarningText",
- }
- },
- },
-
- "SourceReconnect" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnect.bind(this),
- "contentStyle" : "style14",
- "fullScreen" : false,
- "text1Id" : null,
- "meter" : {"meterType":"indeterminate", "meterPath":"common/images/IndeterminateMeter_2.png"},
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "ReconnectEntMenuButton",
- appData : "SelectEntertainmentMenu"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnect.bind(this),
- },
-
- "SourceReconnectFailed" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnectFailed.bind(this),
- "contentStyle" : "style02",
- "fullScreen" : false,
- "text1Id" : null,
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnectFailed.bind(this),
- },
-
- "IntroAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "QuickStartLoop" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["QUICKTRANLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "PowerDownAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["EXITLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "IdleStandby" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "WaitForEnding" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "EnableRVR" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackEnableRVR.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "SiriDisabled",
- }
- },
- "readyFunction" : this._readyEnableRVR.bind(this),
- },
-
- "RVRInstructions" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "InitiateSiri",
- }
- },
- },
-
- "SiriInSession" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "Siri",
- contentStyle : "style14",
- "meter" : {"meterType":"indeterminate", "meterPath":"apps/system/images/IcnSiri.png"}
- }
- },
- },
-
- "SiriLaunchingError" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- //titleStyle : "titleStyle01",
- // titleId : "Siri",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "DisconnectThenReconnect",
- }
- },
- "readyFunction" : this._readySiriLaunchingError.bind(this),
- },
- }; // end of this._contextTable object
-
- //@formatter:off
- this._messageTable = {
- // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
- "StatusMenu" : this._StatusMenuMsgHandler.bind(this),
-
- // Add or remove certain menu items.
- "StatusMenuVisible" : this._StatusMenuVisibleMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for USB1 and USB2 audio
- "StatusMenuUSBAudio" : this._StatusMenuUSBAudioMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for BTAudio
- "StatusMenuBTAudio" : this._StatusMenuBTAudioMsgHandler.bind(this),
-
- // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
- "StatusUpdateEcoEnergy" : this._StatusUpdateEcoEnergyMsgHandler.bind(this),
-
- // Updates the number of notifications for missed sms and emails.
- "StatusUpdateNotifications" : this._StatusUpdateNotificationsHandler.bind(this),
-
- // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
- "StatusPhoneCall" : this._StatusPhoneCallMsgHandler.bind(this),
-
- // Show an Audio SourceNotAvailable SBN
- "TimedSBN_SourceNotAvailable" : this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
-
- // Update the current audio source icon in the Entertainment menu
- "StatusUpdateAudioSource" : this._StatusUpdateAudioSourceMsgHandler.bind(this),
-
- // Update the number of missed calls
- "StatusUpdateMissedCallCount" : this._StatusUpdateMissedCallCountMsgHandler.bind(this),
-
- // Update the number of warnings displayed apps men
- "WarningStatusCount" : this._WarningStatusCountMsgHandler.bind(this),
-
- // Update whether scheduled maintenance is due
- "StatusUpdateSchedMaint" : this._StatusUpdateSchedMaintHandler.bind(this),
-
- // Show an Siri SBN
- "ShowStateSBN_SiriActive" : this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
-
- // Show an Siri Error SBN
- "TimedSBN_SiriError" : this._TimedSBN_SiriErrorMsgHandler.bind(this),
-
- // Remove an Siri SBN
- "RemoveStateSBN_SiriActive" : this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
-
- //Show timed SBN Voice not supported
- "TimedSBN_VoiceNotSupported" : this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
-
- //Show timed SBN Voice Recognition Loading
- "TimedSBN_VRLoading" : this._TimedSBN_VRLoadingMsgHandler.bind(this),
-
- //At Speed Restriction
- "Global.AtSpeed" : this._AtSpeedMsgHandler.bind(this),
-
- //At No Speed
- "Global.NoSpeed" : this._NoSpeedMsgHandler.bind(this),
- };
- //@formatter:on
-
- // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
- // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
- // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
- // so the remaining time must be restarted when this happens.
- this._disclaimerTime = {
-
- // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
- // flag is set true after a the timer times out or the user hits the OK button.
- reset : true,
-
- // (Number) Milliseconds remaining to show the Disclaimer.
- remaining : 0,
-
- // (Number) Millisecond timestamp when the Disclaimer was first shown.
- whenStarted : 0,
-
- // (Handle) setTimeout ID
- timeoutId : null
- };
-
- // Array containing the appName of the list which supports Speed Restriction.
- //@appName = appName of the item , @status = default value of disabled property for particular appName
- this._SpeedRestrictedApps = [ {appName : "vdt_settings",status : true}];
-};
-
-/**************************
- * Set Wink Properties *
- **************************/
-
-systemApp.prototype.getWinkProperties = function(alert, params)
-{ log.info("setting wink properties for: ", alert, params);
- var winkProperties = null;
- switch(alert)
- {
- case "System_RVR_NOT_ACTIVE":
- case "System_RVR_EFM_ERROR":
- case "System_RVR_ACTIVATE_ERROR":
- winkProperties = {
- "style": "style03",
- "text1Id": "ErrorWhileStartingSiri"
- };
- break;
- case "System_RVR_ACTIVE":
- case "System_RVR_ACTIVE_WITH_EFM":
- case "System_RVR_ACTIVE_NO_EFM":
- winkProperties = {
- "style": "style03",
- "text1Id": "Siri"
- };
- break;
- default:
- // Display default Wink
- log.debug("No properties found for wink: " + alert);
- break;
- }
- // return the properties to Common
- return winkProperties;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Initialize various menu data lists
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._initEntertainmentDataList = function()
-{ var items = [];
-
- if (framework.localize.getRegion() === framework.localize.REGIONS.Japan)
- {
- // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
- // add it if the region is Japan.
- items.push({ appData : { appName : 'amradio', isVisible : true, audioSourceId : 'TrafficInfo' , mmuiEvent : 'SelectTrafficAlert' }, text1Id : 'TrafficAlertsItem', disabled : true, itemStyle : 'style01', hasCaret: false });
- }
-
- items.push(
- { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: FmRadioPos },
- { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AmRadioPos },
- { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: DabRadioPos },
- { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: SdarsRadioPos },
- { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AhaRadioPos },
- { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false, pos: PandoraPos },
- { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: StitcherItemPos },
- { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false, pos: BluetoothPos },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false, pos: UsbAudioAPos },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false, pos: UsbAudioBPos },
- { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false, pos: CdPlayerPos },
- { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AuxInPos },
- { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: DVDItemPos },
- { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: TVItemPos }
- );
- items.sort(function(a, b) {
- return a.pos - b.pos;
- })
- // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterEntertainmentDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initApplicationsDataList = function()
-{ var items = [];
-
- this._vehicleConfigurationType = null;
- this._vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
-
- log.info("this._vehicleConfigurationType " +this._vehicleConfigurationType);
-
- items.push(
- { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vsm', isVisible : false, mmuiEvent : 'SelectEngineOilLevel' }, text1Id : 'EngineOilLevel', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vehicleStatus', isVisible : false, mmuiEvent : 'SelectVehicleStatusMonitor' }, text1Id : 'VehicleStatusMonitor', disabled : false, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterApplicationDataList = {
- items: items
- };
-
- this._updateApplicationStructure(this._vehicleConfigurationType);
-
- // Keep the index of vehicleStatus ready to be used during enable/disable and visible/hidden of this item.
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if(this._masterApplicationDataList.items[i].appData.appName === "vehicleStatus")
- {
- this._indexOfVSMApp = i;
- }
- }
-
-};
-
-systemApp.prototype._initCommunicationsDataList = function()
-{ var items = [];
-
- items.push(
- { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
- { appData : { appName : '', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._communicationsDataList = {
-
- items: items
-
- };
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers, helpers
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._StatusPhoneCallMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus)
- {
- // Add or remove the Active Call item in the communications menu
- var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
- var dirty = false;
- if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall')
- {
- this._communicationsDataList.items[0].appData.isVisible = true;
- dirty = true;
- }
- else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall'
- && this._communicationsDataList.items[0].appData.isVisible === true)
- {
- this._communicationsDataList.items[0].appData.isVisible = false;
- dirty = true;
- }
-
- // If it changed, and we are in the Comm ctxt, update the list shown
- if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- //build list (which will exclude isVisible==false items)
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusMenuMsgHandler = function(msg)
-{ log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
-
- // Update menu items associated with the given appName of the message. Menu items can appear
- // in several different contexts or appear multiple times: this function searches all those places.
-
- var appName = msg.params.payload.statusMenu.appName;
- var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
-
- //Update the Availability Status of Speed Restricted Apps
- this._StatusMenuChanged(appName,isDisabled);
-
- // Update the static menu lists so they are correctly enable next time the context is shown
- this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
- this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
- this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
-
- // Update the menu list in the current context if needed
- if (this._currentContext)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- case "VehicleStatusMonitor":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled)// At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
-
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
- }
- }
- }
- break;
- }
- }
-};
-
-systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList)
-{ for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- }
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-
- //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
- //Reading the value again and checking the same with existing one.
- var vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
- if (vehicleConfigurationType !== this._vehicleConfigurationType)
- {
- log.info("VehicleConfigurationType is changed to "+vehicleConfigurationType)
- this._vehicleConfigurationType = vehicleConfigurationType;
- this._updateApplicationStructure(vehicleConfigurationType);
- }
-};
-
-systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList)
-{ for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[i].disabled = isDisabled;
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
-
- var appName = msg.params.payload.appName;
- var isVisible = msg.params.payload.state === "Visible";
-
- // Search entertainment items
- var isEntertainmentDirty = false;
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.appName === appName
- && this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible)
- {
- isEntertainmentDirty = true;
- this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Entertainment context if it is currently displayed.
- if (isEntertainmentDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Entertainment"
- && this._currentContextTemplate)
- {
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Search application items
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.appName === appName
- && this._masterApplicationDataList.items[i].appData.isVisible != isVisible)
- {
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
- }
- }
- //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
- //Reading the value again and checking the same with existing one.
- var vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
- if (vehicleConfigurationType !== this._vehicleConfigurationType)
- {
- log.info("VehicleConfigurationType is changed to "+vehicleConfigurationType)
- this._vehicleConfigurationType = vehicleConfigurationType;
- this._updateApplicationStructure(vehicleConfigurationType);
- }
- //If any app inside the VehicleStatusMonitor context is visible then VehicleStatusMonitor will also be visible in Application.
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames["VehicleStatusMonitor"];
- var isVehicleStatusMonitorVisible = false;
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- var applicationsCtxtWiseAppName = applicationsCtxtWiseAppNames[j];
- for (var k = 0; k < this._masterApplicationDataList.items.length; ++k)
- {
- if((this._masterApplicationDataList.items[k].appData.appName === applicationsCtxtWiseAppName) &&
- this._masterApplicationDataList.items[k].appData.isVisible)
- {
- isApplicationsDirty = true;
- isVehicleStatusMonitorVisible = this._masterApplicationDataList.items[k].appData.isVisible;
- break;
- }
- }
- }
-
- //update the visiblity of VehicleStatusMonitor on basis of visible status of application(s) inside VehicleStatusMonitor context.
- this._masterApplicationDataList.items[this._indexOfVSMApp].appData.isVisible = isVehicleStatusMonitorVisible;
-
- // Update the Applications context or VehicleStatusMonitor context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Now that we are listening to StatusMenuVisible for Comm items (for email only)
- // we want to ensure any messages sent by other apps that were previously ignored are still ignored
- // Shoki6 ONLY
- if (appName === "email")
- {
- // Search communication items - avalajh
- var isCommunicationDirty = false;
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.appName === appName
- && this._communicationsDataList.items[i].appData.isVisible != isVisible)
- {
- isCommunicationDirty = true;
- this._communicationsDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Communication context if it is currently displayed.
- if (isCommunicationDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Communication"
- && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- }
-};
-systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio)
- {
- // Update cached values for the USB device status
- var status = msg.params.payload.statusMenuUSBAudio;
- var mmuiEvent = "";
- var textIdWithDevice = "";
- var textIdWithoutDevice = "";
- var masterIndex = -1;
- if (status.usbAB === "USB_A")
- {
- mmuiEvent = "SelectUSBA";
- textIdWithDevice = "UsbAudioAWithDevice";
- textIdWithoutDevice = "UsbAudioA";
- }
- else if (status.usbAB === "USB_B")
- {
- mmuiEvent = "SelectUSBB";
- textIdWithDevice = "UsbAudioBWithDevice";
- textIdWithoutDevice = "UsbAudioB";
- }
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- masterIndex = i;
-
- var isAvailable = status.statusMenu.appStatus === "Available";
- var name = status.displayName;
- this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
- if (isAvailable && typeof name === 'string' && name.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var masterIndex = -1;
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- masterIndex = i;
-
- var isAvailable = msg.params.payload.appStatus === "Available";
- var deviceName = msg.params.payload.deviceName;
-
- // NOTE: This message does not enable/disable the BTAudio menu item.
- // (The StatusMenu message will enable it on startup.)
-
- if (isAvailable && typeof deviceName === "string" && deviceName.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
-
- // Determine correct text ID, based on vehicle fuel type
- var fuelType = msg.params.payload.fuelType;
- var newText1Id;
- switch (fuelType)
- {
- case "HEV":
- newText1Id = "EcoenergyAppHEV";
- break;
-
- case "GAS":
- default:
- newText1Id = "EcoenergyApp";
- break;
- }
-
- // Search application items for the "ecoenergy" application
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
- (this._masterApplicationDataList.items[i].text1Id != newText1Id))
- {
- // Found the app, and it's text ID needs to change, so change it
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].text1Id = newText1Id;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-// Handle message to update the notification counts in the Communication context.
-systemApp.prototype._StatusUpdateNotificationsHandler = function(msg)
-{ if (msg.params && msg.params.payload && msg.params.payload.messageCounts)
- {
- // Update message counts and the notifications list item displayed in the Communication menu
- var countEmail = msg.params.payload.messageCounts.countEmail;
- var countSMS = msg.params.payload.messageCounts.countSMS;
- var total = countEmail + countSMS;
-
- var showMessageIcon = total > 0;
- framework.common.setSbIcon("Message", showMessageIcon);
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- switch (this._communicationsDataList.items[i].appData.mmuiEvent)
- {
- case 'SelectNotifications':
- this._communicationsDataList.items[i].disabled = (total === 0);
- this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
- break;
-
- case 'SelectSms':
- this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
- break;
-
- case 'SelectEmail':
- this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceRecognition',
- imagePath1 : 'apps/system/images/IcnSiriSBN.png'
- };
- framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-};
-
-systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style01',
- text1Id : 'ErrorWhileStartingSiri',
- };
- framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-};
-
-//If VR is not ready after Disclaimer then display SBN
-systemApp.prototype._TimedSBN_VRLoadingMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'common.SbnVoiceLoading',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceRecoLoading', "vrStatus", params);
-};
-
-systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceNotSupported',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
-};
-
-systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
-};
-
-systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var params = {
- sbnStyle : 'Style02',
- imagePath1 : 'common/images/icons/IcnListBtConnType_Music.png'
- };
-
- switch (msg.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- params.text1Id = "AudioSourceNotAvailableBTAudio";
- break;
-
- case "USBAudio":
- case "USB_A":
- case "USB_B":
- params.text1Id = "AudioSourceNotAvailableUSB";
- break;
-
- case "CD":
- params.text1Id = "AudioSourceNotAvailableCD";
- break;
-
- case "DVD":
- params.text1Id = "AudioSourceNotAvailableDVD";
- break;
-
- case "TV":
- params.text1Id = "AudioSourceNotAvailableTV";
- break;
- }
-
- framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
- }
-};
-
-systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList)
-{ for (var i = 0; i < dataList.items.length; ++i)
- {
- if (isPlaying)
- {
- // Set the icon on the audioSource item and clearing it on all other items
- dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
- }
- else
- {
- // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
- // "Off" and "Play" messages do not necessarily come in that order.
- if (dataList.items[i].appData.audioSourceId === audioSource)
- {
- dataList.items[i].image1 = "";
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var audioSource = msg.params.payload.statusAudio.audioSource;
- var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
-
- // Set the icon in the masterEntertainment data list so it is persisted between template instances
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
- list.updateItems(0, list.dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg)
-{ var count = "";
- if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0)
- {
- count = msg.params.payload.missedCallCount.toString();
- }
-
- // Update this._communicationsDataList
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- this._communicationsDataList.items[i].label1 = count;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- list.dataList.items[i].label1 = count;
- list.updateItems(i, i);
- }
- }
- }
-};
-
-systemApp.prototype._WarningStatusCountMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var count = "";
- var icon = "";
- if (msg.params.payload.warningcount > 0)
- {
- count = msg.params.payload.warningcount.toString();
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- this._masterApplicationDataList.items[i].label1 = count;
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
- this._vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- list.dataList.items[i].label1 = count;
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var isDue = msg.params.payload.due;
- var warningCountValue = null;
- //Caching the Due Status to be used in _WarningStatusCountMsgHandler.
- this._SchedMaintDueStatus = isDue;
- this._vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- // Update the master list
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- }
- // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
- else if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- var WarnGuidanceAppItem = utility.getArrayItemByPropertyValue(this._masterApplicationDataList.items,"text1Id","WarnGuidanceApp");
- if(WarnGuidanceAppItem && WarnGuidanceAppItem.item && WarnGuidanceAppItem.item.label1)
- {
- warningCountValue = WarnGuidanceAppItem.item.label1;
- }
-
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !this._masterApplicationDataList.items[i].image2)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- else
- {
- //DO nothing
- }
- }
- }
-
- // Update the current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- list.dataList.items[i].image2 = "";
- }
- list.updateItems(i, i);
- }
- // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
- else if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !list.dataList.items[i].image2)
- {
- list.dataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- list.dataList.items[i].image2 = "";
- }
- else
- {
- //Do Nothing
- }
-
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._AtSpeedMsgHandler = function(msg)
-{ //At speed will disable the speed Restricted items
- this._AtSpeedDisabled = true;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-systemApp.prototype._NoSpeedMsgHandler = function(msg)
-{ //At speed will Enable the speed Restricted items
- this._AtSpeedDisabled = false;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-/**************************
- * Control callbacks
- **************************/
-
-/*
- * Callback for the Main Menu Context icon button clicks
- * @param mainMenuObj (Object) Reference to the MainMenuCtrl
- * @param appData (Object) Data passed in by the app when the control was instantiated
- * @param params (Object) Contains label for the selected icon
- */
-systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params)
-{ log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
-
- var icon = params.icon;
-
- switch(icon)
- {
- case "app":
- framework.sendEventToMmui(this.uiaId, "SelectApplications");
- break;
- case "com":
- framework.sendEventToMmui(this.uiaId, "SelectCommunication");
- break;
- case "ent":
- framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
- break;
- case "nav":
- framework.sendEventToMmui(this.uiaId, "SelectNavigation");
- break;
- case "set":
- framework.sendEventToMmui(this.uiaId, "SelectSettings");
- break;
- }
-};
-
-/*
- * Select callback for Applications, Communication, and Entertainment contexts.
- * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
- */
-systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params)
-{ framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._CommCtxtContextIn = function()
-{ var scrollTo = 0;
-
- // We cannot use the data list in the current context here, becuase it doesn't exist yet
- // so we use _buildCommunicationDataList() just like _readyCommunications() will
- var dataList = this._buildCommunicationDataList();
-
- // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
- var any = false;
- for (var i = 0; i < dataList.items.length - 1; ++i)
- {
- if (dataList.items[i].disabled === false)
- {
- any = true;
- }
- }
-
- if (any === false)
- {
- var lastIndex = dataList.items.length - 1;
- if (dataList.items[lastIndex].disabled === false)
- {
- scrollTo = lastIndex;
- }
- }
-
- this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
- this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Applications
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyApplications = function()
-{ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
-
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Applications Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterApplicationDataList based on the currently visible items.
-systemApp.prototype._buildApplicationsDataList = function()
-{ var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
- //Reading the value again and checking the same with existing one.
- var vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
- if (vehicleConfigurationType !== this._vehicleConfigurationType)
- {
- log.info("VehicleConfigurationType is changed to "+vehicleConfigurationType)
- this._updateApplicationStructure(vehicleConfigurationType);
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.isVisible)
- {
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames[this._currentContext.ctxtId];
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- if(applicationsCtxtWiseAppNames[j] === this._masterApplicationDataList.items[i].appData.appName)
- {
- dataList.items.push(this._masterApplicationDataList.items[i]);
- }
- }
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Entertainment
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyEntertainment = function()
-{ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Entertainment Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterEntertainmentDataList based on the currently visible items.
-systemApp.prototype._buildEntertainmentDataList = function()
-{ var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterEntertainmentDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication - avalajh
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyCommunication = function()
-{ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Communication Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._communicationsDataList based on the currently visible items.
-systemApp.prototype._buildCommunicationDataList = function()
-{ var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._communicationsDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoConnectionNotify
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params)
-{ switch(this._currentContext.ctxtId)
- {
- case 'NoConnectionNotify':
- switch(appData)
- {
- case 'SelectConnect':
- framework.sendEventToMmui("system", appData);
- break;
-
- case 'Global.No':
- framework.sendEventToMmui("common", appData);
- break;
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotifyDialog
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function()
-{ if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData)
- {
- this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
- }
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function()
-{ // Start timer to dismiss the notification if the user doesn't respond
- var self = this;
- this._NotifyDialogTimeoutId = setTimeout(function() {
- this._NotifyDialogTimeoutId = null;
- framework.sendEventToMmui(self.uiaId, "Timeout");
- }, 10000);
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function()
-{ if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-};
-
-systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params)
-{ if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-
- switch (appData)
- {
- case "Global.No":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectNotifyOff":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
-
- case "SelectNotifyMessage":
- if (this._currentContext.params && this._currentContext.params.payload)
- {
- var paramsData = {
- payload : {
- messageId : this._currentContext.params.payload.messageNotifyData.messageId,
- messageNotifyType : this._currentContext.params.payload.messageNotifyData.messageNotifyType
- }
- };
- framework.sendEventToMmui(this.uiaId, appData, paramsData);
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationListRetry
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Cancel":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectRetry":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationList
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyNotificationList = function(readyParams)
-{ log.debug("_readyNotificationList called...");
-
- if (readyParams)
- {
- readyParams.skipRestore = true;
- }
-
- var params = {
- "context_in": 0,
-
- // typedef enum MSG_client_type_e
- // {
- // /// Used for min valid values range check
- // MSG_CLIENT_MIN = 0,
- // /// Invalid value of 0
- // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
- // /// Email client
- // MSG_CLIENT_EMAIL,
- // /// SMS/MMS client
- // MSG_CLIENT_SMS,
- // /// Settings client
- // MSG_CLIENT_SETTINGS,
- // /// Notifications client
- // MSG_CLIENT_NOTIFICATIONS,
- // /// Used for max valid values range check
- // MSG_CLIENT_MAX
- // } MSG_client_type_t;
- "client_type_in": 4,
- "callbacks_in": 0
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
-};
-
-systemApp.prototype._noLongerDisplayedNotificationList = function()
-{ this._closeMsgApiConnection();
-};
-
-systemApp.prototype._msgConnectCallback = function(msg)
-{ if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100)
- {
- this._msgApiConnection = msg.params.connection;
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- "request_type" : 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._msgGetNewMessagesListCallback = function(msg)
-{ if (msg && msg.msgType === "methodResponse" && msg.params)
- {
- switch (msg.params.status)
- {
- // Successful retrieval w/ messages
- case 100:
- {
- log.info("####AppSDK Success####");
- this._closeMsgApiConnection();
-
- var messages = msg.params.message_list.messages;
-
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items: [],
- vuiSupport: true
- };
-
- for (var i = 0; i < messages.length; i++)
- {
- var item = {
- appData: { messageId: messages[i].id, name: messages[i].sender },
- itemStyle : 'style07',
- styleMod : 'bold',
- hasCaret : false,
- text1: messages[i].sender,
- image1 : '',
- label1 : utility.formatSmartDateTime(messages[i].datetime, false),
- label2 : '', // label2 is only set for email's below and left blank for sms.
- labelWidth : 'wide',
- };
-
- // Set image1 and set appData event name.
- switch (messages[i].clientType)
- {
- // MSG_CLIENT_EMAIL
- case 1:
- item.appData.eventId = 'SelectMessageEmail';
- item.image1 = 'common/images/icons/IcnListEmail_En.png';
- item.label2 = messages[i].instance;
- break;
-
- // MSG_CLIENT_SMS
- case 2:
- item.appData.eventId = 'SelectMessageSMS';
- item.image1 = 'common/images/icons/IcnListSms_En.png';
- break;
- }
-
- dataList.items.push(item);
- }
-
- dataList.itemCount = dataList.items.length;
-
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
- }
- break;
- }
-
- // Empty list returned
- case 107:
- {
- log.info("AppSDK returned empty message.");
- this._closeMsgApiConnection();
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- break;
- }
-
- // Unrecognized status code
- default:
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- break;
- }
- }
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._closeMsgApiConnection = function()
-{ if (this._msgApiConnection)
- {
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- };
- framework.sendRequestToAppsdk(this.uiaId, function(){}, "msg", "Disconnect", params);
- this._msgApiConnection = null;
- }
-};
-
-systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params)
-{ if (appData && appData.eventId)
- {
- switch (appData.eventId)
- {
- case 'SelectMessageEmail':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMessageSMS':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMissedCall':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
- }
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoDevice
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.GoBack":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectConnect":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// DisplayOff
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params)
-{ framework.sendEventToMmui("system", "DisplayOffGUIActivity");
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Disclaimer
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayedDisclaimer = function()
-{ framework.sendEventToMmui("system", "DisposeIntroVideo");
-
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
-};
-
-systemApp.prototype._selectCallbackDisclaimer = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-systemApp.prototype._disclaimerTimedout = function()
-{ this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- if (this._currentContext && this._currentContext.ctxtId === "Disclaimer")
- {
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
-
- //Incase after Timeout Disclaimer screen didnt remove then sends start the timer again
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
-};
-
-systemApp.prototype._noLongerDisplayedDisclaimer = function()
-{ // Note: The template is transitioning away either because of a Timeout, the user hit OK or an interrupting context change.
-
- var elapsed = Date.now() - this._disclaimerTime.whenStarted;
- this._disclaimerTime.remaining = this._disclaimerTime.remaining - elapsed;
-
- if (this._disclaimerTime.timeoutId)
- {
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SystemWarning
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// EnableRVR
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// RVRInstructions
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnect
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnect = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
- break;
-
- case "Pandora":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
- break;
-
- case "Stitcher":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
- break;
-
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "SelectEntertainmentMenu":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnectFailed
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnectFailed = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-//Siri EnableRVR context ready to Display Function
-systemApp.prototype._readyEnableRVR = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled",subMapObj);
-
- }
-};
-
-//Siri SiriLaunchingError context ready to Display Function
-systemApp.prototype._readySiriLaunchingError = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect",subMapObj);
-
- }
-};
-
-systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-// Store the Availability Status of Speed Restricted Apps
-systemApp.prototype._StatusMenuChanged = function(appName, isDisabled)
-{ for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
- if(speedRestrictedAppName.indexOf(appName) === 0)
- {
- this._SpeedRestrictedApps[i].status = isDisabled;
- }
- }
-};
-
-// Update the items for Speed Restricted Message
-systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled)
-{ var status = null;
- var appName = null;
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- appName = this._SpeedRestrictedApps[i].appName;
- status = this._SpeedRestrictedApps[i].status;
-
- log.info("AppName : "+appName+" is available or unavailable - (true/false)" +status);
-
- //Checks for Status Availability for the respective AppName
- if(!status)
- {
- this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
- }
- // Update the menu list in the current context if needed
- if (this._currentContext && !status)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var j = 0; j < dataList.items.length; ++j)
- {
- if (dataList.items[j].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[j].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[j].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(j, j);
- }
- }
- }
- break;
- }
- }
- }
-};
-
-// Update the Applications structure based on vehicle configuration(Old or New)
-systemApp.prototype._updateApplicationStructure = function(vehicleConfiguration)
-{ if(vehicleConfiguration === "Old")
- {
- //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
- this._applicationsCtxtWiseAppNames = {
- //Context Name : // [appName,appName....]
- "Applications" : ["hdtrafficimage","idm","ecoenergy","driverid","warnguide","schedmaint","vehicleStatus","vdt_settings","vdt","carplay","androidauto","_androidauto","_videoplayer","_aiotweaks","_speedometer"],
- "VehicleStatusMonitor" : ["vsm"]
- };
-
- }
- else
- {
- //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
- this._applicationsCtxtWiseAppNames = {
- //Context Name : // [appName,appName....]
- "Applications" : ["hdtrafficimage","idm","ecoenergy","driverid","vehicleStatus","vdt_settings","vdt","carplay","androidauto","_androidauto","_videoplayer","_aiotweaks","_speedometer"],
- "VehicleStatusMonitor" : ["warnguide","vsm","schedmaint"]
- };
- }
-}// Tell framework that system app has finished loading
-framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.js b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.js
deleted file mode 100644
index 343aaa9..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.js
+++ /dev/null
@@ -1,2318 +0,0 @@
-// This is a failsafe
-if (typeof FmRadioPos === 'undefined') {
- FmRadioPos = 1;
- AmRadioPos = 2;
- UsbAudioAPos = 4;
- UsbAudioBPos = 5;
- AuxInPos = 6;
- BluetoothPos = 7;
- SdarsRadioPos = 8;
- DabRadioPos = 7;
- AhaRadioPos = 8;
- PandoraPos = 9;
- StitcherItemPos = 10;
- CdPlayerPos = 11;
- DVDItemPos = 12;
- TVItemPos = 13;
-}
-/*
- Copyright 2012 by Johnson Controls
- __________________________________________________________________________
-
- Filename: systemApp.js
- __________________________________________________________________________
-
- Project: JCI-IHU
- Language: EN
- Author: awoodhc
- Date: 05.7.2012
- __________________________________________________________________________
-
- Description: IHU GUI System App
-
- Revisions:
- v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
- v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
- v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between
- v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
- v0.5 - 14-June-2012 Language Localization added to ListCtrls
- v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
- v0.7 - 22-June-2012 Code review changes and reworked context handling
- v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
- v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
- v1.0 - 31-July-2012 Updated Multicontroller behavior.
- v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
- v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
- v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
- v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
- v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
- v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
- v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
- v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
- v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
- v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
- v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
- v2.2 (20-Nov-2012) Stitcher enabled
- v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
- v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
- v2.5 (17-Jan-2013) Changed one event name
- v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
- v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
- v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
- v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
-
- __________________________________________________________________________
-
- */
-
-log.addSrcFile("systemApp.js", "system");
-
-/**********************************************
- * Start of Base App Implementation
- *
- * Code in this section should not be modified
- * except for function names based on the appname
- *********************************************/
-
-function systemApp(uiaId)
-{
- log.debug("constructor called...");
-
- // Base application functionality is provided in a common location via this call to baseApp.init().
- // See framework/js/BaseApp.js for details.
- baseApp.init(this, uiaId);
-
- // All feature-specific initialization is done in appInit()
-}
-
-/*
- * Called just after the app is instantiated by framework.
- * App-specific variables should be declared here.
- */
-systemApp.prototype.appInit = function()
-{
- if (framework.debugMode)
- {
- utility.loadScript("apps/system/test/systemAppTest.js");
- }
-
- //@formatter:off
-
- this._initEntertainmentDataList();
- this._initApplicationsDataList();
- this._initCommunicationsDataList();
-
- this._contextTable = {
-
- "HomeScreen" : {
- "hideHomeBtn" : true,
- "template" : "MainMenuTmplt",
- "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
- "controlProperties": {
- "MainMenuCtrl" : {
- "selectCallback":this._selectCallbackHomeScreen.bind(this),
- } // end of properties for "MainMenuCtrl"
- }, // end of list of controlProperties
- }, // end of "systemAppContext1"
-
- "Communication" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Communication",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": this._communicationsDataList,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyCommunication.bind(this),
- "contextInFunction" : this._CommCtxtContextIn.bind(this),
- }, // end of "Communication"
-
- "Entertainment" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Entertainment",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyEntertainment.bind(this),
- }, // end of "Entertainment"
-
- "Applications" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Applications",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "Applications"
-
- "NoConnectionNotify" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoConnectionNotify.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.No"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoConnectionNotifyTitle',
- text2Id : 'NoConnectionNotifyText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "NotifyDialog" : {
- "template" : "Dialog3Tmplt",
- "sbNameId" : null,
- "readyFunction" : this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
- "displayedFunction" : this._NotifyDialogCtxtTmpltDisplayed.bind(this),
- "noLongerDisplayedFunction" : this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectCallbackNotifyDialog.bind(this),
- "contentStyle" : "style17",
- "buttonCount" : 3,
- "initialFocus" : 2,
- "buttonConfig" : {
- "button1" : {
- labelId : "NotifyOff",
- appData : "SelectNotifyOff",
- },
- "button2" : {
- labelId : "NotifyIgnore",
- appData : "Global.No",
- },
- "button3" : {
- labelId : "NotifyRead",
- appData : "SelectNotifyMessage"
- }
- }, // end of buttonConfig
- "text1Id" : "NotifyIncomingMsg",
- "text2" : "",
- "text3Id" : "NotifyReadNow",
- } // end of properties for dialog
- }, // end of controlProperties
- }, // end of "NotifyDialog"
-
- "NotificationList" : {
- "leftBtnStyle" : "goBack",
- "template" : "List2Tmplt",
- "sbNameId" : "Notifications",
- "readyFunction" : this._readyNotificationList.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedNotificationList.bind(this),
- "controlProperties": {
- "List2Ctrl" : {
- titleConfiguration : "noTitle",
- numberedList : true,
- selectCallback: this._selectNotificationListItem.bind(this),
- title : null,
- dataList : null,
- },
- }, // end of controlProperties
- }, // end of "NotificationList"
-
- "NotificationListRetry" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackNotificationListRetry.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Cancel",
- appData : "Global.Cancel"
- },
- button2 : {
- labelId : "RetryLabel",
- appData : "SelectRetry"
- },
- },
- text1Id : 'FailedNotificationRetrieval',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of NotificationListRetry
-
- "NoDevice" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoDevice.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.GoBack"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoDeviceTitle',
- text2Id : 'NoDeviceText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "DisplayOff" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : this._displayOffUserActivity.bind(this),
- showClock : true,
- }
- },
- }, // end of "DisplayOff"
-
- "Disclaimer" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "WarningTitle",
- contentStyle : "style02",
- fullScreen : true,
- defaultSelectCallback : this._selectCallbackDisclaimer.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "agree",
- appData : "Global.Yes"
- },
- },
- text1Id : 'DisclaimerText',
- }
- },
- "displayedFunction" : this._displayedDisclaimer.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedDisclaimer.bind(this),
- }, // end of Disclaimer
-
- "SystemWarning" : {
- "hideHomeBtn" : true,
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "TempWarning",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackSystemWarning.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "TempWarningText",
- }
- },
- },
-
- "SourceReconnect" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnect.bind(this),
- "contentStyle" : "style14",
- "fullScreen" : false,
- "text1Id" : null,
- "meter" : {"meterType":"indeterminate", "meterPath":"common/images/IndeterminateMeter_2.png"},
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "ReconnectEntMenuButton",
- appData : "SelectEntertainmentMenu"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnect.bind(this),
- },
-
- "SourceReconnectFailed" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnectFailed.bind(this),
- "contentStyle" : "style02",
- "fullScreen" : false,
- "text1Id" : null,
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnectFailed.bind(this),
- },
-
- "IntroAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "QuickStartLoop" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["QUICKTRANLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "PowerDownAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["EXITLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "IdleStandby" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "WaitForEnding" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "EnableRVR" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackEnableRVR.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "SiriDisabled",
- }
- },
- "readyFunction" : this._readyEnableRVR.bind(this),
- },
-
- "RVRInstructions" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "InitiateSiri",
- }
- },
- },
-
- "SiriInSession" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "Siri",
- contentStyle : "style14",
- "meter" : {"meterType":"indeterminate", "meterPath":"apps/system/images/IcnSiri.png"}
- }
- },
- },
-
- "SiriLaunchingError" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- //titleStyle : "titleStyle01",
- // titleId : "Siri",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "DisconnectThenReconnect",
- }
- },
- "readyFunction" : this._readySiriLaunchingError.bind(this),
- },
- }; // end of this._contextTable object
-
- //@formatter:off
- this._messageTable = {
- // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
- "StatusMenu" : this._StatusMenuMsgHandler.bind(this),
-
- // Add or remove certain menu items.
- "StatusMenuVisible" : this._StatusMenuVisibleMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for USB1 and USB2 audio
- "StatusMenuUSBAudio" : this._StatusMenuUSBAudioMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for BTAudio
- "StatusMenuBTAudio" : this._StatusMenuBTAudioMsgHandler.bind(this),
-
- // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
- "StatusUpdateEcoEnergy" : this._StatusUpdateEcoEnergyMsgHandler.bind(this),
-
- // Updates the number of notifications for missed sms and emails.
- "StatusUpdateNotifications" : this._StatusUpdateNotificationsHandler.bind(this),
-
- // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
- "StatusPhoneCall" : this._StatusPhoneCallMsgHandler.bind(this),
-
- // Show an Audio SourceNotAvailable SBN
- "TimedSBN_SourceNotAvailable" : this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
-
- // Update the current audio source icon in the Entertainment menu
- "StatusUpdateAudioSource" : this._StatusUpdateAudioSourceMsgHandler.bind(this),
-
- // Update the number of missed calls
- "StatusUpdateMissedCallCount" : this._StatusUpdateMissedCallCountMsgHandler.bind(this),
-
- // Update the number of warnings displayed apps men
- "WarningStatusCount" : this._WarningStatusCountMsgHandler.bind(this),
-
- // Update whether scheduled maintenance is due
- "StatusUpdateSchedMaint" : this._StatusUpdateSchedMaintHandler.bind(this),
-
- // Show an Siri SBN
- "ShowStateSBN_SiriActive" : this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
-
- // Show an Siri Error SBN
- "TimedSBN_SiriError" : this._TimedSBN_SiriErrorMsgHandler.bind(this),
-
- // Remove an Siri SBN
- "RemoveStateSBN_SiriActive" : this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
-
- //Show timed SBN Voice not supported
- "TimedSBN_VoiceNotSupported" : this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
-
- //At Speed Restriction
- "Global.AtSpeed" : this._AtSpeedMsgHandler.bind(this),
-
- //At No Speed
- "Global.NoSpeed" : this._NoSpeedMsgHandler.bind(this),
- };
- //@formatter:on
-
- // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
- // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
- // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
- // so the remaining time must be restarted when this happens.
- this._disclaimerTime = {
-
- // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
- // flag is set true after a the timer times out or the user hits the OK button.
- reset : true,
-
- // (Number) Milliseconds remaining to show the Disclaimer.
- remaining : 0,
-
- // (Number) Millisecond timestamp when the Disclaimer was first shown.
- whenStarted : 0,
-
- // (Handle) setTimeout ID
- timeoutId : null
- };
-
- // Array containing the appName of the list which supports Speed Restriction.
- //@appName = appName of the item , @status = default value of disabled property for particular appName
- this._SpeedRestrictedApps = [ {appName : "vdt_settings",status : true}];
-};
-
-/**************************
- * Set Wink Properties *
- **************************/
-
-systemApp.prototype.getWinkProperties = function(alert, params)
-{
- log.info("setting wink properties for: ", alert, params);
- var winkProperties = null;
- switch(alert)
- {
- case "System_RVR_NOT_ACTIVE":
- case "System_RVR_EFM_ERROR":
- case "System_RVR_ACTIVATE_ERROR":
- winkProperties = {
- "style": "style03",
- "text1Id": "ErrorWhileStartingSiri"
- };
- break;
- case "System_RVR_ACTIVE":
- case "System_RVR_ACTIVE_WITH_EFM":
- case "System_RVR_ACTIVE_NO_EFM":
- winkProperties = {
- "style": "style03",
- "text1Id": "Siri"
- };
- break;
- default:
- // Display default Wink
- log.debug("No properties found for wink: " + alert);
- break;
- }
- // return the properties to Common
- return winkProperties;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Initialize various menu data lists
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._initEntertainmentDataList = function()
-{
- var items = [];
-
- if (framework.localize.getRegion() === framework.localize.REGIONS.Japan)
- {
- // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
- // add it if the region is Japan.
- items.push({ appData : { appName : 'amradio', isVisible : true, audioSourceId : 'TrafficInfo' , mmuiEvent : 'SelectTrafficAlert' }, text1Id : 'TrafficAlertsItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: '0' });
- }
-
- items.push(
- { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: FmRadioPos },
- { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AmRadioPos },
- { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: DabRadioPos },
- { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: SdarsRadioPos },
- { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AhaRadioPos },
- { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false, pos: PandoraPos },
- { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: StitcherItemPos },
- { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false, pos: BluetoothPos },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false, pos: UsbAudioAPos },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false, pos: UsbAudioBPos },
- { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false, pos: CdPlayerPos },
- { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false, pos: AuxInPos },
- { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: DVDItemPos },
- { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false, pos: TVItemPos }
- );
- items.sort(function(a, b) {
- return a.pos - b.pos;
- })
-
- // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterEntertainmentDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initApplicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
-
- );
-
- // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterApplicationDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initCommunicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
- { appData : { appName : '', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._communicationsDataList = {
-
- items: items
-
- };
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers, helpers
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._StatusPhoneCallMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus)
- {
- // Add or remove the Active Call item in the communications menu
- var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
- var dirty = false;
- if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall')
- {
- this._communicationsDataList.items[0].appData.isVisible = true;
- dirty = true;
- }
- else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall'
- && this._communicationsDataList.items[0].appData.isVisible === true)
- {
- this._communicationsDataList.items[0].appData.isVisible = false;
- dirty = true;
- }
-
- // If it changed, and we are in the Comm ctxt, update the list shown
- if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- //build list (which will exclude isVisible==false items)
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusMenuMsgHandler = function(msg)
-{
- log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
-
- // Update menu items associated with the given appName of the message. Menu items can appear
- // in several different contexts or appear multiple times: this function searches all those places.
-
- var appName = msg.params.payload.statusMenu.appName;
- var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
-
- //Update the Availability Status of Speed Restricted Apps
- this._StatusMenuChanged(appName,isDisabled);
-
- // Update the static menu lists so they are correctly enable next time the context is shown
- this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
- this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
- this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
-
- // Update the menu list in the current context if needed
- if (this._currentContext)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled)// At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
-
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
- }
- }
- }
- break;
- }
- }
-};
-
-systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- }
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[i].disabled = isDisabled;
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
-
- var appName = msg.params.payload.appName;
- var isVisible = msg.params.payload.state === "Visible";
-
- // Search entertainment items
- var isEntertainmentDirty = false;
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.appName === appName
- && this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible)
- {
- isEntertainmentDirty = true;
- this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Entertainment context if it is currently displayed.
- if (isEntertainmentDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Entertainment"
- && this._currentContextTemplate)
- {
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Search application items
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.appName === appName
- && this._masterApplicationDataList.items[i].appData.isVisible != isVisible)
- {
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Applications"
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Now that we are listening to StatusMenuVisible for Comm items (for email only)
- // we want to ensure any messages sent by other apps that were previously ignored are still ignored
- // Shoki6 ONLY
- if (appName === "email")
- {
- // Search communication items - avalajh
- var isCommunicationDirty = false;
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.appName === appName
- && this._communicationsDataList.items[i].appData.isVisible != isVisible)
- {
- isCommunicationDirty = true;
- this._communicationsDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Communication context if it is currently displayed.
- if (isCommunicationDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Communication"
- && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- }
-};
-systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio)
- {
- // Update cached values for the USB device status
- var status = msg.params.payload.statusMenuUSBAudio;
- var mmuiEvent = "";
- var textIdWithDevice = "";
- var textIdWithoutDevice = "";
- var masterIndex = -1;
- if (status.usbAB === "USB_A")
- {
- mmuiEvent = "SelectUSBA";
- textIdWithDevice = "UsbAudioAWithDevice";
- textIdWithoutDevice = "UsbAudioA";
- }
- else if (status.usbAB === "USB_B")
- {
- mmuiEvent = "SelectUSBB";
- textIdWithDevice = "UsbAudioBWithDevice";
- textIdWithoutDevice = "UsbAudioB";
- }
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- masterIndex = i;
-
- var isAvailable = status.statusMenu.appStatus === "Available";
- var name = status.displayName;
- this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
- if (isAvailable && typeof name === 'string' && name.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var masterIndex = -1;
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- masterIndex = i;
-
- var isAvailable = msg.params.payload.appStatus === "Available";
- var deviceName = msg.params.payload.deviceName;
-
- // NOTE: This message does not enable/disable the BTAudio menu item.
- // (The StatusMenu message will enable it on startup.)
-
- if (isAvailable && typeof deviceName === "string" && deviceName.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
-
- // Determine correct text ID, based on vehicle fuel type
- var fuelType = msg.params.payload.fuelType;
- var newText1Id;
- switch (fuelType)
- {
- case "HEV":
- newText1Id = "EcoenergyAppHEV";
- break;
-
- case "GAS":
- default:
- newText1Id = "EcoenergyApp";
- break;
- }
-
- // Search application items for the "ecoenergy" application
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
- (this._masterApplicationDataList.items[i].text1Id != newText1Id))
- {
- // Found the app, and it's text ID needs to change, so change it
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].text1Id = newText1Id;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Applications"
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-// Handle message to update the notification counts in the Communication context.
-systemApp.prototype._StatusUpdateNotificationsHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.messageCounts)
- {
- // Update message counts and the notifications list item displayed in the Communication menu
- var countEmail = msg.params.payload.messageCounts.countEmail;
- var countSMS = msg.params.payload.messageCounts.countSMS;
- var total = countEmail + countSMS;
-
- var showMessageIcon = total > 0;
- framework.common.setSbIcon("Message", showMessageIcon);
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- switch (this._communicationsDataList.items[i].appData.mmuiEvent)
- {
- case 'SelectNotifications':
- this._communicationsDataList.items[i].disabled = (total === 0);
- this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
- break;
-
- case 'SelectSms':
- this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
- break;
-
- case 'SelectEmail':
- this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceRecognition',
- imagePath1 : 'apps/system/images/IcnSiriSBN.png'
- };
- framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-}
-
-systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style01',
- text1Id : 'ErrorWhileStartingSiri',
- };
- framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-}
-
-systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceNotSupported',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
-}
-
-systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
-}
-
-systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var params = {
- sbnStyle : 'Style02',
- imagePath1 : 'common/images/icons/IcnListBtConnType_Music.png'
- };
-
- switch (msg.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- params.text1Id = "AudioSourceNotAvailableBTAudio";
- break;
-
- case "USBAudio":
- case "USB_A":
- case "USB_B":
- params.text1Id = "AudioSourceNotAvailableUSB";
- break;
-
- case "CD":
- params.text1Id = "AudioSourceNotAvailableCD";
- break;
-
- case "DVD":
- params.text1Id = "AudioSourceNotAvailableDVD";
- break;
-
- case "TV":
- params.text1Id = "AudioSourceNotAvailableTV";
- break;
- }
-
- framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
- }
-};
-
-systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (isPlaying)
- {
- // Set the icon on the audioSource item and clearing it on all other items
- dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
- }
- else
- {
- // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
- // "Off" and "Play" messages do not necessarily come in that order.
- if (dataList.items[i].appData.audioSourceId === audioSource)
- {
- dataList.items[i].image1 = "";
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var audioSource = msg.params.payload.statusAudio.audioSource;
- var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
-
- // Set the icon in the masterEntertainment data list so it is persisted between template instances
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
- list.updateItems(0, list.dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg)
-{
- var count = "";
- if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0)
- {
- count = msg.params.payload.missedCallCount.toString();
- }
-
- // Update this._communicationsDataList
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- this._communicationsDataList.items[i].label1 = count;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- list.dataList.items[i].label1 = count;
- list.updateItems(i, i);
- }
- }
- }
-};
-
-systemApp.prototype._WarningStatusCountMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var count = "";
- var icon = "";
- if (msg.params.payload.warningcount > 0)
- {
- count = msg.params.payload.warningcount.toString();
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- this._masterApplicationDataList.items[i].label1 = count;
- this._masterApplicationDataList.items[i].image2 = icon;
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Applications" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- list.dataList.items[i].label1 = count;
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var isDue = msg.params.payload.due;
-
- // Update the master list
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- break;
- }
- }
-
- // Update the current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Applications" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- list.dataList.items[i].image2 = "";
- }
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._AtSpeedMsgHandler = function(msg)
-{
- //At speed will disable the speed Restricted items
- this._AtSpeedDisabled = true;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-systemApp.prototype._NoSpeedMsgHandler = function(msg)
-{
- //At speed will Enable the speed Restricted items
- this._AtSpeedDisabled = false;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-/**************************
- * Control callbacks
- **************************/
-
-/*
- * Callback for the Main Menu Context icon button clicks
- * @param mainMenuObj (Object) Reference to the MainMenuCtrl
- * @param appData (Object) Data passed in by the app when the control was instantiated
- * @param params (Object) Contains label for the selected icon
- */
-systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params)
-{
- log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
-
- var icon = params.icon;
-
- switch(icon)
- {
- case "app":
- framework.sendEventToMmui(this.uiaId, "SelectApplications");
- break;
- case "com":
- framework.sendEventToMmui(this.uiaId, "SelectCommunication");
- break;
- case "ent":
- framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
- break;
- case "nav":
- framework.sendEventToMmui(this.uiaId, "SelectNavigation");
- break;
- case "set":
- framework.sendEventToMmui(this.uiaId, "SelectSettings");
- break;
- }
-};
-
-/*
- * Select callback for Applications, Communication, and Entertainment contexts.
- * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
- */
-systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params)
-{
- framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._CommCtxtContextIn = function()
-{
- var scrollTo = 0;
-
- // We cannot use the data list in the current context here, becuase it doesn't exist yet
- // so we use _buildCommunicationDataList() just like _readyCommunications() will
- var dataList = this._buildCommunicationDataList();
-
- // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
- var any = false;
- for (var i = 0; i < dataList.items.length - 1; ++i)
- {
- if (dataList.items[i].disabled === false)
- {
- any = true;
- }
- }
-
- if (any === false)
- {
- var lastIndex = dataList.items.length - 1;
- if (dataList.items[lastIndex].disabled === false)
- {
- scrollTo = lastIndex;
- }
- }
-
- this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
- this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Applications
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyApplications = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
-
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Applications Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterApplicationDataList based on the currently visible items.
-systemApp.prototype._buildApplicationsDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterApplicationDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Entertainment
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyEntertainment = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Entertainment Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterEntertainmentDataList based on the currently visible items.
-systemApp.prototype._buildEntertainmentDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterEntertainmentDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication - avalajh
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyCommunication = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Communication Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._communicationsDataList based on the currently visible items.
-systemApp.prototype._buildCommunicationDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._communicationsDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// NoConnectionNotify
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params)
-{
- switch(this._currentContext.ctxtId)
- {
- case 'NoConnectionNotify':
- switch(appData)
- {
- case 'SelectConnect':
- framework.sendEventToMmui("system", appData);
- break;
-
- case 'Global.No':
- framework.sendEventToMmui("common", appData);
- break;
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotifyDialog
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function()
-{
- if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData)
- {
- this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
- }
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function()
-{
- // Start timer to dismiss the notification if the user doesn't respond
- var self = this;
- this._NotifyDialogTimeoutId = setTimeout(function() {
- this._NotifyDialogTimeoutId = null;
- framework.sendEventToMmui(self.uiaId, "Timeout");
- }, 10000);
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function()
-{
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-};
-
-systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params)
-{
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-
- switch (appData)
- {
- case "Global.No":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectNotifyOff":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
-
- case "SelectNotifyMessage":
- if (this._currentContext.params && this._currentContext.params.payload)
- {
- var paramsData = {
- payload : {
- messageId : this._currentContext.params.payload.messageNotifyData.messageId,
- messageNotifyType : this._currentContext.params.payload.messageNotifyData.messageNotifyType
- }
- };
- framework.sendEventToMmui(this.uiaId, appData, paramsData);
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationListRetry
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Cancel":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectRetry":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationList
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyNotificationList = function(readyParams)
-{
- log.debug("_readyNotificationList called...");
-
- if (readyParams)
- {
- readyParams.skipRestore = true;
- }
-
- var params = {
- "context_in": 0,
-
- // typedef enum MSG_client_type_e
- // {
- // /// Used for min valid values range check
- // MSG_CLIENT_MIN = 0,
- // /// Invalid value of 0
- // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
- // /// Email client
- // MSG_CLIENT_EMAIL,
- // /// SMS/MMS client
- // MSG_CLIENT_SMS,
- // /// Settings client
- // MSG_CLIENT_SETTINGS,
- // /// Notifications client
- // MSG_CLIENT_NOTIFICATIONS,
- // /// Used for max valid values range check
- // MSG_CLIENT_MAX
- // } MSG_client_type_t;
- "client_type_in": 4,
- "callbacks_in": 0
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
-};
-
-systemApp.prototype._noLongerDisplayedNotificationList = function()
-{
- this._closeMsgApiConnection();
-};
-
-systemApp.prototype._msgConnectCallback = function(msg)
-{
- if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100)
- {
- this._msgApiConnection = msg.params.connection;
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- "request_type" : 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._msgGetNewMessagesListCallback = function(msg)
-{
- if (msg && msg.msgType === "methodResponse" && msg.params)
- {
- switch (msg.params.status)
- {
- // Successful retrieval w/ messages
- case 100:
- {
- log.info("####AppSDK Success####");
- this._closeMsgApiConnection();
-
- var messages = msg.params.message_list.messages;
-
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items: [],
- vuiSupport: true
- };
-
- for (var i = 0; i < messages.length; i++)
- {
- var item = {
- appData: { messageId: messages[i].id, name: messages[i].sender },
- itemStyle : 'style07',
- styleMod : 'bold',
- hasCaret : false,
- text1: messages[i].sender,
- image1 : '',
- label1 : utility.formatSmartDateTime(messages[i].datetime, false),
- label2 : '', // label2 is only set for email's below and left blank for sms.
- labelWidth : 'wide',
- };
-
- // Set image1 and set appData event name.
- switch (messages[i].clientType)
- {
- // MSG_CLIENT_EMAIL
- case 1:
- item.appData.eventId = 'SelectMessageEmail';
- item.image1 = 'common/images/icons/IcnListEmail_En.png';
- item.label2 = messages[i].instance;
- break;
-
- // MSG_CLIENT_SMS
- case 2:
- item.appData.eventId = 'SelectMessageSMS';
- item.image1 = 'common/images/icons/IcnListSms_En.png';
- break;
- }
-
- dataList.items.push(item);
- }
-
- dataList.itemCount = dataList.items.length;
-
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
- }
- break;
- }
-
- // Empty list returned
- case 107:
- {
- log.info("AppSDK returned empty message.");
- this._closeMsgApiConnection();
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- break;
- }
-
- // Unrecognized status code
- default:
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- break;
- }
- }
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._closeMsgApiConnection = function()
-{
- if (this._msgApiConnection)
- {
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- };
- framework.sendRequestToAppsdk(this.uiaId, function(){}, "msg", "Disconnect", params);
- this._msgApiConnection = null;
- }
-};
-
-systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params)
-{
- if (appData && appData.eventId)
- {
- switch (appData.eventId)
- {
- case 'SelectMessageEmail':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMessageSMS':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMissedCall':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
- }
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoDevice
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.GoBack":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectConnect":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// DisplayOff
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params)
-{
- framework.sendEventToMmui("system", "DisplayOffGUIActivity");
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Disclaimer
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayedDisclaimer = function()
-{
- framework.sendEventToMmui("system", "DisposeIntroVideo");
-
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
-};
-
-systemApp.prototype._selectCallbackDisclaimer = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-systemApp.prototype._disclaimerTimedout = function()
-{
- this._disclaimerTime.timeoutId = null;
- this._disclaimerTime.reset = true;
- if (this._currentContext && this._currentContext.ctxtId === "Disclaimer")
- {
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
-
- //Incase after Timeout Disclaimer screen didnt remove then sends start the timer again
- if (this._disclaimerTime.reset)
- {
- this._disclaimerTime.reset = false;
- this._disclaimerTime.remaining = 3500;
- }
-
- if (this._disclaimerTime.remaining < 0)
- {
- this._disclaimerTime.reset = true;
- framework.sendEventToMmui(this.uiaId, "Timeout");
- }
- else
- {
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
- this._disclaimerTime.whenStarted = Date.now();
- this._disclaimerTime.timeoutId = setTimeout(this._disclaimerTimedout.bind(this), this._disclaimerTime.remaining);
- }
-};
-
-systemApp.prototype._noLongerDisplayedDisclaimer = function()
-{
- // Note: The template is transitioning away either because of a Timeout, the user hit OK or an interrupting context change.
-
- var elapsed = Date.now() - this._disclaimerTime.whenStarted;
- this._disclaimerTime.remaining = this._disclaimerTime.remaining - elapsed;
-
- if (this._disclaimerTime.timeoutId)
- {
- clearTimeout(this._disclaimerTime.timeoutId);
- this._disclaimerTime.timeoutId = null;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SystemWarning
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// EnableRVR
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// RVRInstructions
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnect
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnect = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
- break;
-
- case "Pandora":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
- break;
-
- case "Stitcher":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
- break;
-
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "SelectEntertainmentMenu":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnectFailed
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnectFailed = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-//Siri EnableRVR context ready to Display Function
-systemApp.prototype._readyEnableRVR = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled",subMapObj);
-
- }
-};
-
-//Siri SiriLaunchingError context ready to Display Function
-systemApp.prototype._readySiriLaunchingError = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect",subMapObj);
-
- }
-};
-
-systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-// Store the Availability Status of Speed Restricted Apps
-systemApp.prototype._StatusMenuChanged = function(appName, isDisabled)
-{
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
- if(speedRestrictedAppName.indexOf(appName) === 0)
- {
- this._SpeedRestrictedApps[i].status = isDisabled;
- }
- }
-};
-
-// Update the items for Speed Restricted Message
-systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled)
-{
- var status = null;
- var appName = null;
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- appName = this._SpeedRestrictedApps[i].appName;
- status = this._SpeedRestrictedApps[i].status;
-
- log.info("AppName : "+appName+" is available or unavailable - (true/false)" +status);
-
- //Checks for Status Availability for the respective AppName
- if(!status)
- {
- this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
- }
- // Update the menu list in the current context if needed
- if (this._currentContext && !status)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var j = 0; j < dataList.items.length; ++j)
- {
- if (dataList.items[j].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[j].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[j].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(j, j);
- }
- }
- }
- break;
- }
- }
- }
-};
-
-// Tell framework that system app has finished loading
-framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.58.00.250A-NA.js b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.58.00.250A-NA.js
deleted file mode 100644
index e35c2c0..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.58.00.250A-NA.js
+++ /dev/null
@@ -1,2341 +0,0 @@
-
-/*
- Copyright 2012 by Johnson Controls
- __________________________________________________________________________
-
- Filename: systemApp.js
- __________________________________________________________________________
-
- Project: JCI-IHU
- Language: EN
- Author: awoodhc
- Date: 05.7.2012
- __________________________________________________________________________
-
- Description: IHU GUI System App
-
- Revisions:
- v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
- v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
- v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between
- contexts.
- v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
- v0.5 - 14-June-2012 Language Localization added to ListCtrls
- v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
- v0.7 - 22-June-2012 Code review changes and reworked context handling
- v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
- v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
- v1.0 - 31-July-2012 Updated Multicontroller behavior.
- v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
- v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
- v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
- v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
- v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
- v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
- v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
- v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
- v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
- v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
- v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
- v2.2 (20-Nov-2012) Stitcher enabled
- v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
- v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
- v2.5 (17-Jan-2013) Changed one event name
- v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
- v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
- v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
- v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
-
- __________________________________________________________________________
-
- */
-
-log.addSrcFile("systemApp.js", "system");
-
-/**********************************************
- * Start of Base App Implementation
- *
- * Code in this section should not be modified
- * except for function names based on the appname
- *********************************************/
-
-function systemApp(uiaId)
-{
- log.debug("constructor called...");
-
- // Base application functionality is provided in a common location via this call to baseApp.init().
- // See framework/js/BaseApp.js for details.
- baseApp.init(this, uiaId);
-
- // All feature-specific initialization is done in appInit()
-}
-
-/*
- * Called just after the app is instantiated by framework.
- * App-specific variables should be declared here.
- */
-systemApp.prototype.appInit = function()
-{
- if (framework.debugMode)
- {
- utility.loadScript("apps/system/test/systemAppTest.js");
- }
-
- //@formatter:off
-
- this._initEntertainmentDataList();
- this._initApplicationsDataList();
- this._initCommunicationsDataList();
-
- this._contextTable = {
-
- "HomeScreen" : {
- "hideHomeBtn" : true,
- "template" : "MainMenuTmplt",
- "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
- "controlProperties": {
- "MainMenuCtrl" : {
- "selectCallback":this._selectCallbackHomeScreen.bind(this),
- } // end of properties for "MainMenuCtrl"
- }, // end of list of controlProperties
- }, // end of "systemAppContext1"
-
- "Communication" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Communication",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": this._communicationsDataList,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyCommunication.bind(this),
- "contextInFunction" : this._CommCtxtContextIn.bind(this),
- }, // end of "Communication"
-
- "Entertainment" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Entertainment",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyEntertainment.bind(this),
- }, // end of "Entertainment"
-
- "Applications" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Applications",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "Applications"
-
- "VehicleStatusMonitor" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "VehicleStatusMonitor",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "VehicleStatusMonitor"
-
- "NoConnectionNotify" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoConnectionNotify.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.No"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoConnectionNotifyTitle',
- text2Id : 'NoConnectionNotifyText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "NotifyDialog" : {
- "template" : "Dialog3Tmplt",
- "sbNameId" : null,
- "readyFunction" : this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
- "displayedFunction" : this._NotifyDialogCtxtTmpltDisplayed.bind(this),
- "noLongerDisplayedFunction" : this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectCallbackNotifyDialog.bind(this),
- "contentStyle" : "style17",
- "buttonCount" : 3,
- "initialFocus" : 2,
- "buttonConfig" : {
- "button1" : {
- labelId : "NotifyOff",
- appData : "SelectNotifyOff",
- },
- "button2" : {
- labelId : "NotifyIgnore",
- appData : "Global.No",
- },
- "button3" : {
- labelId : "NotifyRead",
- appData : "SelectNotifyMessage"
- }
- }, // end of buttonConfig
- "text1Id" : "NotifyIncomingMsg",
- "text2" : "",
- "text3Id" : "NotifyReadNow",
- } // end of properties for dialog
- }, // end of controlProperties
- }, // end of "NotifyDialog"
-
- "NotificationList" : {
- "leftBtnStyle" : "goBack",
- "template" : "List2Tmplt",
- "sbNameId" : "Notifications",
- "readyFunction" : this._readyNotificationList.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedNotificationList.bind(this),
- "controlProperties": {
- "List2Ctrl" : {
- titleConfiguration : "noTitle",
- numberedList : true,
- selectCallback: this._selectNotificationListItem.bind(this),
- title : null,
- dataList : null,
- },
- }, // end of controlProperties
- }, // end of "NotificationList"
-
- "NotificationListRetry" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackNotificationListRetry.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Cancel",
- appData : "Global.Cancel"
- },
- button2 : {
- labelId : "RetryLabel",
- appData : "SelectRetry"
- },
- },
- text1Id : 'FailedNotificationRetrieval',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of NotificationListRetry
-
- "NoDevice" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoDevice.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.GoBack"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoDeviceTitle',
- text2Id : 'NoDeviceText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "DisplayOff" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : this._displayOffUserActivity.bind(this),
- showClock : true,
- }
- },
- }, // end of "DisplayOff"
-
- "Disclaimer" : {
- "template" : "NoCtrlTmplt",
- "hideHomeBtn" : true,
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/background.png",
- },
- "readyFunction" : this._noMoreDisclaimer.bind(this),
- }, // end of Disclaimer
-
- "SystemWarning" : {
- "hideHomeBtn" : true,
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "TempWarning",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackSystemWarning.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "TempWarningText",
- }
- },
- },
-
- "SourceReconnect" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnect.bind(this),
- "contentStyle" : "style14",
- "fullScreen" : false,
- "text1Id" : null,
- "meter" : {"meterType":"indeterminate", "meterPath":"common/images/IndeterminateMeter_2.png"},
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "ReconnectEntMenuButton",
- appData : "SelectEntertainmentMenu"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnect.bind(this),
- },
-
- "SourceReconnectFailed" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnectFailed.bind(this),
- "contentStyle" : "style02",
- "fullScreen" : false,
- "text1Id" : null,
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnectFailed.bind(this),
- },
-
- "IntroAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "QuickStartLoop" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["QUICKTRANLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "PowerDownAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["EXITLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "IdleStandby" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "WaitForEnding" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "EnableRVR" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackEnableRVR.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "SiriDisabled",
- }
- },
- "readyFunction" : this._readyEnableRVR.bind(this),
- },
-
- "RVRInstructions" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "InitiateSiri",
- }
- },
- },
-
- "SiriInSession" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "Siri",
- contentStyle : "style14",
- "meter" : {"meterType":"indeterminate", "meterPath":"apps/system/images/IcnSiri.png"}
- }
- },
- },
-
- "SiriLaunchingError" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- //titleStyle : "titleStyle01",
- // titleId : "Siri",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "DisconnectThenReconnect",
- }
- },
- "readyFunction" : this._readySiriLaunchingError.bind(this),
- },
- }; // end of this._contextTable object
-
- //@formatter:off
- this._messageTable = {
- // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
- "StatusMenu" : this._StatusMenuMsgHandler.bind(this),
-
- // Add or remove certain menu items.
- "StatusMenuVisible" : this._StatusMenuVisibleMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for USB1 and USB2 audio
- "StatusMenuUSBAudio" : this._StatusMenuUSBAudioMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for BTAudio
- "StatusMenuBTAudio" : this._StatusMenuBTAudioMsgHandler.bind(this),
-
- // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
- "StatusUpdateEcoEnergy" : this._StatusUpdateEcoEnergyMsgHandler.bind(this),
-
- // Updates the number of notifications for missed sms and emails.
- "StatusUpdateNotifications" : this._StatusUpdateNotificationsHandler.bind(this),
-
- // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
- "StatusPhoneCall" : this._StatusPhoneCallMsgHandler.bind(this),
-
- // Show an Audio SourceNotAvailable SBN
- "TimedSBN_SourceNotAvailable" : this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
-
- // Update the current audio source icon in the Entertainment menu
- "StatusUpdateAudioSource" : this._StatusUpdateAudioSourceMsgHandler.bind(this),
-
- // Update the number of missed calls
- "StatusUpdateMissedCallCount" : this._StatusUpdateMissedCallCountMsgHandler.bind(this),
-
- // Update the number of warnings displayed apps men
- "WarningStatusCount" : this._WarningStatusCountMsgHandler.bind(this),
-
- // Update whether scheduled maintenance is due
- "StatusUpdateSchedMaint" : this._StatusUpdateSchedMaintHandler.bind(this),
-
- // Show an Siri SBN
- "ShowStateSBN_SiriActive" : this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
-
- // Show an Siri Error SBN
- "TimedSBN_SiriError" : this._TimedSBN_SiriErrorMsgHandler.bind(this),
-
- // Remove an Siri SBN
- "RemoveStateSBN_SiriActive" : this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
-
- //Show timed SBN Voice not supported
- "TimedSBN_VoiceNotSupported" : this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
-
- //At Speed Restriction
- "Global.AtSpeed" : this._AtSpeedMsgHandler.bind(this),
-
- //At No Speed
- "Global.NoSpeed" : this._NoSpeedMsgHandler.bind(this),
- };
- //@formatter:on
-
- // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
- // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
- // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
- // so the remaining time must be restarted when this happens.
- this._disclaimerTime = {
-
- // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
- // flag is set true after a the timer times out or the user hits the OK button.
- reset : true,
-
- // (Number) Milliseconds remaining to show the Disclaimer.
- remaining : 0,
-
- // (Number) Millisecond timestamp when the Disclaimer was first shown.
- whenStarted : 0,
-
- // (Handle) setTimeout ID
- timeoutId : null
- };
-
- // Array containing the appName of the list which supports Speed Restriction.
- //@appName = appName of the item , @status = default value of disabled property for particular appName
- this._SpeedRestrictedApps = [ {appName : "vdt_settings",status : true}];
-};
-
-/**************************
- * Set Wink Properties *
- **************************/
-
-systemApp.prototype.getWinkProperties = function(alert, params)
-{
- log.info("setting wink properties for: ", alert, params);
- var winkProperties = null;
- switch(alert)
- {
- case "System_RVR_NOT_ACTIVE":
- case "System_RVR_EFM_ERROR":
- case "System_RVR_ACTIVATE_ERROR":
- winkProperties = {
- "style": "style03",
- "text1Id": "ErrorWhileStartingSiri"
- };
- break;
- case "System_RVR_ACTIVE":
- case "System_RVR_ACTIVE_WITH_EFM":
- case "System_RVR_ACTIVE_NO_EFM":
- winkProperties = {
- "style": "style03",
- "text1Id": "Siri"
- };
- break;
- default:
- // Display default Wink
- log.debug("No properties found for wink: " + alert);
- break;
- }
- // return the properties to Common
- return winkProperties;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Initialize various menu data lists
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._initEntertainmentDataList = function()
-{
- var items = [];
-
- if (framework.localize.getRegion() === framework.localize.REGIONS.Japan)
- {
- // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
- // add it if the region is Japan.
- items.push({ appData : { appName : 'amradio', isVisible : true, audioSourceId : 'TrafficInfo' , mmuiEvent : 'SelectTrafficAlert' }, text1Id : 'TrafficAlertsItem', disabled : true, itemStyle : 'style01', hasCaret: false });
- }
-
- items.push(
- { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false }
- );
-
- // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterEntertainmentDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initApplicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vsm', isVisible : true, mmuiEvent : 'SelectEngineOilLevel' }, text1Id : 'EngineOilLevel', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vehicleStatus', isVisible : false, mmuiEvent : 'SelectVehicleStatusMonitor' }, text1Id : 'VehicleStatusMonitor', disabled : false, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterApplicationDataList = {
- items: items
- };
-
- //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
- this._applicationsCtxtWiseAppNames = {
- //Context Name : // [appName,appName....]
- "Applications" : ["hdtrafficimage","idm","ecoenergy","driverid","vehicleStatus","vdt_settings","vdt","carplay","androidauto","_androidauto","_videoplayer","_aiotweaks","_speedometer"],
- "VehicleStatusMonitor" : ["warnguide","vsm","schedmaint"]
- };
-};
-
-systemApp.prototype._initCommunicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
- { appData : { appName : '', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._communicationsDataList = {
-
- items: items
-
- };
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers, helpers
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._StatusPhoneCallMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus)
- {
- // Add or remove the Active Call item in the communications menu
- var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
- var dirty = false;
- if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall')
- {
- this._communicationsDataList.items[0].appData.isVisible = true;
- dirty = true;
- }
- else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall'
- && this._communicationsDataList.items[0].appData.isVisible === true)
- {
- this._communicationsDataList.items[0].appData.isVisible = false;
- dirty = true;
- }
-
- // If it changed, and we are in the Comm ctxt, update the list shown
- if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- //build list (which will exclude isVisible==false items)
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusMenuMsgHandler = function(msg)
-{
- log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
-
- // Update menu items associated with the given appName of the message. Menu items can appear
- // in several different contexts or appear multiple times: this function searches all those places.
-
- var appName = msg.params.payload.statusMenu.appName;
- var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
-
- //Update the Availability Status of Speed Restricted Apps
- this._StatusMenuChanged(appName,isDisabled);
-
- // Update the static menu lists so they are correctly enable next time the context is shown
- this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
- this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
- this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
-
- // Update the menu list in the current context if needed
- if (this._currentContext)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- case "VehicleStatusMonitor":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled)// At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
-
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
- }
- }
- }
- break;
- }
- }
-};
-
-systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- }
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[i].disabled = isDisabled;
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
-
- var appName = msg.params.payload.appName;
- var isVisible = msg.params.payload.state === "Visible";
-
- // Search entertainment items
- var isEntertainmentDirty = false;
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.appName === appName
- && this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible)
- {
- isEntertainmentDirty = true;
- this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Entertainment context if it is currently displayed.
- if (isEntertainmentDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Entertainment"
- && this._currentContextTemplate)
- {
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Search application items
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.appName === appName
- && this._masterApplicationDataList.items[i].appData.isVisible != isVisible)
- {
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
- }
- if(this._masterApplicationDataList.items[i].appData.appName === "vehicleStatus")
- {
- this._indexOfVSMApp = i;
- }
- }
-
- //If any app inside the VehicleStatusMonitor context is visible then VehicleStatusMonitor will also be visible in Application.
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames["VehicleStatusMonitor"];
- var isVehicleStatusMonitorVisible = false;
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- var applicationsCtxtWiseAppName = applicationsCtxtWiseAppNames[j];
- for (var k = 0; k < this._masterApplicationDataList.items.length; ++k)
- {
- if((this._masterApplicationDataList.items[k].appData.appName === applicationsCtxtWiseAppName) &&
- this._masterApplicationDataList.items[k].appData.isVisible)
- {
- isVehicleStatusMonitorVisible = this._masterApplicationDataList.items[k].appData.isVisible;
- break;
- }
- }
- }
-
- //update the visiblity of VehicleStatusMonitor on basis of visible status of application(s) inside VehicleStatusMonitor context.
- this._masterApplicationDataList.items[this._indexOfVSMApp].appData.isVisible = isVehicleStatusMonitorVisible;
-
- // Update the Applications context or VehicleStatusMonitor context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Now that we are listening to StatusMenuVisible for Comm items (for email only)
- // we want to ensure any messages sent by other apps that were previously ignored are still ignored
- // Shoki6 ONLY
- if (appName === "email")
- {
- // Search communication items - avalajh
- var isCommunicationDirty = false;
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.appName === appName
- && this._communicationsDataList.items[i].appData.isVisible != isVisible)
- {
- isCommunicationDirty = true;
- this._communicationsDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Communication context if it is currently displayed.
- if (isCommunicationDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Communication"
- && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- }
-};
-systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio)
- {
- // Update cached values for the USB device status
- var status = msg.params.payload.statusMenuUSBAudio;
- var mmuiEvent = "";
- var textIdWithDevice = "";
- var textIdWithoutDevice = "";
- var masterIndex = -1;
- if (status.usbAB === "USB_A")
- {
- mmuiEvent = "SelectUSBA";
- textIdWithDevice = "UsbAudioAWithDevice";
- textIdWithoutDevice = "UsbAudioA";
- }
- else if (status.usbAB === "USB_B")
- {
- mmuiEvent = "SelectUSBB";
- textIdWithDevice = "UsbAudioBWithDevice";
- textIdWithoutDevice = "UsbAudioB";
- }
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- masterIndex = i;
-
- var isAvailable = status.statusMenu.appStatus === "Available";
- var name = status.displayName;
- this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
- if (isAvailable && typeof name === 'string' && name.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var masterIndex = -1;
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- masterIndex = i;
-
- var isAvailable = msg.params.payload.appStatus === "Available";
- var deviceName = msg.params.payload.deviceName;
-
- // NOTE: This message does not enable/disable the BTAudio menu item.
- // (The StatusMenu message will enable it on startup.)
-
- if (isAvailable && typeof deviceName === "string" && deviceName.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
-
- // Determine correct text ID, based on vehicle fuel type
- var fuelType = msg.params.payload.fuelType;
- var newText1Id;
- switch (fuelType)
- {
- case "HEV":
- newText1Id = "EcoenergyAppHEV";
- break;
-
- case "GAS":
- default:
- newText1Id = "EcoenergyApp";
- break;
- }
-
- // Search application items for the "ecoenergy" application
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
- (this._masterApplicationDataList.items[i].text1Id != newText1Id))
- {
- // Found the app, and it's text ID needs to change, so change it
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].text1Id = newText1Id;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-// Handle message to update the notification counts in the Communication context.
-systemApp.prototype._StatusUpdateNotificationsHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.messageCounts)
- {
- // Update message counts and the notifications list item displayed in the Communication menu
- var countEmail = msg.params.payload.messageCounts.countEmail;
- var countSMS = msg.params.payload.messageCounts.countSMS;
- var total = countEmail + countSMS;
-
- var showMessageIcon = total > 0;
- framework.common.setSbIcon("Message", showMessageIcon);
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- switch (this._communicationsDataList.items[i].appData.mmuiEvent)
- {
- case 'SelectNotifications':
- this._communicationsDataList.items[i].disabled = (total === 0);
- this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
- break;
-
- case 'SelectSms':
- this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
- break;
-
- case 'SelectEmail':
- this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceRecognition',
- imagePath1 : 'apps/system/images/IcnSiriSBN.png'
- };
- framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-};
-
-systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style01',
- text1Id : 'ErrorWhileStartingSiri',
- };
- framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-};
-
-systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceNotSupported',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
-};
-
-systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
-};
-
-systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var params = {
- sbnStyle : 'Style02',
- imagePath1 : 'common/images/icons/IcnListBtConnType_Music.png'
- };
-
- switch (msg.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- params.text1Id = "AudioSourceNotAvailableBTAudio";
- break;
-
- case "USBAudio":
- case "USB_A":
- case "USB_B":
- params.text1Id = "AudioSourceNotAvailableUSB";
- break;
-
- case "CD":
- params.text1Id = "AudioSourceNotAvailableCD";
- break;
-
- case "DVD":
- params.text1Id = "AudioSourceNotAvailableDVD";
- break;
-
- case "TV":
- params.text1Id = "AudioSourceNotAvailableTV";
- break;
- }
-
- framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
- }
-};
-
-systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (isPlaying)
- {
- // Set the icon on the audioSource item and clearing it on all other items
- dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
- }
- else
- {
- // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
- // "Off" and "Play" messages do not necessarily come in that order.
- if (dataList.items[i].appData.audioSourceId === audioSource)
- {
- dataList.items[i].image1 = "";
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var audioSource = msg.params.payload.statusAudio.audioSource;
- var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
-
- // Set the icon in the masterEntertainment data list so it is persisted between template instances
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
- list.updateItems(0, list.dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg)
-{
- var count = "";
- if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0)
- {
- count = msg.params.payload.missedCallCount.toString();
- }
-
- // Update this._communicationsDataList
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- this._communicationsDataList.items[i].label1 = count;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- list.dataList.items[i].label1 = count;
- list.updateItems(i, i);
- }
- }
- }
-};
-
-systemApp.prototype._WarningStatusCountMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var count = "";
- var icon = "";
- if (msg.params.payload.warningcount > 0)
- {
- count = msg.params.payload.warningcount.toString();
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- this._masterApplicationDataList.items[i].label1 = count;
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- list.dataList.items[i].label1 = count;
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var isDue = msg.params.payload.due;
- var warningCountValue = null;
- //Caching the Due Status to be used in _WarningStatusCountMsgHandler.
- this._SchedMaintDueStatus = isDue;
- // Update the master list
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- }
- else if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- var WarnGuidanceAppItem = utility.getArrayItemByPropertyValue(this._masterApplicationDataList.items,"text1Id","WarnGuidanceApp");
- if(WarnGuidanceAppItem && WarnGuidanceAppItem.item && WarnGuidanceAppItem.item.label1)
- {
- warningCountValue = WarnGuidanceAppItem.item.label1;
- }
-
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !this._masterApplicationDataList.items[i].image2)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- else
- {
- //DO nothing
- }
- }
- }
-
- // Update the current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- list.dataList.items[i].image2 = "";
- }
- list.updateItems(i, i);
- }
- else if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !list.dataList.items[i].image2)
- {
- list.dataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- list.dataList.items[i].image2 = "";
- }
- else
- {
- //Do Nothing
- }
-
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._AtSpeedMsgHandler = function(msg)
-{
- //At speed will disable the speed Restricted items
- this._AtSpeedDisabled = true;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-systemApp.prototype._NoSpeedMsgHandler = function(msg)
-{
- //At speed will Enable the speed Restricted items
- this._AtSpeedDisabled = false;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-/**************************
- * Control callbacks
- **************************/
-
-/*
- * Callback for the Main Menu Context icon button clicks
- * @param mainMenuObj (Object) Reference to the MainMenuCtrl
- * @param appData (Object) Data passed in by the app when the control was instantiated
- * @param params (Object) Contains label for the selected icon
- */
-systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params)
-{
- log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
-
- var icon = params.icon;
-
- switch(icon)
- {
- case "app":
- framework.sendEventToMmui(this.uiaId, "SelectApplications");
- break;
- case "com":
- framework.sendEventToMmui(this.uiaId, "SelectCommunication");
- break;
- case "ent":
- framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
- break;
- case "nav":
- framework.sendEventToMmui(this.uiaId, "SelectNavigation");
- break;
- case "set":
- framework.sendEventToMmui(this.uiaId, "SelectSettings");
- break;
- }
-};
-
-/*
- * Select callback for Applications, Communication, and Entertainment contexts.
- * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
- */
-systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params)
-{
- framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._CommCtxtContextIn = function()
-{
- var scrollTo = 0;
-
- // We cannot use the data list in the current context here, becuase it doesn't exist yet
- // so we use _buildCommunicationDataList() just like _readyCommunications() will
- var dataList = this._buildCommunicationDataList();
-
- // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
- var any = false;
- for (var i = 0; i < dataList.items.length - 1; ++i)
- {
- if (dataList.items[i].disabled === false)
- {
- any = true;
- }
- }
-
- if (any === false)
- {
- var lastIndex = dataList.items.length - 1;
- if (dataList.items[lastIndex].disabled === false)
- {
- scrollTo = lastIndex;
- }
- }
-
- this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
- this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Applications
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyApplications = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
-
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Applications Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterApplicationDataList based on the currently visible items.
-systemApp.prototype._buildApplicationsDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.isVisible)
- {
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames[this._currentContext.ctxtId];
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- if(applicationsCtxtWiseAppNames[j] === this._masterApplicationDataList.items[i].appData.appName)
- {
- dataList.items.push(this._masterApplicationDataList.items[i]);
- }
- }
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Entertainment
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyEntertainment = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Entertainment Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterEntertainmentDataList based on the currently visible items.
-systemApp.prototype._buildEntertainmentDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterEntertainmentDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication - avalajh
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyCommunication = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Communication Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._communicationsDataList based on the currently visible items.
-systemApp.prototype._buildCommunicationDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._communicationsDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// NoConnectionNotify
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params)
-{
- switch(this._currentContext.ctxtId)
- {
- case 'NoConnectionNotify':
- switch(appData)
- {
- case 'SelectConnect':
- framework.sendEventToMmui("system", appData);
- break;
-
- case 'Global.No':
- framework.sendEventToMmui("common", appData);
- break;
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotifyDialog
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function()
-{
- if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData)
- {
- this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
- }
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function()
-{
- // Start timer to dismiss the notification if the user doesn't respond
- var self = this;
- this._NotifyDialogTimeoutId = setTimeout(function() {
- this._NotifyDialogTimeoutId = null;
- framework.sendEventToMmui(self.uiaId, "Timeout");
- }, 10000);
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function()
-{
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-};
-
-systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params)
-{
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-
- switch (appData)
- {
- case "Global.No":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectNotifyOff":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
-
- case "SelectNotifyMessage":
- if (this._currentContext.params && this._currentContext.params.payload)
- {
- var paramsData = {
- payload : {
- messageId : this._currentContext.params.payload.messageNotifyData.messageId,
- messageNotifyType : this._currentContext.params.payload.messageNotifyData.messageNotifyType
- }
- };
- framework.sendEventToMmui(this.uiaId, appData, paramsData);
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationListRetry
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Cancel":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectRetry":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationList
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyNotificationList = function(readyParams)
-{
- log.debug("_readyNotificationList called...");
-
- if (readyParams)
- {
- readyParams.skipRestore = true;
- }
-
- var params = {
- "context_in": 0,
-
- // typedef enum MSG_client_type_e
- // {
- // /// Used for min valid values range check
- // MSG_CLIENT_MIN = 0,
- // /// Invalid value of 0
- // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
- // /// Email client
- // MSG_CLIENT_EMAIL,
- // /// SMS/MMS client
- // MSG_CLIENT_SMS,
- // /// Settings client
- // MSG_CLIENT_SETTINGS,
- // /// Notifications client
- // MSG_CLIENT_NOTIFICATIONS,
- // /// Used for max valid values range check
- // MSG_CLIENT_MAX
- // } MSG_client_type_t;
- "client_type_in": 4,
- "callbacks_in": 0
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
-};
-
-systemApp.prototype._noLongerDisplayedNotificationList = function()
-{
- this._closeMsgApiConnection();
-};
-
-systemApp.prototype._msgConnectCallback = function(msg)
-{
- if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100)
- {
- this._msgApiConnection = msg.params.connection;
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- "request_type" : 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._msgGetNewMessagesListCallback = function(msg)
-{
- if (msg && msg.msgType === "methodResponse" && msg.params)
- {
- switch (msg.params.status)
- {
- // Successful retrieval w/ messages
- case 100:
- {
- log.info("####AppSDK Success####");
- this._closeMsgApiConnection();
-
- var messages = msg.params.message_list.messages;
-
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items: [],
- vuiSupport: true
- };
-
- for (var i = 0; i < messages.length; i++)
- {
- var item = {
- appData: { messageId: messages[i].id, name: messages[i].sender },
- itemStyle : 'style07',
- styleMod : 'bold',
- hasCaret : false,
- text1: messages[i].sender,
- image1 : '',
- label1 : utility.formatSmartDateTime(messages[i].datetime, false),
- label2 : '', // label2 is only set for email's below and left blank for sms.
- labelWidth : 'wide',
- };
-
- // Set image1 and set appData event name.
- switch (messages[i].clientType)
- {
- // MSG_CLIENT_EMAIL
- case 1:
- item.appData.eventId = 'SelectMessageEmail';
- item.image1 = 'common/images/icons/IcnListEmail_En.png';
- item.label2 = messages[i].instance;
- break;
-
- // MSG_CLIENT_SMS
- case 2:
- item.appData.eventId = 'SelectMessageSMS';
- item.image1 = 'common/images/icons/IcnListSms_En.png';
- break;
- }
-
- dataList.items.push(item);
- }
-
- dataList.itemCount = dataList.items.length;
-
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
- }
- break;
- }
-
- // Empty list returned
- case 107:
- {
- log.info("AppSDK returned empty message.");
- this._closeMsgApiConnection();
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- break;
- }
-
- // Unrecognized status code
- default:
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- break;
- }
- }
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._closeMsgApiConnection = function()
-{
- if (this._msgApiConnection)
- {
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- };
- framework.sendRequestToAppsdk(this.uiaId, function(){}, "msg", "Disconnect", params);
- this._msgApiConnection = null;
- }
-};
-
-systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params)
-{
- if (appData && appData.eventId)
- {
- switch (appData.eventId)
- {
- case 'SelectMessageEmail':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMessageSMS':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMissedCall':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
- }
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoDevice
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.GoBack":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectConnect":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// DisplayOff
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params)
-{
- framework.sendEventToMmui("system", "DisplayOffGUIActivity");
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Disclaimer
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._noMoreDisclaimer = function(controlRef, appData, params)
-{
- framework.sendEventToMmui("system", "DisposeIntroVideo");
-
- // this need only for log
- this._disclaimerTime.remaining = 3500;
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
-
- framework.sendEventToMmui("common", "Global.Yes");
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SystemWarning
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// EnableRVR
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// RVRInstructions
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnect
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnect = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
- break;
-
- case "Pandora":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
- break;
-
- case "Stitcher":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
- break;
-
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "SelectEntertainmentMenu":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnectFailed
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnectFailed = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-//Siri EnableRVR context ready to Display Function
-systemApp.prototype._readyEnableRVR = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled",subMapObj);
-
- }
-};
-
-//Siri SiriLaunchingError context ready to Display Function
-systemApp.prototype._readySiriLaunchingError = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect",subMapObj);
-
- }
-};
-
-systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-// Store the Availability Status of Speed Restricted Apps
-systemApp.prototype._StatusMenuChanged = function(appName, isDisabled)
-{
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
- if(speedRestrictedAppName.indexOf(appName) === 0)
- {
- this._SpeedRestrictedApps[i].status = isDisabled;
- }
- }
-};
-
-// Update the items for Speed Restricted Message
-systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled)
-{
- var status = null;
- var appName = null;
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- appName = this._SpeedRestrictedApps[i].appName;
- status = this._SpeedRestrictedApps[i].status;
-
- log.info("AppName : "+appName+" is available or unavailable - (true/false)" +status);
-
- //Checks for Status Availability for the respective AppName
- if(!status)
- {
- this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
- }
- // Update the menu list in the current context if needed
- if (this._currentContext && !status)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var j = 0; j < dataList.items.length; ++j)
- {
- if (dataList.items[j].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[j].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[j].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(j, j);
- }
- }
- }
- break;
- }
- }
- }
-};
-
-// Tell framework that system app has finished loading
-framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.59.00.330.js b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.59.00.330.js
deleted file mode 100644
index d6018d7..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.59.00.330.js
+++ /dev/null
@@ -1,2341 +0,0 @@
-
-/*
-Copyright 2012 by Johnson Controls
-__________________________________________________________________________
-
-Filename: systemApp.js
-__________________________________________________________________________
-
-Project: JCI-IHU
-Language: EN
-Author: awoodhc
-Date: 05.7.2012
-__________________________________________________________________________
-
-Description: IHU GUI System App
-
-Revisions:
-v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
-v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
-v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between
-contexts.
-v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
-v0.5 - 14-June-2012 Language Localization added to ListCtrls
-v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
-v0.7 - 22-June-2012 Code review changes and reworked context handling
-v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
-v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
-v1.0 - 31-July-2012 Updated Multicontroller behavior.
-v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
-v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
-v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
-v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
-v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
-v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
-v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
-v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
-v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
-v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
-v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
-v2.2 (20-Nov-2012) Stitcher enabled
-v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
-v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
-v2.5 (17-Jan-2013) Changed one event name
-v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
-v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
-v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
-v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
-
-__________________________________________________________________________
-
-*/
-
-log.addSrcFile("systemApp.js", "system");
-
-/**********************************************
-* Start of Base App Implementation
-*
-* Code in this section should not be modified
-* except for function names based on the appname
-*********************************************/
-
-function systemApp(uiaId)
-{
- log.debug("constructor called...");
-
- // Base application functionality is provided in a common location via this call to baseApp.init().
- // See framework/js/BaseApp.js for details.
- baseApp.init(this, uiaId);
-
- // All feature-specific initialization is done in appInit()
-}
-
-/*
-* Called just after the app is instantiated by framework.
-* App-specific variables should be declared here.
-*/
-systemApp.prototype.appInit = function()
-{
- if (framework.debugMode)
- {
- utility.loadScript("apps/system/test/systemAppTest.js");
- }
-
- //@formatter:off
-
- this._initEntertainmentDataList();
- this._initApplicationsDataList();
- this._initCommunicationsDataList();
-
- this._contextTable = {
-
- "HomeScreen" : {
- "hideHomeBtn" : true,
- "template" : "MainMenuTmplt",
- "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
- "controlProperties": {
- "MainMenuCtrl" : {
- "selectCallback":this._selectCallbackHomeScreen.bind(this),
- } // end of properties for "MainMenuCtrl"
- }, // end of list of controlProperties
- }, // end of "systemAppContext1"
-
- "Communication" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Communication",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": this._communicationsDataList,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyCommunication.bind(this),
- "contextInFunction" : this._CommCtxtContextIn.bind(this),
- }, // end of "Communication"
-
- "Entertainment" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Entertainment",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyEntertainment.bind(this),
- }, // end of "Entertainment"
-
- "Applications" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Applications",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "Applications"
-
- "VehicleStatusMonitor" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "VehicleStatusMonitor",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "VehicleStatusMonitor"
-
- "NoConnectionNotify" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoConnectionNotify.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.No"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoConnectionNotifyTitle',
- text2Id : 'NoConnectionNotifyText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "NotifyDialog" : {
- "template" : "Dialog3Tmplt",
- "sbNameId" : null,
- "readyFunction" : this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
- "displayedFunction" : this._NotifyDialogCtxtTmpltDisplayed.bind(this),
- "noLongerDisplayedFunction" : this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectCallbackNotifyDialog.bind(this),
- "contentStyle" : "style17",
- "buttonCount" : 3,
- "initialFocus" : 2,
- "buttonConfig" : {
- "button1" : {
- labelId : "NotifyOff",
- appData : "SelectNotifyOff",
- },
- "button2" : {
- labelId : "NotifyIgnore",
- appData : "Global.No",
- },
- "button3" : {
- labelId : "NotifyRead",
- appData : "SelectNotifyMessage"
- }
- }, // end of buttonConfig
- "text1Id" : "NotifyIncomingMsg",
- "text2" : "",
- "text3Id" : "NotifyReadNow",
- } // end of properties for dialog
- }, // end of controlProperties
- }, // end of "NotifyDialog"
-
- "NotificationList" : {
- "leftBtnStyle" : "goBack",
- "template" : "List2Tmplt",
- "sbNameId" : "Notifications",
- "readyFunction" : this._readyNotificationList.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedNotificationList.bind(this),
- "controlProperties": {
- "List2Ctrl" : {
- titleConfiguration : "noTitle",
- numberedList : true,
- selectCallback: this._selectNotificationListItem.bind(this),
- title : null,
- dataList : null,
- },
- }, // end of controlProperties
- }, // end of "NotificationList"
-
- "NotificationListRetry" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackNotificationListRetry.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Cancel",
- appData : "Global.Cancel"
- },
- button2 : {
- labelId : "RetryLabel",
- appData : "SelectRetry"
- },
- },
- text1Id : 'FailedNotificationRetrieval',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of NotificationListRetry
-
- "NoDevice" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoDevice.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.GoBack"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoDeviceTitle',
- text2Id : 'NoDeviceText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "DisplayOff" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : this._displayOffUserActivity.bind(this),
- showClock : true,
- }
- },
- }, // end of "DisplayOff"
-
- "Disclaimer" : {
- "template" : "NoCtrlTmplt",
- "hideHomeBtn" : true,
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/background.png",
- },
- "readyFunction" : this._noMoreDisclaimer.bind(this),
- }, // end of Disclaimer
-
- "SystemWarning" : {
- "hideHomeBtn" : true,
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "TempWarning",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackSystemWarning.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "TempWarningText",
- }
- },
- },
-
- "SourceReconnect" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnect.bind(this),
- "contentStyle" : "style14",
- "fullScreen" : false,
- "text1Id" : null,
- "meter" : {"meterType":"indeterminate", "meterPath":"common/images/IndeterminateMeter_2.png"},
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "ReconnectEntMenuButton",
- appData : "SelectEntertainmentMenu"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnect.bind(this),
- },
-
- "SourceReconnectFailed" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnectFailed.bind(this),
- "contentStyle" : "style02",
- "fullScreen" : false,
- "text1Id" : null,
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnectFailed.bind(this),
- },
-
- "IntroAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "QuickStartLoop" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["QUICKTRANLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "PowerDownAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["EXITLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "IdleStandby" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "WaitForEnding" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "EnableRVR" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackEnableRVR.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "SiriDisabled",
- }
- },
- "readyFunction" : this._readyEnableRVR.bind(this),
- },
-
- "RVRInstructions" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "InitiateSiri",
- }
- },
- },
-
- "SiriInSession" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "Siri",
- contentStyle : "style14",
- "meter" : {"meterType":"indeterminate", "meterPath":"apps/system/images/IcnSiri.png"}
- }
- },
- },
-
- "SiriLaunchingError" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- //titleStyle : "titleStyle01",
- // titleId : "Siri",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "DisconnectThenReconnect",
- }
- },
- "readyFunction" : this._readySiriLaunchingError.bind(this),
- },
- }; // end of this._contextTable object
-
- //@formatter:off
- this._messageTable = {
- // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
- "StatusMenu" : this._StatusMenuMsgHandler.bind(this),
-
- // Add or remove certain menu items.
- "StatusMenuVisible" : this._StatusMenuVisibleMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for USB1 and USB2 audio
- "StatusMenuUSBAudio" : this._StatusMenuUSBAudioMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for BTAudio
- "StatusMenuBTAudio" : this._StatusMenuBTAudioMsgHandler.bind(this),
-
- // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
- "StatusUpdateEcoEnergy" : this._StatusUpdateEcoEnergyMsgHandler.bind(this),
-
- // Updates the number of notifications for missed sms and emails.
- "StatusUpdateNotifications" : this._StatusUpdateNotificationsHandler.bind(this),
-
- // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
- "StatusPhoneCall" : this._StatusPhoneCallMsgHandler.bind(this),
-
- // Show an Audio SourceNotAvailable SBN
- "TimedSBN_SourceNotAvailable" : this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
-
- // Update the current audio source icon in the Entertainment menu
- "StatusUpdateAudioSource" : this._StatusUpdateAudioSourceMsgHandler.bind(this),
-
- // Update the number of missed calls
- "StatusUpdateMissedCallCount" : this._StatusUpdateMissedCallCountMsgHandler.bind(this),
-
- // Update the number of warnings displayed apps men
- "WarningStatusCount" : this._WarningStatusCountMsgHandler.bind(this),
-
- // Update whether scheduled maintenance is due
- "StatusUpdateSchedMaint" : this._StatusUpdateSchedMaintHandler.bind(this),
-
- // Show an Siri SBN
- "ShowStateSBN_SiriActive" : this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
-
- // Show an Siri Error SBN
- "TimedSBN_SiriError" : this._TimedSBN_SiriErrorMsgHandler.bind(this),
-
- // Remove an Siri SBN
- "RemoveStateSBN_SiriActive" : this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
-
- //Show timed SBN Voice not supported
- "TimedSBN_VoiceNotSupported" : this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
-
- //At Speed Restriction
- "Global.AtSpeed" : this._AtSpeedMsgHandler.bind(this),
-
- //At No Speed
- "Global.NoSpeed" : this._NoSpeedMsgHandler.bind(this),
- };
- //@formatter:on
-
- // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
- // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
- // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
- // so the remaining time must be restarted when this happens.
- this._disclaimerTime = {
-
- // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
- // flag is set true after a the timer times out or the user hits the OK button.
- reset : true,
-
- // (Number) Milliseconds remaining to show the Disclaimer.
- remaining : 0,
-
- // (Number) Millisecond timestamp when the Disclaimer was first shown.
- whenStarted : 0,
-
- // (Handle) setTimeout ID
- timeoutId : null
- };
-
- // Array containing the appName of the list which supports Speed Restriction.
- //@appName = appName of the item , @status = default value of disabled property for particular appName
- this._SpeedRestrictedApps = [ {appName : "vdt_settings",status : true}];
-};
-
-/**************************
-* Set Wink Properties *
-**************************/
-
-systemApp.prototype.getWinkProperties = function(alert, params)
-{
- log.info("setting wink properties for: ", alert, params);
- var winkProperties = null;
- switch(alert)
- {
- case "System_RVR_NOT_ACTIVE":
- case "System_RVR_EFM_ERROR":
- case "System_RVR_ACTIVATE_ERROR":
- winkProperties = {
- "style": "style03",
- "text1Id": "ErrorWhileStartingSiri"
- };
- break;
- case "System_RVR_ACTIVE":
- case "System_RVR_ACTIVE_WITH_EFM":
- case "System_RVR_ACTIVE_NO_EFM":
- winkProperties = {
- "style": "style03",
- "text1Id": "Siri"
- };
- break;
- default:
- // Display default Wink
- log.debug("No properties found for wink: " + alert);
- break;
- }
- // return the properties to Common
- return winkProperties;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Initialize various menu data lists
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._initEntertainmentDataList = function()
-{
- var items = [];
-
- if (framework.localize.getRegion() === framework.localize.REGIONS.Japan)
- {
- // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
- // add it if the region is Japan.
- items.push({ appData : { appName : 'amradio', isVisible : true, audioSourceId : 'TrafficInfo' , mmuiEvent : 'SelectTrafficAlert' }, text1Id : 'TrafficAlertsItem', disabled : true, itemStyle : 'style01', hasCaret: false });
- }
-
- items.push(
- { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false }
- );
-
- // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterEntertainmentDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initApplicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vsm', isVisible : true, mmuiEvent : 'SelectEngineOilLevel' }, text1Id : 'EngineOilLevel', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vehicleStatus', isVisible : false, mmuiEvent : 'SelectVehicleStatusMonitor' }, text1Id : 'VehicleStatusMonitor', disabled : false, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterApplicationDataList = {
- items: items
- };
-
- //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
- this._applicationsCtxtWiseAppNames = {
- //Context Name : // [appName,appName....]
- "Applications" : ["hdtrafficimage","idm","ecoenergy","driverid","vehicleStatus","vdt_settings","vdt","carplay","androidauto","_androidauto","_videoplayer","_aiotweaks","_speedometer"],
- "VehicleStatusMonitor" : ["warnguide","vsm","schedmaint"]
- };
-};
-
-systemApp.prototype._initCommunicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
- { appData : { appName : '', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._communicationsDataList = {
-
- items: items
-
- };
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers, helpers
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._StatusPhoneCallMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus)
- {
- // Add or remove the Active Call item in the communications menu
- var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
- var dirty = false;
- if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall')
- {
- this._communicationsDataList.items[0].appData.isVisible = true;
- dirty = true;
- }
- else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall'
- && this._communicationsDataList.items[0].appData.isVisible === true)
- {
- this._communicationsDataList.items[0].appData.isVisible = false;
- dirty = true;
- }
-
- // If it changed, and we are in the Comm ctxt, update the list shown
- if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- //build list (which will exclude isVisible==false items)
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusMenuMsgHandler = function(msg)
-{
- log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
-
- // Update menu items associated with the given appName of the message. Menu items can appear
- // in several different contexts or appear multiple times: this function searches all those places.
-
- var appName = msg.params.payload.statusMenu.appName;
- var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
-
- //Update the Availability Status of Speed Restricted Apps
- this._StatusMenuChanged(appName,isDisabled);
-
- // Update the static menu lists so they are correctly enable next time the context is shown
- this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
- this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
- this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
-
- // Update the menu list in the current context if needed
- if (this._currentContext)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- case "VehicleStatusMonitor":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled)// At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
-
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
- }
- }
- }
- break;
- }
- }
-};
-
-systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- }
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[i].disabled = isDisabled;
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
-
- var appName = msg.params.payload.appName;
- var isVisible = msg.params.payload.state === "Visible";
-
- // Search entertainment items
- var isEntertainmentDirty = false;
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.appName === appName
- && this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible)
- {
- isEntertainmentDirty = true;
- this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Entertainment context if it is currently displayed.
- if (isEntertainmentDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Entertainment"
- && this._currentContextTemplate)
- {
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Search application items
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.appName === appName
- && this._masterApplicationDataList.items[i].appData.isVisible != isVisible)
- {
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
- }
- if(this._masterApplicationDataList.items[i].appData.appName === "vehicleStatus")
- {
- this._indexOfVSMApp = i;
- }
- }
-
- //If any app inside the VehicleStatusMonitor context is visible then VehicleStatusMonitor will also be visible in Application.
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames["VehicleStatusMonitor"];
- var isVehicleStatusMonitorVisible = false;
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- var applicationsCtxtWiseAppName = applicationsCtxtWiseAppNames[j];
- for (var k = 0; k < this._masterApplicationDataList.items.length; ++k)
- {
- if((this._masterApplicationDataList.items[k].appData.appName === applicationsCtxtWiseAppName) &&
- this._masterApplicationDataList.items[k].appData.isVisible)
- {
- isVehicleStatusMonitorVisible = this._masterApplicationDataList.items[k].appData.isVisible;
- break;
- }
- }
- }
-
- //update the visiblity of VehicleStatusMonitor on basis of visible status of application(s) inside VehicleStatusMonitor context.
- this._masterApplicationDataList.items[this._indexOfVSMApp].appData.isVisible = isVehicleStatusMonitorVisible;
-
- // Update the Applications context or VehicleStatusMonitor context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Now that we are listening to StatusMenuVisible for Comm items (for email only)
- // we want to ensure any messages sent by other apps that were previously ignored are still ignored
- // Shoki6 ONLY
- if (appName === "email")
- {
- // Search communication items - avalajh
- var isCommunicationDirty = false;
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.appName === appName
- && this._communicationsDataList.items[i].appData.isVisible != isVisible)
- {
- isCommunicationDirty = true;
- this._communicationsDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Communication context if it is currently displayed.
- if (isCommunicationDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Communication"
- && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- }
- };
- systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio)
- {
- // Update cached values for the USB device status
- var status = msg.params.payload.statusMenuUSBAudio;
- var mmuiEvent = "";
- var textIdWithDevice = "";
- var textIdWithoutDevice = "";
- var masterIndex = -1;
- if (status.usbAB === "USB_A")
- {
- mmuiEvent = "SelectUSBA";
- textIdWithDevice = "UsbAudioAWithDevice";
- textIdWithoutDevice = "UsbAudioA";
- }
- else if (status.usbAB === "USB_B")
- {
- mmuiEvent = "SelectUSBB";
- textIdWithDevice = "UsbAudioBWithDevice";
- textIdWithoutDevice = "UsbAudioB";
- }
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- masterIndex = i;
-
- var isAvailable = status.statusMenu.appStatus === "Available";
- var name = status.displayName;
- this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
- if (isAvailable && typeof name === 'string' && name.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
- };
-
- systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- var masterIndex = -1;
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- masterIndex = i;
-
- var isAvailable = msg.params.payload.appStatus === "Available";
- var deviceName = msg.params.payload.deviceName;
-
- // NOTE: This message does not enable/disable the BTAudio menu item.
- // (The StatusMenu message will enable it on startup.)
-
- if (isAvailable && typeof deviceName === "string" && deviceName.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
- };
-
- systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
-
- // Determine correct text ID, based on vehicle fuel type
- var fuelType = msg.params.payload.fuelType;
- var newText1Id;
- switch (fuelType)
- {
- case "HEV":
- newText1Id = "EcoenergyAppHEV";
- break;
-
- case "GAS":
- default:
- newText1Id = "EcoenergyApp";
- break;
- }
-
- // Search application items for the "ecoenergy" application
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
- (this._masterApplicationDataList.items[i].text1Id != newText1Id))
- {
- // Found the app, and it's text ID needs to change, so change it
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].text1Id = newText1Id;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- };
-
- // Handle message to update the notification counts in the Communication context.
- systemApp.prototype._StatusUpdateNotificationsHandler = function(msg)
- {
- if (msg.params && msg.params.payload && msg.params.payload.messageCounts)
- {
- // Update message counts and the notifications list item displayed in the Communication menu
- var countEmail = msg.params.payload.messageCounts.countEmail;
- var countSMS = msg.params.payload.messageCounts.countSMS;
- var total = countEmail + countSMS;
-
- var showMessageIcon = total > 0;
- framework.common.setSbIcon("Message", showMessageIcon);
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- switch (this._communicationsDataList.items[i].appData.mmuiEvent)
- {
- case 'SelectNotifications':
- this._communicationsDataList.items[i].disabled = (total === 0);
- this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
- break;
-
- case 'SelectSms':
- this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
- break;
-
- case 'SelectEmail':
- this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- };
-
- systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function()
- {
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceRecognition',
- imagePath1 : 'apps/system/images/IcnSiriSBN.png'
- };
- framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
- };
-
- systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function()
- {
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style01',
- text1Id : 'ErrorWhileStartingSiri',
- };
- framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
- };
-
- systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function()
- {
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceNotSupported',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
- };
-
- systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function()
- {
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
- };
-
- systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- var params = {
- sbnStyle : 'Style02',
- imagePath1 : 'common/images/icons/IcnListBtConnType_Music.png'
- };
-
- switch (msg.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- params.text1Id = "AudioSourceNotAvailableBTAudio";
- break;
-
- case "USBAudio":
- case "USB_A":
- case "USB_B":
- params.text1Id = "AudioSourceNotAvailableUSB";
- break;
-
- case "CD":
- params.text1Id = "AudioSourceNotAvailableCD";
- break;
-
- case "DVD":
- params.text1Id = "AudioSourceNotAvailableDVD";
- break;
-
- case "TV":
- params.text1Id = "AudioSourceNotAvailableTV";
- break;
- }
-
- framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
- }
- };
-
- systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList)
- {
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (isPlaying)
- {
- // Set the icon on the audioSource item and clearing it on all other items
- dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
- }
- else
- {
- // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
- // "Off" and "Play" messages do not necessarily come in that order.
- if (dataList.items[i].appData.audioSourceId === audioSource)
- {
- dataList.items[i].image1 = "";
- }
- }
- }
- };
-
- systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- var audioSource = msg.params.payload.statusAudio.audioSource;
- var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
-
- // Set the icon in the masterEntertainment data list so it is persisted between template instances
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
- list.updateItems(0, list.dataList.items.length - 1);
- }
- }
- };
-
- systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg)
- {
- var count = "";
- if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0)
- {
- count = msg.params.payload.missedCallCount.toString();
- }
-
- // Update this._communicationsDataList
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- this._communicationsDataList.items[i].label1 = count;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- list.dataList.items[i].label1 = count;
- list.updateItems(i, i);
- }
- }
- }
- };
-
- systemApp.prototype._WarningStatusCountMsgHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- var count = "";
- var icon = "";
- if (msg.params.payload.warningcount > 0)
- {
- count = msg.params.payload.warningcount.toString();
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- this._masterApplicationDataList.items[i].label1 = count;
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- list.dataList.items[i].label1 = count;
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- }
- }
- }
- };
-
- systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg)
- {
- if (msg.params && msg.params.payload)
- {
- var isDue = msg.params.payload.due;
- var warningCountValue = null;
- //Caching the Due Status to be used in _WarningStatusCountMsgHandler.
- this._SchedMaintDueStatus = isDue;
- // Update the master list
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- }
- else if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- var WarnGuidanceAppItem = utility.getArrayItemByPropertyValue(this._masterApplicationDataList.items,"text1Id","WarnGuidanceApp");
- if(WarnGuidanceAppItem && WarnGuidanceAppItem.item && WarnGuidanceAppItem.item.label1)
- {
- warningCountValue = WarnGuidanceAppItem.item.label1;
- }
-
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !this._masterApplicationDataList.items[i].image2)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- else
- {
- //DO nothing
- }
- }
- }
-
- // Update the current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- list.dataList.items[i].image2 = "";
- }
- list.updateItems(i, i);
- }
- else if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor")
- {
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !list.dataList.items[i].image2)
- {
- list.dataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- list.dataList.items[i].image2 = "";
- }
- else
- {
- //Do Nothing
- }
-
- list.updateItems(i, i);
- }
- }
- }
- }
- };
-
- systemApp.prototype._AtSpeedMsgHandler = function(msg)
- {
- //At speed will disable the speed Restricted items
- this._AtSpeedDisabled = true;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- };
-
- systemApp.prototype._NoSpeedMsgHandler = function(msg)
- {
- //At speed will Enable the speed Restricted items
- this._AtSpeedDisabled = false;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- };
-
- /**************************
- * Control callbacks
- **************************/
-
- /*
- * Callback for the Main Menu Context icon button clicks
- * @param mainMenuObj (Object) Reference to the MainMenuCtrl
- * @param appData (Object) Data passed in by the app when the control was instantiated
- * @param params (Object) Contains label for the selected icon
- */
- systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params)
- {
- log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
-
- var icon = params.icon;
-
- switch(icon)
- {
- case "app":
- framework.sendEventToMmui(this.uiaId, "SelectApplications");
- break;
- case "com":
- framework.sendEventToMmui(this.uiaId, "SelectCommunication");
- break;
- case "ent":
- framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
- break;
- case "nav":
- framework.sendEventToMmui(this.uiaId, "SelectNavigation");
- break;
- case "set":
- framework.sendEventToMmui(this.uiaId, "SelectSettings");
- break;
- }
- };
-
- /*
- * Select callback for Applications, Communication, and Entertainment contexts.
- * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
- */
- systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params)
- {
- framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // Communication
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._CommCtxtContextIn = function()
- {
- var scrollTo = 0;
-
- // We cannot use the data list in the current context here, becuase it doesn't exist yet
- // so we use _buildCommunicationDataList() just like _readyCommunications() will
- var dataList = this._buildCommunicationDataList();
-
- // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
- var any = false;
- for (var i = 0; i < dataList.items.length - 1; ++i)
- {
- if (dataList.items[i].disabled === false)
- {
- any = true;
- }
- }
-
- if (any === false)
- {
- var lastIndex = dataList.items.length - 1;
- if (dataList.items[lastIndex].disabled === false)
- {
- scrollTo = lastIndex;
- }
- }
-
- this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
- this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
- };
- ///////////////////////////////////////////////////////////////////////////////
- // Applications
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readyApplications = function()
- {
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
-
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Applications Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
- };
-
- // Build list data from this._masterApplicationDataList based on the currently visible items.
- systemApp.prototype._buildApplicationsDataList = function()
- {
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.isVisible)
- {
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames[this._currentContext.ctxtId];
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- if(applicationsCtxtWiseAppNames[j] === this._masterApplicationDataList.items[i].appData.appName)
- {
- dataList.items.push(this._masterApplicationDataList.items[i]);
- }
- }
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // Entertainment
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readyEntertainment = function()
- {
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Entertainment Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
- };
-
- // Build list data from this._masterEntertainmentDataList based on the currently visible items.
- systemApp.prototype._buildEntertainmentDataList = function()
- {
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterEntertainmentDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
- };
-
-
- ///////////////////////////////////////////////////////////////////////////////
- // Communication - avalajh
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readyCommunication = function()
- {
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Communication Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
- };
-
- // Build list data from this._communicationsDataList based on the currently visible items.
- systemApp.prototype._buildCommunicationDataList = function()
- {
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._communicationsDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
- };
-
-
- ///////////////////////////////////////////////////////////////////////////////
- // NoConnectionNotify
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params)
- {
- switch(this._currentContext.ctxtId)
- {
- case 'NoConnectionNotify':
- switch(appData)
- {
- case 'SelectConnect':
- framework.sendEventToMmui("system", appData);
- break;
-
- case 'Global.No':
- framework.sendEventToMmui("common", appData);
- break;
- }
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // NotifyDialog
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function()
- {
- if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData)
- {
- this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
- }
- };
-
- systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function()
- {
- // Start timer to dismiss the notification if the user doesn't respond
- var self = this;
- this._NotifyDialogTimeoutId = setTimeout(function() {
- this._NotifyDialogTimeoutId = null;
- framework.sendEventToMmui(self.uiaId, "Timeout");
- }, 10000);
- };
-
- systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function()
- {
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
- };
-
- systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params)
- {
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-
- switch (appData)
- {
- case "Global.No":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectNotifyOff":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
-
- case "SelectNotifyMessage":
- if (this._currentContext.params && this._currentContext.params.payload)
- {
- var paramsData = {
- payload : {
- messageId : this._currentContext.params.payload.messageNotifyData.messageId,
- messageNotifyType : this._currentContext.params.payload.messageNotifyData.messageNotifyType
- }
- };
- framework.sendEventToMmui(this.uiaId, appData, paramsData);
- }
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // NotificationListRetry
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Cancel":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectRetry":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // NotificationList
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readyNotificationList = function(readyParams)
- {
- log.debug("_readyNotificationList called...");
-
- if (readyParams)
- {
- readyParams.skipRestore = true;
- }
-
- var params = {
- "context_in": 0,
-
- // typedef enum MSG_client_type_e
- // {
- // /// Used for min valid values range check
- // MSG_CLIENT_MIN = 0,
- // /// Invalid value of 0
- // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
- // /// Email client
- // MSG_CLIENT_EMAIL,
- // /// SMS/MMS client
- // MSG_CLIENT_SMS,
- // /// Settings client
- // MSG_CLIENT_SETTINGS,
- // /// Notifications client
- // MSG_CLIENT_NOTIFICATIONS,
- // /// Used for max valid values range check
- // MSG_CLIENT_MAX
- // } MSG_client_type_t;
- "client_type_in": 4,
- "callbacks_in": 0
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
- };
-
- systemApp.prototype._noLongerDisplayedNotificationList = function()
- {
- this._closeMsgApiConnection();
- };
-
- systemApp.prototype._msgConnectCallback = function(msg)
- {
- if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100)
- {
- this._msgApiConnection = msg.params.connection;
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- "request_type" : 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
- };
-
- systemApp.prototype._msgGetNewMessagesListCallback = function(msg)
- {
- if (msg && msg.msgType === "methodResponse" && msg.params)
- {
- switch (msg.params.status)
- {
- // Successful retrieval w/ messages
- case 100:
- {
- log.info("####AppSDK Success####");
- this._closeMsgApiConnection();
-
- var messages = msg.params.message_list.messages;
-
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items: [],
- vuiSupport: true
- };
-
- for (var i = 0; i < messages.length; i++)
- {
- var item = {
- appData: { messageId: messages[i].id, name: messages[i].sender },
- itemStyle : 'style07',
- styleMod : 'bold',
- hasCaret : false,
- text1: messages[i].sender,
- image1 : '',
- label1 : utility.formatSmartDateTime(messages[i].datetime, false),
- label2 : '', // label2 is only set for email's below and left blank for sms.
- labelWidth : 'wide',
- };
-
- // Set image1 and set appData event name.
- switch (messages[i].clientType)
- {
- // MSG_CLIENT_EMAIL
- case 1:
- item.appData.eventId = 'SelectMessageEmail';
- item.image1 = 'common/images/icons/IcnListEmail_En.png';
- item.label2 = messages[i].instance;
- break;
-
- // MSG_CLIENT_SMS
- case 2:
- item.appData.eventId = 'SelectMessageSMS';
- item.image1 = 'common/images/icons/IcnListSms_En.png';
- break;
- }
-
- dataList.items.push(item);
- }
-
- dataList.itemCount = dataList.items.length;
-
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
- }
- break;
- }
-
- // Empty list returned
- case 107:
- {
- log.info("AppSDK returned empty message.");
- this._closeMsgApiConnection();
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- break;
- }
-
- // Unrecognized status code
- default:
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- break;
- }
- }
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
- };
-
- systemApp.prototype._closeMsgApiConnection = function()
- {
- if (this._msgApiConnection)
- {
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- };
- framework.sendRequestToAppsdk(this.uiaId, function(){}, "msg", "Disconnect", params);
- this._msgApiConnection = null;
- }
- };
-
- systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params)
- {
- if (appData && appData.eventId)
- {
- switch (appData.eventId)
- {
- case 'SelectMessageEmail':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMessageSMS':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMissedCall':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
- }
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // NoDevice
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.GoBack":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectConnect":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // DisplayOff
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params)
- {
- framework.sendEventToMmui("system", "DisplayOffGUIActivity");
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // Disclaimer
- ///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._noMoreDisclaimer = function(controlRef, appData, params)
- {
- framework.sendEventToMmui("system", "DisposeIntroVideo");
-
- // this need only for log
- this._disclaimerTime.remaining = 3500;
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
-
- framework.sendEventToMmui("common", "Global.Yes");
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // SystemWarning
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // EnableRVR
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // RVRInstructions
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // SourceReconnect
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readySourceReconnect = function()
- {
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
- break;
-
- case "Pandora":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
- break;
-
- case "Stitcher":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
- break;
-
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
- break;
-
- default:
- break;
- }
- }
- };
-
- systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "SelectEntertainmentMenu":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // SourceReconnectFailed
- ///////////////////////////////////////////////////////////////////////////////
-
- systemApp.prototype._readySourceReconnectFailed = function()
- {
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
- break;
-
- default:
- break;
- }
- }
- };
-
- //Siri EnableRVR context ready to Display Function
- systemApp.prototype._readyEnableRVR = function()
- {
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled",subMapObj);
-
- }
- };
-
- //Siri SiriLaunchingError context ready to Display Function
- systemApp.prototype._readySiriLaunchingError = function()
- {
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect",subMapObj);
-
- }
- };
-
- systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params)
- {
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
- };
-
- // Store the Availability Status of Speed Restricted Apps
- systemApp.prototype._StatusMenuChanged = function(appName, isDisabled)
- {
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
- if(speedRestrictedAppName.indexOf(appName) === 0)
- {
- this._SpeedRestrictedApps[i].status = isDisabled;
- }
- }
- };
-
- // Update the items for Speed Restricted Message
- systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled)
- {
- var status = null;
- var appName = null;
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- appName = this._SpeedRestrictedApps[i].appName;
- status = this._SpeedRestrictedApps[i].status;
-
- log.info("AppName : "+appName+" is available or unavailable - (true/false)" +status);
-
- //Checks for Status Availability for the respective AppName
- if(!status)
- {
- this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
- }
- // Update the menu list in the current context if needed
- if (this._currentContext && !status)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var j = 0; j < dataList.items.length; ++j)
- {
- if (dataList.items[j].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[j].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[j].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(j, j);
- }
- }
- }
- break;
- }
- }
- }
- };
-
- // Tell framework that system app has finished loading
- framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.59.js b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.59.js
deleted file mode 100644
index 209e937..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.59.js
+++ /dev/null
@@ -1,2358 +0,0 @@
-
-/*
- Copyright 2012 by Johnson Controls
- __________________________________________________________________________
-
- Filename: systemApp.js
- __________________________________________________________________________
-
- Project: JCI-IHU
- Language: EN
- Author: awoodhc
- Date: 05.7.2012
- __________________________________________________________________________
-
- Description: IHU GUI System App
-
- Revisions:
- v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
- v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
- v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between contexts.
- v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
- v0.5 - 14-June-2012 Language Localization added to ListCtrls
- v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
- v0.7 - 22-June-2012 Code review changes and reworked context handling
- v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
- v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
- v1.0 - 31-July-2012 Updated Multicontroller behavior.
- v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
- v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
- v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
- v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
- v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
- v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
- v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
- v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
- v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
- v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
- v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
- v2.2 (20-Nov-2012) Stitcher enabled
- v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
- v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
- v2.5 (17-Jan-2013) Changed one event name
- v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
- v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
- v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
- v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
-
- __________________________________________________________________________
-
- */
-
-log.addSrcFile("systemApp.js", "system");
-
-/**********************************************
- * Start of Base App Implementation
- *
- * Code in this section should not be modified
- * except for function names based on the appname
- *********************************************/
-
-function systemApp(uiaId)
-{
- log.debug("constructor called...");
-
- // Base application functionality is provided in a common location via this call to baseApp.init().
- // See framework/js/BaseApp.js for details.
- baseApp.init(this, uiaId);
-
- // All feature-specific initialization is done in appInit()
-}
-
-/*
- * Called just after the app is instantiated by framework.
- * App-specific variables should be declared here.
- */
-systemApp.prototype.appInit = function()
-{
- if (framework.debugMode)
- {
- utility.loadScript("apps/system/test/systemAppTest.js");
- }
-
- //@formatter:off
-
- this._initEntertainmentDataList();
- this._initApplicationsDataList();
- this._initCommunicationsDataList();
-
- this._contextTable = {
-
- "HomeScreen" : {
- "hideHomeBtn" : true,
- "template" : "MainMenuTmplt",
- "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
- "controlProperties": {
- "MainMenuCtrl" : {
- "selectCallback":this._selectCallbackHomeScreen.bind(this),
- } // end of properties for "MainMenuCtrl"
- }, // end of list of controlProperties
- }, // end of "systemAppContext1"
-
- "Communication" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Communication",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": this._communicationsDataList,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyCommunication.bind(this),
- "contextInFunction" : this._CommCtxtContextIn.bind(this),
- }, // end of "Communication"
-
- "Entertainment" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Entertainment",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyEntertainment.bind(this),
- }, // end of "Entertainment"
-
- "Applications" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Applications",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "Applications"
-
- "VehicleStatusMonitor" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "VehicleStatusMonitor",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "VehicleStatusMonitor"
-
- "NoConnectionNotify" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoConnectionNotify.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.No"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoConnectionNotifyTitle',
- text2Id : 'NoConnectionNotifyText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "NotifyDialog" : {
- "template" : "Dialog3Tmplt",
- "sbNameId" : null,
- "readyFunction" : this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
- "displayedFunction" : this._NotifyDialogCtxtTmpltDisplayed.bind(this),
- "noLongerDisplayedFunction" : this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectCallbackNotifyDialog.bind(this),
- "contentStyle" : "style17",
- "buttonCount" : 3,
- "initialFocus" : 2,
- "buttonConfig" : {
- "button1" : {
- labelId : "NotifyOff",
- appData : "SelectNotifyOff",
- },
- "button2" : {
- labelId : "NotifyIgnore",
- appData : "Global.No",
- },
- "button3" : {
- labelId : "NotifyRead",
- appData : "SelectNotifyMessage"
- }
- }, // end of buttonConfig
- "text1Id" : "NotifyIncomingMsg",
- "text2" : "",
- "text3Id" : "NotifyReadNow",
- } // end of properties for dialog
- }, // end of controlProperties
- }, // end of "NotifyDialog"
-
- "NotificationList" : {
- "leftBtnStyle" : "goBack",
- "template" : "List2Tmplt",
- "sbNameId" : "Notifications",
- "readyFunction" : this._readyNotificationList.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedNotificationList.bind(this),
- "controlProperties": {
- "List2Ctrl" : {
- titleConfiguration : "noTitle",
- numberedList : true,
- selectCallback: this._selectNotificationListItem.bind(this),
- title : null,
- dataList : null,
- },
- }, // end of controlProperties
- }, // end of "NotificationList"
-
- "NotificationListRetry" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackNotificationListRetry.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Cancel",
- appData : "Global.Cancel"
- },
- button2 : {
- labelId : "RetryLabel",
- appData : "SelectRetry"
- },
- },
- text1Id : 'FailedNotificationRetrieval',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of NotificationListRetry
-
- "NoDevice" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoDevice.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.GoBack"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoDeviceTitle',
- text2Id : 'NoDeviceText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "DisplayOff" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : this._displayOffUserActivity.bind(this),
- showClock : true,
- }
- },
- }, // end of "DisplayOff"
-
- "Disclaimer" : {
- "template" : "NoCtrlTmplt",
- "hideHomeBtn" : true,
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/background.png",
- },
- "readyFunction" : this._noMoreDisclaimer.bind(this),
- }, // end of Disclaimer
-
- "SystemWarning" : {
- "hideHomeBtn" : true,
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "TempWarning",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackSystemWarning.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "TempWarningText",
- }
- },
- },
-
- "SourceReconnect" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnect.bind(this),
- "contentStyle" : "style14",
- "fullScreen" : false,
- "text1Id" : null,
- "meter" : {"meterType":"indeterminate", "meterPath":"common/images/IndeterminateMeter_2.png"},
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "ReconnectEntMenuButton",
- appData : "SelectEntertainmentMenu"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnect.bind(this),
- },
-
- "SourceReconnectFailed" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnectFailed.bind(this),
- "contentStyle" : "style02",
- "fullScreen" : false,
- "text1Id" : null,
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnectFailed.bind(this),
- },
-
- "IntroAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "QuickStartLoop" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["QUICKTRANLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "PowerDownAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["EXITLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "IdleStandby" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "WaitForEnding" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "EnableRVR" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackEnableRVR.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "SiriDisabled",
- }
- },
- "readyFunction" : this._readyEnableRVR.bind(this),
- },
-
- "RVRInstructions" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "InitiateSiri",
- }
- },
- },
-
- "SiriInSession" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "Siri",
- contentStyle : "style14",
- "meter" : {"meterType":"indeterminate", "meterPath":"apps/system/images/IcnSiri.png"}
- }
- },
- },
-
- "SiriLaunchingError" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- //titleStyle : "titleStyle01",
- // titleId : "Siri",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "DisconnectThenReconnect",
- }
- },
- "readyFunction" : this._readySiriLaunchingError.bind(this),
- },
- }; // end of this._contextTable object
-
- //@formatter:off
- this._messageTable = {
- // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
- "StatusMenu" : this._StatusMenuMsgHandler.bind(this),
-
- // Add or remove certain menu items.
- "StatusMenuVisible" : this._StatusMenuVisibleMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for USB1 and USB2 audio
- "StatusMenuUSBAudio" : this._StatusMenuUSBAudioMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for BTAudio
- "StatusMenuBTAudio" : this._StatusMenuBTAudioMsgHandler.bind(this),
-
- // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
- "StatusUpdateEcoEnergy" : this._StatusUpdateEcoEnergyMsgHandler.bind(this),
-
- // Updates the number of notifications for missed sms and emails.
- "StatusUpdateNotifications" : this._StatusUpdateNotificationsHandler.bind(this),
-
- // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
- "StatusPhoneCall" : this._StatusPhoneCallMsgHandler.bind(this),
-
- // Show an Audio SourceNotAvailable SBN
- "TimedSBN_SourceNotAvailable" : this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
-
- // Update the current audio source icon in the Entertainment menu
- "StatusUpdateAudioSource" : this._StatusUpdateAudioSourceMsgHandler.bind(this),
-
- // Update the number of missed calls
- "StatusUpdateMissedCallCount" : this._StatusUpdateMissedCallCountMsgHandler.bind(this),
-
- // Update the number of warnings displayed apps men
- "WarningStatusCount" : this._WarningStatusCountMsgHandler.bind(this),
-
- // Update whether scheduled maintenance is due
- "StatusUpdateSchedMaint" : this._StatusUpdateSchedMaintHandler.bind(this),
-
- // Show an Siri SBN
- "ShowStateSBN_SiriActive" : this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
-
- // Show an Siri Error SBN
- "TimedSBN_SiriError" : this._TimedSBN_SiriErrorMsgHandler.bind(this),
-
- // Remove an Siri SBN
- "RemoveStateSBN_SiriActive" : this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
-
- //Show timed SBN Voice not supported
- "TimedSBN_VoiceNotSupported" : this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
-
- //Show timed SBN Voice Recognition Loading
- "TimedSBN_VRLoading" : this._TimedSBN_VRLoadingMsgHandler.bind(this),
-
- //At Speed Restriction
- "Global.AtSpeed" : this._AtSpeedMsgHandler.bind(this),
-
- //At No Speed
- "Global.NoSpeed" : this._NoSpeedMsgHandler.bind(this),
- };
- //@formatter:on
-
- // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
- // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
- // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
- // so the remaining time must be restarted when this happens.
- this._disclaimerTime = {
-
- // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
- // flag is set true after a the timer times out or the user hits the OK button.
- reset : true,
-
- // (Number) Milliseconds remaining to show the Disclaimer.
- remaining : 0,
-
- // (Number) Millisecond timestamp when the Disclaimer was first shown.
- whenStarted : 0,
-
- // (Handle) setTimeout ID
- timeoutId : null
- };
-
- // Array containing the appName of the list which supports Speed Restriction.
- //@appName = appName of the item , @status = default value of disabled property for particular appName
- this._SpeedRestrictedApps = [ {appName : "vdt_settings",status : true}];
-};
-
-/**************************
- * Set Wink Properties *
- **************************/
-
-systemApp.prototype.getWinkProperties = function(alert, params)
-{ log.info("setting wink properties for: ", alert, params);
- var winkProperties = null;
- switch(alert)
- {
- case "System_RVR_NOT_ACTIVE":
- case "System_RVR_EFM_ERROR":
- case "System_RVR_ACTIVATE_ERROR":
- winkProperties = {
- "style": "style03",
- "text1Id": "ErrorWhileStartingSiri"
- };
- break;
- case "System_RVR_ACTIVE":
- case "System_RVR_ACTIVE_WITH_EFM":
- case "System_RVR_ACTIVE_NO_EFM":
- winkProperties = {
- "style": "style03",
- "text1Id": "Siri"
- };
- break;
- default:
- // Display default Wink
- log.debug("No properties found for wink: " + alert);
- break;
- }
- // return the properties to Common
- return winkProperties;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Initialize various menu data lists
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._initEntertainmentDataList = function()
-{ var items = [];
-
- if (framework.localize.getRegion() === framework.localize.REGIONS.Japan)
- {
- // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
- // add it if the region is Japan.
- items.push({ appData : { appName : 'amradio', isVisible : true, audioSourceId : 'TrafficInfo' , mmuiEvent : 'SelectTrafficAlert' }, text1Id : 'TrafficAlertsItem', disabled : true, itemStyle : 'style01', hasCaret: false });
- }
-
- items.push(
- { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false }
- );
-
- // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterEntertainmentDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initApplicationsDataList = function()
-{ var items = [];
-
- this._vehicleConfigurationType = null;
- this._vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
-
- log.info("this._vehicleConfigurationType " +this._vehicleConfigurationType);
-
- items.push(
- { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vsm', isVisible : false, mmuiEvent : 'SelectEngineOilLevel' }, text1Id : 'EngineOilLevel', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vehicleStatus', isVisible : false, mmuiEvent : 'SelectVehicleStatusMonitor' }, text1Id : 'VehicleStatusMonitor', disabled : false, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterApplicationDataList = {
- items: items
- };
-
- this._updateApplicationStructure(this._vehicleConfigurationType);
-
- // Keep the index of vehicleStatus ready to be used during enable/disable and visible/hidden of this item.
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if(this._masterApplicationDataList.items[i].appData.appName === "vehicleStatus")
- {
- this._indexOfVSMApp = i;
- }
- }
-
-};
-
-systemApp.prototype._initCommunicationsDataList = function()
-{ var items = [];
-
- items.push(
- { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
- { appData : { appName : '', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._communicationsDataList = {
-
- items: items
-
- };
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers, helpers
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._StatusPhoneCallMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus)
- {
- // Add or remove the Active Call item in the communications menu
- var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
- var dirty = false;
- if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall')
- {
- this._communicationsDataList.items[0].appData.isVisible = true;
- dirty = true;
- }
- else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall'
- && this._communicationsDataList.items[0].appData.isVisible === true)
- {
- this._communicationsDataList.items[0].appData.isVisible = false;
- dirty = true;
- }
-
- // If it changed, and we are in the Comm ctxt, update the list shown
- if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- //build list (which will exclude isVisible==false items)
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusMenuMsgHandler = function(msg)
-{ log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
-
- // Update menu items associated with the given appName of the message. Menu items can appear
- // in several different contexts or appear multiple times: this function searches all those places.
-
- var appName = msg.params.payload.statusMenu.appName;
- var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
-
- //Update the Availability Status of Speed Restricted Apps
- this._StatusMenuChanged(appName,isDisabled);
-
- // Update the static menu lists so they are correctly enable next time the context is shown
- this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
- this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
- this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
-
- // Update the menu list in the current context if needed
- if (this._currentContext)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- case "VehicleStatusMonitor":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled)// At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
-
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
- }
- }
- }
- break;
- }
- }
-};
-
-systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList)
-{ for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- }
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-
- //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
- //Reading the value again and checking the same with existing one.
- var vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
- if (vehicleConfigurationType !== this._vehicleConfigurationType)
- {
- log.info("VehicleConfigurationType is changed to "+vehicleConfigurationType)
- this._vehicleConfigurationType = vehicleConfigurationType;
- this._updateApplicationStructure(vehicleConfigurationType);
- }
-};
-
-systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList)
-{ for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[i].disabled = isDisabled;
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
-
- var appName = msg.params.payload.appName;
- var isVisible = msg.params.payload.state === "Visible";
-
- // Search entertainment items
- var isEntertainmentDirty = false;
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.appName === appName
- && this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible)
- {
- isEntertainmentDirty = true;
- this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Entertainment context if it is currently displayed.
- if (isEntertainmentDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Entertainment"
- && this._currentContextTemplate)
- {
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Search application items
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.appName === appName
- && this._masterApplicationDataList.items[i].appData.isVisible != isVisible)
- {
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
- }
- }
- //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
- //Reading the value again and checking the same with existing one.
- var vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
- if (vehicleConfigurationType !== this._vehicleConfigurationType)
- {
- log.info("VehicleConfigurationType is changed to "+vehicleConfigurationType)
- this._vehicleConfigurationType = vehicleConfigurationType;
- this._updateApplicationStructure(vehicleConfigurationType);
- }
- //If any app inside the VehicleStatusMonitor context is visible then VehicleStatusMonitor will also be visible in Application.
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames["VehicleStatusMonitor"];
- var isVehicleStatusMonitorVisible = false;
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- var applicationsCtxtWiseAppName = applicationsCtxtWiseAppNames[j];
- for (var k = 0; k < this._masterApplicationDataList.items.length; ++k)
- {
- if((this._masterApplicationDataList.items[k].appData.appName === applicationsCtxtWiseAppName) &&
- this._masterApplicationDataList.items[k].appData.isVisible)
- {
- isApplicationsDirty = true;
- isVehicleStatusMonitorVisible = this._masterApplicationDataList.items[k].appData.isVisible;
- break;
- }
- }
- }
-
- //update the visiblity of VehicleStatusMonitor on basis of visible status of application(s) inside VehicleStatusMonitor context.
- this._masterApplicationDataList.items[this._indexOfVSMApp].appData.isVisible = isVehicleStatusMonitorVisible;
-
- // Update the Applications context or VehicleStatusMonitor context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Now that we are listening to StatusMenuVisible for Comm items (for email only)
- // we want to ensure any messages sent by other apps that were previously ignored are still ignored
- // Shoki6 ONLY
- if (appName === "email")
- {
- // Search communication items - avalajh
- var isCommunicationDirty = false;
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.appName === appName
- && this._communicationsDataList.items[i].appData.isVisible != isVisible)
- {
- isCommunicationDirty = true;
- this._communicationsDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Communication context if it is currently displayed.
- if (isCommunicationDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Communication"
- && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- }
-};
-systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio)
- {
- // Update cached values for the USB device status
- var status = msg.params.payload.statusMenuUSBAudio;
- var mmuiEvent = "";
- var textIdWithDevice = "";
- var textIdWithoutDevice = "";
- var masterIndex = -1;
- if (status.usbAB === "USB_A")
- {
- mmuiEvent = "SelectUSBA";
- textIdWithDevice = "UsbAudioAWithDevice";
- textIdWithoutDevice = "UsbAudioA";
- }
- else if (status.usbAB === "USB_B")
- {
- mmuiEvent = "SelectUSBB";
- textIdWithDevice = "UsbAudioBWithDevice";
- textIdWithoutDevice = "UsbAudioB";
- }
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- masterIndex = i;
-
- var isAvailable = status.statusMenu.appStatus === "Available";
- var name = status.displayName;
- this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
- if (isAvailable && typeof name === 'string' && name.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var masterIndex = -1;
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- masterIndex = i;
-
- var isAvailable = msg.params.payload.appStatus === "Available";
- var deviceName = msg.params.payload.deviceName;
-
- // NOTE: This message does not enable/disable the BTAudio menu item.
- // (The StatusMenu message will enable it on startup.)
-
- if (isAvailable && typeof deviceName === "string" && deviceName.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
-
- // Determine correct text ID, based on vehicle fuel type
- var fuelType = msg.params.payload.fuelType;
- var newText1Id;
- switch (fuelType)
- {
- case "HEV":
- newText1Id = "EcoenergyAppHEV";
- break;
-
- case "GAS":
- default:
- newText1Id = "EcoenergyApp";
- break;
- }
-
- // Search application items for the "ecoenergy" application
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
- (this._masterApplicationDataList.items[i].text1Id != newText1Id))
- {
- // Found the app, and it's text ID needs to change, so change it
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].text1Id = newText1Id;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor")
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-// Handle message to update the notification counts in the Communication context.
-systemApp.prototype._StatusUpdateNotificationsHandler = function(msg)
-{ if (msg.params && msg.params.payload && msg.params.payload.messageCounts)
- {
- // Update message counts and the notifications list item displayed in the Communication menu
- var countEmail = msg.params.payload.messageCounts.countEmail;
- var countSMS = msg.params.payload.messageCounts.countSMS;
- var total = countEmail + countSMS;
-
- var showMessageIcon = total > 0;
- framework.common.setSbIcon("Message", showMessageIcon);
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- switch (this._communicationsDataList.items[i].appData.mmuiEvent)
- {
- case 'SelectNotifications':
- this._communicationsDataList.items[i].disabled = (total === 0);
- this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
- break;
-
- case 'SelectSms':
- this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
- break;
-
- case 'SelectEmail':
- this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceRecognition',
- imagePath1 : 'apps/system/images/IcnSiriSBN.png'
- };
- framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-};
-
-systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style01',
- text1Id : 'ErrorWhileStartingSiri',
- };
- framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-};
-
-//If VR is not ready after Disclaimer then display SBN
-systemApp.prototype._TimedSBN_VRLoadingMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'common.SbnVoiceLoading',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceRecoLoading', "vrStatus", params);
-};
-
-systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceNotSupported',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
-};
-
-systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function()
-{ framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
-};
-
-systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var params = {
- sbnStyle : 'Style02',
- imagePath1 : 'common/images/icons/IcnListBtConnType_Music.png'
- };
-
- switch (msg.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- params.text1Id = "AudioSourceNotAvailableBTAudio";
- break;
-
- case "USBAudio":
- case "USB_A":
- case "USB_B":
- params.text1Id = "AudioSourceNotAvailableUSB";
- break;
-
- case "CD":
- params.text1Id = "AudioSourceNotAvailableCD";
- break;
-
- case "DVD":
- params.text1Id = "AudioSourceNotAvailableDVD";
- break;
-
- case "TV":
- params.text1Id = "AudioSourceNotAvailableTV";
- break;
- }
-
- framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
- }
-};
-
-systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList)
-{ for (var i = 0; i < dataList.items.length; ++i)
- {
- if (isPlaying)
- {
- // Set the icon on the audioSource item and clearing it on all other items
- dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
- }
- else
- {
- // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
- // "Off" and "Play" messages do not necessarily come in that order.
- if (dataList.items[i].appData.audioSourceId === audioSource)
- {
- dataList.items[i].image1 = "";
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var audioSource = msg.params.payload.statusAudio.audioSource;
- var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
-
- // Set the icon in the masterEntertainment data list so it is persisted between template instances
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
- list.updateItems(0, list.dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg)
-{ var count = "";
- if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0)
- {
- count = msg.params.payload.missedCallCount.toString();
- }
-
- // Update this._communicationsDataList
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- this._communicationsDataList.items[i].label1 = count;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- list.dataList.items[i].label1 = count;
- list.updateItems(i, i);
- }
- }
- }
-};
-
-systemApp.prototype._WarningStatusCountMsgHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var count = "";
- var icon = "";
- if (msg.params.payload.warningcount > 0)
- {
- count = msg.params.payload.warningcount.toString();
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- this._masterApplicationDataList.items[i].label1 = count;
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
- this._vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = icon;
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- list.dataList.items[i].label1 = count;
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- //Even though count is zero, if SchedMaintDueStatus is true then Amber icon should be shown on VSM item
- if(this._SchedMaintDueStatus)
- {
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg)
-{ if (msg.params && msg.params.payload)
- {
- var isDue = msg.params.payload.due;
- var warningCountValue = null;
- //Caching the Due Status to be used in _WarningStatusCountMsgHandler.
- this._SchedMaintDueStatus = isDue;
- this._vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- // Update the master list
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- }
- // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
- else if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- var WarnGuidanceAppItem = utility.getArrayItemByPropertyValue(this._masterApplicationDataList.items,"text1Id","WarnGuidanceApp");
- if(WarnGuidanceAppItem && WarnGuidanceAppItem.item && WarnGuidanceAppItem.item.label1)
- {
- warningCountValue = WarnGuidanceAppItem.item.label1;
- }
-
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !this._masterApplicationDataList.items[i].image2)
- {
- this._masterApplicationDataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- else
- {
- //DO nothing
- }
- }
- }
-
- // Update the current context if needed
- if (this._currentContext && (this._currentContext.ctxtId === "Applications" || this._currentContext.ctxtId === "VehicleStatusMonitor") &&
- this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- list.dataList.items[i].image2 = "";
- }
- list.updateItems(i, i);
- }
- // Amber icon should be display in VehicleStatusMonitor only with New VehicleConfigData type
- else if (list.dataList.items[i].appData.mmuiEvent === "SelectVehicleStatusMonitor" && this._vehicleConfigurationType === "New")
- {
- //IF is Due is true and not having any image in image2 then need to show Amber icon.
- if(isDue && !list.dataList.items[i].image2)
- {
- list.dataList.items[i].image2 = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
- //IF is Due is false and warningCountValue is 0 then no need to show Amber icon.
- else if(!isDue && !warningCountValue)
- {
- list.dataList.items[i].image2 = "";
- }
- else
- {
- //Do Nothing
- }
-
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._AtSpeedMsgHandler = function(msg)
-{ //At speed will disable the speed Restricted items
- this._AtSpeedDisabled = true;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-systemApp.prototype._NoSpeedMsgHandler = function(msg)
-{ //At speed will Enable the speed Restricted items
- this._AtSpeedDisabled = false;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-/**************************
- * Control callbacks
- **************************/
-
-/*
- * Callback for the Main Menu Context icon button clicks
- * @param mainMenuObj (Object) Reference to the MainMenuCtrl
- * @param appData (Object) Data passed in by the app when the control was instantiated
- * @param params (Object) Contains label for the selected icon
- */
-systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params)
-{ log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
-
- var icon = params.icon;
-
- switch(icon)
- {
- case "app":
- framework.sendEventToMmui(this.uiaId, "SelectApplications");
- break;
- case "com":
- framework.sendEventToMmui(this.uiaId, "SelectCommunication");
- break;
- case "ent":
- framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
- break;
- case "nav":
- framework.sendEventToMmui(this.uiaId, "SelectNavigation");
- break;
- case "set":
- framework.sendEventToMmui(this.uiaId, "SelectSettings");
- break;
- }
-};
-
-/*
- * Select callback for Applications, Communication, and Entertainment contexts.
- * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
- */
-systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params)
-{ framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._CommCtxtContextIn = function()
-{ var scrollTo = 0;
-
- // We cannot use the data list in the current context here, becuase it doesn't exist yet
- // so we use _buildCommunicationDataList() just like _readyCommunications() will
- var dataList = this._buildCommunicationDataList();
-
- // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
- var any = false;
- for (var i = 0; i < dataList.items.length - 1; ++i)
- {
- if (dataList.items[i].disabled === false)
- {
- any = true;
- }
- }
-
- if (any === false)
- {
- var lastIndex = dataList.items.length - 1;
- if (dataList.items[lastIndex].disabled === false)
- {
- scrollTo = lastIndex;
- }
- }
-
- this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
- this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Applications
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyApplications = function()
-{ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
-
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Applications Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterApplicationDataList based on the currently visible items.
-systemApp.prototype._buildApplicationsDataList = function()
-{ var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- //Even though vehicle configuration can not be changed in between after boot up but just to make sure it has updated configuration
- //Reading the value again and checking the same with existing one.
- var vehicleConfigurationType = framework.getSharedData("syssettings","VehicleConfigData");
- //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed.
- if (vehicleConfigurationType !== this._vehicleConfigurationType)
- {
- log.info("VehicleConfigurationType is changed to "+vehicleConfigurationType)
- this._updateApplicationStructure(vehicleConfigurationType);
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.isVisible)
- {
- var applicationsCtxtWiseAppNames = this._applicationsCtxtWiseAppNames[this._currentContext.ctxtId];
- for (var j = 0; j < applicationsCtxtWiseAppNames.length; ++j)
- {
- if(applicationsCtxtWiseAppNames[j] === this._masterApplicationDataList.items[i].appData.appName)
- {
- dataList.items.push(this._masterApplicationDataList.items[i]);
- }
- }
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Entertainment
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyEntertainment = function()
-{ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Entertainment Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterEntertainmentDataList based on the currently visible items.
-systemApp.prototype._buildEntertainmentDataList = function()
-{ var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterEntertainmentDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication - avalajh
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyCommunication = function()
-{ // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Communication Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._communicationsDataList based on the currently visible items.
-systemApp.prototype._buildCommunicationDataList = function()
-{ var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._communicationsDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoConnectionNotify
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params)
-{ switch(this._currentContext.ctxtId)
- {
- case 'NoConnectionNotify':
- switch(appData)
- {
- case 'SelectConnect':
- framework.sendEventToMmui("system", appData);
- break;
-
- case 'Global.No':
- framework.sendEventToMmui("common", appData);
- break;
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotifyDialog
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function()
-{ if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData)
- {
- this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
- }
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function()
-{ // Start timer to dismiss the notification if the user doesn't respond
- var self = this;
- this._NotifyDialogTimeoutId = setTimeout(function() {
- this._NotifyDialogTimeoutId = null;
- framework.sendEventToMmui(self.uiaId, "Timeout");
- }, 10000);
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function()
-{ if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-};
-
-systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params)
-{ if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-
- switch (appData)
- {
- case "Global.No":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectNotifyOff":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
-
- case "SelectNotifyMessage":
- if (this._currentContext.params && this._currentContext.params.payload)
- {
- var paramsData = {
- payload : {
- messageId : this._currentContext.params.payload.messageNotifyData.messageId,
- messageNotifyType : this._currentContext.params.payload.messageNotifyData.messageNotifyType
- }
- };
- framework.sendEventToMmui(this.uiaId, appData, paramsData);
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationListRetry
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Cancel":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectRetry":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationList
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyNotificationList = function(readyParams)
-{ log.debug("_readyNotificationList called...");
-
- if (readyParams)
- {
- readyParams.skipRestore = true;
- }
-
- var params = {
- "context_in": 0,
-
- // typedef enum MSG_client_type_e
- // {
- // /// Used for min valid values range check
- // MSG_CLIENT_MIN = 0,
- // /// Invalid value of 0
- // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
- // /// Email client
- // MSG_CLIENT_EMAIL,
- // /// SMS/MMS client
- // MSG_CLIENT_SMS,
- // /// Settings client
- // MSG_CLIENT_SETTINGS,
- // /// Notifications client
- // MSG_CLIENT_NOTIFICATIONS,
- // /// Used for max valid values range check
- // MSG_CLIENT_MAX
- // } MSG_client_type_t;
- "client_type_in": 4,
- "callbacks_in": 0
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
-};
-
-systemApp.prototype._noLongerDisplayedNotificationList = function()
-{ this._closeMsgApiConnection();
-};
-
-systemApp.prototype._msgConnectCallback = function(msg)
-{ if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100)
- {
- this._msgApiConnection = msg.params.connection;
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- "request_type" : 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._msgGetNewMessagesListCallback = function(msg)
-{ if (msg && msg.msgType === "methodResponse" && msg.params)
- {
- switch (msg.params.status)
- {
- // Successful retrieval w/ messages
- case 100:
- {
- log.info("####AppSDK Success####");
- this._closeMsgApiConnection();
-
- var messages = msg.params.message_list.messages;
-
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items: [],
- vuiSupport: true
- };
-
- for (var i = 0; i < messages.length; i++)
- {
- var item = {
- appData: { messageId: messages[i].id, name: messages[i].sender },
- itemStyle : 'style07',
- styleMod : 'bold',
- hasCaret : false,
- text1: messages[i].sender,
- image1 : '',
- label1 : utility.formatSmartDateTime(messages[i].datetime, false),
- label2 : '', // label2 is only set for email's below and left blank for sms.
- labelWidth : 'wide',
- };
-
- // Set image1 and set appData event name.
- switch (messages[i].clientType)
- {
- // MSG_CLIENT_EMAIL
- case 1:
- item.appData.eventId = 'SelectMessageEmail';
- item.image1 = 'common/images/icons/IcnListEmail_En.png';
- item.label2 = messages[i].instance;
- break;
-
- // MSG_CLIENT_SMS
- case 2:
- item.appData.eventId = 'SelectMessageSMS';
- item.image1 = 'common/images/icons/IcnListSms_En.png';
- break;
- }
-
- dataList.items.push(item);
- }
-
- dataList.itemCount = dataList.items.length;
-
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
- }
- break;
- }
-
- // Empty list returned
- case 107:
- {
- log.info("AppSDK returned empty message.");
- this._closeMsgApiConnection();
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- break;
- }
-
- // Unrecognized status code
- default:
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- break;
- }
- }
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._closeMsgApiConnection = function()
-{ if (this._msgApiConnection)
- {
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- };
- framework.sendRequestToAppsdk(this.uiaId, function(){}, "msg", "Disconnect", params);
- this._msgApiConnection = null;
- }
-};
-
-systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params)
-{ if (appData && appData.eventId)
- {
- switch (appData.eventId)
- {
- case 'SelectMessageEmail':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMessageSMS':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMissedCall':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
- }
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoDevice
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.GoBack":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectConnect":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// DisplayOff
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params)
-{ framework.sendEventToMmui("system", "DisplayOffGUIActivity");
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Disclaimer
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._noMoreDisclaimer = function(controlRef, appData, params)
-{ framework.sendEventToMmui("system", "DisposeIntroVideo");
-
- // this need only for log
-
- this._disclaimerTime.remaining = 3500;
-
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
-
- framework.sendEventToMmui("common", "Global.Yes");
-
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SystemWarning
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// EnableRVR
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// RVRInstructions
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnect
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnect = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
- break;
-
- case "Pandora":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
- break;
-
- case "Stitcher":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
- break;
-
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "SelectEntertainmentMenu":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnectFailed
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnectFailed = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-//Siri EnableRVR context ready to Display Function
-systemApp.prototype._readyEnableRVR = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled",subMapObj);
-
- }
-};
-
-//Siri SiriLaunchingError context ready to Display Function
-systemApp.prototype._readySiriLaunchingError = function()
-{ if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect",subMapObj);
-
- }
-};
-
-systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params)
-{ switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-// Store the Availability Status of Speed Restricted Apps
-systemApp.prototype._StatusMenuChanged = function(appName, isDisabled)
-{ for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
- if(speedRestrictedAppName.indexOf(appName) === 0)
- {
- this._SpeedRestrictedApps[i].status = isDisabled;
- }
- }
-};
-
-// Update the items for Speed Restricted Message
-systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled)
-{ var status = null;
- var appName = null;
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- appName = this._SpeedRestrictedApps[i].appName;
- status = this._SpeedRestrictedApps[i].status;
-
- log.info("AppName : "+appName+" is available or unavailable - (true/false)" +status);
-
- //Checks for Status Availability for the respective AppName
- if(!status)
- {
- this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
- }
- // Update the menu list in the current context if needed
- if (this._currentContext && !status)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var j = 0; j < dataList.items.length; ++j)
- {
- if (dataList.items[j].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[j].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[j].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(j, j);
- }
- }
- }
- break;
- }
- }
- }
-};
-
-// Update the Applications structure based on vehicle configuration(Old or New)
-systemApp.prototype._updateApplicationStructure = function(vehicleConfiguration)
-{ if(vehicleConfiguration === "Old")
- {
- //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
- this._applicationsCtxtWiseAppNames = {
- //Context Name : // [appName,appName....]
- "Applications" : ["hdtrafficimage","idm","ecoenergy","driverid","warnguide","schedmaint","vehicleStatus","vdt_settings","vdt","carplay","androidauto","_androidauto","_videoplayer","_aiotweaks","_speedometer"],
- "VehicleStatusMonitor" : ["vsm"]
- };
-
- }
- else
- {
- //We have two different context (Applications and VehicleStatusMonitor) for displaying Appication item(s),so context wise storing the array of appName(s) to be displayed on corresponding Context.
- this._applicationsCtxtWiseAppNames = {
- //Context Name : // [appName,appName....]
- "Applications" : ["hdtrafficimage","idm","ecoenergy","driverid","vehicleStatus","vdt_settings","vdt","carplay","androidauto","_androidauto","_videoplayer","_aiotweaks","_speedometer"],
- "VehicleStatusMonitor" : ["warnguide","vsm","schedmaint"]
- };
- }
-}// Tell framework that system app has finished loading
-framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.js b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.js
deleted file mode 100644
index fc7ecc8..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.js
+++ /dev/null
@@ -1,2218 +0,0 @@
-/*
- Copyright 2012 by Johnson Controls
- __________________________________________________________________________
-
- Filename: systemApp.js
- __________________________________________________________________________
-
- Project: JCI-IHU
- Language: EN
- Author: awoodhc
- Date: 05.7.2012
- __________________________________________________________________________
-
- Description: IHU GUI System App
-
- Revisions:
- v0.1 - 08-May-2012 Integrated mainMenuControl. Fixed issues with DOM ready
- v0.2 - 10-May-2012 Added ActivePanel, LeftButton, StatusBar
- v0.3 - 11-May-2012 Merged transitions.js code into framework. System App Prototype now shows transitions between contexts.
- v0.4 - 17-May-2012 Reworked functionality of Active Panel Content to handle transitions. Added alerts.
- v0.5 - 14-June-2012 Language Localization added to ListCtrls
- v0.6 - 20-June-2012 Fixed buggy ActivePanel behavior related to new "pop transitions"
- v0.7 - 22-June-2012 Code review changes and reworked context handling
- v0.8 - 03-July-2012 Fixed active content crash involving template with no active panel
- v0.9 - 09-July-2012 Added handling for UpdateEntertainmentMenu MMUI Messages. Moved appInit to top of file
- v1.0 - 31-July-2012 Updated Multicontroller behavior.
- v1.1 (13-Aug-2012) Modified handleControllerEvent behavior
- v1.2 (24-Aug-2012) Changed UiaMgr events to common events.
- v1.3 (28-Aug-2012) Gutted system app globl behavior. All global behavior is now in common.js. Updated control select callbacks
- v1.4 (08-Oct-2012) Changes according to 2.0 UI Spec
- v1.5 (19-Oct-2012) Enabled every feature in Entertainment menu
- v1.6 (24-Oct-2012) Add handling for StatusMenu, StatusMenuUSBAudio
- v1.7 (02-Nov-2012) StatusMenu is no longer case sensitive, CD is disabled by default
- v1.8 (06-Nov-2012) Changes in StatusMenuUSBAudio
- v1.9 (07-Nov-2012) Greyed out AuxIn, AhaRadio, Stitcher
- v2.0 (12-Nov-2012) Added ScreenRep to StatusMenu
- v2.1 (15-Nov-2012) Changes in _CommCtxtTmpltReadyToDisplay
- v2.2 (20-Nov-2012) Stitcher enabled
- v2.3 (22-Nov-2012) Switched to Global.IntentSettingsTab
- v2.4 (19-Dec-2012) Removed Settings context and datalist, removed the capital C from Common to common
- v2.5 (17-Jan-2013) Changed one event name
- v2.6 (22-Jan-2013) Add NotifyDialog and Notifications
- v2.7 (08-Feb-2013) Add now-playing icon to entertainment menu. Add traffic info item (Japan region only)
- v2.8 (15-Feb-2013) Communication context payload converted into msg instead. Hide home button icon on HomeScreen. Removed some remnants of change language.
- v2.9 (18-Feb-2013) HD Traffic Image item (regin specific)
-
- __________________________________________________________________________
-
- */
-
-log.addSrcFile("systemApp.js", "system");
-
-/**********************************************
- * Start of Base App Implementation
- *
- * Code in this section should not be modified
- * except for function names based on the appname
- *********************************************/
-
-function systemApp(uiaId)
-{
- log.debug("constructor called...");
-
- // Base application functionality is provided in a common location via this call to baseApp.init().
- // See framework/js/BaseApp.js for details.
- baseApp.init(this, uiaId);
-
- // All feature-specific initialization is done in appInit()
-}
-
-/*
- * Called just after the app is instantiated by framework.
- * App-specific variables should be declared here.
- */
-systemApp.prototype.appInit = function()
-{
- if (framework.debugMode)
- {
- utility.loadScript("apps/system/test/systemAppTest.js");
- }
-
- //@formatter:off
-
- this._initEntertainmentDataList();
- this._initApplicationsDataList();
- this._initCommunicationsDataList();
-
- this._contextTable = {
-
- "HomeScreen" : {
- "hideHomeBtn" : true,
- "template" : "MainMenuTmplt",
- "templatePath": "apps/system/templates/MainMenu", //only needed for app-specific templates
- "controlProperties": {
- "MainMenuCtrl" : {
- "selectCallback":this._selectCallbackHomeScreen.bind(this),
- } // end of properties for "MainMenuCtrl"
- }, // end of list of controlProperties
- }, // end of "systemAppContext1"
-
- "Communication" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Communication",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": this._communicationsDataList,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyCommunication.bind(this),
- "contextInFunction" : this._CommCtxtContextIn.bind(this),
- }, // end of "Communication"
-
- "Entertainment" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Entertainment",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : false,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyEntertainment.bind(this),
- }, // end of "Entertainment"
-
- "Applications" : {
- "leftBtnStyle" : "goBack",
- "sbNameId" : "Applications",
- "template" : "List2Tmplt",
- "controlProperties": {
- "List2Ctrl" : {
- "dataList": null,
- titleConfiguration : 'noTitle',
- numberedList : true,
- selectCallback : this._menuItemSelectCallback.bind(this),
- } // end of properties for "List2Ctrl"
- }, // end of list of controlProperties
- "readyFunction" : this._readyApplications.bind(this),
- }, // end of "Applications"
-
- "NoConnectionNotify" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoConnectionNotify.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.No"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoConnectionNotifyTitle',
- text2Id : 'NoConnectionNotifyText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "NotifyDialog" : {
- "template" : "Dialog3Tmplt",
- "sbNameId" : null,
- "readyFunction" : this._NotifyDialogCtxtTmpltReadyToDisplay.bind(this),
- "displayedFunction" : this._NotifyDialogCtxtTmpltDisplayed.bind(this),
- "noLongerDisplayedFunction" : this._NotifyDialogCtxtTmpltNoLongerDisplayed.bind(this),
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectCallbackNotifyDialog.bind(this),
- "contentStyle" : "style17",
- "buttonCount" : 3,
- "initialFocus" : 2,
- "buttonConfig" : {
- "button1" : {
- labelId : "NotifyOff",
- appData : "SelectNotifyOff",
- },
- "button2" : {
- labelId : "NotifyIgnore",
- appData : "Global.No",
- },
- "button3" : {
- labelId : "NotifyRead",
- appData : "SelectNotifyMessage"
- }
- }, // end of buttonConfig
- "text1Id" : "NotifyIncomingMsg",
- "text2" : "",
- "text3Id" : "NotifyReadNow",
- } // end of properties for dialog
- }, // end of controlProperties
- }, // end of "NotifyDialog"
-
- "NotificationList" : {
- "leftBtnStyle" : "goBack",
- "template" : "List2Tmplt",
- "sbNameId" : "Notifications",
- "readyFunction" : this._readyNotificationList.bind(this),
- "noLongerDisplayedFunction" : this._noLongerDisplayedNotificationList.bind(this),
- "controlProperties": {
- "List2Ctrl" : {
- titleConfiguration : "noTitle",
- numberedList : true,
- selectCallback: this._selectNotificationListItem.bind(this),
- title : null,
- dataList : null,
- },
- }, // end of controlProperties
- }, // end of "NotificationList"
-
- "NotificationListRetry" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackNotificationListRetry.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Cancel",
- appData : "Global.Cancel"
- },
- button2 : {
- labelId : "RetryLabel",
- appData : "SelectRetry"
- },
- },
- text1Id : 'FailedNotificationRetrieval',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of NotificationListRetry
-
- "NoDevice" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style13",
- defaultSelectCallback : this._selectCallbackNoDevice.bind(this),
- buttonCount : 2,
- initialFocus : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.No",
- appData : "Global.GoBack"
- },
- button2 : {
- labelId : "Connect",
- appData : "SelectConnect"
- },
- },
- text1Id : 'NoDeviceTitle',
- text2Id : 'NoDeviceText',
- } // end of properties for "DialogCtrl"
- }, // end of list of controlProperties
- }, // end of "NoConnectionNotify"
-
- "DisplayOff" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : this._displayOffUserActivity.bind(this),
- showClock : true,
- }
- },
- }, // end of "DisplayOff"
-
- "Disclaimer" : {
- "template" : "NoCtrlTmplt",
- "hideHomeBtn" : true,
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/background.png",
- },
- "readyFunction" : this._noMoreDisclaimer.bind(this),
- }, // end of Disclaimer
-
- "SystemWarning" : {
- "hideHomeBtn" : true,
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "TempWarning",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackSystemWarning.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "TempWarningText",
- }
- },
- },
-
- "SourceReconnect" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnect.bind(this),
- "contentStyle" : "style14",
- "fullScreen" : false,
- "text1Id" : null,
- "meter" : {"meterType":"indeterminate", "meterPath":"common/images/IndeterminateMeter_2.png"},
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "ReconnectEntMenuButton",
- appData : "SelectEntertainmentMenu"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnect.bind(this),
- },
-
- "SourceReconnectFailed" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- "defaultSelectCallback" : this._selectSourceReconnectFailed.bind(this),
- "contentStyle" : "style02",
- "fullScreen" : false,
- "text1Id" : null,
- "buttonCount" : 1,
- "buttonConfig" : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- }
- },
- "readyFunction" : this._readySourceReconnectFailed.bind(this),
- },
-
- "IntroAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["TRANLOGO_SURFACE", "TRANLOGOEND_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "QuickStartLoop" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["QUICKTRANLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "PowerDownAnimation" : {
- "hideHomeBtn" : true,
- "template" : "NoCtrlTmplt",
- "properties": {
- "visibleSurfaces" : ["EXITLOGO_SURFACE"],
- "statusBarVisible" : false,
- "customBgImage" : "common/images/FullTransparent.png",
- },
- },
-
- "IdleStandby" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "WaitForEnding" : {
- "hideHomeBtn" : true,
- "template" : "OffScreenTmplt",
- "templatePath": "apps/system/templates/OffScreen",
- "controlProperties": {
- "OffScreenCtrl" : {
- userActivityCallback : null,
- showClock : false,
- }
- },
- },
-
- "EnableRVR" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackEnableRVR.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "SiriDisabled",
- }
- },
- "readyFunction" : this._readyEnableRVR.bind(this),
- },
-
- "RVRInstructions" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "InitiateSiri",
- }
- },
- },
-
- "SiriInSession" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- titleStyle : "titleStyle01",
- titleId : "Siri",
- contentStyle : "style14",
- "meter" : {"meterType":"indeterminate", "meterPath":"apps/system/images/IcnSiri.png"}
- }
- },
- },
-
- "SiriLaunchingError" : {
- "template" : "Dialog3Tmplt",
- "controlProperties": {
- "Dialog3Ctrl" : {
- //titleStyle : "titleStyle01",
- // titleId : "Siri",
- contentStyle : "style02",
- defaultSelectCallback : this._selectCallbackRVRInstructions.bind(this),
- buttonCount : 1,
- buttonConfig : {
- button1 : {
- labelId : "common.Ok",
- appData : "Global.Yes"
- },
- },
- text1Id : "DisconnectThenReconnect",
- }
- },
- "readyFunction" : this._readySiriLaunchingError.bind(this),
- },
- }; // end of this._contextTable object
-
- //@formatter:off
- this._messageTable = {
- // Indicates Available / Unavailable for (most) apps, communication items, entertainment items, navi, and settings.
- "StatusMenu" : this._StatusMenuMsgHandler.bind(this),
-
- // Add or remove certain menu items.
- "StatusMenuVisible" : this._StatusMenuVisibleMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for USB1 and USB2 audio
- "StatusMenuUSBAudio" : this._StatusMenuUSBAudioMsgHandler.bind(this),
-
- // Indicates Available / Unavailable and device name for BTAudio
- "StatusMenuBTAudio" : this._StatusMenuBTAudioMsgHandler.bind(this),
-
- // Indicates vehicle fuel type (GAS/HEV) for EcoEnergy
- "StatusUpdateEcoEnergy" : this._StatusUpdateEcoEnergyMsgHandler.bind(this),
-
- // Updates the number of notifications for missed sms and emails.
- "StatusUpdateNotifications" : this._StatusUpdateNotificationsHandler.bind(this),
-
- // Updates the phone connection status which adds or removes the "Active Call" item from the Communication context
- "StatusPhoneCall" : this._StatusPhoneCallMsgHandler.bind(this),
-
- // Show an Audio SourceNotAvailable SBN
- "TimedSBN_SourceNotAvailable" : this._TimedSBN_SourceNotAvailableMsgHandler.bind(this),
-
- // Update the current audio source icon in the Entertainment menu
- "StatusUpdateAudioSource" : this._StatusUpdateAudioSourceMsgHandler.bind(this),
-
- // Update the number of missed calls
- "StatusUpdateMissedCallCount" : this._StatusUpdateMissedCallCountMsgHandler.bind(this),
-
- // Update the number of warnings displayed apps men
- "WarningStatusCount" : this._WarningStatusCountMsgHandler.bind(this),
-
- // Update whether scheduled maintenance is due
- "StatusUpdateSchedMaint" : this._StatusUpdateSchedMaintHandler.bind(this),
-
- // Show an Siri SBN
- "ShowStateSBN_SiriActive" : this._ShowStateSBN_SiriActiveMsgHandler.bind(this),
-
- // Show an Siri Error SBN
- "TimedSBN_SiriError" : this._TimedSBN_SiriErrorMsgHandler.bind(this),
-
- // Remove an Siri SBN
- "RemoveStateSBN_SiriActive" : this._RemoveStateSBN_SiriActiveMsgHandler.bind(this),
-
- //Show timed SBN Voice not supported
- "TimedSBN_VoiceNotSupported" : this._TimedSBN_VoiceNotSupportedMsgHandler.bind(this),
-
- //At Speed Restriction
- "Global.AtSpeed" : this._AtSpeedMsgHandler.bind(this),
-
- //At No Speed
- "Global.NoSpeed" : this._NoSpeedMsgHandler.bind(this),
- };
- //@formatter:on
-
- // (Object) Related values needed to implement the Disclaimer timeout. From the requirements:
- // "Note: The Disclaimer Screen Timer is paused if covered up by another screen."
- // The Disclaimer screen might be shown a second time during a quick start sequence that follows a normal start sequence
- // so the remaining time must be restarted when this happens.
- this._disclaimerTime = {
-
- // (Boolean) If true when showing the Disclaimer we should reset the default remaining time. The reset
- // flag is set true after a the timer times out or the user hits the OK button.
- reset : true,
-
- // (Number) Milliseconds remaining to show the Disclaimer.
- remaining : 0,
-
- // (Number) Millisecond timestamp when the Disclaimer was first shown.
- whenStarted : 0,
-
- // (Handle) setTimeout ID
- timeoutId : null
- };
-
- // Array containing the appName of the list which supports Speed Restriction.
- //@appName = appName of the item , @status = default value of disabled property for particular appName
- this._SpeedRestrictedApps = [ {appName : "vdt_settings",status : true}];
-};
-
-/**************************
- * Set Wink Properties *
- **************************/
-
-systemApp.prototype.getWinkProperties = function(alert, params)
-{
- log.info("setting wink properties for: ", alert, params);
- var winkProperties = null;
- switch(alert)
- {
- case "System_RVR_NOT_ACTIVE":
- case "System_RVR_EFM_ERROR":
- case "System_RVR_ACTIVATE_ERROR":
- winkProperties = {
- "style": "style03",
- "text1Id": "ErrorWhileStartingSiri"
- };
- break;
- case "System_RVR_ACTIVE":
- case "System_RVR_ACTIVE_WITH_EFM":
- case "System_RVR_ACTIVE_NO_EFM":
- winkProperties = {
- "style": "style03",
- "text1Id": "Siri"
- };
- break;
- default:
- // Display default Wink
- log.debug("No properties found for wink: " + alert);
- break;
- }
- // return the properties to Common
- return winkProperties;
-}
-///////////////////////////////////////////////////////////////////////////////
-// Initialize various menu data lists
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._initEntertainmentDataList = function()
-{
- var items = [];
-
- if (framework.localize.getRegion() === framework.localize.REGIONS.Japan)
- {
- // Traffic alert is Japan only. We do not get a separate StatusMenuVisible for this so we only
- // add it if the region is Japan.
- items.push({ appData : { appName : 'amradio', isVisible : true, audioSourceId : 'TrafficInfo' , mmuiEvent : 'SelectTrafficAlert' }, text1Id : 'TrafficAlertsItem', disabled : true, itemStyle : 'style01', hasCaret: false });
- }
-
- items.push(
- { appData : { appName : 'fmradio', isVisible : true, audioSourceId : 'FMRadio', mmuiEvent : 'SelectRadioFM' }, text1Id : 'FmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'amradio', isVisible : true, audioSourceId : 'AMRadio', mmuiEvent : 'SelectRadioAM' }, text1Id : 'AmRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dab', isVisible : false, audioSourceId : 'DAB', mmuiEvent : 'SelectDAB' }, text1Id : 'DabRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'satradio', isVisible : false, audioSourceId : 'SatRadio', mmuiEvent : 'SelectSatRadio' }, text1Id : 'SdarsRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'aharadio', isVisible : false, audioSourceId : 'AhaRadio', mmuiEvent : 'SelectAhaRadio' }, text1Id : 'AhaRadio', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'pandora', isVisible : false, audioSourceId : 'Pandora', mmuiEvent : 'SelectPandora' }, text1Id : 'Pandora', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'stitcher', isVisible : true, audioSourceId : 'Stitcher', mmuiEvent : 'SelectStitcher' }, text1Id : 'StitcherItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'btaudio', isVisible : true, audioSourceId : 'BTAudio', mmuiEvent : 'SelectBTAudio' }, text1Id : 'Bluetooth', disabled : false, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_A', mmuiEvent : 'SelectUSBA' }, text1Id : 'UsbAudioA', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : '', isVisible : true, audioSourceId : 'USB_B', mmuiEvent : 'SelectUSBB' }, text1Id : 'UsbAudioB', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'cd', isVisible : false, audioSourceId : 'CD', mmuiEvent : 'SelectCD' }, text1Id : 'CdPlayer', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'auxin', isVisible : true, audioSourceId : 'AuxIn', mmuiEvent : 'SelectAuxIn' }, text1Id : 'AuxIn', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'dvd', isVisible : false, audioSourceId : 'DVD', mmuiEvent : 'SelectDVD' }, text1Id : 'DVDItem', disabled : true, itemStyle : 'style01', hasCaret: false },
- { appData : { appName : 'tv', isVisible : false, audioSourceId : 'TV', mmuiEvent : 'SelectTV' }, text1Id : 'TVItem', disabled : true, itemStyle : 'style01', hasCaret: false }
- );
-
- // All Entertainment list items are kept in _masterEntertainmentDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Entertainment contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterEntertainmentDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initApplicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : 'hdtrafficimage', isVisible : false, mmuiEvent : 'SelectHDTrafficImage' }, text1Id : 'HDTrafficItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'idm', isVisible : false, mmuiEvent : 'SelectIntelligentDriveMaster' }, text1Id : 'IntelligentDriveMasterItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'ecoenergy', isVisible : true, mmuiEvent : 'SelectEcoEnergy' }, text1Id : 'EcoenergyApp', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'driverid', isVisible : false, mmuiEvent : 'SelectDriverIdentification' }, text1Id : 'DriverIDItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'schedmaint', isVisible : true, mmuiEvent : 'SelectSchedMaint' }, text1Id : 'SchedMaintenanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'warnguide', isVisible : true, mmuiEvent : 'SelectWarnGuide' }, text1Id : 'WarnGuidanceApp', disabled : true, itemStyle : 'style22', hasCaret : false, image2: '', label1: "" },
- { appData : { appName : 'vdt_settings', isVisible : false, mmuiEvent : 'SelectVehicleTelemetryTransfer'}, text1Id : 'VehicleTelemetryTransfer', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'vdt', isVisible : false, mmuiEvent : 'SelectDriveRecord' }, text1Id : 'DriveRecord', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'carplay', isVisible : false, mmuiEvent : 'SelectCarPlay' }, text1Id : 'CarPlay', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'androidauto', isVisible : false, mmuiEvent : 'SelectAndroidAuto' }, text1Id : 'AndroidAuto', disabled : true, itemStyle : 'style01', hasCaret : false }
-
- );
-
- // All Application list items are kept in _masterApplicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Application contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._masterApplicationDataList = {
- items: items
- };
-};
-
-systemApp.prototype._initCommunicationsDataList = function()
-{
- var items = [];
-
- items.push(
- { appData : { appName : '', isVisible : false, mmuiEvent : 'SelectActiveCall' }, text1Id : 'ActiveCallItem', disabled : false, itemStyle : 'style01', hasCaret : false},
- { appData : { appName : '', isVisible : true, mmuiEvent : 'SelectNotifications' }, text1Id : 'Notifications', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'favorites', isVisible : true, mmuiEvent : 'SelectFavoritesComm' }, text1Id : 'FavoritesItem', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'contacts', isVisible : true, mmuiEvent : 'SelectContacts' }, text1Id : 'Contacts', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectCallHistory' }, text1Id : 'CallHistory', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'phone', isVisible : true, mmuiEvent : 'SelectPhone' }, text1Id : 'DialPhone', disabled : true, itemStyle : 'style01', hasCaret : false },
- { appData : { appName : 'sms', isVisible : true, mmuiEvent : 'SelectSms' }, text1Id : 'Sms', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'email', isVisible : false, mmuiEvent : 'SelectEmail' }, text1Id : 'Email', disabled : true, itemStyle : 'style06', hasCaret : false, label1 : '' },
- { appData : { appName : 'syssettings', isVisible : true, mmuiEvent : 'SelectSettings' }, text1Id : 'SettingsCommunication', disabled : true, itemStyle : 'style01', hasCaret : false }
- );
-
- // All Communication list items are kept in _masterCommunicationDataList, including items that may or may not be present on a specific vehicle.
- //
- // MMUI will send a StatusMenuVisible message to show or hide a particular item. The message handler will update the isVisible flag in the appData above.
- // During Communication contexts readyFunction in we build a shallow copy of the master data and set it on the list.
-
- this._communicationsDataList = {
-
- items: items
-
- };
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers, helpers
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._StatusPhoneCallMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.phoneCallStatus)
- {
- // Add or remove the Active Call item in the communications menu
- var hasActiveCall = msg.params.payload.phoneCallStatus === "ActiveCall" || msg.params.payload.phoneCallStatus === "Connecting";
- var dirty = false;
- if (hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent !== 'SelectActiveCall')
- {
- this._communicationsDataList.items[0].appData.isVisible = true;
- dirty = true;
- }
- else if (!hasActiveCall && this._communicationsDataList.items[0].appData.mmuiEvent === 'SelectActiveCall'
- && this._communicationsDataList.items[0].appData.isVisible === true)
- {
- this._communicationsDataList.items[0].appData.isVisible = false;
- dirty = true;
- }
-
- // If it changed, and we are in the Comm ctxt, update the list shown
- if (dirty && this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- //build list (which will exclude isVisible==false items)
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusMenuMsgHandler = function(msg)
-{
- log.debug("Received StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
-
- // Update menu items associated with the given appName of the message. Menu items can appear
- // in several different contexts or appear multiple times: this function searches all those places.
-
- var appName = msg.params.payload.statusMenu.appName;
- var isDisabled = msg.params.payload.statusMenu.appStatus !== "Available";
-
- //Update the Availability Status of Speed Restricted Apps
- this._StatusMenuChanged(appName,isDisabled);
-
- // Update the static menu lists so they are correctly enable next time the context is shown
- this._enableAppListItem(appName, isDisabled, this._masterApplicationDataList);
- this._enableAppListItem(appName, isDisabled, this._communicationsDataList);
- this._enableAppListItem(appName, isDisabled, this._masterEntertainmentDataList);
-
- // Update the menu list in the current context if needed
- if (this._currentContext)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled)// At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
-
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[i].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(i, i);
- }
- log.debug("Updated current screen based on StatusMenu message: " + msg.params.payload.statusMenu.appName + " " + msg.params.payload.statusMenu.appStatus);
- }
- }
- }
- break;
- }
- }
-};
-
-systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName.indexOf(appName) === 0)
- {
- if(this._AtSpeedDisabled) // At speed : Available status will be skipped for the speed restricted apps
- {
- var speedRestrictedAppName = null;
- var isNoAppAtSpeed = true;
- for(var j = 0; j < this._SpeedRestrictedApps.length; ++j)
- {
- speedRestrictedAppName = this._SpeedRestrictedApps[j].appName;
- log.info("speedRestrictedAppName : "+speedRestrictedAppName + " checking for AppName : "+dataList.items[i].appData.appName);
- if(speedRestrictedAppName === dataList.items[i].appData.appName)
- {
- isNoAppAtSpeed = false;// App found with At Speed
- break;
- }
- }
- if(isNoAppAtSpeed)
- {
- dataList.items[i].disabled = isDisabled;
- }
- }
- else
- {
- dataList.items[i].disabled = isDisabled;
- }
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._enableSpeedRestrictedItem = function(appName, isDisabled, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (dataList.items[i].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[i].disabled = isDisabled;
- log.debug("Updated cached list item based on StatusMenu message: " + appName + " " + !isDisabled);
- }
- }
-};
-
-systemApp.prototype._StatusMenuVisibleMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received StatusMenuVisible message: " + msg.params.payload.appName + " " + msg.params.payload.state);
-
- var appName = msg.params.payload.appName;
- var isVisible = msg.params.payload.state === "Visible";
-
- // Search entertainment items
- var isEntertainmentDirty = false;
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.appName === appName
- && this._masterEntertainmentDataList.items[i].appData.isVisible != isVisible)
- {
- isEntertainmentDirty = true;
- this._masterEntertainmentDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Entertainment context if it is currently displayed.
- if (isEntertainmentDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Entertainment"
- && this._currentContextTemplate)
- {
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Search application items
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.appName === appName
- && this._masterApplicationDataList.items[i].appData.isVisible != isVisible)
- {
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Applications"
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
-
- // Now that we are listening to StatusMenuVisible for Comm items (for email only)
- // we want to ensure any messages sent by other apps that were previously ignored are still ignored
- // Shoki6 ONLY
- if (appName === "email")
- {
- // Search communication items - avalajh
- var isCommunicationDirty = false;
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.appName === appName
- && this._communicationsDataList.items[i].appData.isVisible != isVisible)
- {
- isCommunicationDirty = true;
- this._communicationsDataList.items[i].appData.isVisible = isVisible;
- }
- }
-
- // Update the Communication context if it is currently displayed.
- if (isCommunicationDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Communication"
- && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
- }
-};
-systemApp.prototype._StatusMenuUSBAudioMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.statusMenuUSBAudio)
- {
- // Update cached values for the USB device status
- var status = msg.params.payload.statusMenuUSBAudio;
- var mmuiEvent = "";
- var textIdWithDevice = "";
- var textIdWithoutDevice = "";
- var masterIndex = -1;
- if (status.usbAB === "USB_A")
- {
- mmuiEvent = "SelectUSBA";
- textIdWithDevice = "UsbAudioAWithDevice";
- textIdWithoutDevice = "UsbAudioA";
- }
- else if (status.usbAB === "USB_B")
- {
- mmuiEvent = "SelectUSBB";
- textIdWithDevice = "UsbAudioBWithDevice";
- textIdWithoutDevice = "UsbAudioB";
- }
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- masterIndex = i;
-
- var isAvailable = status.statusMenu.appStatus === "Available";
- var name = status.displayName;
- this._masterEntertainmentDataList.items[i].disabled = !isAvailable;
- if (isAvailable && typeof name === 'string' && name.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: name };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = textIdWithoutDevice;
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === mmuiEvent)
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusMenuBTAudioMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var masterIndex = -1;
-
- // Update the master entertainment data list which contains all items
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- masterIndex = i;
-
- var isAvailable = msg.params.payload.appStatus === "Available";
- var deviceName = msg.params.payload.deviceName;
-
- // NOTE: This message does not enable/disable the BTAudio menu item.
- // (The StatusMenu message will enable it on startup.)
-
- if (isAvailable && typeof deviceName === "string" && deviceName.length > 0)
- {
- this._masterEntertainmentDataList.items[i].text1Id = "BluetoothWithDevice";
- this._masterEntertainmentDataList.items[i].text1SubMap = { deviceName: deviceName };
- }
- else
- {
- this._masterEntertainmentDataList.items[i].text1Id = "Bluetooth";
- this._masterEntertainmentDataList.items[i].text1SubMap = null;
- }
-
- if (!isAvailable)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- this._masterEntertainmentDataList.items[i].image1 = "";
- }
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectBTAudio")
- {
- list.dataList.items[i] = this._masterEntertainmentDataList.items[masterIndex];
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateEcoEnergyMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- log.debug("Received _StatusUpdateEcoEnergy message: " + msg.params.payload.fuelType);
-
- // Determine correct text ID, based on vehicle fuel type
- var fuelType = msg.params.payload.fuelType;
- var newText1Id;
- switch (fuelType)
- {
- case "HEV":
- newText1Id = "EcoenergyAppHEV";
- break;
-
- case "GAS":
- default:
- newText1Id = "EcoenergyApp";
- break;
- }
-
- // Search application items for the "ecoenergy" application
- var isApplicationsDirty = false;
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if ((this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectEcoEnergy") &&
- (this._masterApplicationDataList.items[i].text1Id != newText1Id))
- {
- // Found the app, and it's text ID needs to change, so change it
- isApplicationsDirty = true;
- this._masterApplicationDataList.items[i].text1Id = newText1Id;
- }
- }
-
- // Update the Applications context if it is currently displayed.
- if (isApplicationsDirty
- && this._currentContext
- && this._currentContext.ctxtId === "Applications"
- && this._currentContextTemplate)
- {
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-// Handle message to update the notification counts in the Communication context.
-systemApp.prototype._StatusUpdateNotificationsHandler = function(msg)
-{
- if (msg.params && msg.params.payload && msg.params.payload.messageCounts)
- {
- // Update message counts and the notifications list item displayed in the Communication menu
- var countEmail = msg.params.payload.messageCounts.countEmail;
- var countSMS = msg.params.payload.messageCounts.countSMS;
- var total = countEmail + countSMS;
-
- var showMessageIcon = total > 0;
- framework.common.setSbIcon("Message", showMessageIcon);
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- switch (this._communicationsDataList.items[i].appData.mmuiEvent)
- {
- case 'SelectNotifications':
- this._communicationsDataList.items[i].disabled = (total === 0);
- this._communicationsDataList.items[i].label1 = (total === 0) ? "" : total.toString();
- break;
-
- case 'SelectSms':
- this._communicationsDataList.items[i].label1 = (countSMS === 0) ? "" : countSMS.toString();
- break;
-
- case 'SelectEmail':
- this._communicationsDataList.items[i].label1 = (countEmail === 0) ? "" : countEmail.toString();
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._ShowStateSBN_SiriActiveMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus"); //End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceRecognition',
- imagePath1 : 'apps/system/images/IcnSiriSBN.png'
- };
- framework.common.showStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-}
-
-systemApp.prototype._TimedSBN_SiriErrorMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style01',
- text1Id : 'ErrorWhileStartingSiri',
- };
- framework.common.startTimedSbn(this.uiaId, 'SiriStatusNotification', "vrStatus", params);
-}
-
-systemApp.prototype._TimedSBN_VoiceNotSupportedMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");//End the SBN if displayed
- var params = {
- sbnStyle : 'Style02',
- text1Id : 'VoiceNotSupported',
- imagePath1 : 'common/images/icons/IcnSbnMicUnavail.png'
- };
- framework.common.startTimedSbn(this.uiaId, 'VoiceNotificationErr', "vrStatus", params);
-}
-
-systemApp.prototype._RemoveStateSBN_SiriActiveMsgHandler = function()
-{
- framework.common.endStateSbn(this.uiaId, 'SiriStatusNotification', "vrStatus");
-}
-
-systemApp.prototype._TimedSBN_SourceNotAvailableMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var params = {
- sbnStyle : 'Style02',
- imagePath1 : 'common/images/icons/IcnListBtConnType_Music.png'
- };
-
- switch (msg.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- params.text1Id = "AudioSourceNotAvailableBTAudio";
- break;
-
- case "USBAudio":
- case "USB_A":
- case "USB_B":
- params.text1Id = "AudioSourceNotAvailableUSB";
- break;
-
- case "CD":
- params.text1Id = "AudioSourceNotAvailableCD";
- break;
-
- case "DVD":
- params.text1Id = "AudioSourceNotAvailableDVD";
- break;
-
- case "TV":
- params.text1Id = "AudioSourceNotAvailableTV";
- break;
- }
-
- framework.common.startTimedSbn(this.uiaId, 'AudioSourceNotAvailable', "errorNotification", params);
- }
-};
-
-systemApp.prototype._updateEntertainmentNowPlayingIcon = function(audioSource, isPlaying, dataList)
-{
- for (var i = 0; i < dataList.items.length; ++i)
- {
- if (isPlaying)
- {
- // Set the icon on the audioSource item and clearing it on all other items
- dataList.items[i].image1 = (dataList.items[i].appData.audioSourceId === audioSource) ? "common/images/icons/IcnListEntNowPlaying_En.png" : "";
- }
- else
- {
- // Only remove the icon from the audioSource item given. This is important because when switching audio sources the
- // "Off" and "Play" messages do not necessarily come in that order.
- if (dataList.items[i].appData.audioSourceId === audioSource)
- {
- dataList.items[i].image1 = "";
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateAudioSourceMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var audioSource = msg.params.payload.statusAudio.audioSource;
- var isPlaying = msg.params.payload.statusAudio.audioActive === "Play";
-
- // Set the icon in the masterEntertainment data list so it is persisted between template instances
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, this._masterEntertainmentDataList);
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Entertainment" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- this._updateEntertainmentNowPlayingIcon(audioSource, isPlaying, list.dataList);
- list.updateItems(0, list.dataList.items.length - 1);
- }
- }
-};
-
-systemApp.prototype._StatusUpdateMissedCallCountMsgHandler = function(msg)
-{
- var count = "";
- if (msg.params && msg.params.payload && msg.params.payload.missedCallCount > 0)
- {
- count = msg.params.payload.missedCallCount.toString();
- }
-
- // Update this._communicationsDataList
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- this._communicationsDataList.items[i].label1 = count;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Communication" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectCallHistory")
- {
- list.dataList.items[i].label1 = count;
- list.updateItems(i, i);
- }
- }
- }
-};
-
-systemApp.prototype._WarningStatusCountMsgHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var count = "";
- var icon = "";
- if (msg.params.payload.warningcount > 0)
- {
- count = msg.params.payload.warningcount.toString();
- icon = "common/images/icons/IcnListCarHealthAmber_Small.png";
- }
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- this._masterApplicationDataList.items[i].label1 = count;
- this._masterApplicationDataList.items[i].image2 = icon;
- break;
- }
- }
-
- // Update current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Applications" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectWarnGuide")
- {
- list.dataList.items[i].label1 = count;
- list.dataList.items[i].image2 = icon;
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._StatusUpdateSchedMaintHandler = function(msg)
-{
- if (msg.params && msg.params.payload)
- {
- var isDue = msg.params.payload.due;
-
- // Update the master list
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- this._masterApplicationDataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- this._masterApplicationDataList.items[i].image2 = "";
- }
- break;
- }
- }
-
- // Update the current context if needed
- if (this._currentContext && this._currentContext.ctxtId === "Applications" && this._currentContextTemplate)
- {
- var list = this._currentContextTemplate.list2Ctrl;
- for (var i = 0; i < list.dataList.items.length; ++i)
- {
- if (list.dataList.items[i].appData.mmuiEvent === "SelectSchedMaint")
- {
- if (isDue)
- {
- list.dataList.items[i].image2 = "apps/system/images/IcnListServiceNotifications_En.png";
- }
- else
- {
- list.dataList.items[i].image2 = "";
- }
- list.updateItems(i, i);
- }
- }
- }
- }
-};
-
-systemApp.prototype._AtSpeedMsgHandler = function(msg)
-{
- //At speed will disable the speed Restricted items
- this._AtSpeedDisabled = true;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-systemApp.prototype._NoSpeedMsgHandler = function(msg)
-{
- //At speed will Enable the speed Restricted items
- this._AtSpeedDisabled = false;
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
-};
-
-/**************************
- * Control callbacks
- **************************/
-
-/*
- * Callback for the Main Menu Context icon button clicks
- * @param mainMenuObj (Object) Reference to the MainMenuCtrl
- * @param appData (Object) Data passed in by the app when the control was instantiated
- * @param params (Object) Contains label for the selected icon
- */
-systemApp.prototype._selectCallbackHomeScreen = function(mainMenuCtrlObj, appData, params)
-{
- log.debug("_selectCallbackHomeScreen() called for icon: " + params.icon);
-
- var icon = params.icon;
-
- switch(icon)
- {
- case "app":
- framework.sendEventToMmui(this.uiaId, "SelectApplications");
- break;
- case "com":
- framework.sendEventToMmui(this.uiaId, "SelectCommunication");
- break;
- case "ent":
- framework.sendEventToMmui(this.uiaId, "SelectEntertainment");
- break;
- case "nav":
- framework.sendEventToMmui(this.uiaId, "SelectNavigation");
- break;
- case "set":
- framework.sendEventToMmui(this.uiaId, "SelectSettings");
- break;
- }
-};
-
-/*
- * Select callback for Applications, Communication, and Entertainment contexts.
- * Appdata for these list items is a hash: { appName: "", mmuiEvent: ""}
- */
-systemApp.prototype._menuItemSelectCallback = function(listCtrlObj, appData, params)
-{
- framework.sendEventToMmui(this.uiaId, appData.mmuiEvent, {}, params.fromVui);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._CommCtxtContextIn = function()
-{
- var scrollTo = 0;
-
- // We cannot use the data list in the current context here, becuase it doesn't exist yet
- // so we use _buildCommunicationDataList() just like _readyCommunications() will
- var dataList = this._buildCommunicationDataList();
-
- // If Settings (the last item) is the only enabled item then scroll to that. Otherwise default focus behavior.
- var any = false;
- for (var i = 0; i < dataList.items.length - 1; ++i)
- {
- if (dataList.items[i].disabled === false)
- {
- any = true;
- }
- }
-
- if (any === false)
- {
- var lastIndex = dataList.items.length - 1;
- if (dataList.items[lastIndex].disabled === false)
- {
- scrollTo = lastIndex;
- }
- }
-
- this._contextTable["Communication"].controlProperties.List2Ctrl.scrollTo = scrollTo;
- this._contextTable["Communication"].controlProperties.List2Ctrl.focussedItem = scrollTo;
-};
-///////////////////////////////////////////////////////////////////////////////
-// Applications
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyApplications = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
-
- var dataList = this._buildApplicationsDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Applications Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterApplicationDataList based on the currently visible items.
-systemApp.prototype._buildApplicationsDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterApplicationDataList.items.length; ++i)
- {
- if (this._masterApplicationDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterApplicationDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Entertainment
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyEntertainment = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildEntertainmentDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Entertainment Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._masterEntertainmentDataList based on the currently visible items.
-systemApp.prototype._buildEntertainmentDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._masterEntertainmentDataList.items.length; ++i)
- {
- if (this._masterEntertainmentDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._masterEntertainmentDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Communication - avalajh
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyCommunication = function()
-{
- // This context has dynamically visible items (see StatusMenuVisible message) so the list contents is rebuilt.
- if (this._currentContext && this._currentContextTemplate)
- {
- this._AtSpeedDisabled = framework.common.getAtSpeedValue();
- var dataList = this._buildCommunicationDataList();
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.items.length - 1);
-
- // Checking for Speed Restricted Items For Communication Screen
- this._updateSpeedRestrictedApps(this._AtSpeedDisabled);
- }
-};
-
-// Build list data from this._communicationsDataList based on the currently visible items.
-systemApp.prototype._buildCommunicationDataList = function()
-{
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items : [],
- vuiSupport: true
- };
-
- for (var i = 0; i < this._communicationsDataList.items.length; ++i)
- {
- if (this._communicationsDataList.items[i].appData.isVisible)
- {
- dataList.items.push(this._communicationsDataList.items[i]);
- }
- }
- dataList.itemCount = dataList.items.length;
-
- return dataList;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// NoConnectionNotify
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoConnectionNotify = function(dialogBtnCtrlObj, appData, params)
-{
- switch(this._currentContext.ctxtId)
- {
- case 'NoConnectionNotify':
- switch(appData)
- {
- case 'SelectConnect':
- framework.sendEventToMmui("system", appData);
- break;
-
- case 'Global.No':
- framework.sendEventToMmui("common", appData);
- break;
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotifyDialog
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._NotifyDialogCtxtTmpltReadyToDisplay = function()
-{
- if (this._currentContext.params && this._currentContext.params.payload && this._currentContext.params.payload.messageNotifyData)
- {
- this._currentContextTemplate.dialog3Ctrl.setText2(this._currentContext.params.payload.messageNotifyData.name);
- }
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltDisplayed = function()
-{
- // Start timer to dismiss the notification if the user doesn't respond
- var self = this;
- this._NotifyDialogTimeoutId = setTimeout(function() {
- this._NotifyDialogTimeoutId = null;
- framework.sendEventToMmui(self.uiaId, "Timeout");
- }, 10000);
-};
-
-systemApp.prototype._NotifyDialogCtxtTmpltNoLongerDisplayed = function()
-{
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-};
-
-systemApp.prototype._selectCallbackNotifyDialog = function(controlRef, appData, params)
-{
- if (this._NotifyDialogTimeoutId !== null)
- {
- clearTimeout(this._NotifyDialogTimeoutId);
- this._NotifyDialogTimeoutId = null;
- }
-
- switch (appData)
- {
- case "Global.No":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectNotifyOff":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
-
- case "SelectNotifyMessage":
- if (this._currentContext.params && this._currentContext.params.payload)
- {
- var paramsData = {
- payload : {
- messageId : this._currentContext.params.payload.messageNotifyData.messageId,
- messageNotifyType : this._currentContext.params.payload.messageNotifyData.messageNotifyType
- }
- };
- framework.sendEventToMmui(this.uiaId, appData, paramsData);
- }
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationListRetry
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNotificationListRetry = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Cancel":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectRetry":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NotificationList
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readyNotificationList = function(readyParams)
-{
- log.debug("_readyNotificationList called...");
-
- if (readyParams)
- {
- readyParams.skipRestore = true;
- }
-
- var params = {
- "context_in": 0,
-
- // typedef enum MSG_client_type_e
- // {
- // /// Used for min valid values range check
- // MSG_CLIENT_MIN = 0,
- // /// Invalid value of 0
- // MSG_CLIENT_INVALID = MSG_CLIENT_MIN,
- // /// Email client
- // MSG_CLIENT_EMAIL,
- // /// SMS/MMS client
- // MSG_CLIENT_SMS,
- // /// Settings client
- // MSG_CLIENT_SETTINGS,
- // /// Notifications client
- // MSG_CLIENT_NOTIFICATIONS,
- // /// Used for max valid values range check
- // MSG_CLIENT_MAX
- // } MSG_client_type_t;
- "client_type_in": 4,
- "callbacks_in": 0
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgConnectCallback.bind(this), "msg", "Connect", params);
-};
-
-systemApp.prototype._noLongerDisplayedNotificationList = function()
-{
- this._closeMsgApiConnection();
-};
-
-systemApp.prototype._msgConnectCallback = function(msg)
-{
- if (msg && msg.msgType === "methodResponse" && msg.params && msg.params.status === 100)
- {
- this._msgApiConnection = msg.params.connection;
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- "request_type" : 3, // MSG_REQUEST_NEW_DATA_STORE_AND_RETRIEVE
- };
- framework.sendRequestToAppsdk(this.uiaId, this._msgGetNewMessagesListCallback.bind(this), "msg", "GetNewMessagesList", params);
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._msgGetNewMessagesListCallback = function(msg)
-{
- if (msg && msg.msgType === "methodResponse" && msg.params)
- {
- switch (msg.params.status)
- {
- // Successful retrieval w/ messages
- case 100:
- {
- log.info("####AppSDK Success####");
- this._closeMsgApiConnection();
-
- var messages = msg.params.message_list.messages;
-
- var dataList = {
- itemCountKnown : true,
- itemCount : 0,
- items: [],
- vuiSupport: true
- };
-
- for (var i = 0; i < messages.length; i++)
- {
- var item = {
- appData: { messageId: messages[i].id, name: messages[i].sender },
- itemStyle : 'style07',
- styleMod : 'bold',
- hasCaret : false,
- text1: messages[i].sender,
- image1 : '',
- label1 : utility.formatSmartDateTime(messages[i].datetime, false),
- label2 : '', // label2 is only set for email's below and left blank for sms.
- labelWidth : 'wide',
- };
-
- // Set image1 and set appData event name.
- switch (messages[i].clientType)
- {
- // MSG_CLIENT_EMAIL
- case 1:
- item.appData.eventId = 'SelectMessageEmail';
- item.image1 = 'common/images/icons/IcnListEmail_En.png';
- item.label2 = messages[i].instance;
- break;
-
- // MSG_CLIENT_SMS
- case 2:
- item.appData.eventId = 'SelectMessageSMS';
- item.image1 = 'common/images/icons/IcnListSms_En.png';
- break;
- }
-
- dataList.items.push(item);
- }
-
- dataList.itemCount = dataList.items.length;
-
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setDataList(dataList);
- this._currentContextTemplate.list2Ctrl.updateItems(0, dataList.itemCount - 1);
- }
- break;
- }
-
- // Empty list returned
- case 107:
- {
- log.info("AppSDK returned empty message.");
- this._closeMsgApiConnection();
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- break;
- }
-
- // Unrecognized status code
- default:
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- break;
- }
- }
- }
- else
- {
- log.error("APPSDK response " + msg.serviceName + " " + msg.methodName + " " + msg.errorType);
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- this._currentContextTemplate.list2Ctrl.setLoading(false);
- }
- framework.sendEventToMmui(this.uiaId, "NotificationListRetrieveFailure");
- this._closeMsgApiConnection();
- }
-};
-
-systemApp.prototype._closeMsgApiConnection = function()
-{
- if (this._msgApiConnection)
- {
- var params = {
- "connection_in" : this._msgApiConnection,
- "context_in" : 0,
- };
- framework.sendRequestToAppsdk(this.uiaId, function(){}, "msg", "Disconnect", params);
- this._msgApiConnection = null;
- }
-};
-
-systemApp.prototype._selectNotificationListItem = function(controlRef, appData, params)
-{
- if (appData && appData.eventId)
- {
- switch (appData.eventId)
- {
- case 'SelectMessageEmail':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMessageSMS':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
-
- case 'SelectMissedCall':
- var stuff = {
- payload : {
- messageId : appData.messageId,
- }
- };
- framework.sendEventToMmui(this.uiaId, appData.eventId, stuff, params.fromVui);
- break;
- }
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoDevice
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackNoDevice = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.GoBack":
- framework.sendEventToMmui("common", appData);
- break;
-
- case "SelectConnect":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// DisplayOff
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._displayOffUserActivity = function(controlRef, appData, params)
-{
- framework.sendEventToMmui("system", "DisplayOffGUIActivity");
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Disclaimer
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._noMoreDisclaimer = function(controlRef, appData, params)
-{
- framework.sendEventToMmui("system", "DisposeIntroVideo");
-
- // this need only for log
- this._disclaimerTime.remaining = 3500;
- log.debug("Starting a Disclaimer timer with remaining time: " + this._disclaimerTime.remaining);
-
- framework.sendEventToMmui("common", "Global.Yes");
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SystemWarning
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackSystemWarning = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// EnableRVR
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackEnableRVR = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// RVRInstructions
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._selectCallbackRVRInstructions = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnect
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnect = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectBTAudio");
- break;
-
- case "Pandora":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectPandora");
- break;
-
- case "Stitcher":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectStitcher");
- break;
-
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectAhaRadio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-systemApp.prototype._selectSourceReconnect = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "SelectEntertainmentMenu":
- framework.sendEventToMmui(this.uiaId, appData);
- break;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SourceReconnectFailed
-///////////////////////////////////////////////////////////////////////////////
-
-systemApp.prototype._readySourceReconnectFailed = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- switch (this._currentContext.params.payload.audioSource)
- {
- case "BTAudio":
- case "Pandora":
- case "Stitcher":
- case "AhaRadio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedBTAudio");
- break;
-
- case "USB_A":
- case "USB_B":
- case "USBAudio":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedUSB");
- break;
-
- case "CD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedCD");
- break;
-
- case "DVD":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedDVD");
- break;
-
- case "TV":
- this._currentContextTemplate.dialog3Ctrl.setText1Id("ReconnectFailedTV");
- break;
-
- default:
- break;
- }
- }
-};
-
-//Siri EnableRVR context ready to Display Function
-systemApp.prototype._readyEnableRVR = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("SiriDisabled",subMapObj);
-
- }
-};
-
-//Siri SiriLaunchingError context ready to Display Function
-systemApp.prototype._readySiriLaunchingError = function()
-{
- if (this._currentContext.params &&
- this._currentContext.params.payload &&
- this._currentContextTemplate &&
- this._currentContextTemplate.dialog3Ctrl)
- {
- this._CachedDeviceName = this._currentContext.params.payload.deviceName;
- var subMapObj = {nameOfDevice : this._CachedDeviceName}
- this._currentContextTemplate.dialog3Ctrl.setText1Id("DisconnectThenReconnect",subMapObj);
-
- }
-};
-
-systemApp.prototype._selectSourceReconnectFailed = function(controlRef, appData, params)
-{
- switch (appData)
- {
- case "Global.Yes":
- framework.sendEventToMmui("common", appData);
- break;
- }
-};
-
-// Store the Availability Status of Speed Restricted Apps
-systemApp.prototype._StatusMenuChanged = function(appName, isDisabled)
-{
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- var speedRestrictedAppName = this._SpeedRestrictedApps[i].appName;
- if(speedRestrictedAppName.indexOf(appName) === 0)
- {
- this._SpeedRestrictedApps[i].status = isDisabled;
- }
- }
-};
-
-// Update the items for Speed Restricted Message
-systemApp.prototype._updateSpeedRestrictedApps = function(isDisabled)
-{
- var status = null;
- var appName = null;
- for(var i = 0; i < this._SpeedRestrictedApps.length; ++i)
- {
- appName = this._SpeedRestrictedApps[i].appName;
- status = this._SpeedRestrictedApps[i].status;
-
- log.info("AppName : "+appName+" is available or unavailable - (true/false)" +status);
-
- //Checks for Status Availability for the respective AppName
- if(!status)
- {
- this._enableSpeedRestrictedItem(appName, isDisabled, this._masterApplicationDataList);
- }
- // Update the menu list in the current context if needed
- if (this._currentContext && !status)
- {
- switch (this._currentContext.ctxtId)
- {
- case "Communication":
- case "Entertainment":
- case "Applications":
- if (this._currentContextTemplate && this._currentContextTemplate.list2Ctrl)
- {
- var dataList = this._currentContextTemplate.list2Ctrl.dataList;
- for (var j = 0; j < dataList.items.length; ++j)
- {
- if (dataList.items[j].appData.appName === appName)
- {
- log.info("AppName : "+appName+" is found for making it disabled : "+isDisabled);
- dataList.items[j].disabled = isDisabled;
- if (isDisabled)
- {
- // Clear nowplaying icon just in case it was still shown for this now unavailable item
- dataList.items[j].image1 = "";
- }
- this._currentContextTemplate.list2Ctrl.updateItems(j, j);
- }
- }
- }
- break;
- }
- }
- }
-};
-
-// Tell framework that system app has finished loading
-framework.registerAppLoaded("system", null, true);
diff --git a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/systemApp.js.disclaimer b/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/systemApp.js.disclaimer
deleted file mode 100644
index 93cb647..0000000
--- a/app/files/tweaks/config_org/audio_order_AND_no_More_Disclaimer/systemApp.js.disclaimer
+++ /dev/null
@@ -1,14 +0,0 @@
-var UsbAudioAPos = 8;
-var UsbAudioBPos = 9;
-var AuxInPos = null;
-var BluetoothPos = 7;
-var FmRadioPos = 0;
-var AmRadioPos = 1;
-var SdarsRadioPos = 3;
-var DabRadioPos = 2;
-var AhaRadioPos = 4;
-var PandoraPos = 5;
-var StitcherItemPos = 6;
-var CdPlayerPos = 10;
-var DVDItemPos = null;
-var TVItemPos = null;
diff --git a/app/index.html b/app/index.html
index 2a6fc67..ef23bbf 100644
--- a/app/index.html
+++ b/app/index.html
@@ -4,10 +4,10 @@
|** ************************************************************************ **|
|** MZD-AIO-TI **|
|** By: Trezdog44 - Trevor Martin **|
-|** http://mazdatweaks.com **|
+|** https://mazdatweaks.com **|
|** ©2017 Trevelopment **|
|** **|
-|** An Installer And Uninstaller for 40+ 'Tweaks' For the **|
+|** An Installer And Uninstaller for 50+ 'Tweaks' For the **|
|** Mazda MZD Infotainment System. **|
|** **|
|** index.html - The main view. **|
@@ -28,14 +28,6 @@
-
-
-
-
-
-
-
-
@@ -53,8 +45,17 @@
+
+
+
+
+
+
+
+
-
+
+
-
+
@@ -155,20 +156,22 @@
{{menu.save.label}}
{{menu.load.label}}
+
+ {{menu.load.label}} Last Compile
{{menu.resetoptions.label}}
{{menu.reloadapp.label}}
Full System Restore
-
+
CASDK
-
+
-
+