Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ea617c3 authored by Flavio Lerda's avatar Flavio Lerda Committed by Android (Google) Code Review
Browse files

Merge "Maintain the current view (voicemail only or all calls) on updates."

parents f8297235 c071dc49
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public class CallLogAdapter extends GroupingListAdapter
        implements Runnable, ViewTreeObserver.OnPreDrawListener, CallLogGroupBuilder.GroupCreator {
    /** Interface used to initiate a refresh of the content. */
    public interface CallFetcher {
        public void startCallsQuery();
        public void fetchCalls();
    }

    /** The time in millis to delay starting the thread processing requests. */
@@ -183,9 +183,7 @@ public class CallLogAdapter extends GroupingListAdapter
     */
    @Override
    protected void onContentChanged() {
        // When the content changes, always fetch all the calls, in case a new missed call came
        // in and we were filtering over voicemail only, so that we see the missed call.
        mCallFetcher.startCallsQuery();
        mCallFetcher.fetchCalls();
    }

    void setLoading(boolean loading) {
+8 −0
Original line number Diff line number Diff line
@@ -220,6 +220,14 @@ public class CallLogFragment extends ListFragment implements ViewPagerVisibility
    }

    @Override
    public void fetchCalls() {
        if (mShowingVoicemailOnly) {
            mCallLogQueryHandler.fetchVoicemailOnly();
        } else {
            mCallLogQueryHandler.fetchAllCalls();
        }
    }

    public void startCallsQuery() {
        mAdapter.setLoading(true);
        mCallLogQueryHandler.fetchAllCalls();
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ public class CallLogAdapterTest extends AndroidTestCase {
        // Use a call fetcher that does not do anything.
        CallLogAdapter.CallFetcher fakeCallFetcher = new CallLogAdapter.CallFetcher() {
            @Override
            public void startCallsQuery() {}
            public void fetchCalls() {}
        };

        mAdapter = new TestCallLogAdapter(getContext(), fakeCallFetcher, TEST_COUNTRY_ISO,