summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Kast <Julian.kast@livio.io>2020-02-25 14:18:37 -0500
committerGitHub <noreply@github.com>2020-02-25 14:18:37 -0500
commit18404b48f11a1ff55794d80aad572759c7240423 (patch)
tree9f52c47a4777ff0b9f0c49dc4a51906554c732f8
parent6c24b9efbb2f4d93187c2b711d30f72983a640c5 (diff)
parentc41879683624c9e50dd53fba7b43b249921670eb (diff)
downloadsdl_android-18404b48f11a1ff55794d80aad572759c7240423.tar.gz
Merge pull request #1281 from smartdevicelink/bugfix/issue_1279
Remove setting new buffer after PSM FINISHED/ERROR states in USB tarnsport
-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) {