Чистка предупреждений

This commit is contained in:
2026-04-19 14:10:29 +03:00
parent b3c00b1719
commit c84edcf16a
10 changed files with 17 additions and 20 deletions

View File

@@ -18,7 +18,7 @@ import javax.inject.Singleton
@Singleton
class TaskPipelineForegroundBootstrap @Inject constructor(
@ApplicationContext private val app: Context,
@param:ApplicationContext private val app: Context,
private val orchestrator: ITaskOrchestrator,
) {
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.Default)

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
</manifest>

View File

@@ -2,8 +2,8 @@ package com.github.nullptroma.wallenc.data.storages
import com.github.nullptroma.wallenc.data.db.app.repository.StorageKeyMapRepository
import com.github.nullptroma.wallenc.data.model.StorageKeyMap
import com.github.nullptroma.wallenc.domain.datatypes.EncryptKey
import com.github.nullptroma.wallenc.data.storages.encrypt.EncryptedStorage
import com.github.nullptroma.wallenc.domain.datatypes.EncryptKey
import com.github.nullptroma.wallenc.domain.encrypt.Encryptor
import com.github.nullptroma.wallenc.domain.interfaces.IStorage
import com.github.nullptroma.wallenc.domain.interfaces.IUnlockManager
@@ -12,7 +12,6 @@ import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock

View File

@@ -291,8 +291,8 @@ class LocalStorageAccessor(
return@withContext listOf()
val list = mutableListOf<IFile>()
scanStorage(baseStoragePath = path, maxDepth = 0, fileCallback = { _, CommonFile ->
list.add(CommonFile)
scanStorage(baseStoragePath = path, maxDepth = 0, fileCallback = { _, commonFile ->
list.add(commonFile)
})
return@withContext list
}
@@ -303,7 +303,7 @@ class LocalStorageAccessor(
val buf = mutableListOf<IFile>()
var pageNumber = 0
scanStorage(baseStoragePath = path, maxDepth = 0, fileCallback = { _, CommonFile ->
scanStorage(baseStoragePath = path, maxDepth = 0, fileCallback = { _, commonFile ->
if (buf.size == DATA_PAGE_LENGTH) {
val page = DataPage(
list = buf.toList(),
@@ -316,7 +316,7 @@ class LocalStorageAccessor(
emit(page)
buf.clear()
}
buf.add(CommonFile)
buf.add(commonFile)
})
// отправка последней страницы
val page = DataPage(

View File

@@ -94,11 +94,11 @@ class CloseHandledStreamExtension {
}
fun OutputStream.onClosing(callback: ()->Unit): OutputStream {
return CloseHandledOutputStream(this, callback, {})
return CloseHandledOutputStream(this, callback) {}
}
fun InputStream.onClosing(callback: ()->Unit): InputStream {
return CloseHandledInputStream(this, callback, {})
return CloseHandledInputStream(this, callback) {}
}
}
}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
</manifest>

View File

@@ -7,22 +7,20 @@ import com.github.nullptroma.wallenc.domain.interfaces.IDirectory
import com.github.nullptroma.wallenc.domain.interfaces.IFile
import com.github.nullptroma.wallenc.domain.interfaces.ILogger
import com.github.nullptroma.wallenc.domain.interfaces.IStorageInfo
import com.github.nullptroma.wallenc.domain.tasks.ITaskOrchestrator
import com.github.nullptroma.wallenc.domain.tasks.TaskLogLevel
import com.github.nullptroma.wallenc.domain.usecases.GetOpenedStoragesUseCase
import com.github.nullptroma.wallenc.domain.usecases.ManageLocalVaultUseCase
import com.github.nullptroma.wallenc.domain.usecases.ManageStoragesEncryptionUseCase
import com.github.nullptroma.wallenc.domain.usecases.RemoveStorageUseCase
import com.github.nullptroma.wallenc.domain.usecases.RenameStorageUseCase
import com.github.nullptroma.wallenc.domain.usecases.StorageFileManagementUseCase
import com.github.nullptroma.wallenc.domain.tasks.ITaskOrchestrator
import com.github.nullptroma.wallenc.domain.tasks.PipelineWork
import com.github.nullptroma.wallenc.domain.tasks.TaskLogLevel
import com.github.nullptroma.wallenc.presentation.ViewModelBase
import com.github.nullptroma.wallenc.presentation.extensions.toPrintable
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.launch
import javax.inject.Inject
import kotlin.system.measureTimeMillis
@@ -116,7 +114,7 @@ class LocalVaultViewModel @Inject constructor(
taskOrchestrator.enqueue(
title = "Create storage",
requiresForeground = false,
work = PipelineWork { ctx ->
work = { ctx ->
ctx.log(TaskLogLevel.Info, "Creating storage…")
manageLocalVaultUseCase.createStorage()
ctx.log(TaskLogLevel.Info, "Storage created")
@@ -195,7 +193,7 @@ class LocalVaultViewModel @Inject constructor(
taskOrchestrator.enqueue(
title = "Disable encryption",
requiresForeground = true,
work = PipelineWork { ctx ->
work = { ctx ->
try {
ctx.log(TaskLogLevel.Info, "Disabling encryption…")
manageStoragesEncryptionUseCase.clearAndDisableEncryption(storage) { p ->
@@ -221,7 +219,7 @@ class LocalVaultViewModel @Inject constructor(
taskOrchestrator.enqueue(
title = "Remove storage",
requiresForeground = true,
work = PipelineWork { ctx ->
work = { ctx ->
try {
ctx.log(TaskLogLevel.Info, "Removing storage…")
removeStorageUseCase.remove(storage)

View File

@@ -18,7 +18,7 @@ class TaskPipelineViewModel @Inject constructor(
orchestrator.enqueue(
title = "Test task (${safeDurationSec}s)",
requiresForeground = true,
work = PipelineWork { ctx ->
work = { ctx ->
val steps = if (safeDurationSec == 0) 1 else safeDurationSec * 10
ctx.log(TaskLogLevel.Info, "Test task started for ${safeDurationSec}s")
for (step in 0..steps) {