diff options
author | Scott Lobdell <slobdell@google.com> | 2021-07-09 05:33:36 +0000 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2021-07-09 05:33:36 +0000 |
commit | 8507fe74dccb3114f7942bb3ca2087dab2c890e6 (patch) | |
tree | 5d15051c03662b66bb54d04f158eb1b0ca623c44 /obex | |
parent | 70ec282c1bd5e68015ed9412a730f5254ee6585c (diff) | |
parent | 9dd561f2a032908f6c916be577f6a7136c9b03ef (diff) |
Merge SP1A.210624.001
Change-Id: I96a39cdca22771b76e89caebd53ed52416005092
Diffstat (limited to 'obex')
-rw-r--r-- | obex/javax/obex/ObexHelper.java | 14 | ||||
-rw-r--r-- | obex/javax/obex/ObexTransport.java | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/obex/javax/obex/ObexHelper.java b/obex/javax/obex/ObexHelper.java index f09d3d3fb09c..0922be283912 100644 --- a/obex/javax/obex/ObexHelper.java +++ b/obex/javax/obex/ObexHelper.java @@ -34,6 +34,8 @@ package javax.obex; +import android.util.Log; + import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -43,7 +45,6 @@ import java.util.Calendar; import java.util.Date; import java.util.TimeZone; -import android.util.Log; /** * This class defines a set of helper methods for the implementation of Obex. @@ -1105,11 +1106,12 @@ public final class ObexHelper { } private static int validateMaxPacketSize(int size) { - if(VDBG && (size > MAX_PACKET_SIZE_INT)) Log.w(TAG, - "The packet size supported for the connection (" + size + ") is larger" - + " than the configured OBEX packet size: " + MAX_PACKET_SIZE_INT); - if(size != -1) { - if(size < LOWER_LIMIT_MAX_PACKET_SIZE) { + if (VDBG && (size > MAX_PACKET_SIZE_INT)) { + Log.w(TAG, "The packet size supported for the connection (" + size + ") is larger" + + " than the configured OBEX packet size: " + MAX_PACKET_SIZE_INT); + } + if (size != -1 && size < MAX_PACKET_SIZE_INT) { + if (size < LOWER_LIMIT_MAX_PACKET_SIZE) { throw new IllegalArgumentException(size + " is less that the lower limit: " + LOWER_LIMIT_MAX_PACKET_SIZE); } diff --git a/obex/javax/obex/ObexTransport.java b/obex/javax/obex/ObexTransport.java index a5a75f55f553..4cef0b33df4f 100644 --- a/obex/javax/obex/ObexTransport.java +++ b/obex/javax/obex/ObexTransport.java @@ -81,6 +81,8 @@ public interface ObexTransport { * size. Therefore this value shall not change. * For RFCOMM or other transport types where the OBEX packets size * is unrelated to the transport packet size, return -1; + * Exception can be made (like PBAP transport) with a smaller value + * to avoid bad effect on other profiles using the RFCOMM; * @return the maximum allowed OBEX packet that can be send over * the transport. Or -1 in case of don't care. */ |