diff options
Diffstat (limited to 'src/com/android/dialer')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 51 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 2 |
2 files changed, 1 insertions, 52 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 106513156..173306882 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -40,7 +40,6 @@ import android.view.ViewTreeObserver; import android.view.accessibility.AccessibilityEvent; import android.widget.ImageView; import android.widget.TextView; -import android.widget.Toast; import com.android.common.widget.GroupingListAdapter; import com.android.contacts.common.ContactPhotoManager; @@ -143,7 +142,6 @@ public class CallLogAdapter extends GroupingListAdapter protected final Context mContext; private final ContactInfoHelper mContactInfoHelper; private final CallFetcher mCallFetcher; - private final Toast mReportedToast; private final OnReportButtonClickListener mOnReportButtonClickListener; private ViewTreeObserver mViewTreeObserver = null; @@ -345,8 +343,6 @@ public class CallLogAdapter extends GroupingListAdapter mCallItemExpandedListener = callItemExpandedListener; mOnReportButtonClickListener = onReportButtonClickListener; - mReportedToast = Toast.makeText(mContext, R.string.toast_caller_id_reported, - Toast.LENGTH_SHORT); mContactInfoCache = ExpirableCache.create(CONTACT_INFO_CACHE_SIZE); mRequests = new LinkedList<ContactInfoRequest>(); @@ -1121,48 +1117,6 @@ public class CallLogAdapter extends GroupingListAdapter mDayGroups.clear(); } - /* - * Get the number from the Contacts, if available, since sometimes - * the number provided by caller id may not be formatted properly - * depending on the carrier (roaming) in use at the time of the - * incoming call. - * Logic : If the caller-id number starts with a "+", use it - * Else if the number in the contacts starts with a "+", use that one - * Else if the number in the contacts is longer, use that one - */ - public String getBetterNumberFromContacts(String number, String countryIso) { - String matchingNumber = null; - // Look in the cache first. If it's not found then query the Phones db - NumberWithCountryIso numberCountryIso = new NumberWithCountryIso(number, countryIso); - ContactInfo ci = mContactInfoCache.getPossiblyExpired(numberCountryIso); - if (ci != null && ci != ContactInfo.EMPTY) { - matchingNumber = ci.number; - } else { - try { - Cursor phonesCursor = mContext.getContentResolver().query( - Uri.withAppendedPath(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI, number), - PhoneQuery._PROJECTION, null, null, null); - if (phonesCursor != null) { - try { - if (phonesCursor.moveToFirst()) { - matchingNumber = phonesCursor.getString(PhoneQuery.MATCHED_NUMBER); - } - } finally { - phonesCursor.close(); - } - } - } catch (Exception e) { - // Use the number from the call log - } - } - if (!TextUtils.isEmpty(matchingNumber) && - (matchingNumber.startsWith("+") - || matchingNumber.length() > number.length())) { - number = matchingNumber; - } - return number; - } - /** * Retrieves the call Ids represented by the current call log row. * @@ -1199,11 +1153,6 @@ public class CallLogAdapter extends GroupingListAdapter } } - public void onBadDataReported(String number) { - mContactInfoCache.expireAll(); - mReportedToast.show(); - } - /** * Manages the state changes for the UI interaction where a call log row is expanded. * diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index 6d07301df..c4e453c33 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -672,7 +672,7 @@ public class CallLogFragment extends ListFragment if (number == null) { return; } - mAdapter.onBadDataReported(number); + mAdapter.invalidateCache(); mAdapter.notifyDataSetChanged(); } |