Skip to content

Commit

Permalink
Merge pull request #65 from smartdevicelink/fix/proprietary_ptu_flow
Browse files Browse the repository at this point in the history
Fix PTU retry flow with `PROPRIETARY` SystemRequests
  • Loading branch information
jacobkeeler authored Apr 11, 2018
2 parents c86505c + c0a349e commit 7e66c02
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
21 changes: 6 additions & 15 deletions app/controller/SettingsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,21 +341,12 @@ SDL.SettingsController = Em.Object.create(
1000;
SDL.SDLModel.data.policyUpdateRetry.timer = setTimeout(
function() {
if(FLAGS.ExternalPolicies === true) {
FFW.ExternalPolicies.pack({
type: 'PROPRIETARY',
policyUpdateFile: SDL.SettingsController.policyUpdateFile,
url: SDL.SDLModel.data.policyURLs[0].url,
appID: SDL.SDLModel.data.policyURLs[0].appID
})
} else {
FFW.BasicCommunication.OnSystemRequest(
'PROPRIETARY',
SDL.SettingsController.policyUpdateFile,
SDL.SDLModel.data.policyURLs[0].url,
SDL.SDLModel.data.policyURLs[0].appID
);
}
FFW.BasicCommunication.OnSystemRequest(
'PROPRIETARY',
SDL.SettingsController.policyUpdateFile,
SDL.SDLModel.data.policyURLs[0].url,
SDL.SDLModel.data.policyURLs[0].appID
);
SDL.SettingsController.policyUpdateRetry();
}, SDL.SDLModel.data.policyUpdateRetry.oldTimer
);
Expand Down
12 changes: 9 additions & 3 deletions ffw/BasicCommunicationRPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ FFW.BasicCommunication = FFW.RPCObserver
} else {
this.OnSystemRequest('PROPRIETARY');
}
SDL.SettingsController.policyUpdateRetry();

if (FLAGS.ExternalPolicies === true) {
SDL.SettingsController.policyUpdateRetry();
}
}
},
/**
Expand Down Expand Up @@ -289,6 +292,11 @@ FFW.BasicCommunication = FFW.RPCObserver
case 'UP_TO_DATE':
{
messageCode = 'StatusUpToDate';
//Update is complete, stop retry sequence
if (FLAGS.ExternalPolicies === true) {
SDL.SettingsController.policyUpdateRetry('ABORT');
}
SDL.SettingsController.policyUpdateFile = null;
break;
}
case 'UPDATING':
Expand Down Expand Up @@ -397,13 +405,11 @@ FFW.BasicCommunication = FFW.RPCObserver
SDL.InfoAppsView.showAppList();
}
if (request.method == 'BasicCommunication.SystemRequest') {
SDL.SettingsController.policyUpdateRetry('ABORT');
if(FLAGS.ExternalPolicies === true) {
FFW.ExternalPolicies.unpack(request.params.fileName);
} else {
this.OnReceivedPolicyUpdate(request.params.fileName);
}
SDL.SettingsController.policyUpdateFile = null;
this.sendBCResult(
SDL.SDLModel.data.resultCode.SUCCESS,
request.id,
Expand Down

0 comments on commit 7e66c02

Please # to comment.