-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDL-0293] Enable OEM exclusive apps support #374
[SDL-0293] Enable OEM exclusive apps support #374
Conversation
@santhanamk could you please start Ford review? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ymalovanyi I have reviewed the PR, and have left a few comments/suggestions. Please take a look whenever you get the chance.
@@ -72,6 +72,12 @@ _ControlFrameTags.RPC = Object.freeze({ | |||
VIDEO_SERVICE_TRANSPORTS: 'videoServiceTransports', | |||
/** Auth token to be used for log in into services **/ | |||
AUTH_TOKEN: 'authToken', | |||
VEHICLE_MAKE: 'make', | |||
VEHICLE_MODEL: 'model', | |||
VEHICLE_MODEL_YEAR: 'modelYear', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ymalovanyi On line 77, does the tag name need to be model year
like it is defined in the proposal or is modelYear
okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this is just a typo in the proposal, on testing alongside the core we received modelYear
thus included it in camelcase instead of space-separated.
@@ -406,6 +438,23 @@ class _SdlProtocolBase { | |||
const version = sdlPacket.getVersion(); | |||
const serviceType = sdlPacket.getServiceType(); | |||
if (version >= 5) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ymalovanyi On line 440, does this need to be >= 6
instead of >= 5
? In the proposal the example method onPacketRead
has it as > = 6
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our initial implementation was exactly with >= 6
according to the proposal, but testing alongside the core we never met that condition, it seems the protocol version is not increased with this proposal. Therefore we rolled back to 5
.
* @param {String} systemHardwareVersion - hardware version of the system. | ||
* @returns {Boolean} Return true if this session should continue, false if the session should end | ||
*/ | ||
onVehicleTypeReceived (vehicleType, systemSoftwareVersion, systemHardwareVersion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ymalovanyi In the proposal the method onVehicleTypeReceived
is defined like: onVehicleTypeReceived (sdlManager, vehicleType) {}...
. Does your definition starting on line 210 need to match with what the proposal has?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sdlManager
parameter is not required in the context of the current library implementation, we assume this was added in the proposal by mistake. systemSoftwareVersion
and systemHardwareVersion
parameters now under discussion here smartdevicelink/sdl_evolution#1108 this PR already includes changes of that revision.
* Set the SystemHardwareVersion | ||
* @since SmartDeviceLink 7.1.0 | ||
* @param {String} version - The hardware version of the system - The desired SystemHardwareVersion. | ||
* {'string_min_length': 1, 'string_max_length': 500} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ymalovanyi Are these defined somewhere? For example, the string_min_length 1 string_max_length 500
? It would be nice to cross verify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is autogenerated code, no RPC classes in the library for now those cross-verify such parameters.
@@ -484,6 +510,17 @@ class _LifecycleManager { | |||
this._cleanProxy(); | |||
} | |||
|
|||
if (this._rpcSpecVersion.isNewerThan(new Version(7, 0, 0)) === 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ymalovanyi Do the unit tests in LifecycleManagerTests.js
need to be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@santhanamk Added tests for new methods.
lib/js/src/session/_SdlSession.js
Outdated
* @param {String} systemHardwareVersion - hardware version of the system. | ||
* @returns {Boolean} Return true if this session should continue, false if the session should end | ||
*/ | ||
onVehicleTypeReceived (vehicleType, systemSoftwareVersion, systemHardwareVersion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ymalovanyi In the proposal this method is defined as onVehicleTypeReceived (sdlManager, vehicleType) {}
. Does your method definition need to change to match with the proposal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @vladmu for the clarifications. I have approved this PR.
…xclusive_app_support
…peReceived and adjust the code to match the current 0293 proposal state * added didReceiveVehicleType flag, to avoid double firing onVehicleTypeReceived in RAI response
@santhanamk I apologize, I should ask you to re-review the PR. I have made some changes to reflect the current state of the proposal instead of unapproved revision. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladmu @ymalovanyi I have reviewed the PR. I have one suggestion. Please take a look whenever you get a chance.
@@ -38,14 +38,14 @@ import { _FrameType } from './enums/_FrameType.js'; | |||
import { _MessageFrameAssembler } from './_MessageFrameAssembler.js'; | |||
import { _SdlPacket } from './_SdlPacket.js'; | |||
import { _ControlFrameTags } from './enums/_ControlFrameTags.js'; | |||
import { _BitConverter } from './../util/_BitConverter.js'; | |||
import { _BitConverter } from '../util/_BitConverter.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ymalovanyi @vladmu Do you need unit tests for this? For example, sdl java suite has SdlProtocolTests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@santhanamk we don't need the test for this particular line as this is just a shortenest path identical to previous but aligned with the style of other imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladmu I meant do you need unit tests overall for the changes made to this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@santhanamk it is hard to define expectations of such tests in the order of the library and this class as we don't have any tests of previous functionality covered here. We appreciate any help in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladmu Ok no problem. It was an optional request, as these were not existing before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ymalovanyi @vladmu I have approved this PR.
Hi @jordynmackool This PR is ready for Livio review. |
// TODO: awaiting 0293 revisions to process those fields | ||
const systemHardwareVersion = sdlPacket.getTag(_ControlFrameTags.RPC.StartServiceACK.VEHICLE_SYSTEM_HARDWARE_VERSION); | ||
const systemSoftwareVersion = sdlPacket.getTag(_ControlFrameTags.RPC.StartServiceACK.VEHICLE_SYSTEM_SOFTWARE_VERSION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method seems unfinished since these values are never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@renonick87 no, the method is finished and reflects the current state of the proposal. Without revisions, we receive those fields here but never use or process them. The TODO was added to reflect that the processing needs to be added after accepting the revisions.
/** | ||
* Gets the Vehicle details received in StartService ACK protocol message | ||
* @returns {VehicleType|null} - A RPC VehicleType struct received from the packet if exists null otherwise. | ||
*/ | ||
_getVehicleType(sdlPacket) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation here is missing the @param tag for the sdlPacket
parameter. There also needs to be a space before the function parentheses on line 277. Use the command npm run lint
to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
vehicleType | ||
&& this._sdlProtocolListener !== null | ||
&& typeof this._sdlProtocolListener.onVehicleTypeReceived === 'function' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation for lines 441-443 is incorrect. There is an indentation of 14 spaces but it should be 16. Use the command npm run lint
to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
lib/js/src/session/_SdlSession.js
Outdated
* A way to determine if VehicleType already received | ||
* @returns {Boolean} Return true if received | ||
*/ | ||
didReceiveVehicleType() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There needs to be a space before the function parentheses on line 177. Use the command npm run lint
to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ymalovanyi I've done an initial review of this PR but will hold off on a more thorough review until after the core and HMI PRs are ready to be tested against. See my comments for requested changes and please run npm run lint
to ensure that all contributions pass lint validation.
@ymalovanyi the proposal markdown file has been updated per the revisions included in the accepted with revisions review issue: SDL 0293 Revisions - Enable OEM exclusive apps support. Please make the needed updates to this PR and then tag @renonick87 to re-review when ready. Thanks! |
@renonick87 all required adjustments were made, the PR is ready for review. |
@ymalovanyi, the Java Suite team has written a new PR, smartdevicelink/sdl_java_suite#1618, for this proposal. Please update this PR or open a new one to match. |
@renonick87 I did review the new Java implementation and this JS seems to look the same at first glance. Did you compare on your own what is missed here? |
@ymalovanyi @vladmu The Java Suite PR 1681 has been approved on our side and tested with Core for this feature. We have not compared the differences between that PR and this PR. To ensure app library alignment, please review the approved Java Suite library PR and make the necessary updates to this PR to align. Once all the needed updates are complete, please tag @renonick87 for a re-review. Thanks! |
@vladmu The PRs does seem similar at first glance but there are differences in the exact implementation. To name a few differences: all logic in the ProtocolBase has been moved, an existing listener has been updated in the SdlSessionListener, and the protocol version is updated to 5.4. There are likely other differences that I didn't cover so please review the Java PR and then update this PR to ensure that it matches the Java implementation. |
@renonick87 I have aligned the code to smartdevicelink/sdl_java_suite#1618 PR and tested this against the core and hmi. Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladmu See my review comments for some requested revisions.
@@ -216,7 +216,7 @@ class _SdlProtocolBase { | |||
*/ | |||
_setVersion (version) { | |||
if (version > 5) { | |||
this._protocolVersion = new Version('5.1.0'); // protect for future, proxy only supports v5 or lower | |||
this._protocolVersion = new Version('5.4.0'); // protect for future, proxy only supports v5 or lower |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not need to be changed. This method is for setting the major version based on the packet header. The more accurate protocol version is set in the _handleStartServiceACK method based on the packet payload.
@@ -484,6 +518,16 @@ class _LifecycleManager { | |||
this._cleanProxy(); | |||
} | |||
|
|||
if (!this._didCheckSystemInfo) { | |||
this._didCheckSystemInfo = true; | |||
const systemInfo = new SystemInfo(registerAppInterfaceResponse.getVehicleType(), registerAppInterfaceResponse.getSystemSoftwareVersion()) ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a check before creating the SystemInfo object that either vehicleType or systemSoftwareVersion exist.
if (vehicleType || systemSoftwareVersion)
@renonick87 I've processed all your comments. Please review. |
Fixes #367
Risk
This PR makes minor API changes.
Testing Plan
Unit Tests
Core Tests
StartSessionACK
packet and processed correctlyRAI
response and processed correctlyRAI
response is used whenStartSessionACK
has no Vehicle DetailsonVehicleTypeReceived
callback set inSdlManagerListener
Core version / branch / commit hash / module tested against: LuxoftSDL/sdl_core#sdl_0293_enable_oem_exclusive_apps_support
HMI name / version / branch / commit hash / module tested against: LuxoftSDL/sdl_hmi#sdl_0293_enable_oem_exclusive_apps_support
Summary
Applied [SDL-0293] Enable OEM exclusive apps support changes
Changelog
Breaking Changes
N/A
Enhancements
onVehicleTypeReceived
,setOnVehicleTypeReceved
methods to propagate Vehicle Type info to the application layer and check Vehicle Type on_SdlProtocolBase.js
and_LifecycleManager.js
levelsBug Fixes
N/A
Tasks Remaining:
N/A
CLA