summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Grover <joeygrover@gmail.com>2020-02-20 13:36:42 -0500
committerJoey Grover <joeygrover@gmail.com>2020-02-20 13:36:42 -0500
commitc41879683624c9e50dd53fba7b43b249921670eb (patch)
tree38bc1cadb080b9555319eaa0cde8eb28dd979043
parent7e6a16c027bcdd0fb523a9993dc59b0171167aea (diff)
downloadsdl_android-bugfix/issue_1279.tar.gz
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java
index 7ebcec1c2..d72987a88 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java
@@ -249,7 +249,7 @@ public class MultiplexUsbTransport extends MultiplexBaseTransport{
if(!stateProgress){//We are trying to weed through the bad packet info until we get something
//Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
psm.reset();
- buffer = new byte[READ_BUFFER_SIZE];
+ continue; //Move to the next iteration of the loop
}
if(psm.getState() == SdlPsm.FINISHED_STATE){
@@ -259,9 +259,11 @@ public class MultiplexUsbTransport extends MultiplexBaseTransport{
packet.setTransportRecord(getTransportRecord());
handler.obtainMessage(SdlRouterService.MESSAGE_READ, packet).sendToTarget();
}
- //We put a trace statement in the message read so we can avoid all the extra bytes
+ //Reset the PSM now that we have a finished packet.
+ //We will continue to loop through the data to see if any other packet
+ //is present.
psm.reset();
- buffer = new byte[READ_BUFFER_SIZE]; //FIXME just do an array copy and send off
+ continue; //Move to the next iteration of the loop
}
}
} catch (IOException e) {