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

Commit f25a88fc authored by Kihong Seong's avatar Kihong Seong Committed by Gerrit Code Review
Browse files

Merge "Close cursor with try resource statement in CallLogPullRequest"

parents ff9608e1 e4f1df11
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");
        }
        }