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

Commit 818a6f8e authored by Hemant Gupta's avatar Hemant Gupta
Browse files

MAP: Set messageList element to proper size based on offset/count

Handle all the cases based on offset and count to create message list
element when message listing is performed from car kit for any folder

Change-Id: Ibcc6f8ed24c47464e05f26a79b38b99d233ca58b
parent aad1ef6e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -105,7 +105,12 @@ public class BluetoothMapMessageListing {
        if (offset + count <= list.size()) {
            list = list.subList(offset, offset + count);
        } else {
            list = null;
            if(offset > list.size()) {
               list = new ArrayList<BluetoothMapMessageListingElement>();
               Log.d(TAG, "offset greater than list size. Returning empty list");
            } else {
               list = list.subList(offset, list.size());
            }
        }
    }
}