Move the KeyValueDatabase to a separate physical database.

This commit is contained in:
Greyson Parrelli
2021-01-05 11:50:20 -05:00
committed by Alan Evans
parent 46d412a6c3
commit c466dba8c4
10 changed files with 228 additions and 50 deletions

View File

@@ -1,5 +1,6 @@
package org.thoughtcrime.securesms.keyvalue;
import android.app.Application;
import android.content.Context;
import androidx.annotation.AnyThread;
@@ -38,9 +39,9 @@ public final class KeyValueStore implements KeyValueReader {
private KeyValueDataSet dataSet;
public KeyValueStore(@NonNull Context context) {
public KeyValueStore(@NonNull Application application) {
this.executor = SignalExecutors.newCachedSingleThreadExecutor("signal-KeyValueStore");
this.database = DatabaseFactory.getKeyValueDatabase(context);
this.database = KeyValueDatabase.getInstance(application);
}
@AnyThread