diff options
author | Jay Shrauner <shrauner@google.com> | 2014-09-11 16:00:45 -0700 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2014-09-12 12:19:11 -0700 |
commit | 515bd5d6bd69220eb80f6d58eb5bf9540ef5b50a (patch) | |
tree | b362430d37ddbcccbcd2a30aff8c1ccc29e8d5a3 /src/com/android/dialer/calllog/CallLogFragment.java | |
parent | b0d983f23060c3ef3884a03e52af0c273b1b072a (diff) |
Fix cursor handling in CallLogQueryHandler
Remove dead code and fix potential leak.
Bug:17472228
Change-Id: I0d628b20efa424c049457b57b4a669670d3d51ed
Diffstat (limited to 'src/com/android/dialer/calllog/CallLogFragment.java')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index b75e1c62d..9dbfd4464 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -42,7 +42,6 @@ import android.view.ViewGroup.LayoutParams; import android.widget.ListView; import android.widget.TextView; -import com.android.common.io.MoreCloseables; import com.android.contacts.common.GeoUtil; import com.android.contacts.common.util.ViewUtil; import com.android.dialer.R; @@ -227,9 +226,10 @@ public class CallLogFragment extends AnalyticsListFragment /** Called by the CallLogQueryHandler when the list of calls has been fetched or updated. */ @Override - public void onCallsFetched(Cursor cursor) { + public boolean onCallsFetched(Cursor cursor) { if (getActivity() == null || getActivity().isFinishing()) { - return; + // Return false; we did not take ownership of the cursor + return false; } mAdapter.setLoading(false); mAdapter.changeCursor(cursor); @@ -262,6 +262,7 @@ public class CallLogFragment extends AnalyticsListFragment } mCallLogFetched = true; destroyEmptyLoaderIfAllDataFetched(); + return true; } /** @@ -276,7 +277,6 @@ public class CallLogFragment extends AnalyticsListFragment int activeSources = mVoicemailStatusHelper.getNumberActivityVoicemailSources(statusCursor); setVoicemailSourcesAvailable(activeSources != 0); - MoreCloseables.closeQuietly(statusCursor); mVoicemailStatusFetched = true; destroyEmptyLoaderIfAllDataFetched(); } |