Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf72f860 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Set max transmit packet size for OBEX packets to the max if they exceed...

Merge "Set max transmit packet size for OBEX packets to the max if they exceed the max allowed packet size" am: 4ec69295 am: f1ba6bb4

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1727418

Change-Id: I5006640e2c1fb95fc91c3c5e113dff4d890dd1ae
parents 939e9d36 f1ba6bb4
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -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.
@@ -1083,10 +1084,11 @@ 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"
        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 != -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);
+2 −0
Original line number Diff line number Diff line
@@ -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.
     */