Skip to content

Commit ad6b87c

Browse files
author
mat-in
committed
Pass ioDispatcher to SafeBox.create in init()
1 parent 6bd5b1f commit ad6b87c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
xmlns:tools="http://schemas.android.com/tools" >
1919

2020
<application
21-
android:name=".demo"
2221
android:allowBackup="false"
2322
android:dataExtractionRules="@xml/data_extraction_rules"
2423
android:fullBackupContent="false"

safebox/src/main/java/com/harrytmthy/safebox/SafeBoxProvider.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package com.harrytmthy.safebox
22

33
import android.content.Context
44
import androidx.annotation.VisibleForTesting
5+
import kotlinx.coroutines.CoroutineDispatcher
6+
import kotlinx.coroutines.Dispatchers
57

68
/**
79
* SafeBoxProvider is a singleton holder for a [SafeBox] instance.
@@ -29,14 +31,16 @@ object SafeBoxProvider {
2931
keyAlias: String = SafeBox.DEFAULT_KEY_ALIAS,
3032
valueKeyStoreAlias: String = SafeBox.DEFAULT_VALUE_KEYSTORE_ALIAS,
3133
aad: ByteArray = fileName.toByteArray(),
34+
ioDispatcher: CoroutineDispatcher = Dispatchers.IO
3235
) {
3336
if (instance == null) {
3437
instance = SafeBox.create(
3538
context.applicationContext,
3639
fileName,
3740
keyAlias,
3841
valueKeyStoreAlias,
39-
aad
42+
aad,
43+
ioDispatcher
4044
)
4145
}
4246
}

0 commit comments

Comments
 (0)