Allow subclasses of ContactTileView to customize name display

Bug: 10294357
Change-Id: I7706561b585d0e5eb8dd85b083534ae0724aab06
diff --git a/src/com/android/contacts/common/list/ContactTileView.java b/src/com/android/contacts/common/list/ContactTileView.java
index 1f0e514..99d0da1 100644
--- a/src/com/android/contacts/common/list/ContactTileView.java
+++ b/src/com/android/contacts/common/list/ContactTileView.java
@@ -92,7 +92,7 @@
     public void loadFromContact(ContactEntry entry) {
 
         if (entry != null) {
-            mName.setText(entry.name);
+            mName.setText(getNameForView(entry.name));
             mLookupUri = entry.lookupKey;
 
             if (mStatus != null) {
@@ -161,6 +161,14 @@
     }
 
     /**
+     * Returns the string that should actually be displayed as the contact's name. Subclasses
+     * can override this to return formatted versions of the name - i.e. first name only.
+     */
+    protected String getNameForView(String name) {
+        return name;
+    }
+
+    /**
      * Implemented by subclasses to estimate the size of the picture. This can return -1 if only
      * a thumbnail is shown anyway
      */