Returns true if database connection is open and initialized. @return true if the database connection is open, false otherwise.
()
| 427 | * @return true if the database connection is open, false otherwise. |
| 428 | */ |
| 429 | public boolean isOpen() { |
| 430 | // We need to special case for the auto closing database because mDatabase is the |
| 431 | // underlying database and not the wrapped database. |
| 432 | if (mAutoCloser != null) { |
| 433 | return mAutoCloser.isActive(); |
| 434 | } |
| 435 | |
| 436 | final SupportSQLiteDatabase db = mDatabase; |
| 437 | return db != null && db.isOpen(); |
| 438 | } |
| 439 | |
| 440 | /** |
| 441 | * Closes the database if it is already open. |
no test coverage detected