Skip to content
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

Feature/0293 oem android specific #1604

Merged

Conversation

kboskin
Copy link
Contributor

@kboskin kboskin commented Jan 14, 2021

Fixes #1588

This PR is [ready] for review.

Risk

This PR makes [minor] API changes.

Testing Plan

  • I have verified that I have not introduced new warnings in this PR (or explain why below)
  • I have run the unit tests with this PR
  • I have tested this PR against Core and verified behavior (if applicable, if not applicable, explain why below).
  • I have tested Android, Java SE, and Java EE

Core Tests

  • Check that app receives VehicleType in the SDL receiver of App and decides if it should proceed or not
  • Check that it`s possible to connect with App w/o metadata params
  • Connect with the non-Ford app in the XML to the Ford Vehicle, check that notification doesn't appear, unregister the process executed
  • Connect with the Ford app in the XML to the Ford Vehicle, check that connection established, SDL use case continues
  • Check that there are no errors when App connects with OEM make data, but w/o model/any other non-mandatory
  • For BT connection: check that after the app closed and relaunch the app start SDL service
  • Check that app sends startService msg and reads the VehicleData from the response when the MultiplexTransport has connected and executes exclusive app filtering logic

Test report

Core version / branch / commit hash / module tested against
HMI name / version / branch / commit hash / module tested against

Unit Tests

  • AndroidToolsTests link

    • Test testVehicleTypeSave tests if the VehicleType serialized and stored correctly in the shared preferences (persistent app storage).
      Expected behavior - serialization/deserialization works properly, the object is saved in the persistent storage
  • SdlAppInfoTests link

    • Existing tests are updated to be executed with a method containing the new parameter (context)
    • Test testDeserializeVehicleInfo checks the deserialization process of the VehicleType configured in the XML by the developer works and compares deserialized information with the object programmatically configured.
      Expected behavior - objects are identical
    • Test testVehicleTypeSupported checks the logic of determining if the VehicleType passed as an argument is present in the list of VehicleType retrieved from the mock XML file (XML configured by developer in future).
      Expected behavior - passed valid object is considered as present in the predefined list, XML deserialization works fine, the final deserialized list contains passed object
    • Test testVehicleTypeNotSupported tests the reversed logic of testVehicleTypeSupported
  • VehicleTypeTests link

    • Introduced tests are testing a new constructor of the object. These tests are needed to cover the Android-specific behavior, the platform returns from the persistent storage HashMap object (platform-specific).
      Expected behavior - all the data, which was in the object should serialize/deserialize correctly

Summary

Changes according to #1588

CLA

kboskin added 2 commits January 13, 2021 14:19
- Implement Android specific part
- Fix tag name
@a-prykho
Copy link

@santhanamk could you please start Ford review? Thanks

kboskin added 10 commits January 18, 2021 11:45
- Fix hardware version
- Fix supported_vehicle_type.xml
- Applied logs
- Remove the check
- Remove the check
- Remove the check
- Remove the check
- Handle NPE
- Add mocks
- Update the deserialization function
Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KostyaBoss I have reviewed this PR, and have given some suggestions. Please take a look whenever you get the chance.

kboskin added 2 commits January 20, 2021 12:52
- Update the deserialization function, fix shared preferences
- Update the logic
Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KostyaBoss I have reviewed your latest commits, and have provided some feedback. Please take a look whenever you get the chance.

- Update parsing method
Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KostyaBoss I reviewed your latest commit, and provided more feedback. Please review everything whenever you get the chance.

kboskin added 3 commits January 22, 2021 13:29
@kboskin
Copy link
Contributor Author

kboskin commented Jan 22, 2021

@santhanamk there were additional changes made, please, re-review

@codecov
Copy link

codecov bot commented Jan 22, 2021

Codecov Report

Merging #1604 (25eb526) into develop (e6836ba) will decrease coverage by 0.31%.
The diff coverage is 30.76%.

❗ Current head 25eb526 differs from pull request most recent head ee95166. Consider uploading reports for the commit ee95166 to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1604      +/-   ##
=============================================
- Coverage      54.46%   54.14%   -0.32%     
- Complexity      5407     5433      +26     
=============================================
  Files            555      555              
  Lines          24746    25074     +328     
  Branches        3156     3230      +74     
=============================================
+ Hits           13477    13577     +100     
- Misses         10095    10307     +212     
- Partials        1174     1190      +16     
Impacted Files Coverage Δ
...martdevicelink/transport/SdlBroadcastReceiver.java 3.04% <0.00%> (-0.18%) ⬇️
...link/transport/USBAccessoryAttachmentActivity.java 0.00% <0.00%> (ø)
...com/smartdevicelink/util/IntegrationValidator.java 0.00% <0.00%> (ø)
...anagers/screen/choiceset/BaseChoiceSetManager.java 43.52% <0.00%> (-0.37%) ⬇️
...gers/screen/choiceset/PreloadChoicesOperation.java 18.80% <0.00%> (-1.57%) ⬇️
...vicelink/managers/screen/menu/BaseMenuManager.java 48.92% <0.00%> (ø)
.../com/smartdevicelink/protocol/SdlProtocolBase.java 15.20% <0.00%> (-0.10%) ⬇️
...va/com/smartdevicelink/session/BaseSdlSession.java 22.60% <0.00%> (-0.48%) ⬇️
.../smartdevicelink/transport/TransportConstants.java 0.00% <ø> (ø)
...artdevicelink/transport/utl/SdlDeviceListener.java 7.93% <2.22%> (-2.41%) ⬇️
... and 9 more

Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KostyaBoss I have reviewed this PR, and have given a few suggestions. Please take a look whenever you get the chance.

@kboskin
Copy link
Contributor Author

kboskin commented Jan 25, 2021

@santhanamk Covered as much as possible, added a bunch of tests to cover new functions. There is also a failing test after merging the latest develop branch, related to the RemoteDisplayTests. Please, re-review, let me know if there is anything I should adjust

Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KostyaBoss the SdlRemoteDisplayTests passed for me. I left a few suggestions. Please review whenever you get a chance.

Can you also please take a look at my suggestions from 4-5 days ago, and see if anything needs to be changed there?

Copy link
Contributor

@JulianKast JulianKast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YaroslavLutsenko I have some more request changes.

Copy link
Contributor

@JulianKast JulianKast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YaroslavLutsenko I have been testing and I have some more requested changes. Could you also add some Java Docs to the newly added methods in this PR, an example would be:

    /**
     * This method will retrieve the Bluetooth Mac address from the transport record.
     *
     * @return a string containing the Bluetooth Mac address of the connected vehicle
     */
    public String getBluetoothMacAddress() {

@YaroslavLutsenko
Copy link
Contributor

@JulianKast I have applied your suggestions. Also I added some Java Docs. Could you check them, pls? (bbbd73d)

Copy link
Contributor

@JulianKast JulianKast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YaroslavLutsenko a few minor things for clean up

@YaroslavLutsenko
Copy link
Contributor

Hi @JulianKast, thank you. Done (c5c0e44)

Copy link
Member

@joeygrover joeygrover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some code clean up items that need to be taken care of especially in regards to NPEs. A few items need to be refactored to better align with the rest of the library and items that should be generalized so we can avoid adding hyper specific solutions.

@YaroslavLutsenko
Copy link
Contributor

Hi, @joeygrover! Thank you for your feedback, I did several corrections. Could you check this pr again, please?

@JulianKast JulianKast merged commit 05b6219 into smartdevicelink:develop Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.