From e31d7c01ca2d45941311f589e1df39077e8124f3 Mon Sep 17 00:00:00 2001 From: greenrobot Team Date: Mon, 12 Jun 2017 08:47:07 +0200 Subject: [PATCH] Add Database#isOpen(). Closes #700. --- .../main/java/org/greenrobot/greendao/database/Database.java | 2 ++ .../org/greenrobot/greendao/database/EncryptedDatabase.java | 5 +++++ .../org/greenrobot/greendao/database/StandardDatabase.java | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/DaoCore/src/main/java/org/greenrobot/greendao/database/Database.java b/DaoCore/src/main/java/org/greenrobot/greendao/database/Database.java index fbc1e8c33..1634e72f0 100644 --- a/DaoCore/src/main/java/org/greenrobot/greendao/database/Database.java +++ b/DaoCore/src/main/java/org/greenrobot/greendao/database/Database.java @@ -40,6 +40,8 @@ public interface Database { boolean isDbLockedByCurrentThread(); + boolean isOpen(); + void close(); Object getRawDatabase(); diff --git a/DaoCore/src/main/java/org/greenrobot/greendao/database/EncryptedDatabase.java b/DaoCore/src/main/java/org/greenrobot/greendao/database/EncryptedDatabase.java index 3906cabec..c586ab4ce 100644 --- a/DaoCore/src/main/java/org/greenrobot/greendao/database/EncryptedDatabase.java +++ b/DaoCore/src/main/java/org/greenrobot/greendao/database/EncryptedDatabase.java @@ -72,6 +72,11 @@ public boolean isDbLockedByCurrentThread() { return delegate.isDbLockedByCurrentThread(); } + @Override + public boolean isOpen() { + return delegate.isOpen(); + } + @Override public void close() { delegate.close(); diff --git a/DaoCore/src/main/java/org/greenrobot/greendao/database/StandardDatabase.java b/DaoCore/src/main/java/org/greenrobot/greendao/database/StandardDatabase.java index ff7493271..6106f8143 100644 --- a/DaoCore/src/main/java/org/greenrobot/greendao/database/StandardDatabase.java +++ b/DaoCore/src/main/java/org/greenrobot/greendao/database/StandardDatabase.java @@ -72,6 +72,11 @@ public boolean isDbLockedByCurrentThread() { return delegate.isDbLockedByCurrentThread(); } + @Override + public boolean isOpen() { + return delegate.isOpen(); + } + @Override public void close() { delegate.close();