diff options
author | Nancy Chen <nancychen@google.com> | 2015-10-21 15:14:30 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2015-10-21 15:14:30 -0700 |
commit | 32919a5a3a242ba80d479470cbe00c858d06d89b (patch) | |
tree | 638917cb2be0eabc83712eb39182352c373a0981 /src/com/android/dialer | |
parent | b4d3a0d174ed0a3754d594623f40cf77ac141141 (diff) |
Fix NPE when plugging and unplugging earphones.
Crashes because the VoicemailPlaybackPresenter is alerted when the state
of the headset changes but the corresponding view may be out of focus.
Bug: 25090589
Change-Id: Iabe24eb969777ae3919ede05474f35d6c596b20e
Diffstat (limited to 'src/com/android/dialer')
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 9b4e20d38..c0884ad1b 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -749,6 +749,10 @@ public class VoicemailPlaybackPresenter implements MediaPlayer.OnPreparedListene * the presenter without the presenter triggering the audio manager and duplicating actions. */ public void setSpeakerphoneOn(boolean on) { + if (mView == null) { + return; + } + mView.onSpeakerphoneOn(on); mIsSpeakerphoneOn = on; |