summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/providers/contacts/CallLogProvider.java4
-rw-r--r--src/com/android/providers/contacts/ContactsDatabaseHelper.java20
-rw-r--r--tests/src/com/android/providers/contacts/CallLogProviderTest.java2
3 files changed, 24 insertions, 2 deletions
diff --git a/src/com/android/providers/contacts/CallLogProvider.java b/src/com/android/providers/contacts/CallLogProvider.java
index f37e62b..8202241 100644
--- a/src/com/android/providers/contacts/CallLogProvider.java
+++ b/src/com/android/providers/contacts/CallLogProvider.java
@@ -78,6 +78,10 @@ public class CallLogProvider extends ContentProvider {
sCallsProjectionMap.put(Calls.CACHED_NUMBER_LABEL, Calls.CACHED_NUMBER_LABEL);
sCallsProjectionMap.put(Calls.COUNTRY_ISO, Calls.COUNTRY_ISO);
sCallsProjectionMap.put(Calls.GEOCODED_LOCATION, Calls.GEOCODED_LOCATION);
+ sCallsProjectionMap.put(Calls.CACHED_LOOKUP_URI, Calls.CACHED_LOOKUP_URI);
+ sCallsProjectionMap.put(Calls.CACHED_MATCHED_NUMBER, Calls.CACHED_MATCHED_NUMBER);
+ sCallsProjectionMap.put(Calls.CACHED_NORMALIZED_NUMBER, Calls.CACHED_NORMALIZED_NUMBER);
+ sCallsProjectionMap.put(Calls.CACHED_PHOTO_ID, Calls.CACHED_PHOTO_ID);
}
private ContactsDatabaseHelper mDbHelper;
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
index edf343d..f7847dd 100644
--- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java
+++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
@@ -102,7 +102,7 @@ import java.util.Locale;
* 600-699 Ice Cream Sandwich
* </pre>
*/
- static final int DATABASE_VERSION = 614;
+ static final int DATABASE_VERSION = 615;
private static final String DATABASE_NAME = "contacts2.db";
private static final String DATABASE_PRESENCE = "presence_db";
@@ -1162,6 +1162,10 @@ import java.util.Locale;
Calls.VOICEMAIL_URI + " TEXT," +
Calls.IS_READ + " INTEGER," +
Calls.GEOCODED_LOCATION + " TEXT," +
+ Calls.CACHED_LOOKUP_URI + " TEXT," +
+ Calls.CACHED_MATCHED_NUMBER + " TEXT," +
+ Calls.CACHED_NORMALIZED_NUMBER + " TEXT," +
+ Calls.CACHED_PHOTO_ID + " INTEGER NOT NULL DEFAULT 0," +
Voicemails._DATA + " TEXT," +
Voicemails.HAS_CONTENT + " INTEGER," +
Voicemails.MIME_TYPE + " TEXT," +
@@ -2213,6 +2217,11 @@ import java.util.Locale;
oldVersion = 614;
}
+ if (oldVersion < 615) {
+ upgradeToVersion615(db);
+ oldVersion = 615;
+ }
+
if (upgradeViewsAndTriggers) {
createContactsViews(db);
createGroupsView(db);
@@ -3405,6 +3414,15 @@ import java.util.Locale;
"FOREIGN KEY(stream_item_id) REFERENCES stream_items(_id));");
}
+ private void upgradeToVersion615(SQLiteDatabase db) {
+ // Old calls will not have up to date values for these columns, they will be filled in
+ // as needed.
+ db.execSQL("ALTER TABLE calls ADD lookup_uri TEXT DEFAULT NULL;");
+ db.execSQL("ALTER TABLE calls ADD matched_number TEXT DEFAULT NULL;");
+ db.execSQL("ALTER TABLE calls ADD normalized_number TEXT DEFAULT NULL;");
+ db.execSQL("ALTER TABLE calls ADD photo_id INTEGER NOT NULL DEFAULT 0;");
+ }
+
public String extractHandleFromEmailAddress(String email) {
Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(email);
if (tokens.length == 0) {
diff --git a/tests/src/com/android/providers/contacts/CallLogProviderTest.java b/tests/src/com/android/providers/contacts/CallLogProviderTest.java
index e337862..3a73c97 100644
--- a/tests/src/com/android/providers/contacts/CallLogProviderTest.java
+++ b/tests/src/com/android/providers/contacts/CallLogProviderTest.java
@@ -63,7 +63,7 @@ public class CallLogProviderTest extends BaseContactsProvider2Test {
Voicemails.SOURCE_DATA,
Voicemails.STATE};
/** Total number of columns exposed by call_log provider. */
- private static final int NUM_CALLLOG_FIELDS = 13;
+ private static final int NUM_CALLLOG_FIELDS = 17;
@Override
protected Class<? extends ContentProvider> getProviderClass() {