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

Commit 6f02f510 authored by Staffan Lindvall's avatar Staffan Lindvall Committed by Jean-Baptiste Queru
Browse files

Incorrect response code after pull of invalid vCard handle.

When calling pullVcardEntry with an invalid / non-existing
vCard handle the response code is always "OK".

Instead the phone should respond "NOT FOUND" according
to Bluetooth PBAP specification.

The problem exists both for phonebook and call logs.

Change-Id: I339b1fe0cdb7fa9b6c6b425f1b1686c24cab9626
parent e7f887da
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -869,7 +869,7 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
        int size = mVcardManager.getPhonebookSize(appParamValue.needTag);
        if (size == 0) {
            if (V) Log.v(TAG, "PhonebookSize is 0, return.");
            return ResponseCodes.OBEX_HTTP_OK;
            return ResponseCodes.OBEX_HTTP_NOT_FOUND;
        }

        boolean vcard21 = appParamValue.vcard21;
@@ -879,7 +879,7 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
        } else if (appParamValue.needTag == ContentType.PHONEBOOK) {
            if (intIndex < 0 || intIndex >= size) {
                Log.w(TAG, "The requested vcard is not acceptable! name= " + name);
                return ResponseCodes.OBEX_HTTP_OK;
                return ResponseCodes.OBEX_HTTP_NOT_FOUND;
            } else if (intIndex == 0) {
                // For PB_PATH, 0.vcf is the phone number of this phone.
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21);
@@ -891,7 +891,7 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
        } else {
            if (intIndex <= 0 || intIndex > size) {
                Log.w(TAG, "The requested vcard is not acceptable! name= " + name);
                return ResponseCodes.OBEX_HTTP_OK;
                return ResponseCodes.OBEX_HTTP_NOT_FOUND;
            }
            // For others (ich/och/cch/mch), 0.vcf is meaningless, and must
            // begin from 1.vcf