[Issue 2099206] Encoding phone number prior to sending it to the phone lookup filter

Change-Id: I80327febe7134ac1bdef958251943a9777879d53
This commit is contained in:
Dmitri Plotnikov
2009-09-09 19:35:55 -07:00
parent e02f4f1274
commit 84b4d37dd1
3 changed files with 4 additions and 3 deletions

View File

@@ -366,7 +366,8 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
public void bindFromPhoneNumber(String number) {
Cursor c = null;
try {
c = mContentResolver.query(Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, number),
c = mContentResolver.query(
Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number)),
PHONE_LOOKUP_PROJECTION, null, null, null);
if (c != null && c.moveToFirst()) {
long contactId = c.getLong(PHONE_LOOKUP_CONTACT_ID_COLUMN_INDEX);

View File

@@ -250,7 +250,7 @@ public class CallerInfo {
}
}
Uri contactUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, number);
Uri contactUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
CallerInfo info = getCallerInfo(context, contactUri);

View File

@@ -303,7 +303,7 @@ public class CallerInfoAsyncQuery {
public static CallerInfoAsyncQuery startQuery(int token, Context context, String number,
OnQueryCompleteListener listener, Object cookie) {
//contruct the URI object and start Query.
Uri contactRef = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, number);
Uri contactRef = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
CallerInfoAsyncQuery c = new CallerInfoAsyncQuery();
c.allocate(context, contactRef);