Add voicemail transcriptions to Dialer

* Display voicemail transcriptions in the call log and call details
activity in the Dialer
* Fix a bug in CallDetailActivity that would result in multiple instances of    VoicemailPlaybackFragment being added on rotation. Now, reuse the same fragment
if it is already present in the FragmentManager, to avoid creating new ones
* Simplify some test and ctor logic in PhoneCallDetails to reduce the pain
of adding new fields into PhoneCallDetails
* Simplified playback_layout.xml to remove unnecessary parent LinearLayouts

Bug: 16320164

Change-Id: Ie68acc9058aace49d8e64f44a0128de0b6a3f842
diff --git a/src/com/android/dialer/PhoneCallDetails.java b/src/com/android/dialer/PhoneCallDetails.java
index 0dc6fd3..8692036 100644
--- a/src/com/android/dialer/PhoneCallDetails.java
+++ b/src/com/android/dialer/PhoneCallDetails.java
@@ -16,6 +16,8 @@
 
 package com.android.dialer;
 
+import com.google.common.annotations.VisibleForTesting;
+
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.provider.CallLog.Calls;
@@ -76,15 +78,32 @@
      * Total data usage for this call.
      */
     public final Long dataUsage;
+    /**
+     * Voicemail transcription
+     */
+    public final String transcription;
+
+    /**
+     * Create the details for a call, with empty defaults specified for extra fields that are
+     * not necessary for testing.
+     */
+    @VisibleForTesting
+    public PhoneCallDetails(CharSequence number, int numberPresentation,
+            CharSequence formattedNumber, String countryIso, String geocode,
+            int[] callTypes, long date, long duration) {
+        this (number, numberPresentation, formattedNumber, countryIso, geocode,
+        callTypes, date, duration, "", 0, "", null, null, 0, null, Calls.FEATURES_NONE,
+        null, null);
+    }
 
     /** Create the details for a call with a number not associated with a contact. */
     public PhoneCallDetails(CharSequence number, int numberPresentation,
             CharSequence formattedNumber, String countryIso, String geocode,
             int[] callTypes, long date, long duration, Drawable accountIcon, int features,
-            Long dataUsage) {
+            Long dataUsage, String transcription) {
         this(number, numberPresentation, formattedNumber, countryIso, geocode,
                 callTypes, date, duration, "", 0, "", null, null, 0, accountIcon, features,
-                dataUsage);
+                dataUsage, transcription);
     }
 
     /** Create the details for a call with a number associated with a contact. */
@@ -92,7 +111,8 @@
             CharSequence formattedNumber, String countryIso, String geocode,
             int[] callTypes, long date, long duration, CharSequence name,
             int numberType, CharSequence numberLabel, Uri contactUri,
-            Uri photoUri, int sourceType, Drawable accountIcon, int features, Long dataUsage) {
+            Uri photoUri, int sourceType, Drawable accountIcon, int features, Long dataUsage,
+            String transcription) {
         this.number = number;
         this.numberPresentation = numberPresentation;
         this.formattedNumber = formattedNumber;
@@ -110,5 +130,6 @@
         this.accountIcon = accountIcon;
         this.features = features;
         this.dataUsage = dataUsage;
+        this.transcription = transcription;
     }
 }