修改了contact类,完善了根据电话号码获取联系人姓名逻辑

pull/16/head
gy 4 weeks ago
parent 249914bef0
commit 4ddbb2c3e0

@ -25,16 +25,10 @@ import android.util.Log;
import java.util.HashMap;
/**
*
*/
public class Contact {
// 联系人缓存,避免重复查询
private static HashMap<String, String> sContactCache;
// 日志标签
private static final String TAG = "Contact";
// 查询联系人的SQL条件用于通过电话号码查找联系人
private static final String CALLER_ID_SELECTION = "PHONE_NUMBERS_EQUAL(" + Phone.NUMBER
+ ",?) AND " + Data.MIMETYPE + "='" + Phone.CONTENT_ITEM_TYPE + "'"
+ " AND " + Data.RAW_CONTACT_ID + " IN "
@ -42,12 +36,6 @@ public class Contact {
+ " FROM phone_lookup"
+ " WHERE min_match = '+')";
/**
*
* @param context
* @param phoneNumber
* @return null
*/
public static String getContact(Context context, String phoneNumber) {
if(sContactCache == null) {
sContactCache = new HashMap<String, String>();

Loading…
Cancel
Save