From ce57ca248cc40ace646529b019787f46e04d0f2a Mon Sep 17 00:00:00 2001 From: Bilal Alsharifi Date: Tue, 21 May 2019 16:10:52 -0400 Subject: Fix an issue with sendSequentialRPCs onupdate callback --- .../smartdevicelink/managers/lifecycle/LifecycleManager.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'javaSE/src/main/java/com') diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java index 1d17d4ea5..c82d7c3c6 100644 --- a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java +++ b/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java @@ -202,10 +202,8 @@ public class LifecycleManager extends BaseLifecycleManager { private void sendSequentialRPCs(final List messages, final OnMultipleRequestListener listener){ if (messages != null){ - final int rpcCount = messages.size(); - // Break out of recursion, we have finished the requests - if (rpcCount == 0) { + if (messages.size() == 0) { if(listener != null){ listener.onFinished(); } @@ -229,7 +227,7 @@ public class LifecycleManager extends BaseLifecycleManager { } if (listener != null) { listener.onResponse(correlationId, response); - listener.onUpdate(rpcCount); + listener.onUpdate(messages.size()); } // recurse after onResponse sendSequentialRPCs(messages, listener); @@ -242,7 +240,7 @@ public class LifecycleManager extends BaseLifecycleManager { } if (listener != null) { listener.onError(correlationId, resultCode, info); - listener.onUpdate(rpcCount); + listener.onUpdate(messages.size()); } // recurse after onError @@ -254,7 +252,7 @@ public class LifecycleManager extends BaseLifecycleManager { // Notifications and Responses sendRPCMessagePrivate(rpc); if (listener != null) { - listener.onUpdate(rpcCount); + listener.onUpdate(messages.size()); } // recurse after sending a notification or response as there is no response. sendSequentialRPCs(messages, listener); -- cgit v1.2.1