Merge "New behavior of setSynchronousMode" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
492457e94e
@@ -296,7 +296,9 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen
|
||||
final boolean useCompatibilityWal = mConfiguration.useCompatibilityWal();
|
||||
if (walEnabled || useCompatibilityWal) {
|
||||
setJournalMode("WAL");
|
||||
if (useCompatibilityWal && SQLiteCompatibilityWalFlags.areFlagsSet()) {
|
||||
if (mConfiguration.syncMode != null) {
|
||||
setSyncMode(mConfiguration.syncMode);
|
||||
} else if (useCompatibilityWal && SQLiteCompatibilityWalFlags.areFlagsSet()) {
|
||||
setSyncMode(SQLiteCompatibilityWalFlags.getWALSyncMode());
|
||||
} else {
|
||||
setSyncMode(SQLiteGlobal.getWALSyncMode());
|
||||
|
||||
@@ -2413,8 +2413,7 @@ public final class SQLiteDatabase extends SQLiteClosable {
|
||||
|
||||
/**
|
||||
* Returns <a href="https://sqlite.org/pragma.html#pragma_synchronous">synchronous mode</a>.
|
||||
* This value will only be used when {@link SQLiteDatabase#ENABLE_WRITE_AHEAD_LOGGING} flag
|
||||
* is not set, otherwise a system wide default will be used.
|
||||
* If not set, a system wide default will be used.
|
||||
* @see Builder#setSynchronousMode(String)
|
||||
*/
|
||||
@Nullable
|
||||
@@ -2601,7 +2600,7 @@ public final class SQLiteDatabase extends SQLiteClosable {
|
||||
|
||||
/**
|
||||
* Sets <a href="https://sqlite.org/pragma.html#pragma_synchronous">synchronous mode</a>
|
||||
* to use when {@link SQLiteDatabase#ENABLE_WRITE_AHEAD_LOGGING} flag is not set.
|
||||
* .
|
||||
* @return
|
||||
*/
|
||||
@NonNull
|
||||
|
||||
@@ -117,8 +117,9 @@ public final class SQLiteDatabaseConfiguration {
|
||||
public String journalMode;
|
||||
|
||||
/**
|
||||
* Synchronous mode to use when {@link SQLiteDatabase#ENABLE_WRITE_AHEAD_LOGGING} is not set.
|
||||
* Synchronous mode to use.
|
||||
* <p>Default is returned by {@link SQLiteGlobal#getDefaultSyncMode()}
|
||||
* or {@link SQLiteGlobal#getWALSyncMode()} depending on journal mode
|
||||
*/
|
||||
public String syncMode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user