diff options
author | Jay Shrauner <shrauner@google.com> | 2015-11-11 14:55:46 -0800 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2015-11-11 14:55:46 -0800 |
commit | 178d8da43a86726b74858b338e46b609722578dc (patch) | |
tree | 2c5f50b1c36d119267e23ac6e6310f23e4feaac7 /src | |
parent | 6b78baf09d39b6ef7a9decbef0d6677f63e73cef (diff) |
Fix NPE in requestContent
Null check mVoicemailUri.
Bug:25634572
Change-Id: I1d4a810516244ecc56426d757590360ed9d3e308
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 658aaec2d..8191d1dd8 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -429,8 +429,14 @@ public class VoicemailPlaybackPresenter implements MediaPlayer.OnPreparedListene * proceed to {@link #prepareContent()}. If the has_content field does not * become true within the allowed time, we will update the ui to reflect the fact that content * was not available. + * + * @return whether issued request to fetch content */ - private void requestContent() { + private boolean requestContent() { + if (mContext == null || mVoicemailUri == null) { + return false; + } + if (mFetchResultHandler != null) { mFetchResultHandler.destroy(); } @@ -442,6 +448,7 @@ public class VoicemailPlaybackPresenter implements MediaPlayer.OnPreparedListene // Send voicemail fetch request. Intent intent = new Intent(VoicemailContract.ACTION_FETCH_VOICEMAIL, mVoicemailUri); mContext.sendBroadcast(intent); + return true; } @ThreadSafe @@ -629,14 +636,13 @@ public class VoicemailPlaybackPresenter implements MediaPlayer.OnPreparedListene * playing. */ public void resumePlayback() { - if (mView == null || mContext == null) { + if (mView == null) { return; } if (!mIsPrepared) { // If we haven't downloaded the voicemail yet, attempt to download it. - requestContent(); - mIsPlaying = true; + mIsPlaying = requestContent(); return; } |