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

Commit 2abed571 authored by Kihong Seong's avatar Kihong Seong Committed by Automerger Merge Worker
Browse files

Merge "Close cursor with try resource statement in CallLogPullRequest" am: f25a88fc

parents ab5e174e f25a88fc
Loading
Loading
Loading
Loading
+11 −10
Original line number Original line Diff line number Diff line
@@ -147,7 +147,7 @@ public class CallLogPullRequest extends PullRequest {
            values.put(ContactsContract.RawContacts.TIMES_CONTACTED, mCallCounter.get(key));
            values.put(ContactsContract.RawContacts.TIMES_CONTACTED, mCallCounter.get(key));
            Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI,
            Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI,
                    Uri.encode(key));
                    Uri.encode(key));
            Cursor c = mContext.getContentResolver().query(uri, null, null, null);
            try (Cursor c = mContext.getContentResolver().query(uri, null, null, null)) {
                if (c != null && c.getCount() > 0) {
                if (c != null && c.getCount() > 0) {
                    c.moveToNext();
                    c.moveToNext();
                    String contactId = c.getString(c.getColumnIndex(
                    String contactId = c.getString(c.getColumnIndex(
@@ -160,6 +160,7 @@ public class CallLogPullRequest extends PullRequest {
                            ContactsContract.RawContacts.CONTENT_URI, values, where, null);
                            ContactsContract.RawContacts.CONTENT_URI, values, where, null);
                }
                }
            }
            }
        }
        if (DBG) {
        if (DBG) {
            Log.d(TAG, "Updated TIMES_CONTACTED");
            Log.d(TAG, "Updated TIMES_CONTACTED");
        }
        }