Skip to content

Commit cacba45

Browse files
Daisuke MiyakawaAndroid (Google) Code Review
authored andcommitted
Merge "Use callable-filter capability when updating call log" into jb-dev
2 parents 9d7bbcb + e23362a commit cacba45

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

core/java/android/provider/CallLog.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import android.content.Context;
2626
import android.database.Cursor;
2727
import android.net.Uri;
28+
import android.provider.ContactsContract.CommonDataKinds.Callable;
2829
import android.provider.ContactsContract.CommonDataKinds.Phone;
2930
import android.provider.ContactsContract.DataUsageFeedback;
3031
import android.text.TextUtils;
@@ -312,10 +313,12 @@ public static Uri addCall(CallerInfo ci, Context context, String number,
312313
null);
313314
} else {
314315
final String phoneNumber = ci.phoneNumber != null ? ci.phoneNumber : number;
315-
cursor = resolver.query(Phone.CONTENT_URI,
316+
cursor = resolver.query(
317+
Uri.withAppendedPath(Callable.CONTENT_FILTER_URI,
318+
Uri.encode(phoneNumber)),
316319
new String[] { Phone._ID },
317-
Phone.CONTACT_ID + " =? AND " + Phone.NUMBER + " =?",
318-
new String[] { String.valueOf(ci.person_id), phoneNumber},
320+
Phone.CONTACT_ID + " =?",
321+
new String[] { String.valueOf(ci.person_id) },
319322
null);
320323
}
321324

0 commit comments

Comments
 (0)