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

Commit 81b65ebc authored by Vasu Nori's avatar Vasu Nori Committed by Android (Google) Code Review
Browse files

Merge "when database is opened, set journal_mode to TRAUNCATE"

parents 89ec91b6 f9e2bd08
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;