diff options
author | Andrew Lee <anwlee@google.com> | 2015-06-20 01:18:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-20 01:18:52 +0000 |
commit | f3ec8ad515ec344acd53fa4acaa9df4cad0c2306 (patch) | |
tree | 557ead47e7e583cb8b37b8c4a9cb9cf664d0ae15 /src/com/android/dialer/calllog/CallLogFragment.java | |
parent | 03aaf3894d8af53f241d1189c504e44c538100d4 (diff) | |
parent | 053b9c7a4b2662588706211fd8aa1f8a03ec2901 (diff) |
Merge "Rewrite of MediaPlayer logic." into mnc-dev
Diffstat (limited to 'src/com/android/dialer/calllog/CallLogFragment.java')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index 0f19f1491..21ea97ea6 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -187,7 +187,10 @@ public class CallLogFragment extends Fragment resolver.registerContentObserver(Status.CONTENT_URI, true, mVoicemailStatusObserver); setHasOptionsMenu(true); - mVoicemailPlaybackPresenter = new VoicemailPlaybackPresenter(activity, state); + if (mCallTypeFilter == Calls.VOICEMAIL_TYPE) { + mVoicemailPlaybackPresenter = VoicemailPlaybackPresenter + .getInstance(activity, state); + } } /** Called by the CallLogQueryHandler when the list of calls has been fetched or updated. */ @@ -321,23 +324,28 @@ public class CallLogFragment extends Fragment @Override public void onPause() { - mVoicemailPlaybackPresenter.onPause(getActivity().isFinishing()); + if (mVoicemailPlaybackPresenter != null) { + mVoicemailPlaybackPresenter.onPause(); + } mAdapter.pauseCache(); super.onPause(); } @Override public void onStop() { - super.onStop(); - updateOnTransition(false /* onEntry */); + + super.onStop(); } @Override public void onDestroy() { mAdapter.pauseCache(); mAdapter.changeCursor(null); - mVoicemailPlaybackPresenter.onDestroy(getActivity().isFinishing()); + + if (mVoicemailPlaybackPresenter != null) { + mVoicemailPlaybackPresenter.onDestroy(); + } getActivity().getContentResolver().unregisterContentObserver(mCallLogObserver); getActivity().getContentResolver().unregisterContentObserver(mContactsObserver); @@ -353,7 +361,10 @@ public class CallLogFragment extends Fragment outState.putLong(KEY_DATE_LIMIT, mDateLimit); mAdapter.onSaveInstanceState(outState); - mVoicemailPlaybackPresenter.onSaveInstanceState(outState); + + if (mVoicemailPlaybackPresenter != null) { + mVoicemailPlaybackPresenter.onSaveInstanceState(outState); + } } @Override |