Only show loading text when downloading VM.

In other cases (eg. buffering), just load without showing the text,
since it will likely appear only for a very short time, and give
the appearance of flickering.

Bug: 22333980
Change-Id: Ic2bbba7a2127654aaf12546b177c465c9311ddc1
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c1eec8e..1ce6ab6 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -111,9 +111,6 @@
     <!-- Message to show when there is an error playing back the voicemail. [CHAR LIMIT=40] -->
     <string name="voicemail_playback_error">Couldn\'t play voicemail</string>
 
-    <!-- Message to display before we have prepared the media player, i.e. before we know duration. [CHAR LIMIT=40] -->
-    <string name="voicemail_buffering">Buffering\u2026</string>
-
     <!-- Message to display whilst we are waiting for the content to be fetched. [CHAR LIMIT=40] -->
     <string name="voicemail_fetching_content">Loading voicemail\u2026</string>
 
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
index 4a41c0e..69c075f 100644
--- a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
+++ b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
@@ -354,12 +354,6 @@
     }
 
     @Override
-    public void setIsBuffering() {
-        disableUiElements();
-        mStateText.setText(getString(R.string.voicemail_buffering));
-    }
-
-    @Override
     public void setIsFetchingContent() {
         disableUiElements();
         mStateText.setText(getString(R.string.voicemail_fetching_content));
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
index 3479dce..3f5a489 100644
--- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
+++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
@@ -85,7 +85,6 @@
         void onSpeakerphoneOn(boolean on);
         void setClipPosition(int clipPositionInMillis, int clipLengthInMillis);
         void setFetchContentTimeout();
-        void setIsBuffering();
         void setIsFetchingContent();
         void setPresenter(VoicemailPlaybackPresenter presenter, Uri voicemailUri);
     }
@@ -346,7 +345,6 @@
      * a request to fetch the content asynchronously via {@link #requestContent()}.
      */
     private void checkForContent() {
-        mView.setIsFetchingContent();
         mAsyncTaskExecutor.submit(Tasks.CHECK_FOR_CONTENT, new AsyncTask<Void, Void, Boolean>() {
             @Override
             public Boolean doInBackground(Void... params) {
@@ -403,6 +401,8 @@
 
         mFetchResultHandler = new FetchResultHandler(new Handler(), mVoicemailUri);
 
+        mView.setIsFetchingContent();
+
         // Send voicemail fetch request.
         Intent intent = new Intent(VoicemailContract.ACTION_FETCH_VOICEMAIL, mVoicemailUri);
         mContext.sendBroadcast(intent);
@@ -485,7 +485,7 @@
             mMediaPlayer = null;
         }
 
-        mView.setIsBuffering();
+        mView.disableUiElements();
         mIsPrepared = false;
 
         try {