Disable auto vacuum for Redmi note

pull/209/head
M66B 3 years ago
parent 6a3f908bc3
commit 3468ff7c45

@ -137,7 +137,7 @@ public abstract class DB extends RoomDatabase {
"page_count", "page_size", "max_page_count", "freelist_count", "page_count", "page_size", "max_page_count", "freelist_count",
"cache_size", "cache_spill", "cache_size", "cache_spill",
"soft_heap_limit", "hard_heap_limit", "mmap_size", "soft_heap_limit", "hard_heap_limit", "mmap_size",
"foreign_keys" "foreign_keys", "auto_vacuum"
)); ));
@Override @Override
@ -408,6 +408,15 @@ public abstract class DB extends RoomDatabase {
crumb.put("WAL", Boolean.toString(db.isWriteAheadLoggingEnabled())); crumb.put("WAL", Boolean.toString(db.isWriteAheadLoggingEnabled()));
Log.breadcrumb("Database", crumb); Log.breadcrumb("Database", crumb);
if (BuildConfig.DEBUG || Helper.isRedmiNote()) {
// https://www.sqlite.org/pragma.html#pragma_auto_vacuum
// https://android.googlesource.com/platform/external/sqlite.git/+/6ab557bdc070f11db30ede0696888efd19800475%5E!/
Log.i("Set PRAGMA auto_vacuum = INCREMENTAL");
try (Cursor cursor = db.query("PRAGMA auto_vacuum = INCREMENTAL;", null)) {
cursor.moveToNext(); // required
}
}
// https://www.sqlite.org/pragma.html#pragma_cache_size // https://www.sqlite.org/pragma.html#pragma_cache_size
Integer cache_size = getCacheSizeKb(context); Integer cache_size = getCacheSizeKb(context);
if (cache_size != null) { if (cache_size != null) {

Loading…
Cancel
Save