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

Commit 46725933 authored by Conley Owens's avatar Conley Owens Committed by Android Git Automerger
Browse files

am 13260c68: Merge "Bluetooth: Add vCard version support for call history."

* commit '13260c68':
  Bluetooth: Add vCard version support for call history.
parents 5ae46855 13260c68
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ public class BluetoothPbapCallLogComposer {
        }
    }

    public boolean createOneEntry() {
    public boolean createOneEntry(boolean vcardVer21) {
        if (mCursor == null || mCursor.isAfterLast()) {
            mErrorReason = FAILURE_REASON_NOT_INITIALIZED;
            return false;
@@ -160,7 +160,7 @@ public class BluetoothPbapCallLogComposer {

        final String vcard;
        try {
            vcard = createOneCallLogEntryInternal();
            vcard = createOneCallLogEntryInternal(vcardVer21);
        } catch (OutOfMemoryError error) {
            Log.e(TAG, "OutOfMemoryError occured. Ignore the entry");
            System.gc();
@@ -184,10 +184,9 @@ public class BluetoothPbapCallLogComposer {
        return true;
    }

    private String createOneCallLogEntryInternal() {
        // We should not allow vCard composer to re-format phone numbers, since
        // some characters are (inappropriately) removed and devices do not work fine.
        final int vcardType = VCardConfig.VCARD_TYPE_V21_GENERIC |
    private String createOneCallLogEntryInternal(boolean vcardVer21) {
        final int vcardType = (vcardVer21 ? VCardConfig.VCARD_TYPE_V21_GENERIC :
                VCardConfig.VCARD_TYPE_V30_GENERIC) |
                VCardConfig.FLAG_REFRAIN_PHONE_NUMBER_FORMATTING;
        final VCardBuilder builder = new VCardBuilder(vcardType);
        String name = mCursor.getString(CALLER_NAME_COLUMN_INDEX);
+1 −1
Original line number Diff line number Diff line
@@ -479,7 +479,7 @@ public class BluetoothPbapVcardManager {
                        BluetoothPbapObexServer.sIsAborted = false;
                        break;
                    }
                    if (!composer.createOneEntry()) {
                    if (!composer.createOneEntry(vcardType21)) {
                        Log.e(TAG, "Failed to read a contact. Error reason: "
                                + composer.getErrorReason());
                        return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;