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

Commit 43ad30c6 authored by Matthew Xie's avatar Matthew Xie Committed by Android Partner Code Review
Browse files

Merge "PBAP: Check for spurious entries of searched contacts" into klp-wireless-dev

parents dad1f247 92072fa3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -608,7 +608,7 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
                        itemsFound < requestSize; pos++) {
                    currentValue = nameList.get(pos);
                    if (D) Log.d(TAG, "currentValue=" + currentValue);
                    if (currentValue.startsWith(compareValue)) {
                    if (currentValue.equals(compareValue)) {
                        itemsFound++;
                        if (currentValue.contains(","))
                           currentValue = currentValue.substring(0, currentValue.lastIndexOf(','));
+9 −1
Original line number Diff line number Diff line
@@ -294,6 +294,7 @@ public class BluetoothPbapVcardManager {

    public final ArrayList<String> getContactNamesByNumber(final String phoneNumber) {
        ArrayList<String> nameList = new ArrayList<String>();
        ArrayList<String> tempNameList = new ArrayList<String>();

        Cursor contactCursor = null;
        Uri uri = null;
@@ -318,7 +319,7 @@ public class BluetoothPbapVcardManager {
                        name = mContext.getString(android.R.string.unknownName);
                    }
                    if (V) Log.v(TAG, "got name " + name + " by number " + phoneNumber + " @" + id);
                    nameList.add(name + "," + id);
                    tempNameList.add(name + "," + id);
                }
            }
        } catch (CursorWindowAllocationException e) {
@@ -329,6 +330,13 @@ public class BluetoothPbapVcardManager {
                contactCursor = null;
            }
        }
        int tempListSize = tempNameList.size();
        for (int index = 0; index < tempListSize; index++) {
            String object = tempNameList.get(index);
            if (!nameList.contains(object))
                nameList.add(object);
        }

        return nameList;
    }