Skip to content

Commit

Permalink
Fix/Reset AudioStreamingIndicator to PLAY_PAUSE (#572)
Browse files Browse the repository at this point in the history
* Reset audioStreamingIndicator to PLAY_PAUSE if undefined in request

* Address review comment

* Reset audiostreamingIndicator to PLAY_PAUSE on HMI_NONE

* Remove unused RPC case UI.SetAudioStreamingIndicator
  • Loading branch information
ShobhitAd authored May 28, 2021
1 parent dbc83f8 commit 634a3c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
6 changes: 3 additions & 3 deletions app/controller/sdl/Abstract/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1504,16 +1504,16 @@ SDL.SDLController = Em.Object.extend(
/**
* SetAudioStreamingIndicator notification handler
*
* @param {Object} params
* @param {Object} audioStreamingIndicator audioStreamingIndicator name
* @constructor
* @return {boolean}
*/
SetAudioStreamingIndicator: function(params) {
SetAudioStreamingIndicator: function(audioStreamingIndicator) {
if (SDL.SDLController.model) {
SDL.SDLController.model.set(
'mediaPlayerIndicator',
SDL.SDLModel.data.
mediaPlayerIndicatorEnum[params.audioStreamingIndicator]
mediaPlayerIndicatorEnum[audioStreamingIndicator]
);
return true;
}
Expand Down
1 change: 1 addition & 0 deletions app/controller/sdl/MediaController.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ SDL.SDLMediaController = Em.Object.create(
for (var i = 0; i < SDL.SDLModel.data.registeredApps.length; i++) {
if (SDL.SDLModel.data.registeredApps[i].get('appID') != appID) { continue; }

SDL.SDLController.SetAudioStreamingIndicator("PLAY_PAUSE")
SDL.SDLModel.data.registeredApps[i].set('forwardSeekIndicator', {type: "TRACK", seekTime: null})
SDL.SDLModel.data.registeredApps[i].set('backSeekIndicator', {type: "TRACK", seekTime: null})
}
Expand Down
24 changes: 5 additions & 19 deletions ffw/UIRPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,11 @@ FFW.UI = FFW.RPCObserver.create(
if(request.params.enableSeek) {
this.OnSeekMediaClockTimer(request.params.startTime, request.params.appID);
}
if(request.params.audioStreamingIndicator) {
SDL.SDLController.SetAudioStreamingIndicator(request.params)
}

let indicator = (request.params.audioStreamingIndicator) ? request.params.audioStreamingIndicator
: "PLAY_PAUSE";
SDL.SDLController.SetAudioStreamingIndicator(indicator);

this.sendUIResult(resultCode, request.id, request.method);
} else {
this.sendError(
Expand Down Expand Up @@ -1660,22 +1662,6 @@ FFW.UI = FFW.RPCObserver.create(
);
break;
}
case 'UI.SetAudioStreamingIndicator':
{
if (SDL.SDLController.SetAudioStreamingIndicator(request.params)) {
this.sendUIResult(
SDL.SDLModel.data.resultCode.SUCCESS, request.id, request.method
);
} else {
this.sendError(
SDL.SDLModel.data.resultCode.SUCCESS,
request.id,
request.method,
'No application in FULL mode'
);
}
break;
}
case 'UI.CreateWindow':
{
const resultCode = FFW.RPCHelper.getCustomResultCode(request.params.appID, 'uiCreateWindow');
Expand Down

0 comments on commit 634a3c2

Please sign in to comment.