always reset singleton if running a unit test
This commit is contained in:
@@ -58,15 +58,12 @@ public class KeychainDatabase {
|
||||
private static KeychainDatabase sInstance;
|
||||
|
||||
public static KeychainDatabase getInstance(Context context) {
|
||||
if (sInstance == null || Constants.IS_RUNNING_UNITTEST) {
|
||||
sInstance = new KeychainDatabase(context.getApplicationContext());
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public static void resetSingleton() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
public interface Tables {
|
||||
String KEY_RINGS_PUBLIC = "keyrings_public";
|
||||
String KEYS = "keys";
|
||||
|
||||
Reference in New Issue
Block a user