Skip to content

Commit

Permalink
Merge pull request #268 from smartdevicelink/release/0.8.1
Browse files Browse the repository at this point in the history
Hotfix Release 0.8.1
  • Loading branch information
ShobhitAd authored May 1, 2020
2 parents 73c7ff4 + 62301dd commit 8bdd258
Show file tree
Hide file tree
Showing 7 changed files with 2,127 additions and 2,095 deletions.
4,170 changes: 2,094 additions & 2,076 deletions build/bundle.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/js/AppStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ class AppStore extends React.Component {

return res.json();
}).then((json) => {
store.dispatch(updateAvailableAppStoreApps(json.map((app) => {
var apps = [];
if (json.data && json.data.applications) {
apps = json.data.applications
} else {
apps = json
}
store.dispatch(updateAvailableAppStoreApps(apps.map((app) => {
if ('icon_url' in app) {
app.iconUrl = app.icon_url;
delete app.icon_url;
Expand Down
17 changes: 9 additions & 8 deletions src/js/Controllers/BCController.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ class BCController {
return {"rpc": RpcFactory.MixingAudioResponse(rpc)}
case "PolicyUpdate":
store.dispatch(policyUpdate(rpc.params.file, rpc.params.retry, rpc.params.timeout))
sdlController.getPolicyConfiguration("module_config", "endpoints");
var state = store.getState()
if(flags.ExternalPolicies || state.system.ptuWithModemEnabled) {
sdlController.getPolicyConfiguration("module_config", "endpoints");
}
else {
this.onSystemRequest(rpc.params.file);
}
return true;
case "SystemRequest":
if(flags.ExternalPolicies) {
Expand Down Expand Up @@ -144,13 +150,8 @@ class BCController {
onExitAllApplications(reason) {
this.listener.send(RpcFactory.OnExitAllApplicationsNotification(reason))
}
onSystemRequest(policyFile, urls) {
for (var i in urls) {
var appID = urls[i].appID
var url = urls[i].url
this.listener.send(RpcFactory.OnSystemRequestNotification(policyFile, url, appID))
}

onSystemRequest(policyFile, url, appID) {
this.listener.send(RpcFactory.OnSystemRequestNotification(policyFile, url, appID))
}
onAllowSDLFunctionality(allowed, source) {
this.listener.send(RpcFactory.OnAllowSDLFunctionality(allowed, source))
Expand Down
6 changes: 3 additions & 3 deletions src/js/Controllers/ExternalPoliciesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ class ExternalPoliciesController {
}
}
onPackMessage(evt) {
bcController.onSystemRequest(this.sysReqParams.fileName, this.sysReqParams.urls)
bcController.onSystemRequest(this.sysReqParams.fileName, this.sysReqParams.urls[0].url)
this.retryCount = 0;
this.retryTimeout = 0;
this.policyUpdateRetry();

}
onUnpackMessage(evt) {
sdlController.onReceivedPolicyUpdate(evt.data)
Expand All @@ -88,7 +87,8 @@ class ExternalPoliciesController {

this.policyUpdateRetryTimer = setTimeout(
function() {
bcController.onSystemRequest(this.sysReqParams.policyUpdateFile, this.sysReqParams.urls)
var endpoint = this.sysReqParams.urls[this.retryCount % this.sysReqParams.urls.length];
bcController.onSystemRequest(this.sysReqParams.fileName, endpoint.url)
this.policyUpdateRetry();
}.bind(this), this.retryTimeout
);
Expand Down
1 change: 1 addition & 0 deletions src/js/Controllers/FileSystemController.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class FileSystemController extends SimpleRPCClient {
reject();
}
xhr.open('POST', url)
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(pts_data)
});
}
Expand Down
15 changes: 10 additions & 5 deletions src/js/Controllers/RpcFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,16 +413,21 @@ class RpcFactory {
})
}
static OnSystemRequestNotification(policyFile, url, appID) {
return ({
var msg = {
'jsonrpc': '2.0',
'method': 'BasicCommunication.OnSystemRequest',
'params': {
'requestType': 'PROPRIETARY',
'url': url,
'fileName': policyFile,
'appID': appID
'fileName': policyFile
}
})
}
if (url) {
msg.params.url = url
}
if (appID) {
msg.params.appID = appID
}
return (msg)
}
static OnReceivedPolicyUpdate(policyFile) {
return ({
Expand Down
5 changes: 3 additions & 2 deletions src/js/Controllers/SDLController.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ class SDLController {
retry: state.system.policyRetry,
timeout: state.system.policyTimeout
})
} else {
bcController.onSystemRequest(state.system.policyFile, state.system.urls)
}
else {
bcController.onSystemRequest(state.system.policyFile)
}
};

Expand Down

0 comments on commit 8bdd258

Please sign in to comment.