Handle null phone account handle for calllog filtering

cl/163140580 filters out audio call from Duo, but will also remove fi voicemails because fi writes null phone account handle.

null NOT LIKE x returns null.
null OR x returns x.

This CL limits the filter only to the call log, and handles the null phone account handle.

Bug: 64060628
Test: manual, leave voicemails in fi. Automated tests in a future CL. Test call log database in progress(see cl162013087)
PiperOrigin-RevId: 163284363
Change-Id: I69ba6cbadbd1a02f05405ca0f5273b0a5ea0e5e9
diff --git a/java/com/android/dialer/database/CallLogQueryHandler.java b/java/com/android/dialer/database/CallLogQueryHandler.java
index 4ccf68e..4867d9d 100644
--- a/java/com/android/dialer/database/CallLogQueryHandler.java
+++ b/java/com/android/dialer/database/CallLogQueryHandler.java
@@ -188,20 +188,22 @@
       VoicemailComponent.get(mContext)
           .getVoicemailClient()
           .appendOmtpVoicemailSelectionClause(mContext, where, selectionArgs);
+    } else {
+      // Filter out all Duo entries other than video calls
+      where
+          .append(" AND (")
+          .append(Calls.PHONE_ACCOUNT_COMPONENT_NAME)
+          .append(" IS NULL OR ")
+          .append(Calls.PHONE_ACCOUNT_COMPONENT_NAME)
+          .append(" NOT LIKE 'com.google.android.apps.tachyon%' OR ")
+          .append(Calls.FEATURES)
+          .append(" & ")
+          .append(Calls.FEATURES_VIDEO)
+          .append(" == ")
+          .append(Calls.FEATURES_VIDEO)
+          .append(")");
     }
 
-    // Filter out all Duo entries other than video calls
-    where
-        .append(" AND (")
-        .append(Calls.PHONE_ACCOUNT_COMPONENT_NAME)
-        .append(" NOT LIKE 'com.google.android.apps.tachyon%' OR ")
-        .append(Calls.FEATURES)
-        .append(" & ")
-        .append(Calls.FEATURES_VIDEO)
-        .append(" == ")
-        .append(Calls.FEATURES_VIDEO)
-        .append(")");
-
     final int limit = (mLogLimit == -1) ? NUM_LOGS_TO_DISPLAY : mLogLimit;
     final String selection = where.length() > 0 ? where.toString() : null;
     Uri uri =