Merge "avoid cursor leak in email provider" into jb-ub-mail-ur9

This commit is contained in:
Paul Westbrook 2013-04-05 20:49:09 +00:00 committed by Android (Google) Code Review
commit 9fd03edb83

View File

@ -1066,6 +1066,7 @@ public final class DBHelper {
Cursor c = db.query(Account.TABLE_NAME,
new String[] {EmailContent.RECORD_ID /*0*/, AccountColumns.SECURITY_FLAGS /*1*/},
AccountColumns.SECURITY_FLAGS + ">0", null, null, null, null);
try {
ContentValues cv = new ContentValues();
String[] args = new String[1];
while (c.moveToNext()) {
@ -1077,6 +1078,9 @@ public final class DBHelper {
args[0] = Long.toString(c.getLong(0 /*RECORD_ID*/));
db.update(Account.TABLE_NAME, cv, EmailContent.RECORD_ID + "=?", args);
}
} finally {
c.close();
}
}
/** Upgrades the database from v17 to v18 */