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

Commit 01a479cc authored by Vasu Nori's avatar Vasu Nori
Browse files

bug:3339065 enable sqlite concurrency enhancing feature on settingsprovider

why is settingsprovider doing getReadbleDatabase() in onCreate() method?
it shoul do getWritableDatabse() so that sqlite's WAL
feature can be enabled on it.

Change-Id: I60e46ce240a6474bbb50ab26fb1d979242b0c9ad
parent 91bfb813
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -262,11 +262,8 @@ public class SettingsProvider extends ContentProvider {

        // Watch for external modifications to the database file,
        // keeping our cache in sync.
        // It's kinda lame to call mOpenHelper.getReadableDatabase()
        // during onCreate(), but since ensureAndroidIdIsSet has
        // already done it above and initialized/upgraded the
        // database, might as well just use it...
        SQLiteDatabase db = mOpenHelper.getReadableDatabase();
        SQLiteDatabase db = mOpenHelper.getWritableDatabase();
        db.enableWriteAheadLogging();
        sObserverInstance = new SettingsFileObserver(db.getPath());
        sObserverInstance.startWatching();
        startAsyncCachePopulation();