summaryrefslogtreecommitdiff
path: root/sdl_android_lib
diff options
context:
space:
mode:
Diffstat (limited to 'sdl_android_lib')
-rw-r--r--sdl_android_lib/src/com/smartdevicelink/SdlConnection/SdlSession.java8
-rw-r--r--sdl_android_lib/src/com/smartdevicelink/protocol/AbstractProtocol.java1
-rw-r--r--sdl_android_lib/src/com/smartdevicelink/protocol/WiProProtocol.java8
-rw-r--r--sdl_android_lib/src/com/smartdevicelink/streaming/AbstractPacketizer.java8
-rw-r--r--sdl_android_lib/src/com/smartdevicelink/streaming/StreamPacketizer.java7
-rw-r--r--sdl_android_lib/src/com/smartdevicelink/streaming/StreamRPCPacketizer.java3
6 files changed, 5 insertions, 30 deletions
diff --git a/sdl_android_lib/src/com/smartdevicelink/SdlConnection/SdlSession.java b/sdl_android_lib/src/com/smartdevicelink/SdlConnection/SdlSession.java
index 1a9d051a6..09f029fca 100644
--- a/sdl_android_lib/src/com/smartdevicelink/SdlConnection/SdlSession.java
+++ b/sdl_android_lib/src/com/smartdevicelink/SdlConnection/SdlSession.java
@@ -105,14 +105,6 @@ public class SdlSession implements ISdlConnectionListener, IHeartbeatMonitorList
return this._sdlConnection;
}
- public int getMtu(){
- if(this._sdlConnection!=null){
- return this._sdlConnection.getWiProProtocol().getMtu();
- }else{
- return 0;
- }
- }
-
public void close() {
if (sdlSecurity != null)
{
diff --git a/sdl_android_lib/src/com/smartdevicelink/protocol/AbstractProtocol.java b/sdl_android_lib/src/com/smartdevicelink/protocol/AbstractProtocol.java
index 8acc709e1..5cdf06e95 100644
--- a/sdl_android_lib/src/com/smartdevicelink/protocol/AbstractProtocol.java
+++ b/sdl_android_lib/src/com/smartdevicelink/protocol/AbstractProtocol.java
@@ -30,7 +30,6 @@ public abstract class AbstractProtocol {
// over which to send the message, etc.
public abstract void SendMessage(ProtocolMessage msg);
- public abstract int getMtu();
public abstract void handlePacketReceived(SdlPacket packet);
diff --git a/sdl_android_lib/src/com/smartdevicelink/protocol/WiProProtocol.java b/sdl_android_lib/src/com/smartdevicelink/protocol/WiProProtocol.java
index bca456a75..885be58b3 100644
--- a/sdl_android_lib/src/com/smartdevicelink/protocol/WiProProtocol.java
+++ b/sdl_android_lib/src/com/smartdevicelink/protocol/WiProProtocol.java
@@ -51,14 +51,6 @@ public class WiProProtocol extends AbstractProtocol {
}
} // end-ctor
- /**
- * Retrieves the max payload size for a packet to be sent to the module
- * @return the max transfer unit
- */
- public int getMtu(){
- return MAX_DATA_SIZE;
- }
-
public byte getVersion() {
return this._version;
}
diff --git a/sdl_android_lib/src/com/smartdevicelink/streaming/AbstractPacketizer.java b/sdl_android_lib/src/com/smartdevicelink/streaming/AbstractPacketizer.java
index 81dbdd0b0..b4ee3ed1f 100644
--- a/sdl_android_lib/src/com/smartdevicelink/streaming/AbstractPacketizer.java
+++ b/sdl_android_lib/src/com/smartdevicelink/streaming/AbstractPacketizer.java
@@ -10,13 +10,13 @@ import com.smartdevicelink.proxy.RPCRequest;
abstract public class AbstractPacketizer {
protected IStreamListener _streamListener = null;
+ private final static int BUFF_READ_SIZE = 1000000;
protected byte _rpcSessionID = 0;
protected SessionType _serviceType = null;
protected SdlSession _session = null;
protected InputStream is = null;
- protected int bufferSize;
- protected byte[] buffer;
+ protected byte[] buffer = new byte[BUFF_READ_SIZE];
protected boolean upts = false;
protected RPCRequest _request = null;
protected byte _wiproVersion = 1;
@@ -30,8 +30,6 @@ abstract public class AbstractPacketizer {
_rpcSessionID = rpcSessionID;
_serviceType = sType;
this._session = session;
- bufferSize = this._session.getMtu();
- buffer = new byte[bufferSize];
}
public AbstractPacketizer(IStreamListener streamListener, InputStream is, RPCRequest request, SessionType sType, byte rpcSessionID, byte wiproVersion, SdlSession session) throws IOException {
@@ -42,8 +40,6 @@ abstract public class AbstractPacketizer {
_request = request;
_wiproVersion = wiproVersion;
this._session = session;
- bufferSize = this._session.getMtu();
- buffer = new byte[bufferSize];
}
public abstract void start() throws IOException;
diff --git a/sdl_android_lib/src/com/smartdevicelink/streaming/StreamPacketizer.java b/sdl_android_lib/src/com/smartdevicelink/streaming/StreamPacketizer.java
index 525d94739..a05fb9c52 100644
--- a/sdl_android_lib/src/com/smartdevicelink/streaming/StreamPacketizer.java
+++ b/sdl_android_lib/src/com/smartdevicelink/streaming/StreamPacketizer.java
@@ -26,11 +26,6 @@ public class StreamPacketizer extends AbstractPacketizer implements Runnable{
mPauseLock = new Object();
mPaused = false;
isServiceProtected = _session.isServiceProtected(_serviceType);
- if(isServiceProtected){ //If our service is encrypted we can only use 1024 as the max buffer size.
- bufferSize = BUFF_READ_SIZE;
- buffer = new byte[bufferSize];
- }
-
}
public void start() throws IOException {
@@ -68,7 +63,7 @@ public class StreamPacketizer extends AbstractPacketizer implements Runnable{
}
}
- length = is.read(buffer, 0, bufferSize);
+ length = is.read(buffer, 0, BUFF_READ_SIZE);
if (length >= 0)
{
diff --git a/sdl_android_lib/src/com/smartdevicelink/streaming/StreamRPCPacketizer.java b/sdl_android_lib/src/com/smartdevicelink/streaming/StreamRPCPacketizer.java
index 5652aafc3..2fc35a5a9 100644
--- a/sdl_android_lib/src/com/smartdevicelink/streaming/StreamRPCPacketizer.java
+++ b/sdl_android_lib/src/com/smartdevicelink/streaming/StreamRPCPacketizer.java
@@ -26,6 +26,7 @@ import com.smartdevicelink.proxy.rpc.listeners.OnPutFileUpdateListener;
public class StreamRPCPacketizer extends AbstractPacketizer implements IPutFileResponseListener, Runnable{
private Integer iInitialCorrID = 0;
+ private final static int BUFF_READ_SIZE = 1000000;
private Hashtable<Integer, OnStreamRPC> notificationList = new Hashtable<Integer, OnStreamRPC>();
private Thread thread = null;
private long lFileSize = 0;
@@ -191,7 +192,7 @@ public class StreamRPCPacketizer extends AbstractPacketizer implements IPutFileR
}
}
- length = is.read(buffer, 0, bufferSize);
+ length = is.read(buffer, 0, BUFF_READ_SIZE);
if (length == -1)
stop();