diff options
author | linyuh <linyuh@google.com> | 2018-01-24 18:15:17 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-24 19:10:21 -0800 |
commit | 849f332ffa5fc9430c4bc38c5a0ee78da77f0a39 (patch) | |
tree | d7891f88dcd88c5f20625eb58b3f43dd1e8610ad /java/com/android/dialer/calllog | |
parent | 0874af841f7e23357ceb2bb8825180b111d613b4 (diff) |
Add skeleton for SpamPhoneLookup
Bug: 70989534
Test: SpamPhoneLookupTest
PiperOrigin-RevId: 183174131
Change-Id: I46e819a0710ccce293195594e2f249e91d74551a
Diffstat (limited to 'java/com/android/dialer/calllog')
-rw-r--r-- | java/com/android/dialer/calllog/database/AnnotatedCallLogContentProvider.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/java/com/android/dialer/calllog/database/AnnotatedCallLogContentProvider.java b/java/com/android/dialer/calllog/database/AnnotatedCallLogContentProvider.java index 2427624a4..77de62ea4 100644 --- a/java/com/android/dialer/calllog/database/AnnotatedCallLogContentProvider.java +++ b/java/com/android/dialer/calllog/database/AnnotatedCallLogContentProvider.java @@ -75,7 +75,6 @@ public class AnnotatedCallLogContentProvider extends ContentProvider { } private AnnotatedCallLogDatabaseHelper databaseHelper; - private Coalescer coalescer; private final ThreadLocal<Boolean> applyingBatch = new ThreadLocal<>(); @@ -87,7 +86,12 @@ public class AnnotatedCallLogContentProvider extends ContentProvider { @Override public boolean onCreate() { databaseHelper = new AnnotatedCallLogDatabaseHelper(getContext(), MAX_ROWS); - coalescer = CallLogDatabaseComponent.get(getContext()).coalescer(); + + // Note: As this method is called before Application#onCreate, we must *not* initialize objects + // that require preparation work done in Application#onCreate. + // One example is to avoid obtaining an instance that depends on Google's proprietary config, + // which is initialized in Application#onCreate. + return true; } @@ -158,7 +162,10 @@ public class AnnotatedCallLogContentProvider extends ContentProvider { null, null, AnnotatedCallLog.TIMESTAMP + " DESC")) { - Cursor coalescedRows = coalescer.coalesce(allAnnotatedCallLogRows); + Cursor coalescedRows = + CallLogDatabaseComponent.get(getContext()) + .coalescer() + .coalesce(allAnnotatedCallLogRows); coalescedRows.setNotificationUri( getContext().getContentResolver(), CoalescedAnnotatedCallLog.CONTENT_URI); return coalescedRows; |