Ignore read missed calls and voicemails for notification

When the call log is restored by the system, all items are marked as new even though they could already been read. This causes a torrent of "missed" calls after restoring call log with the setup wizard.

This CL ignore read entities in the query.

Bug: 62871863
Test: CallLogNotificationQueryHelperTest
PiperOrigin-RevId: 167602820
Change-Id: Iba5609ace895a309685bfcd61eae85e080562ec5
diff --git a/java/com/android/dialer/app/calllog/CallLogNotificationsQueryHelper.java b/java/com/android/dialer/app/calllog/CallLogNotificationsQueryHelper.java
index 43e03e9..c749b65 100644
--- a/java/com/android/dialer/app/calllog/CallLogNotificationsQueryHelper.java
+++ b/java/com/android/dialer/app/calllog/CallLogNotificationsQueryHelper.java
@@ -298,7 +298,13 @@
             "no READ_CALL_LOG permission, returning null for calls lookup.");
         return null;
       }
-      final String selection = String.format("%s = 1 AND %s = ?", Calls.NEW, Calls.TYPE);
+      // A call is "new" when:
+      // NEW is 1. usually set when a new row is inserted
+      // TYPE matches the query type.
+      // IS_READ is not 1. A call might be backed up and restored, so it will be "new" to the
+      //   call log, but the user has already read it on another device.
+      final String selection =
+          String.format("%s = 1 AND %s = ? AND %s IS NOT 1", Calls.NEW, Calls.TYPE, Calls.IS_READ);
       final String[] selectionArgs = new String[] {Integer.toString(type)};
       try (Cursor cursor =
           mContentResolver.query(