summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllog/database
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2017-10-17 13:24:05 -0700
committerEric Erfanian <erfanian@google.com>2017-10-17 22:45:29 +0000
commit68cc4733e1619e1b6b7f6d5f52ab057cc48525bb (patch)
treec0a251acef8363247f40c01a19093038ac7d767f /java/com/android/dialer/calllog/database
parent30b973450f12cf0b694c7bf06018830a698ce40a (diff)
Display Voicemail Contact Name and Photo in Voicemail Fragment.
This CL lays the foundation of querying the annotated call log, retrieving only the voicemail entries and some of the voicemail information in the Voicemail tab. This CL only displays the name/number as well as the corresponding photo of the voicemails present on the device. WANT_LGTM=zachh SCREENSHOT: http://screen/YYBG8T0Ma0J Bug: 33006245, 64882313 Test: Unit tests and manual verification. PiperOrigin-RevId: 172504512 Change-Id: Ie7187b021abf42d1a4522458a1ab28537a7c222c
Diffstat (limited to 'java/com/android/dialer/calllog/database')
-rw-r--r--java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java b/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java
index a5f1425f8..589fe6384 100644
--- a/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java
+++ b/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java
@@ -60,6 +60,7 @@ class AnnotatedCallLogDatabaseHelper extends SQLiteOpenHelper {
.toString();
/** Deletes all but the first maxRows rows (by timestamp) to keep the table a manageable size. */
+ // TODO(zachh): Prevent voicemails from being garbage collected.
private static final String CREATE_TRIGGER_SQL =
"create trigger delete_old_rows after insert on "
+ AnnotatedCallLog.TABLE
@@ -79,12 +80,20 @@ class AnnotatedCallLogDatabaseHelper extends SQLiteOpenHelper {
+ AnnotatedCallLog.TABLE
+ " )); end;";
+ private static final String CREATE_INDEX_ON_CALL_TYPE_SQL =
+ "create index call_type_index on "
+ + AnnotatedCallLog.TABLE
+ + " ("
+ + AnnotatedCallLog.CALL_TYPE
+ + ");";
+
@Override
public void onCreate(SQLiteDatabase db) {
LogUtil.enterBlock("AnnotatedCallLogDatabaseHelper.onCreate");
long startTime = System.currentTimeMillis();
db.execSQL(CREATE_TABLE_SQL);
db.execSQL(String.format(Locale.US, CREATE_TRIGGER_SQL, maxRows, maxRows));
+ db.execSQL(CREATE_INDEX_ON_CALL_TYPE_SQL);
// TODO(zachh): Consider logging impression.
LogUtil.i(
"AnnotatedCallLogDatabaseHelper.onCreate",