From d9c8b90cf4e2772a5d1d19a95eb11e596bf24f37 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 23 Jun 2015 17:19:53 -0700 Subject: Protect against null context. Bug: 22031896 Change-Id: I2da646a30a119c5be07dba8ad71c8e902969454e --- src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 5e75ca7e2..4cd8c4d13 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -272,8 +272,8 @@ public class VoicemailPlaybackPresenter * Must be invoked when the parent activity is paused. */ public void onPause() { - int orientation = mContext.getResources().getConfiguration().orientation; - if (mInitialOrientation != orientation && mIsPrepared) { + if (mContext != null && mIsPrepared + && mInitialOrientation != mContext.getResources().getConfiguration().orientation) { // If an orientation change triggers the pause, retain the MediaPlayer. Log.d(TAG, "onPause: Orientation changed."); return; -- cgit v1.2.3