Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Fix for arabic crash
Browse files Browse the repository at this point in the history
Make sure not to localize when using String.format to build SQL.

Bug 5619742

Change-Id: I66fd9c4a50dd6c083099a9def93840ff05aed5a6
  • Loading branch information
Makoto Onuki committed Nov 16, 2011
1 parent 38f1fd2 commit a99ffbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/com/android/providers/contacts/ContactAggregator.java
Expand Up @@ -58,6 +58,7 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;

/**
* ContactAggregator deals with aggregating contact information coming from different sources.
Expand Down Expand Up @@ -351,11 +352,11 @@ public ContactAggregator(ContactsProvider2 contactsProvider,
mMimeTypeIdPhone = mDbHelper.getMimeTypeId(Phone.CONTENT_ITEM_TYPE);

// Query used to retrieve data from raw contacts to populate the corresponding aggregate
mRawContactsQueryByRawContactId = String.format(
mRawContactsQueryByRawContactId = String.format(Locale.US,
RawContactsQuery.SQL_FORMAT_BY_RAW_CONTACT_ID,
mMimeTypeIdPhoto, mMimeTypeIdPhone);

mRawContactsQueryByContactId = String.format(
mRawContactsQueryByContactId = String.format(Locale.US,
RawContactsQuery.SQL_FORMAT_BY_CONTACT_ID,
mMimeTypeIdPhoto, mMimeTypeIdPhone);
}
Expand Down
3 changes: 2 additions & 1 deletion src/com/android/providers/contacts/ContactsProvider2.java
Expand Up @@ -6063,7 +6063,8 @@ private Cursor bundleLetterCountExtras(Cursor cursor, final SQLiteDatabase db,

String locale = getLocale().toString();
HashMap<String, String> projectionMap = Maps.newHashMap();
String sectionHeading = String.format(AddressBookIndexQuery.SECTION_HEADING, sortKey);
String sectionHeading = String.format(Locale.US, AddressBookIndexQuery.SECTION_HEADING,
sortKey);
projectionMap.put(AddressBookIndexQuery.LETTER,
sectionHeading + " AS " + AddressBookIndexQuery.LETTER);

Expand Down

0 comments on commit a99ffbd

Please sign in to comment.