diff options
author | Dianne Hackborn <hackbod@google.com> | 2009-05-06 15:22:38 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2009-05-06 15:22:38 -0700 |
commit | 2d5ed1fa3d29cdf1afb3bdfc3fc6a061f9f3feb3 (patch) | |
tree | 068b11207ac027c232bb4bc4679d938afc596560 /core/java/android/content/SyncStorageEngine.java | |
parent | 534032610c6701b63ab94f0336beeb9f4a830f2d (diff) | |
download | frameworks_base-2d5ed1fa3d29cdf1afb3bdfc3fc6a061f9f3feb3.zip frameworks_base-2d5ed1fa3d29cdf1afb3bdfc3fc6a061f9f3feb3.tar.gz frameworks_base-2d5ed1fa3d29cdf1afb3bdfc3fc6a061f9f3feb3.tar.bz2 |
Another fix: look at db version to determine if there is a type column.
Diffstat (limited to 'core/java/android/content/SyncStorageEngine.java')
-rw-r--r-- | core/java/android/content/SyncStorageEngine.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/java/android/content/SyncStorageEngine.java b/core/java/android/content/SyncStorageEngine.java index e240e65..e20e70f 100644 --- a/core/java/android/content/SyncStorageEngine.java +++ b/core/java/android/content/SyncStorageEngine.java @@ -1167,6 +1167,8 @@ public class SyncStorageEngine extends Handler { } if (db != null) { + final boolean hasType = db.getVersion() >= 11; + // Copy in all of the status information, as well as accounts. if (DEBUG_FILE) Log.v(TAG, "Reading legacy sync accounts db"); SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); @@ -1174,7 +1176,9 @@ public class SyncStorageEngine extends Handler { HashMap<String,String> map = new HashMap<String,String>(); map.put("_id", "status._id as _id"); map.put("account", "stats.account as account"); - map.put("account_type", "stats.account_type as account_type"); + if (hasType) { + map.put("account_type", "stats.account_type as account_type"); + } map.put("authority", "stats.authority as authority"); map.put("totalElapsedTime", "totalElapsedTime"); map.put("numSyncs", "numSyncs"); @@ -1193,7 +1197,8 @@ public class SyncStorageEngine extends Handler { Cursor c = qb.query(db, null, null, null, null, null, null); while (c.moveToNext()) { String accountName = c.getString(c.getColumnIndex("account")); - String accountType = c.getString(c.getColumnIndex("account_type")); + String accountType = hasType + ? c.getString(c.getColumnIndex("account_type")) : null; if (accountType == null) { accountType = "com.google.GAIA"; } |