summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-06-18 18:19:20 -0700
committerAndrew Lee <anwlee@google.com>2015-06-19 18:16:32 -0700
commit053b9c7a4b2662588706211fd8aa1f8a03ec2901 (patch)
treea9a933161af013c40bf64a9a457a86a86df3637e /src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
parentb67f24eb6229ea10afb83f8ef2bf2bc6ba29a8f6 (diff)
Rewrite of MediaPlayer logic.
+ Control MediaPlayer instance more tightly. Wait until prepareContent to initialize instance. Release MediaPlayer when it is no longer needed. + Instead of using isFinishing, check explicitly for orientation change to know whether to release MediaPlayer. + Change Presenter to singleton, to address audio change wonkiness. + Only create a Presenter if the call log fragment shows voicemail. + ... fixing a variety of cases. - Temporarily disable proximity sensor until blocking issue is fixed. Bug: 21856243 Change-Id: Ic06e98bb5278467c3cce726a06b6cf3d855861a2
Diffstat (limited to 'src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java')
-rw-r--r--src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
index 73f4b3b1c..ca487db56 100644
--- a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
+++ b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
@@ -50,8 +50,9 @@ import javax.annotation.concurrent.NotThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
/**
- * Displays and plays a single voicemail.
- * <p>
+ * Displays and plays a single voicemail. See {@link VoicemailPlaybackPresenter} for
+ * details on the voicemail playback implementation.
+ *
* This class is not thread-safe, it is thread-confined. All calls to all public
* methods on this class are expected to come from the main ui thread.
*/
@@ -178,12 +179,13 @@ public class VoicemailPlaybackLayout extends LinearLayout
if (mPresenter == null) {
return;
}
- CallLogAsyncTaskUtil.deleteVoicemail(mContext, mPresenter.getVoicemailUri(), null);
+ CallLogAsyncTaskUtil.deleteVoicemail(mContext, mVoicemailUri, null);
}
};
private Context mContext;
private VoicemailPlaybackPresenter mPresenter;
+ private Uri mVoicemailUri;
private boolean mIsPlaying = false;
@@ -209,8 +211,9 @@ public class VoicemailPlaybackLayout extends LinearLayout
}
@Override
- public void setPresenter(VoicemailPlaybackPresenter presenter) {
+ public void setPresenter(VoicemailPlaybackPresenter presenter, Uri voicemailUri) {
mPresenter = presenter;
+ mVoicemailUri = voicemailUri;
}
@Override
@@ -256,15 +259,13 @@ public class VoicemailPlaybackLayout extends LinearLayout
}
@Override
- public void onPlaybackError(Exception e) {
+ public void onPlaybackError() {
if (mPositionUpdater != null) {
mPositionUpdater.stopUpdating();
}
disableUiElements();
mPlaybackPosition.setText(getString(R.string.voicemail_playback_error));
-
- Log.e(TAG, "Could not play voicemail", e);
}