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

Commit 76de7cd3 authored by Kim Schulz's avatar Kim Schulz Committed by Matthew Xie
Browse files

MAP: Empty parameter mask handled wrong

If an empty parameter mask is set in a get message listing request
we only returned the handles, where as the spec states that we
should return all parameters.

Solution: Set the parameter filter to 0xFFFF if it is omitted or 0.

Change-Id: I2cb99569c0920c706c0d3b3ed269852471cb1ee6
Bug: 12915453
parent 35e29496
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -87,6 +87,9 @@ public class BluetoothMapAppParams {
    public static final int CHARSET_NATIVE = 0;
    public static final int CHARSET_UTF8 = 1;

    /* Default values for omitted application parameters */
    public static final long PARAMETER_MASK_ALL_ENABLED = 0xFFFF; // TODO: Update when bit 16-31 will be used.

    private int maxListCount        = INVALID_VALUE_PARAMETER;
    private int startOffset         = INVALID_VALUE_PARAMETER;
    private int filterMessageType   = INVALID_VALUE_PARAMETER;
+9 −0
Original line number Diff line number Diff line
@@ -1175,6 +1175,15 @@ public class BluetoothMapContent {
        BluetoothMapMessageListing bmList = new BluetoothMapMessageListing();
        BluetoothMapMessageListingElement e = null;

        /* We overwrite the parameter mask here if it is 0 or not present, as this
         * should cause all parameters to be included in the message list. */
        if(ap.getParameterMask() == BluetoothMapAppParams.INVALID_VALUE_PARAMETER ||
                ap.getParameterMask() == 0) {
            ap.setParameterMask(BluetoothMapAppParams.PARAMETER_MASK_ALL_ENABLED);
            if (V) Log.w(TAG, "msgListing(): appParameterMask is zero or not present, " +
                    "changing to: " + ap.getParameterMask());
        }

        /* Cache some info used throughout filtering */
        FilterInfo fi = new FilterInfo();
        setFilterInfo(fi);