Call History Affordances Swap

1. Swapped the intents for the primary view
2. Changed the icon for the secondary action button
3. Added a vertical divider line to separate the secondary action button from the primary view
4. Cleaned up the accessibility text

Change-Id: Ifd4ceff0d67b1587c4378e29be7344de50057a7d
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java
index 2a4a142..4424fcb 100644
--- a/src/com/android/dialer/PhoneCallDetailsHelper.java
+++ b/src/com/android/dialer/PhoneCallDetailsHelper.java
@@ -91,26 +91,13 @@
                 isHighlighted ? mCallTypeHelper.getHighlightedColor(details.callTypes[0]) : null;
 
         // The date of this call, relative to the current time.
-        CharSequence dateText =
-            DateUtils.getRelativeTimeSpanString(details.date,
-                    getCurrentTimeMillis(),
-                    DateUtils.MINUTE_IN_MILLIS,
-                    DateUtils.FORMAT_ABBREV_RELATIVE);
+        CharSequence dateText = getCallDate(details);
 
         // Set the call count and date.
         setCallCountAndDate(views, callCount, dateText, highlightColor);
 
-        CharSequence numberFormattedLabel = null;
-        // Only show a label if the number is shown and it is not a SIP address.
-        if (!TextUtils.isEmpty(details.number)
-                && !PhoneNumberHelper.isUriNumber(details.number.toString())) {
-            if (details.numberLabel == ContactInfo.GEOCODE_AS_LABEL) {
-                numberFormattedLabel = details.geocode;
-            } else {
-                numberFormattedLabel = Phone.getTypeLabel(mResources, details.numberType,
-                        details.numberLabel);
-            }
-        }
+        // Get type of call (ie mobile, home, etc) if known, or the caller's
+        CharSequence numberFormattedLabel = getCallTypeOrLocation(details);
 
         final CharSequence nameText;
         final CharSequence numberText;
@@ -141,6 +128,41 @@
         views.labelView.setVisibility(TextUtils.isEmpty(labelText) ? View.GONE : View.VISIBLE);
     }
 
+    /**
+     * For a call, if there is an associated contact for the caller, return the known call type
+     * (e.g. mobile, home, work).  If there is no associated contact, attempt to use the caller's
+     * location if known.
+     * @param details Call details to use.
+     * @return Type of call (mobile/home) if known, or the location of the caller (if known).
+     */
+    public CharSequence getCallTypeOrLocation(PhoneCallDetails details) {
+        CharSequence numberFormattedLabel = null;
+        // Only show a label if the number is shown and it is not a SIP address.
+        if (!TextUtils.isEmpty(details.number)
+                && !PhoneNumberHelper.isUriNumber(details.number.toString())) {
+            if (details.numberLabel == ContactInfo.GEOCODE_AS_LABEL) {
+                numberFormattedLabel = details.geocode;
+            } else {
+                numberFormattedLabel = Phone.getTypeLabel(mResources, details.numberType,
+                        details.numberLabel);
+            }
+        }
+        return numberFormattedLabel;
+    }
+
+    /**
+     * Get the call date/time of the call, relative to the current time.
+     * e.g. 3 minutes ago
+     * @param details Call details to use.
+     * @return String representing when the call occurred.
+     */
+    public CharSequence getCallDate(PhoneCallDetails details) {
+        return DateUtils.getRelativeTimeSpanString(details.date,
+                getCurrentTimeMillis(),
+                DateUtils.MINUTE_IN_MILLIS,
+                DateUtils.FORMAT_ABBREV_RELATIVE);
+    }
+
     /** Sets the text of the header view for the details page of a phone call. */
     public void setCallDetailsHeader(TextView nameView, PhoneCallDetails details) {
         final CharSequence nameText;