Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix logic for when multiple HMI_FULL notifications are sent after eac…
…h other as a result of ChoiceSets/Alerts
  • Loading branch information
renonick87 committed Mar 22, 2021
commit 4c30aa3fbd551ff5106996a997957507ecff64c0
5 changes: 3 additions & 2 deletions examples/js/hello-sdl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@
this._logPermissions();

// wait for the FULL state for more functionality
if (hmiLevel === SDL.rpc.enums.HMILevel.HMI_FULL && this._prevHmiLevel !== SDL.rpc.enums.HMILevel.HMI_FULL) {
const prevHmiFull = this._prevHmiLevel !== SDL.rpc.enums.HMILevel.HMI_FULL
this._prevHmiLevel = hmiLevel;
if (hmiLevel === SDL.rpc.enums.HMILevel.HMI_FULL && prevHmiFull) {
const screenManager = this._sdlManager.getScreenManager();
const isRpcAllowed = (rpc) => {
if (!this._permissionManager) {
Expand Down Expand Up @@ -255,7 +257,6 @@

screenManager.presentAlert(alertView, alertCompletionListener);
}
this._prevHmiLevel = hmiLevel;
}

async _sleep (timeout = 1000) {
Expand Down
5 changes: 3 additions & 2 deletions examples/node/hello-sdl-tcp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ class AppClient {
this._logPermissions();

// wait for the FULL state for more functionality
if (hmiLevel === SDL.rpc.enums.HMILevel.HMI_FULL && this._prevHmiLevel !== SDL.rpc.enums.HMILevel.HMI_FULL) {
const prevHmiFull = this._prevHmiLevel !== SDL.rpc.enums.HMILevel.HMI_FULL;
this._prevHmiLevel = hmiLevel;
if (hmiLevel === SDL.rpc.enums.HMILevel.HMI_FULL && prevHmiFull) {
const screenManager = this._sdlManager.getScreenManager();
const isRpcAllowed = (rpc) => {
if (!this._permissionManager) {
Expand Down Expand Up @@ -252,7 +254,6 @@ class AppClient {

screenManager.presentAlert(alertView, alertCompletionListener);
}
this._prevHmiLevel = hmiLevel;
}

_onButtonListener (buttonName, onButton) {
Expand Down
5 changes: 3 additions & 2 deletions examples/node/hello-sdl/AppClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ class AppClient {
this._logPermissions();

// wait for the FULL state for more functionality
if (hmiLevel === SDL.rpc.enums.HMILevel.HMI_FULL && this._prevHmiLevel !== SDL.rpc.enums.HMILevel.HMI_FULL) {
const prevHmiFull = this._prevHmiLevel !== SDL.rpc.enums.HMILevel.HMI_FULL;
this._prevHmiLevel = hmiLevel;
if (hmiLevel === SDL.rpc.enums.HMILevel.HMI_FULL && prevHmiFull) {
this._hmiFull = true;
this._checkReadyState();
}
this._prevHmiLevel = hmiLevel;
}

async _checkReadyState () {
Expand Down