Really really delay SMS processing until sqlcipher migration completes

Blocking the SMS job on the screen lock isn't enough, since then
the job races against the migration.

Fixes #7390
This commit is contained in:
Moxie Marlinspike
2018-02-26 14:02:12 -08:00
parent a0a9e412b4
commit 18aa202695
6 changed files with 87 additions and 4 deletions

View File

@@ -696,6 +696,10 @@ public class SmsDatabase extends MessagingDatabase {
return threadDeleted;
}
public void ensureMigration() {
databaseHelper.getWritableDatabase();
}
private boolean isDuplicate(IncomingTextMessage message, long threadId) {
SQLiteDatabase database = databaseHelper.getReadableDatabase();
Cursor cursor = database.query(TABLE_NAME, null, DATE_SENT + " = ? AND " + ADDRESS + " = ? AND " + THREAD_ID + " = ?",