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

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

PBAPS: Enable contact search with full or part of given string

Enables searching of text in contact name starting with a given
matching string instead of matching the complete string.

Change-Id: I91258391b7b7cb014d55e17e1ed3b92267a2c7da
parent 2f224e91
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -670,7 +670,7 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
            }
        } else {
            if (searchValue != null) {
                compareValue = searchValue.trim();
                compareValue = searchValue.trim().toLowerCase();
            }
            for (int pos = listStartOffset; pos < listSize &&
                    itemsFound < requestSize; pos++) {
@@ -678,7 +678,7 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
                if (currentValue.contains(","))
                    currentValue = currentValue.substring(0, currentValue.lastIndexOf(','));

                if (searchValue.isEmpty() || ((currentValue.toLowerCase()).equals(compareValue.toLowerCase()))) {
                if (searchValue.isEmpty() || ((currentValue.toLowerCase()).startsWith(compareValue))) {
                    itemsFound++;
                    writeVCardEntry(pos, currentValue,result);
                }