Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1789 +/- ##
==========================================
Coverage 54.42% 54.43%
- Complexity 5519 5523 +4
==========================================
Files 562 562
Lines 25540 25542 +2
Branches 3327 3328 +1
==========================================
+ Hits 13900 13903 +3
+ Misses 10381 10380 -1
Partials 1259 1259
|
|
Fixes #1780 This PR is [ready] for review. RiskThis PR makes [no] API changes. Testing Plan
Unit TestsN/A Core TestsUsing a modified version of the SDL library without Robert's changes, I was able to force the NPE by setting After including Robert's changes, the NPE no longer occurs and the crash is prevented. Core version / branch / commit hash / module tested against: SDL Core v8.0.0 master 68f082169e0a40fccd9eb0db3c83911c28870f07 SummaryThis PR surrounds I have verified Robert's assessment regarding possible causes of CLA
|
Fixes #1780
This PR is [not ready] for review.
Risk
This PR makes [no] API changes.
Testing Plan
Unit Tests
N/A
Core Tests
[List of tests performed against Core and behaviors verified]
Core version / branch / commit hash / module tested against: [INSERT]
HMI name / version / branch / commit hash / module tested against: [INSERT]
Summary
In
SdlDeviceListenerthebluetoothTransportandbluetoothHandlerare only initialized if the device has not connected previously. In the event that the device has connected before thebluetoothTransportis not initialized because we get the relevant data from the shared preferences. If this is the casebluetoothTransportwill not be initialized and will be null. If this is the case thevehicleInfowill be retrieved from the shared preferences instead and the logic to retrieve the vehicleData from the startServiceACK is not needed.in
SdlDeviceListenertheonPacketReadmethod will be called when the StartServiceACK is received. This will later callnotifyConnectionwhich will try to stop thebluetoothTransportif the RFCOMM channel should not remain open. If this is the case after stoping thebluetoothTransportit will then be set to null. When this happens we should also set thebluetoothHandlerto null as we no longer want itshandleMessagesmethod to be called. This will prevent the case wherenotifyConnectionis called while thebluetoothTransportis nullIn
onPacketReadwe are already performing a null check before writing to thebluetoohTransport. Since it is possible thatbluetoothTransportis null whennotifyConnectionis called we should also check for null before callingbluetoothTransport.stop().CLA