[db] Use `LocaleListCompat.getDefault()`
Not a fan to bake this in everywhere, but perhaps we'll address it someday.
This commit is contained in:
parent
c4be61c5a8
commit
63b06c0bda
|
@ -1,7 +1,5 @@
|
|||
package org.fdroid.database
|
||||
|
||||
import android.content.res.Resources
|
||||
import androidx.core.os.ConfigurationCompat.getLocales
|
||||
import androidx.core.os.LocaleListCompat
|
||||
import org.fdroid.CompatibilityChecker
|
||||
import org.fdroid.index.IndexFormatVersion.ONE
|
||||
|
@ -24,7 +22,7 @@ internal class DbV1StreamReceiver(
|
|||
private val compatibilityChecker: CompatibilityChecker,
|
||||
) : IndexV1StreamReceiver {
|
||||
|
||||
private val locales: LocaleListCompat = getLocales(Resources.getSystem().configuration)
|
||||
private val locales: LocaleListCompat = LocaleListCompat.getDefault()
|
||||
|
||||
override fun receive(repo: RepoV2, version: Long, certificate: String?) {
|
||||
db.getRepositoryDao().clear(repoId)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package org.fdroid.database
|
||||
|
||||
import android.content.res.Resources
|
||||
import androidx.core.os.ConfigurationCompat.getLocales
|
||||
import androidx.core.os.LocaleListCompat
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import org.fdroid.CompatibilityChecker
|
||||
|
@ -13,7 +11,7 @@ internal class DbV2DiffStreamReceiver(
|
|||
private val compatibilityChecker: CompatibilityChecker,
|
||||
) : IndexV2DiffStreamReceiver {
|
||||
|
||||
private val locales: LocaleListCompat = getLocales(Resources.getSystem().configuration)
|
||||
private val locales: LocaleListCompat = LocaleListCompat.getDefault()
|
||||
|
||||
override fun receiveRepoDiff(version: Long, repoJsonObject: JsonObject) {
|
||||
db.getRepositoryDao().updateRepository(repoId, version, repoJsonObject)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package org.fdroid.database
|
||||
|
||||
import android.content.res.Resources
|
||||
import androidx.core.os.ConfigurationCompat.getLocales
|
||||
import androidx.core.os.LocaleListCompat
|
||||
import kotlinx.serialization.SerializationException
|
||||
import org.fdroid.CompatibilityChecker
|
||||
|
@ -23,7 +21,7 @@ internal class DbV2StreamReceiver(
|
|||
private val compatibilityChecker: CompatibilityChecker,
|
||||
) : IndexV2StreamReceiver {
|
||||
|
||||
private val locales: LocaleListCompat = getLocales(Resources.getSystem().configuration)
|
||||
private val locales: LocaleListCompat = LocaleListCompat.getDefault()
|
||||
private var clearedRepoData = false
|
||||
private val nonNullFileV2: (FileV2?) -> Unit = { fileV2 ->
|
||||
if (fileV2 != null) {
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package org.fdroid.repo
|
||||
|
||||
import android.content.res.Resources
|
||||
import android.net.Uri
|
||||
import androidx.core.os.ConfigurationCompat.getLocales
|
||||
import androidx.core.os.LocaleListCompat
|
||||
import kotlinx.serialization.SerializationException
|
||||
import org.fdroid.database.Repository
|
||||
|
@ -24,7 +22,7 @@ internal class RepoV1Fetcher(
|
|||
private val repoUriBuilder: RepoUriBuilder,
|
||||
) : RepoFetcher {
|
||||
|
||||
private val locales: LocaleListCompat = getLocales(Resources.getSystem().configuration)
|
||||
private val locales: LocaleListCompat = LocaleListCompat.getDefault()
|
||||
|
||||
@Throws(SigningException::class, SerializationException::class)
|
||||
override suspend fun fetchRepo(
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package org.fdroid.repo
|
||||
|
||||
import android.content.res.Resources
|
||||
import androidx.core.os.ConfigurationCompat.getLocales
|
||||
import androidx.core.os.LocaleListCompat
|
||||
import org.fdroid.LocaleChooser.getBestLocale
|
||||
import org.fdroid.database.AppOverviewItem
|
||||
|
@ -78,7 +76,7 @@ internal open class RepoV2StreamReceiver(
|
|||
)
|
||||
}
|
||||
|
||||
private val locales: LocaleListCompat = getLocales(Resources.getSystem().configuration)
|
||||
private val locales: LocaleListCompat = LocaleListCompat.getDefault()
|
||||
|
||||
override fun receive(repo: RepoV2, version: Long, certificate: String) {
|
||||
receiver.onRepoReceived(
|
||||
|
|
Loading…
Reference in New Issue