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

Commit a0e844da authored by Chienyuan's avatar Chienyuan
Browse files

PBAP: Return sim contact size with cursor.getCount

Bug: 229804056
Tag: #refactor
Test: connect carkit, download sim contact
Change-Id: I3964b98d9f849fdcc529294d885281a55e5737a8
parent 0ea847df
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ public class BluetoothPbapSimVcardManager {
        try {
            contactCursor = mContentResolver.query(myUri, SIM_PROJECTION, null,null, null);
            if (contactCursor != null) {
                size = contactCursor.getCount() +1;  //always has the 0.vcf
                size = contactCursor.getCount();
            }
        } finally {
            if (contactCursor != null) {
@@ -397,7 +397,7 @@ public class BluetoothPbapSimVcardManager {
                String vcard = composer.createOneEntry(vcardType21);
                if (vcard == null) {
                    Log.e(TAG, "Failed to read a contact. Error reason: "
                            + composer.getErrorReason());
                            + composer.getErrorReason() + ", count:" + count);
                    return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
                }
                buffer.onEntryCreated(vcard);