Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9e2bd08 authored by Vasu Nori's avatar Vasu Nori
Browse files

when database is opened, set journal_mode to TRAUNCATE

this journal_mode is more efficnent than the default journal_mode (DELETE)

Change-Id: I8879d3fe8dda410f4674ead9270aa7ecdaf91b5e
parent a896308c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -884,6 +884,13 @@ public class SQLiteDatabase extends SQLiteClosable {
        }
        sqliteDatabase.setPageSize(sBlockSize);

        // set journal_mode to truncate
        String s = DatabaseUtils.stringForQuery(sqliteDatabase, "PRAGMA journal_mode=TRUNCATE",
                null);
        if (!s.equalsIgnoreCase("TRUNCATE")) {
            Log.e(TAG, "setting journal_mode to TRUNCATE failed");
        }

        // add this database to the list of databases opened in this process
        ActiveDatabases.addActiveDatabase(sqliteDatabase);
        return sqliteDatabase;