Skip to content

Commit 73eab78

Browse files
committed
Merge branch 'bugfix/issue_1781' of origin
2 parents 9182e91 + 5727e3a commit 73eab78

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,14 @@ public void onReceived(RPCMessage message) {
411411
VehicleType vehicleType = raiResponse.getVehicleType();
412412
String systemSoftwareVersion = raiResponse.getSystemSoftwareVersion();
413413
if (vehicleType != null || systemSoftwareVersion != null) {
414+
415+
List<TransportRecord> activeTransports = null;
414416
synchronized (session) {
415417
if (session != null) {
416-
saveVehicleType(session.getActiveTransports(), vehicleType);
418+
activeTransports = session.getActiveTransports();
417419
}
418420
}
421+
saveVehicleType(activeTransports, vehicleType);
419422
SystemInfo systemInfo = new SystemInfo(vehicleType, systemSoftwareVersion, null);
420423
boolean validSystemInfo = lifecycleListener.onSystemInfoReceived(systemInfo);
421424
if (!validSystemInfo) {
@@ -974,17 +977,23 @@ public void onSessionStarted(int sessionID, Version version, SystemInfo systemIn
974977

975978
if (systemInfo != null && lifecycleListener != null) {
976979
didCheckSystemInfo = true;
980+
List<TransportRecord> activeTransports = null;
977981
synchronized (session) {
978982
if (session != null) {
979-
saveVehicleType(session.getActiveTransports(), systemInfo.getVehicleType());
980-
boolean validSystemInfo = lifecycleListener.onSystemInfoReceived(systemInfo);
981-
if (!validSystemInfo) {
982-
DebugTool.logWarning(TAG, "Disconnecting from head unit, the system info was not accepted.");
983+
activeTransports = session.getActiveTransports();
984+
}
985+
}
986+
saveVehicleType(activeTransports, systemInfo.getVehicleType());
987+
boolean validSystemInfo = lifecycleListener.onSystemInfoReceived(systemInfo);
988+
if (!validSystemInfo) {
989+
DebugTool.logWarning(TAG, "Disconnecting from head unit, the system info was not accepted.");
990+
synchronized (session) {
991+
if (session != null) {
983992
session.endService(SessionType.RPC);
984-
clean();
985-
onClose("System not supported", null, SdlDisconnectedReason.DEFAULT);
986-
return;
987993
}
994+
clean();
995+
onClose("System not supported", null, SdlDisconnectedReason.DEFAULT);
996+
return;
988997
}
989998
}
990999
//If the vehicle is acceptable, init security lib

0 commit comments

Comments
 (0)