Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1786 +/- ##
=============================================
+ Coverage 54.36% 54.42% +0.05%
- Complexity 5513 5522 +9
=============================================
Files 562 562
Lines 25516 25543 +27
Branches 3319 3328 +9
=============================================
+ Hits 13872 13901 +29
Misses 10382 10382
+ Partials 1262 1260 -2
|
Add another check in case the manager listener is never instantiated
Also make SdlManager default constructor package private
Resolve merge conflicts
Also add debug warning about using the constructor outside the builder
| } | ||
| } else { | ||
| DebugTool.logError(TAG, "Change Registration onError: " + response.getResultCode() + " | Info: " + response.getInfo()); | ||
| retryChangeRegistration(); |
There was a problem hiding this comment.
Looks like this code was missed, this should not be removed
| SdlManager sdlManager = createSampleManager("Test App", "test.test.test", lockScreenConfig); | ||
| sdlManager.dispose(); | ||
| sdlManager.retryChangeRegistration(); | ||
| } |
There was a problem hiding this comment.
I dont think these unit tests actually will catch what we are trying to prevent. If the checkLifecycleConfiguration method is updated to manually throw an exception these tests will still pass. It does not look like the code is waiting for the runnable to complete so I believe the tests are completing before the runnable even executes.
There was a problem hiding this comment.
Think I should just remove them then?
There was a problem hiding this comment.
Yeah, I dont believe these tests are needed
| }; | ||
|
|
||
| public SdlManager(){ | ||
| DebugTool.logWarning(TAG, "If this SdlManager was created without using SdlManager.Builder, most of its members are not initialized"); |
There was a problem hiding this comment.
| DebugTool.logWarning(TAG, "If this SdlManager was created without using SdlManager.Builder, most of its members are not initialized"); | |
| DebugTool.logWarning(TAG, "SdlManager must be created with SdlManager.Builder"); |
|
Fixes #1783 This is not ready for review. RiskNone Testing Plan
Unit Tests
Core TestsBoth Core tests were performed in a modified version of Hello Sdl Android, while locally making
Core version / branch / commit hash / module tested against: SDL Core v8.0.0 master 68f082169e0a40fccd9eb0db3c83911c28870f07 SummaryConverts local variable Add In In ChangelogBreaking Changes
Enhancements
Bug FixesCLA
|
Fixes #1783
This is not ready for review.
Risk
None
Testing Plan
Unit Tests
testDisposeAfterRetryChangeRegistration()- Creates a sampleSdlManager, callsretryChangeRegistration()and then callsdispose(). This test will pass if no exceptions are thrown.testRetryChangeRegistrationAfterDispose()- Creates a sampleSdlManager, callsdispose()and then callsretryChangeRegistration(). This test will pass if no exceptions are thrown.Core Tests
Both Core tests were performed in a modified version of Hello Sdl Android, while locally making
retryChangeRegistration()public so it can be directly called in the app.At the end of
SdlService.performWelcomeShow()I calledsdlManager.retryChangeRegistration()thensdlManager.dispose(). As a result, the app did not crash andSdlManagerdid not throw a visible exception.At the end of
SdlService.performWelcomeShow()I calledsdlManager.dispose()thensdlManager.retryChangeRegistration(). As a result, the app did not crash andSdlManagerdid not throw a visible exception.Core version / branch / commit hash / module tested against: SDL Core v8.0.0 master 68f082169e0a40fccd9eb0db3c83911c28870f07
HMI name / version / branch / commit hash / module tested against: Generic HMI v0.11.0 master 47e0ad42f05b27adff61befd864e79c2ab4b8cec
Summary
Converts local variable
handlerinSdlManager.retryChangeRegistration()to a private member of the classCreates private member
changeRegistrationRunnableto replace anonymousRunnableinSdlManager.retryChangeRegistration()Add
DebugToolwarning in the default constructor ofSdlManagerto let developers know not to use the constructor directly.In
SdlManager.dismiss(), removechangeRegistrationRunnablefromhandlerif both are not nullIn
BaseSdlManager.checkLifecycleConfiguration()add a null check formanagerListenerChangelog
Breaking Changes
Enhancements
Bug Fixes
CLA