make recreation of views atomic operation
This commit is contained in:
@@ -363,9 +363,15 @@ public class KeychainDatabase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void recreateUnifiedKeyView(SupportSQLiteDatabase db) {
|
private void recreateUnifiedKeyView(SupportSQLiteDatabase db) {
|
||||||
// noinspection deprecation
|
try {
|
||||||
db.execSQL("DROP VIEW IF EXISTS " + KeysModel.UNIFIEDKEYVIEW_VIEW_NAME);
|
db.beginTransaction();
|
||||||
db.execSQL(KeysModel.UNIFIEDKEYVIEW);
|
// noinspection deprecation
|
||||||
|
db.execSQL("DROP VIEW IF EXISTS " + KeysModel.UNIFIEDKEYVIEW_VIEW_NAME);
|
||||||
|
db.execSQL(KeysModel.UNIFIEDKEYVIEW);
|
||||||
|
db.setTransactionSuccessful();
|
||||||
|
} finally {
|
||||||
|
db.endTransaction();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void migrateSecretKeysFromDbToLocalStorage(SupportSQLiteDatabase db, Context context) throws IOException {
|
private void migrateSecretKeysFromDbToLocalStorage(SupportSQLiteDatabase db, Context context) throws IOException {
|
||||||
|
|||||||
Reference in New Issue
Block a user