Skip to content

Commit

Permalink
Merge pull request #461 from smartdevicelink/develop
Browse files Browse the repository at this point in the history
Release 5.4.0
  • Loading branch information
iCollin authored Nov 5, 2020
2 parents 38d5a9d + 7e6fd1c commit 3bbcd28
Show file tree
Hide file tree
Showing 81 changed files with 5,244 additions and 1,571 deletions.
2 changes: 2 additions & 0 deletions app/AppViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SDL.AppViews = Em.ContainerView.extend(
SDL.HomeView,
SDL.MediaView,
SDL.NavigationAppView,
SDL.WebEngineView,
SDL.InfoView,
SDL.PhoneView,
SDL.ClimateView,
Expand All @@ -69,6 +70,7 @@ SDL.AppViews = Em.ContainerView.extend(
SDL.BottomControls,
SDL.TTSPopUp,
SDL.AlertPopUp,
SDL.SubtleAlertPopUp,
SDL.ServiceUpdatePopUp,
SDL.AlertManeuverPopUp,
SDL.AudioPassThruPopUp,
Expand Down
1 change: 0 additions & 1 deletion app/Flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ FLAGS = Em.Object.create(
Navigation: null,
CAN: null,
RC: null,
steeringWheelLocation: 'LEFT',
/**
* 0 - G
* 1 - R
Expand Down
33 changes: 33 additions & 0 deletions app/StateManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ var StateManager = Em.StateManager.extend(
);
this._super();
},
rpccontrol: Em.State.create({
rpcconfig: Em.State.create({}),
rpcwaypointconfig: Em.State.create({}),
rpcvehicledataconfig: Em.State.create({}),
rpcgetivdconfig: Em.State.create({})
}
),
policies: Em.State.create(
{
statisticsInfo: Em.State.create({}),
Expand All @@ -191,6 +198,14 @@ var StateManager = Em.StateManager.extend(
}
}
),
ccpuEditor: Em.State.create(
{
enter: function() {
this._super();
SDL.SettingsController.set('editedCcpuVersionValue', SDL.SDLModel.data.ccpuVersion);
}
}
),
deviceConfig: Em.State.create(
{
enter: function() {
Expand Down Expand Up @@ -475,6 +490,24 @@ var StateManager = Em.StateManager.extend(
}
}
),
webViewApp: Em.State.create(
{
modelBinding: 'SDL.RCModulesController',
enter: function() {
this._super();
SDL.SDLController.onEventChanged('player', false);
SDL.SDLController.onEventChanged(this.name, true);
SDL.SDLController.showWebViewApp(SDL.SDLController.model.appID);
},
exit: function() {
this._super();
SDL.SDLController.onEventChanged(this.name, false);
SDL.SDLModel.data.set('limitedExist', false);
SDL.SDLController.hideWebApps();
SDL.SDLController.deactivateApp();
}
}
),
/** Navigation state */
navigation: Em.State.create(
{
Expand Down
11 changes: 1 addition & 10 deletions app/controller/ClimateController.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ SDL.ClimateController = Em.Object.create(
return (data.unit == 'CELSIUS'
? data.value
: Math.round((data.value - 32) * 5 / 9));
},
getClimateControlData: function() {
var properties = this.model.getDataForSending();
var climateControlData = this.model.getClimateControlData();
var data = SDL.SDLController.filterObjectProperty(climateControlData, properties);
if(!climateControlData.climateEnable) {
data['currentTemperature'] = this.model.getClimateControlData().currentTemperature;
}
return data;
},
}
}
);
110 changes: 58 additions & 52 deletions app/controller/InfoController.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,38 +158,51 @@ SDL.InfoController = Em.Object.create(
setAppProperties: function(old_properties, new_properties) {
this.set('editedAppPropertiesToApply', new_properties);

if ((!'enabled' in old_properties || old_properties['enabled'] == false) &&
new_properties['enabled'] === true) {
let that = this;
const policyAppID = new_properties['policyAppID'];
let is_app_installation_required = function() {
const old_app_id = old_properties['policyAppID'];
const new_app_id = new_properties['policyAppID'];

let get_app_title = function() {
let title = policyAppID;
if ('nicknames' in new_properties && new_properties['nicknames'].length > 0) {
title = new_properties['nicknames'][0];
}
return title;
};
const old_enabled_state = ('enabled' in old_properties) ? old_properties['enabled'] : false;
const new_enabled_state = ('enabled' in new_properties) ? new_properties['enabled'] : false;

let on_installation_failed = function() {
SDL.PopUp.create().appendTo('body').popupActivate(
`Can't install "${get_app_title()}" app from applications store...`, null, false
);
SDL.WebAppSettingsView.editorAppSettings = old_properties;
SDL.WebAppSettingsView.showProperties();
FFW.RPCSimpleClient.disconnect();
};
if (old_app_id != new_app_id) {
return new_enabled_state;
}

that.downloadAppBundle(policyAppID)
.then( function() {
Em.Logger.log(`App store: app installed successfully`);
FFW.BasicCommunication.SetAppProperties(new_properties);
FFW.RPCSimpleClient.disconnect();
}, on_installation_failed);
return;
return new_enabled_state && !old_enabled_state;
}

FFW.BasicCommunication.SetAppProperties(new_properties);
if (!is_app_installation_required()) {
FFW.BasicCommunication.SetAppProperties(new_properties);
return;
}

let that = this;
const policyAppID = new_properties['policyAppID'];

let get_app_title = function() {
let title = policyAppID;
if ('nicknames' in new_properties && new_properties['nicknames'].length > 0) {
title = new_properties['nicknames'][0];
}
return title;
};

let on_installation_failed = function() {
SDL.PopUp.create().appendTo('body').popupActivate(
`Can't install "${get_app_title()}" app from applications store...`, null, false
);
SDL.WebAppSettingsView.editorAppSettings = old_properties;
SDL.WebAppSettingsView.showProperties();
FFW.RPCSimpleClient.disconnect();
};

that.downloadAppBundle(policyAppID)
.then( function() {
Em.Logger.log(`App store: app installed successfully`);
FFW.BasicCommunication.SetAppProperties(new_properties);
FFW.RPCSimpleClient.disconnect();
}, on_installation_failed);
},

/**
Expand Down Expand Up @@ -325,15 +338,23 @@ SDL.InfoController = Em.Object.create(

if (policyAppID in SDL.SDLModel.webApplicationFramesMap) {
let frame = SDL.SDLModel.webApplicationFramesMap[policyAppID];
document.body.removeChild(frame);
const web_engine_view = document.getElementById("webEngineView");
if (web_engine_view) {
web_engine_view.removeChild(frame);
}
}

const frame_name = `web_app_frame_${policyAppID}`;
let web_app_frame = document.createElement("iframe");
web_app_frame.name = frame_name;
web_app_frame.id = frame_name;
web_app_frame.className = "InvisibleFrame";
document.body.appendChild(web_app_frame);
web_app_frame.className = 'WebEngineFrame';
web_app_frame.hidden = false;

const web_engine_view = document.getElementById("webEngineView");
if (web_engine_view) {
web_engine_view.appendChild(web_app_frame);
}

SDL.SDLModel.webApplicationFramesMap[policyAppID] = web_app_frame;

Expand Down Expand Up @@ -400,9 +421,9 @@ SDL.InfoController = Em.Object.create(
*/
downloadAppBundle: function(policyAppID) {
return new Promise( (resolve, reject) => {
if (!policyAppID in SDL.InfoController.appPackageDownloadUrlsMap) {
Em.Logger.log(`App store: download URL for ${policyAppID} was not found`);
reject();
if (!(policyAppID in SDL.InfoController.appPackageDownloadUrlsMap)) {
Em.Logger.log(`App store: download URL for ${policyAppID} was not found. Assume bundle was installed manually.`);
return resolve();
}

let download_url = SDL.InfoController.appPackageDownloadUrlsMap[policyAppID];
Expand All @@ -422,7 +443,7 @@ SDL.InfoController = Em.Object.create(

if (params.success == false) {
Em.Logger.log('App store: Bundle downloading was not successful');
reject();
return reject();
}

Em.Logger.log('App store: Bundle was downloaded successfully');
Expand Down Expand Up @@ -468,7 +489,7 @@ SDL.InfoController = Em.Object.create(

if (params.success == false) {
Em.Logger.log('App store: Manifest loading was not successful');
reject();
return reject();
}

Em.Logger.log('App store: Manifest was loaded successfully');
Expand Down Expand Up @@ -503,13 +524,13 @@ SDL.InfoController = Em.Object.create(
}
catch {
Em.Logger.log(`App store: failed to parse JSON content`);
reject();
return reject();
}

Em.Logger.log(`App store: manifest parsed successfully`);
if (!('entrypoint' in bundle_json)) {
Em.Logger.log(`App store: entrypoint is not specified - use default`);
resolve("index.html");
return resolve("index.html");
}

resolve(bundle_json['entrypoint']);
Expand Down Expand Up @@ -558,21 +579,6 @@ SDL.InfoController = Em.Object.create(
if (SDL.SDLController.model) {
SDL.SDLController.model.set('active', true);
}
/**
* Go to SDL state
*/
if (SDL.SDLController.model.appType) {
for (var i = 0; i < SDL.SDLController.model.appType.length; i++) {
if (SDL.SDLController.model.appType[i] == 'NAVIGATION' ||
SDL.SDLController.model.appType[i] == 'PROJECTION') {
SDL.BaseNavigationView.update();
SDL.States.goToStates('navigationApp.baseNavigation');
return;
}
}
}
SDL.States.goToStates('info.nonMedia');
//SDL.States.goToStates('media.sdlmedia');
}
}
);
Loading

0 comments on commit 3bbcd28

Please sign in to comment.