Merge "Move view-specific logic to ViewHolders."
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 28dab88..4c4921d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -627,10 +627,6 @@
          [CHAR LIMIT=NONE] -->
     <string name="toast_entry_removed">Deleted from call history</string>
 
-    <!-- Toast message which appears when a call log contact is reported.
-         [CHAR LIMIT=NONE] -->
-    <string name="toast_caller_id_reported">Number reported to Google</string>
-
     <!-- Button text for the "report" button displayed underneath an entry in the call log.
          Tapping causes the call log entry to be reported to Google as a bad id.
          [CHAR LIMIT=30] -->
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 1065131..1733068 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -40,7 +40,6 @@
 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 @@
     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 @@
         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 @@
         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 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 6d07301..c4e453c 100644
--- a/src/com/android/dialer/calllog/CallLogFragment.java
+++ b/src/com/android/dialer/calllog/CallLogFragment.java
@@ -672,7 +672,7 @@
         if (number == null) {
             return;
         }
-        mAdapter.onBadDataReported(number);
+        mAdapter.invalidateCache();
         mAdapter.notifyDataSetChanged();
     }