If there are no new calls, do not show older header.

If there are new and older calls, we should headers to identify them.
However, if there are only older calls, it does not make sense to have a
header there, and we should just show the call themselves.

On the other hand, if there are only new calls, it still makes sense to
keep the header there.

Bug: 5035679
Change-Id: I717577cf3b76f95843050acad4511ef71c864123
diff --git a/src/com/android/contacts/calllog/CallLogQueryHandler.java b/src/com/android/contacts/calllog/CallLogQueryHandler.java
index f0ce6c2..8ea544d 100644
--- a/src/com/android/contacts/calllog/CallLogQueryHandler.java
+++ b/src/com/android/contacts/calllog/CallLogQueryHandler.java
@@ -214,23 +214,16 @@
     @GuardedBy("this")
     private Cursor createMergedCursor() {
         try {
-            final boolean noNewCalls = mNewCallsCursor.getCount() == 0;
-            final boolean noOldCalls = mOldCallsCursor.getCount() == 0;
+            final boolean hasNewCalls = mNewCallsCursor.getCount() != 0;
+            final boolean hasOldCalls = mOldCallsCursor.getCount() != 0;
 
-            if (noNewCalls && noOldCalls) {
-                // Nothing in either cursors.
+            if (!hasNewCalls) {
+                // Return only the old calls, without the header.
                 MoreCloseables.closeQuietly(mNewCallsCursor);
                 return mOldCallsCursor;
             }
 
-            if (noNewCalls) {
-                // Return only the old calls.
-                MoreCloseables.closeQuietly(mNewCallsCursor);
-                return new MergeCursor(
-                        new Cursor[]{ createOldCallsHeaderCursor(), mOldCallsCursor });
-            }
-
-            if (noOldCalls) {
+            if (!hasOldCalls) {
                 // Return only the new calls.
                 MoreCloseables.closeQuietly(mOldCallsCursor);
                 return new MergeCursor(