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

Commit b16e4ea0 authored by Hemant Gupta's avatar Hemant Gupta Committed by Andre Eisenbach
Browse files

OPP: Remove un-supported formats from SDP

Use case:
1. Send a vcalendar file to DUT
2. Verify file is received on DUT

Result:
DUT rejects vCalendar put request with reason unsupported media type
although DUT SDP records claim support for vcalendar format. Same is valid
for vNote and vMessage formats as well.

Rootcause:
ACCEPTABLE_SHARE_INBOUND_TYPES does not have support for above MIME formats.

Fix:
Remove vCal, vNote and vMessage from OPP Server supported format list.

Reproducibiltiy:
5/5

Test: All PTS tests that were enabled because of support for different OPP MIME
formats got disabled as by default OPP Rx will not support these MIME formats
leading to no OPP failures in PTS.

Bug: 36467777
Change-Id: I2503f5c61dd28fd3cf73d10939c6d931dbe0d6ea
parent 1c75df6e
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -80,6 +80,14 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti
    private static final boolean D = Constants.DEBUG;
    private static final boolean V = Constants.VERBOSE;

    private static final byte OPP_FORMAT_VCARD21 = 0x01;
    private static final byte OPP_FORMAT_VCARD30 = 0x02;
    private static final byte OPP_FORMAT_VCAL10 = 0x03;
    private static final byte OPP_FORMAT_ANY_TYPE_OF_OBJ = (byte) 0xFF;

    private static final byte[] SUPPORTED_OPP_FORMAT = {
            OPP_FORMAT_VCARD21, OPP_FORMAT_VCARD30, OPP_FORMAT_VCAL10, OPP_FORMAT_ANY_TYPE_OF_OBJ};

    private boolean userAccepted = false;

    private class BluetoothShareContentObserver extends ContentObserver {
@@ -358,7 +366,7 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti
            return;
        }
        sdpManager.createOppOpsRecord("OBEX Object Push", mServerSocket.getRfcommChannel(),
                mServerSocket.getL2capPsm(), 0x0102, SdpManager.OPP_FORMAT_ALL);
                mServerSocket.getL2capPsm(), 0x0102, SUPPORTED_OPP_FORMAT);
    }

    @Override
+0 −20
Original line number Diff line number Diff line
@@ -49,26 +49,6 @@ public class SdpManager {
    public static final byte PBAP_REPO_SPEED_DAIL   = 0x01<<2;
    public static final byte PBAP_REPO_FAVORITES    = 0x01<<3;

    // TODO: When changing OPP to use this new API.
    //       Move the defines to the profile
    /* Object Push formats */
    public static final byte OPP_FORMAT_VCARD21     = 0x01;
    public static final byte OPP_FORMAT_VCARD30     = 0x02;
    public static final byte OPP_FORMAT_VCAL10      = 0x03;
    public static final byte OPP_FORMAT_ICAL20      = 0x04;
    public static final byte OPP_FORMAT_VNOTE       = 0x05;
    public static final byte OPP_FORMAT_VMESSAGE    = 0x06;
    public static final byte OPP_FORMAT_ANY_TYPE_OF_OBJ = (byte)0xFF;

    public static final byte[] OPP_FORMAT_ALL= {
        OPP_FORMAT_VCARD21,
        OPP_FORMAT_VCARD30,
        OPP_FORMAT_VCAL10,
        OPP_FORMAT_ICAL20,
        OPP_FORMAT_VNOTE,
        OPP_FORMAT_VMESSAGE,
        OPP_FORMAT_ANY_TYPE_OF_OBJ};

    /* Variables to keep track of ongoing and queued search requests.
     * mTrackerLock must be held, when using/changing sSdpSearchTracker
     * and mSearchInProgress. */