mirror of
https://github.com/moparisthebest/k-9
synced 2025-03-03 01:51:49 -05:00
Make contacts searchable from phonetic names on Eclair and earlier.
Signed-off-by: HIRANO Takahito <hiranotaka@zng.info>
This commit is contained in:
parent
2daf8eaec8
commit
f8f916edde
@ -46,11 +46,15 @@ public abstract class Contacts
|
||||
int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
|
||||
|
||||
String className = null;
|
||||
if (sdkVersion <= Build.VERSION_CODES.DONUT)
|
||||
/*
|
||||
* The new API appeared in Eclair, but it supported phonetic names in Froyo.
|
||||
* Therefore we employ the old API in Eclair.
|
||||
*/
|
||||
if (sdkVersion <= Build.VERSION_CODES.ECLAIR_MR1)
|
||||
{
|
||||
className = "com.fsck.k9.helper.ContactsSdk3_4";
|
||||
}
|
||||
else if (sdkVersion >= Build.VERSION_CODES.ECLAIR)
|
||||
else
|
||||
{
|
||||
className = "com.fsck.k9.helper.ContactsSdk5";
|
||||
}
|
||||
|
@ -147,11 +147,15 @@ public class ContactsSdk3_4 extends com.fsck.k9.helper.Contacts
|
||||
") OR (" +
|
||||
Contacts.People.NAME + " LIKE ?" +
|
||||
") OR (" +
|
||||
Contacts.People.PHONETIC_NAME + " LIKE ?" +
|
||||
") OR (" +
|
||||
Contacts.People.PHONETIC_NAME + " LIKE ?" +
|
||||
") OR (" +
|
||||
Contacts.ContactMethods.DATA + " LIKE ?" +
|
||||
")";
|
||||
final String filter = constraint.toString() + "%";
|
||||
final String filter2 = "% " + filter;
|
||||
args = new String[] {filter, filter2, filter};
|
||||
args = new String[] {filter, filter2, filter, filter2, filter};
|
||||
}
|
||||
|
||||
final Cursor c = mContentResolver.query(
|
||||
|
Loading…
x
Reference in New Issue
Block a user