Merge "New behavior of setSynchronousMode" into pi-dev

am: 492457e94e

Change-Id: I45c388d4386b443a48b6c94632c373dfe1aa8af3
This commit is contained in:
Fyodor Kupolov
2018-06-04 14:47:39 -07:00
committed by android-build-merger
3 changed files with 7 additions and 5 deletions

View File

@@ -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());

View File

@@ -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

View File

@@ -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;