Merge changes I0d53a576,I0baf31c3,I297b945c,I63c9165f

* changes:
  Forgot to keep this file in sync with //google/internal/communications/voicemailtranscription/v1/voicemail_transcription.proto
  Fixed issue where all contacts weren't beign shown.
  Add more logging when video surface texture is destroyed.
  Don't truncate long voicemail transcriptions
diff --git a/java/com/android/dialer/app/res/layout/call_log_list_item.xml b/java/com/android/dialer/app/res/layout/call_log_list_item.xml
index 63f14db..39dcbac 100644
--- a/java/com/android/dialer/app/res/layout/call_log_list_item.xml
+++ b/java/com/android/dialer/app/res/layout/call_log_list_item.xml
@@ -63,6 +63,7 @@
         <FrameLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_gravity="top"
             >
 
           <com.android.dialer.app.calllog.DialerQuickContactBadge
@@ -71,7 +72,6 @@
               android:layout_height="@dimen/contact_photo_size"
               android:paddingTop="2dp"
               android:nextFocusRight="@id/primary_action_view"
-              android:layout_gravity="top"
               android:focusable="true"/>
 
           <ImageView
@@ -162,9 +162,7 @@
               android:layout_height="wrap_content"
               android:textColor="@color/call_log_voicemail_transcript_color"
               android:textSize="@dimen/call_log_voicemail_transcription_text_size"
-              android:textIsSelectable="true"
-              android:ellipsize="marquee"
-              android:maxLines="10"/>
+              android:textIsSelectable="true"/>
 
             <TextView
               android:id="@+id/voicemail_transcription_branding"
diff --git a/java/com/android/dialer/searchfragment/list/SearchCursorManager.java b/java/com/android/dialer/searchfragment/list/SearchCursorManager.java
index 95bede0..3704e81 100644
--- a/java/com/android/dialer/searchfragment/list/SearchCursorManager.java
+++ b/java/com/android/dialer/searchfragment/list/SearchCursorManager.java
@@ -96,7 +96,7 @@
       contactsCursor.close();
     }
 
-    if (cursor != null && cursor.getCount() > 0) {
+    if (cursor != null) {
       contactsCursor = cursor;
     } else {
       contactsCursor = null;
@@ -114,7 +114,7 @@
       nearbyPlacesCursor.close();
     }
 
-    if (cursor != null && cursor.getCount() > 0) {
+    if (cursor != null) {
       nearbyPlacesCursor = cursor;
     } else {
       nearbyPlacesCursor = null;
@@ -132,7 +132,7 @@
       corpDirectoryCursor.close();
     }
 
-    if (cursor != null && cursor.getCount() > 0) {
+    if (cursor != null) {
       corpDirectoryCursor = cursor;
     } else {
       corpDirectoryCursor = null;
diff --git a/java/com/android/incallui/videosurface/impl/VideoSurfaceTextureImpl.java b/java/com/android/incallui/videosurface/impl/VideoSurfaceTextureImpl.java
index 6ce564a..fa75724 100644
--- a/java/com/android/incallui/videosurface/impl/VideoSurfaceTextureImpl.java
+++ b/java/com/android/incallui/videosurface/impl/VideoSurfaceTextureImpl.java
@@ -220,10 +220,10 @@
     public boolean onSurfaceTextureDestroyed(SurfaceTexture destroyedSurfaceTexture) {
       LogUtil.i(
           "SurfaceTextureListener.onSurfaceTextureDestroyed",
-          "destroyedSurfaceTexture: "
-              + destroyedSurfaceTexture
-              + " "
-              + VideoSurfaceTextureImpl.this.toString());
+          "destroyedSurfaceTexture: %s, %s, isDoneWithSurface: %b",
+          destroyedSurfaceTexture,
+          VideoSurfaceTextureImpl.this.toString(),
+          isDoneWithSurface);
       if (delegate != null) {
         delegate.onSurfaceDestroyed(VideoSurfaceTextureImpl.this);
       } else {
diff --git a/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto b/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto
index a2064d1..697e9e3 100644
--- a/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto
+++ b/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto
@@ -56,6 +56,18 @@
   FAILED_NO_SPEECH_DETECTED = 7;
 }
 
+// Enum that specifies the user's consent to donate a specific voicemail.
+enum DonationPreference {
+  // Default but invalid value.
+  USER_PREFERENCE_UNSPECIFIED = 0;
+
+  // User does not consent to donating this voicemail.
+  DO_NOT_DONATE = 1;
+
+  // User consents to donating this voicemail.
+  DONATE = 2;
+}
+
 // Request for synchronous voicemail transcription.
 message TranscribeVoicemailRequest {
   // Voicemail audio file containing the raw bytes we receive from the carrier.
@@ -78,6 +90,16 @@
 
   // Audio format of the voicemail file.
   optional AudioFormat audio_format = 2;
+
+  // The client may provide their own unique ID for this transcription. It
+  // should be globally unique across all voicemails from all users.
+  // If the given transcription_id is not unique, an ALREADY_EXISTS (409) error
+  // will be returned.
+  // If no transcription_id is provided, one will be generated by the server.
+  optional string transcription_id = 3;
+
+  // User's donation preference.
+  optional DonationPreference donation_preference = 4;
 }
 
 // Response for asynchronous voicemail transcription containing information