Remove unnecessary JNI lib and main thread check

The actual disk I/O will perform in the scope of DataStore.
This commit is contained in:
FooIbar committed 2025-08-19 12:07:34 +08:00
1 parent 35d92f1386
commit 51d6775429
2 files changed
+3 -2

No files matched your search

+3
View File
@@ -97,6 +97,9 @@ android {
dex {
useLegacyPackaging = false
}
jniLibs {
excludes += "**/libdatastore_shared_counter.so" // DataStore multi-process
}
resources {
// Required by Layout Inspector
pickFirsts += "/META-INF/androidx.compose.ui_ui.version"
@@ -5,11 +5,9 @@ import androidx.datastore.preferences.SharedPreferencesMigration
import androidx.datastore.preferences.core.PreferenceDataStoreFactory
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.preferencesDataStoreFile
import com.ehviewer.core.mainthread.checkNotMainThread
import splitties.init.appCtx
internal actual fun getDateStore(name: String?): DataStore<Preferences> {
checkNotMainThread()
val context = appCtx
val actualName = name ?: "${context.packageName}_preferences"
return PreferenceDataStoreFactory.create(