FileDocCategorySizeDatePackage
SQLiteGlobal.javaAPI DocAndroid 5.1 API4247Thu Mar 12 22:22:10 GMT 2015android.database.sqlite

SQLiteGlobal

public final class SQLiteGlobal extends Object
Provides access to SQLite functions that affect all database connection, such as memory management. The native code associated with SQLiteGlobal is also sets global configuration options using sqlite3_config() then calls sqlite3_initialize() to ensure that the SQLite library is properly initialized exactly once before any other framework or application code has a chance to run. Verbose SQLite logging is enabled if the "log.tag.SQLiteLog" property is set to "V". (per {@link SQLiteDebug#DEBUG_SQL_LOG}).
hide

Fields Summary
private static final String
TAG
private static final Object
sLock
private static int
sDefaultPageSize
Constructors Summary
private SQLiteGlobal()


        

      
    
Methods Summary
public static java.lang.StringgetDefaultJournalMode()
Gets the default journal mode when WAL is not in use.

        return SystemProperties.get("debug.sqlite.journalmode",
                Resources.getSystem().getString(
                com.android.internal.R.string.db_default_journal_mode));
    
public static intgetDefaultPageSize()
Gets the default page size to use when creating a database.

        synchronized (sLock) {
            if (sDefaultPageSize == 0) {
                sDefaultPageSize = new StatFs("/data").getBlockSize();
            }
            return SystemProperties.getInt("debug.sqlite.pagesize", sDefaultPageSize);
        }
    
public static java.lang.StringgetDefaultSyncMode()
Gets the default database synchronization mode when WAL is not in use.

        return SystemProperties.get("debug.sqlite.syncmode",
                Resources.getSystem().getString(
                com.android.internal.R.string.db_default_sync_mode));
    
public static intgetJournalSizeLimit()
Gets the journal size limit in bytes.

        return SystemProperties.getInt("debug.sqlite.journalsizelimit",
                Resources.getSystem().getInteger(
                com.android.internal.R.integer.db_journal_size_limit));
    
public static intgetWALAutoCheckpoint()
Gets the WAL auto-checkpoint integer in database pages.

        int value = SystemProperties.getInt("debug.sqlite.wal.autocheckpoint",
                Resources.getSystem().getInteger(
                com.android.internal.R.integer.db_wal_autocheckpoint));
        return Math.max(1, value);
    
public static intgetWALConnectionPoolSize()
Gets the connection pool size when in WAL mode.

        int value = SystemProperties.getInt("debug.sqlite.wal.poolsize",
                Resources.getSystem().getInteger(
                com.android.internal.R.integer.db_connection_pool_size));
        return Math.max(2, value);
    
public static java.lang.StringgetWALSyncMode()
Gets the database synchronization mode when in WAL mode.

        return SystemProperties.get("debug.sqlite.wal.syncmode",
                Resources.getSystem().getString(
                com.android.internal.R.string.db_wal_sync_mode));
    
private static native intnativeReleaseMemory()

public static intreleaseMemory()
Attempts to release memory by pruning the SQLite page cache and other internal data structures.

return
The number of bytes that were freed.

        return nativeReleaseMemory();