From a1fa899a3d7c1497006707976560180c0fb2b1ae Mon Sep 17 00:00:00 2001 From: twyen Date: Wed, 26 Jul 2017 18:00:48 -0700 Subject: 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 --- .../dialer/database/CallLogQueryHandler.java | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'java/com/android/dialer') diff --git a/java/com/android/dialer/database/CallLogQueryHandler.java b/java/com/android/dialer/database/CallLogQueryHandler.java index 4ccf68e4f..4867d9dce 100644 --- a/java/com/android/dialer/database/CallLogQueryHandler.java +++ b/java/com/android/dialer/database/CallLogQueryHandler.java @@ -188,20 +188,22 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { 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 = -- cgit v1.2.3