diff options
author | zachh <zachh@google.com> | 2017-08-21 11:29:44 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-30 11:21:01 -0700 |
commit | 4a7cd6b773053c707c7198cfb6a309c02ab32abb (patch) | |
tree | ad6aec4ac2694ce3446d969876e2aeca2f7fb662 | |
parent | 8a16bd61085696e3b3ee5b6f9dfb9032175875d0 (diff) |
Fixed crash due to calling setRetainInstance on a nested fragment.
Fixed by using the activity's fragment manager when creating the DialerUiTask.
Bug: 64841638
Test: manual
PiperOrigin-RevId: 165952771
Change-Id: Id9cac50a127f5bf8af65fd8926a055abe2ef7525
3 files changed, 5 insertions, 3 deletions
diff --git a/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java b/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java index 6882ef9d8..8bfd48b05 100644 --- a/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java +++ b/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java @@ -80,7 +80,9 @@ public class VisualVoicemailCallLogFragment extends CallLogFragment { mPreSyncVoicemailStatusCheckExecutor = DialerExecutors.createUiTaskBuilder( - getFragmentManager(), "fetchVoicemailStatus", new VoicemailStatusWorker()) + getActivity().getFragmentManager(), + "fetchVoicemailStatus", + new VoicemailStatusWorker()) .onSuccess(this::onPreSyncVoicemailStatusChecked) .build(); diff --git a/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java b/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java index 6d5015a22..de4e1cc4a 100644 --- a/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java +++ b/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java @@ -221,7 +221,7 @@ public class VoicemailPlaybackPresenter } shareVoicemailExecutor = DialerExecutors.createUiTaskBuilder( - mActivity.getFragmentManager(), "test", new ShareVoicemailWorker()) + mActivity.getFragmentManager(), "shareVoicemail", new ShareVoicemailWorker()) .onSuccess( output -> { if (output == null) { diff --git a/java/com/android/dialer/common/concurrent/DialerUiTaskFragment.java b/java/com/android/dialer/common/concurrent/DialerUiTaskFragment.java index 7f2a5a06b..b6068b24e 100644 --- a/java/com/android/dialer/common/concurrent/DialerUiTaskFragment.java +++ b/java/com/android/dialer/common/concurrent/DialerUiTaskFragment.java @@ -88,7 +88,7 @@ public final class DialerUiTaskFragment<InputT, OutputT> extends Fragment { (DialerUiTaskFragment<InputT, OutputT>) fragmentManager.findFragmentByTag(taskId); if (fragment == null) { - LogUtil.i("DialerUiTaskFragment.create", "creating new DialerUiTaskFragment"); + LogUtil.i("DialerUiTaskFragment.create", "creating new DialerUiTaskFragment for " + taskId); fragment = new DialerUiTaskFragment<>(); fragmentManager.beginTransaction().add(fragment, taskId).commit(); } |