From 05b6a53db23cf8c2d90442d1c84c14fd09519390 Mon Sep 17 00:00:00 2001 From: zachh Date: Mon, 11 Dec 2017 13:57:57 -0800 Subject: Don't save UI executor in UiListener. When an activity is killed by the system, a new UiListener is created and attached, but it doesn't have its executor set. Rather than save it as an instance field, just get the Ui executor when needed, by passing the context to the listen method. Bug: 70510707 Test: unit and manual via "don't keep activities" developer option PiperOrigin-RevId: 178668338 Change-Id: I5360b525377edab5f3a117d1f0f50bf6da6a6f0c --- java/com/android/dialer/calllog/ui/NewCallLogFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'java/com/android/dialer/calllog/ui/NewCallLogFragment.java') diff --git a/java/com/android/dialer/calllog/ui/NewCallLogFragment.java b/java/com/android/dialer/calllog/ui/NewCallLogFragment.java index a5dccaf69..c10b52123 100644 --- a/java/com/android/dialer/calllog/ui/NewCallLogFragment.java +++ b/java/com/android/dialer/calllog/ui/NewCallLogFragment.java @@ -141,7 +141,8 @@ public final class NewCallLogFragment extends Fragment checkDirty ? refreshAnnotatedCallLogWorker.refreshWithDirtyCheck() : refreshAnnotatedCallLogWorker.refreshWithoutDirtyCheck(); - refreshAnnotatedCallLogListener.listen(future, unused -> {}, RuntimeException::new); + refreshAnnotatedCallLogListener.listen( + getContext(), future, unused -> {}, RuntimeException::new); }; ThreadUtil.getUiThreadHandler().postDelayed(refreshAnnotatedCallLogRunnable, WAIT_MILLIS); } -- cgit v1.2.3