summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-06-30 10:52:59 -0700
committerYorke Lee <yorkelee@google.com>2015-06-30 10:52:59 -0700
commit465ae0eabc9ee6afce10dbb53789ead8800d519f (patch)
treed454d2f69508e16470d8119e545bab7bac2a0906
parent82d30284d32d2e563661ad0a1465c1b9bf501a9f (diff)
Protect against null mView
Bug: 22194812 Change-Id: I95e07820ed97d02fe61ee3ceee62c7e76c6f1cb5
-rw-r--r--src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
index 4597d35d0..19f71455d 100644
--- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
+++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
@@ -521,7 +521,9 @@ public class VoicemailPlaybackPresenter
mIsPrepared = false;
}
- mView.onPlaybackError();
+ if (mView != null) {
+ mView.onPlaybackError();
+ }
mPosition = 0;
mIsPlaying = false;
@@ -536,7 +538,9 @@ public class VoicemailPlaybackPresenter
// Reset the seekbar position to the beginning.
mPosition = 0;
- mView.setClipPosition(0, mDuration.get());
+ if (mView != null) {
+ mView.setClipPosition(0, mDuration.get());
+ }
}
@Override
@@ -610,7 +614,9 @@ public class VoicemailPlaybackPresenter
mPosition = mMediaPlayer.getCurrentPosition();
Log.d(TAG, "Paused playback at " + mPosition + ".");
- mView.onPlaybackStopped();
+ if (mView != null) {
+ mView.onPlaybackStopped();
+ }
mAudioManager.abandonAudioFocus(this);
mActivity.getWindow().clearFlags(LayoutParams.FLAG_KEEP_SCREEN_ON);