summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/contacts/ContactsDatabaseHelper.java
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-07-16 17:19:36 -0700
committerYorke Lee <yorkelee@google.com>2014-07-17 15:22:26 -0700
commit3b34457a4cc0d2c55676f366ddc673091a198adb (patch)
tree1c747584502b2b79560d5b2aa981586b5efc722c /src/com/android/providers/contacts/ContactsDatabaseHelper.java
parent20452f1ba16ee28786ceb0271cbf326a5f8487f8 (diff)
downloadpackages_providers_ContactsProvider-3b34457a4cc0d2c55676f366ddc673091a198adb.zip
packages_providers_ContactsProvider-3b34457a4cc0d2c55676f366ddc673091a198adb.tar.gz
packages_providers_ContactsProvider-3b34457a4cc0d2c55676f366ddc673091a198adb.tar.bz2
Sync call log entries from the primary user into the secondary user's call log
On startup of a secondary user's call log provider, sync any call log entries from the primary user's call log that are: 1) Newer than the last sync time 2) Not a voicemail 3) Not a duplicate entry (identified by the number, and start time of the call) Bug: 16298776 Change-Id: I843dfd8dd5c9433942e610cbbc2dfed95c29dd1c
Diffstat (limited to 'src/com/android/providers/contacts/ContactsDatabaseHelper.java')
-rw-r--r--src/com/android/providers/contacts/ContactsDatabaseHelper.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
index 2243288..76cbeb1 100644
--- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java
+++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
@@ -314,6 +314,7 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper {
String ICU_VERSION = "icu_version";
String LOCALE = "locale";
String DATABASE_TIME_CREATED = "database_time_created";
+ String CALL_LOG_LAST_SYNCED = "call_log_last_synced";
}
public interface Clauses {
@@ -1456,8 +1457,11 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper {
Contacts._ID + " INTEGER PRIMARY KEY" +
");");
- // The table for recent calls is here so we can do table joins
- // on people, phones, and calls all in one place.
+ // The table for recent calls is here so we can do table joins on people, phones, and
+ // calls all in one place.
+ // NOTE: When adding a new column to Tables.CALLS, make sure to also add it to
+ // CallLogProvider.CALL_LOG_SYNC_PROJECTION, if it is a column that should be copied to
+ // the call log of secondary users.
db.execSQL("CREATE TABLE " + Tables.CALLS + " (" +
Calls._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
Calls.NUMBER + " TEXT," +