From 4ee24a9492c7c83952f59ecc54071c31aa68fa86 Mon Sep 17 00:00:00 2001 From: zachh Date: Thu, 11 Jan 2018 14:05:10 -0800 Subject: Fixed bug in handling of empty numbers in new call log. Empty numbers were not being inserted into PhoneLookupHistory because the URI "content://.../PhoneLookupHistory/" is treated the same as "content://.../PhoneLookupHistory" (w/o the trailing slash). This caused the update (i.e. replace) operation to incorrectly update all rows in the table when it should have updated a single row. The fix for this was to switch to a query parameter, so the empty number URI now looks like "content://.../PhoneLookupHistory?number=" Also improved some logging while debugging this problem. Bug: 71866050 Test: unit and manual PiperOrigin-RevId: 181659081 Change-Id: Idec4fb77e74920cd5485620b0a997db03aa8ff9b --- java/com/android/dialer/calllog/database/MutationApplier.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'java/com/android/dialer/calllog/database') diff --git a/java/com/android/dialer/calllog/database/MutationApplier.java b/java/com/android/dialer/calllog/database/MutationApplier.java index eee810eb8..2fb52558e 100644 --- a/java/com/android/dialer/calllog/database/MutationApplier.java +++ b/java/com/android/dialer/calllog/database/MutationApplier.java @@ -68,7 +68,7 @@ public class MutationApplier { if (!mutations.getInserts().isEmpty()) { LogUtil.i( - "CallLogMutations.applyToDatabase", "inserting %d rows", mutations.getInserts().size()); + "MutationApplier.applyToDatabase", "inserting %d rows", mutations.getInserts().size()); for (Entry entry : mutations.getInserts().entrySet()) { long id = entry.getKey(); ContentValues contentValues = entry.getValue(); @@ -82,7 +82,7 @@ public class MutationApplier { if (!mutations.getUpdates().isEmpty()) { LogUtil.i( - "CallLogMutations.applyToDatabase", "updating %d rows", mutations.getUpdates().size()); + "MutationApplier.applyToDatabase", "updating %d rows", mutations.getUpdates().size()); for (Entry entry : mutations.getUpdates().entrySet()) { long id = entry.getKey(); ContentValues contentValues = entry.getValue(); @@ -96,7 +96,7 @@ public class MutationApplier { if (!mutations.getDeletes().isEmpty()) { LogUtil.i( - "CallLogMutations.applyToDatabase", "deleting %d rows", mutations.getDeletes().size()); + "MutationApplier.applyToDatabase", "deleting %d rows", mutations.getDeletes().size()); String[] questionMarks = new String[mutations.getDeletes().size()]; Arrays.fill(questionMarks, "?"); -- cgit v1.2.3