docs: public void reconfigure(SQLiteDatabaseConfiguration configuration) {
          if (configuration == null) {
              throw new IllegalArgumentException("configuration must not be null.");
          }
  
          synchronized (mLock) {
              throwIfClosedLocked();
  
              boolean walModeChanged = ((configuration.openFlags ^ mConfiguration.openFlags)
                      & SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING) != 0;
              if (walModeChanged) {
                  // WAL mode can only be changed if there are no acquired connections
                  // because we need to close all but the primary connection first.
                  if (!mAcquiredConnections.isEmpty()) {
                      throw new IllegalStateException("Write Ahead Logging (WAL) mode cannot "
                              + "be enabled or disabled while there are transactions in "
                              + "progress.  Finish all transactions and release all active "
                              + "database connections first.");
                  }
  
                  // Close all non-primary connections.  This should happen immediately
                  // because none of them are in use.
                  closeAvailableNonPrimaryConnectionsAndLogExceptionsLocked();
                  assert mAvailableNonPrimaryConnections.isEmpty();
              }
  
              boolean foreignKeyModeChanged = configuration.foreignKeyConstraintsEnabled
                      != mConfiguration.foreignKeyConstraintsEnabled;
              if (foreignKeyModeChanged) {
                  // Foreign key constraints can only be changed if there are no transactions
                  // in progress.  To make this clear, we throw an exception if there are
                  // any acquired connections.
                  if (!mAcquiredConnections.isEmpty()) {
                      throw new IllegalStateException("Foreign Key Constraints cannot "
                              + "be enabled or disabled while there are transactions in "
                              + "progress.  Finish all transactions and release all active "
                              + "database connections first.");
                  }
              }
  
              if (mConfiguration.openFlags != configuration.openFlags) {
                  // If we are changing open flags and WAL mode at the same time, then
                  // we have no choice but to close the primary connection beforehand
                  // because there can only be one connection open when we change WAL mode.
                  if (walModeChanged) {
                      closeAvailableConnectionsAndLogExceptionsLocked();
                  }
  
                  // Try to reopen the primary connection using the new open flags then
                  // close and discard all existing connections.
                  // This might throw if the database is corrupt or cannot be opened in
                  // the new mode in which case existing connections will remain untouched.
                  SQLiteConnection newPrimaryConnection = openConnectionLocked(configuration,
                          true /*primaryConnection*/); // might throw
  
                  closeAvailableConnectionsAndLogExceptionsLocked();
                  discardAcquiredConnectionsLocked();
  
                  mAvailablePrimaryConnection = newPrimaryConnection;
                  mConfiguration.updateParametersFrom(configuration);
                  setMaxConnectionPoolSizeLocked();
              } else {
                  // Reconfigure the database connections in place.
                  mConfiguration.updateParametersFrom(configuration);
                  setMaxConnectionPoolSizeLocked();
  
                  closeExcessConnectionsAndLogExceptionsLocked();
                  reconfigureAllConnectionsLocked();
              }
  
              wakeConnectionWaitersLocked();
          }
      }