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

Commit cf59ab23 authored by Joseph Pirozzo's avatar Joseph Pirozzo
Browse files

PBAP PropertySelector

Fill out and transmit the PropertySelector when requesting to download
the phonebook.  Although the PropertySelector field is an optional field
and the default behavior is well specified when it is absent, some
phones do not adhere to the specification.  By sending the
PropertySelector field we can improve interoperability and eliminate
unneeded data.

Bug: 35322439
Change-Id: I25bcfce8bf4c7648c7cc07387bf02ebef600cf44
Test: Verification of filter bits set in wireshark and successfull
transfer of contact images, names, and numbers.
parent e428c979
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -61,8 +61,20 @@ class PbapClientConnectionHandler extends Handler {
    private static final int PBAP_FEATURE_BROWSING = 0x00000002;
    private static final int PBAP_FEATURE_DOWNLOADING = 0x00000001;

    private static final long PBAP_FILTER_VERSION = 1 << 0;
    private static final long PBAP_FILTER_FN = 1 << 1;
    private static final long PBAP_FILTER_N = 1 << 2;
    private static final long PBAP_FILTER_PHOTO = 1 << 3;
    private static final long PBAP_FILTER_ADR = 1 << 5;
    private static final long PBAP_FILTER_TEL = 1 << 7;
    private static final long PBAP_FILTER_EMAIL = 1 << 8;
    private static final long PBAP_FILTER_NICKNAME = 1 << 23;

    private static final int PBAP_SUPPORTED_FEATURE =
            PBAP_FEATURE_DEFAULT_IMAGE_FORMAT | PBAP_FEATURE_BROWSING | PBAP_FEATURE_DOWNLOADING;
    private static final long PBAP_REQUESTED_FIELDS = PBAP_FILTER_VERSION | PBAP_FILTER_FN
            | PBAP_FILTER_N | PBAP_FILTER_PHOTO | PBAP_FILTER_ADR | PBAP_FILTER_TEL
            | PBAP_FILTER_NICKNAME;
    private static final int PBAP_V1_2 = 0x0102;
    private static final int L2CAP_INVALID_PSM = -1;

@@ -206,8 +218,8 @@ class PbapClientConnectionHandler extends Handler {
                    }
                    // Start at contact 1 to exclued Owner Card PBAP 1.1 sec 3.1.5.2
                    BluetoothPbapRequestPullPhoneBook request =
                            new BluetoothPbapRequestPullPhoneBook(PB_PATH, mAccount, 0,
                                    VCARD_TYPE_30, 0, 1);
                            new BluetoothPbapRequestPullPhoneBook(
                                    PB_PATH, mAccount, PBAP_REQUESTED_FIELDS, VCARD_TYPE_30, 0, 1);
                    request.execute(mObexSession);
                    PhonebookPullRequest processor =
                            new PhonebookPullRequest(mPbapClientStateMachine.getContext(),
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ import java.util.HashMap;
import java.util.List;

public class PhonebookPullRequest extends PullRequest {
    private static final int MAX_OPS = 500;
    private static final int MAX_OPS = 250;
    private static final boolean VDBG = false;
    private static final String TAG = "PbapPhonebookPullRequest";