code: public void setWriteAheadLoggingEnabled(boolean enabled) {
          synchronized (this) {
              if (mEnableWriteAheadLogging != enabled) {
                  if (mDatabase != null && mDatabase.isOpen() && !mDatabase.isReadOnly()) {
                      if (enabled) {
                          mDatabase.enableWriteAheadLogging();
                      } else {
                          mDatabase.disableWriteAheadLogging();
                      }
                  }
                  mEnableWriteAheadLogging = enabled;
              }
          }
      }
docs: Enables or disables the use of write-ahead logging for the database.
  
  Write-ahead logging cannot be used with read-only databases so the value of
  this flag is ignored if the database is opened read-only.
  
  @param enabled True if write-ahead logging should be enabled, false if it
  should be disabled.
  
  @see SQLiteDatabase#enableWriteAheadLogging()