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

Commit 0f20a953 authored by Pradeep Panigrahi's avatar Pradeep Panigrahi
Browse files

Bluetooth: MAP: Do not set body header if maxlist count is 0

As per MAP profile spec when message listing or folder
listing is done with 0 as max list count, then the response
should not contain the body header. Hence add change for the
same

Change-Id: I09b44a07bb9d15f248c0657563da4927ce4b4996
parent 617b708e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -487,7 +487,9 @@ public class BluetoothMapObexServer extends ServerRequestHandler {
                listSize = mOutContent.msgListingSize(folderName, appParams);
                hasUnread = mOutContent.msgListingHasUnread(folderName, appParams);
                outAppParams.setMessageListingSize(listSize);
                if(V) Log.v(TAG, "not setting body and end of body header");
                op.noBodyHeader();
                op.noEndofBody();
            }

            // Build the application parameter header
@@ -582,10 +584,12 @@ public class BluetoothMapObexServer extends ServerRequestHandler {
            if(maxListCount == BluetoothMapAppParams.INVALID_VALUE_PARAMETER)
                maxListCount = 1024;

            if(maxListCount != 0)
            {
            if(maxListCount != 0) {
                outBytes = mCurrentFolder.encode(listStartOffset, maxListCount);
                outStream = op.openOutputStream();
            } else {
                op.noBodyHeader();
                op.noEndofBody();
            }

            // Build and set the application parameter header