summaryrefslogtreecommitdiff
path: root/java/com/android/dialer
diff options
context:
space:
mode:
authortwyen <twyen@google.com>2017-07-26 18:00:48 -0700
committerEric Erfanian <erfanian@google.com>2017-07-27 07:30:33 -0700
commita1fa899a3d7c1497006707976560180c0fb2b1ae (patch)
treebf85d9de45ed618511fadfdaeb0b4b87cd10aa70 /java/com/android/dialer
parent83258c2b5b6e68b3f603e5cfb9cf82992f46953b (diff)
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
Diffstat (limited to 'java/com/android/dialer')
-rw-r--r--java/com/android/dialer/database/CallLogQueryHandler.java26
1 files changed, 14 insertions, 12 deletions
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 =