File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
aws-android-sdk-iot/src/main/java/com/amazonaws/mobileconnectors/iot Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1338,19 +1338,20 @@ void setupCallbackForMqttClient() {
13381338 public void connectionLost (Throwable cause ) {
13391339 LOGGER .warn ("connection is Lost" );
13401340 if (!userDisconnect && autoReconnect ) {
1341- connectionState = MqttManagerConnectionState .Reconnecting ;
1342- userConnectionCallback ();
1343-
13441341 // If we have been connected longer than the connectionStabilityTime then
13451342 // restart the reconnect logic from minimum value before scheduling reconnect.
13461343 if ((lastConnackTime + (connectionStabilityTime * MILLIS_IN_ONE_SECOND )) < getSystemTimeMs ()) {
13471344 resetReconnect ();
13481345 }
1349- scheduleReconnect ();
1346+ if (scheduleReconnect ()) {
1347+ connectionState = MqttManagerConnectionState .Reconnecting ;
1348+ } else {
1349+ connectionState = MqttManagerConnectionState .Disconnected ;
1350+ }
13501351 } else {
13511352 connectionState = MqttManagerConnectionState .Disconnected ;
1352- userConnectionCallback (cause );
13531353 }
1354+ userConnectionCallback (cause );
13541355 }
13551356
13561357 @ Override
You can’t perform that action at this time.
0 commit comments