private void validateDatabase ( SQLiteDatabase sqliteDatabase , boolean validateHeader , boolean validateIntegrity , boolean close , boolean closeOnError ) { try { if ( validateHeader ) { validateDatabaseHeader ( sqliteDatabase ) ; } if ( validateIntegrity ) { validateDatabaseIntegrity ( sqliteDatabase ) ; } } catch ( Exception e ) { if ( closeOnError ) { sqliteDatabase . close ( ) ; } throw e ; } if ( close ) { sqliteDatabase . close ( ) ; } }
Validate the database header and integrity . Throw an error when not valid .