Исправлено множество предупреждений
This commit is contained in:
@@ -35,7 +35,7 @@ class YandexDiskLiveIntegrationTest {
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() = runBlocking {
|
||||
fun tearDown(): Unit = runBlocking {
|
||||
runCatching { repository.delete(probePath, permanently = true) }
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,6 @@ object YandexTestCredentials {
|
||||
fun oauthToken(): String? =
|
||||
InstrumentationRegistry.getArguments().getString("yandex.oauth.token")?.takeIf { it.isNotBlank() }
|
||||
|
||||
fun userId(): String? =
|
||||
InstrumentationRegistry.getArguments().getString("yandex.user.id")?.takeIf { it.isNotBlank() }
|
||||
|
||||
fun vaultUuid(): String? =
|
||||
InstrumentationRegistry.getArguments().getString("yandex.vault.uuid")?.takeIf { it.isNotBlank() }
|
||||
|
||||
fun assumePresent(message: String = "Добавьте yandex.test.oauth.token в local.properties") {
|
||||
assumeFalse(message, oauthToken().isNullOrBlank())
|
||||
}
|
||||
|
||||
@@ -70,7 +70,8 @@
|
||||
<service
|
||||
android:name=".tasks.TaskPipelineForegroundService"
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="dataSync" />
|
||||
android:foregroundServiceType="dataSync"
|
||||
android:description="@string/fgs_task_pipeline_description" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -16,11 +16,19 @@ object UiStringModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideUiStringResolver(@ApplicationContext context: Context): UiStringResolver =
|
||||
UiStringResolver { id, args ->
|
||||
if (args.isEmpty()) {
|
||||
context.getString(id)
|
||||
} else {
|
||||
context.getString(id, *args)
|
||||
}
|
||||
object : UiStringResolver {
|
||||
override fun invoke(id: Int, vararg formatArgs: Any): String =
|
||||
if (formatArgs.isEmpty()) {
|
||||
context.getString(id)
|
||||
} else {
|
||||
context.getString(id, *formatArgs)
|
||||
}
|
||||
|
||||
override fun plurals(id: Int, quantity: Int, vararg formatArgs: Any): String =
|
||||
if (formatArgs.isEmpty()) {
|
||||
context.resources.getQuantityString(id, quantity)
|
||||
} else {
|
||||
context.resources.getQuantityString(id, quantity, *formatArgs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.callbackFlow
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import androidx.core.content.edit
|
||||
|
||||
/**
|
||||
* Хранение выбранного языка. SharedPreferences — для синхронного чтения в
|
||||
@@ -50,7 +51,7 @@ internal object AppLocaleStorage {
|
||||
}
|
||||
|
||||
fun persistLanguage(context: Context, language: AppLanguage) {
|
||||
prefs(context).edit().putString(PREFS_KEY_LANGUAGE, language.storageValue).apply()
|
||||
prefs(context).edit { putString(PREFS_KEY_LANGUAGE, language.storageValue) }
|
||||
applyLanguage(language)
|
||||
}
|
||||
|
||||
@@ -83,7 +84,7 @@ internal object AppLocaleStorage {
|
||||
runCatching {
|
||||
val legacy = storage.legacyLocaleDataStore.data.first()[legacyLanguageKey]
|
||||
if (legacy != null) {
|
||||
prefs(storage).edit().putString(PREFS_KEY_LANGUAGE, legacy).apply()
|
||||
prefs(storage).edit { putString(PREFS_KEY_LANGUAGE, legacy) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,5 @@
|
||||
<string name="task_notification_preparing">Подготовка…</string>
|
||||
<string name="task_notification_indeterminate">Выполняется…</string>
|
||||
<string name="task_notification_cancel">Отмена</string>
|
||||
<string name="fgs_task_pipeline_description">Показывает прогресс фоновых задач хранилищ и vault.</string>
|
||||
</resources>
|
||||
|
||||
@@ -6,4 +6,5 @@
|
||||
<string name="task_notification_preparing">Preparing…</string>
|
||||
<string name="task_notification_indeterminate">Running…</string>
|
||||
<string name="task_notification_cancel">Cancel</string>
|
||||
<string name="fgs_task_pipeline_description">Shows progress while storage and vault tasks run in the background.</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user