Update metro to v0.11.0 (#6245)
* Update metro to v0.11.0 * Fix `@AssistedInject` usages Now the injected variables in the factories must match the names in the constructors --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín <jorgem@element.io>
This commit is contained in:
parent
4fb6346d4b
commit
896d62a81e
11 changed files with 23 additions and 23 deletions
|
|
@ -27,11 +27,11 @@ import timber.log.Timber
|
|||
|
||||
@AssistedInject
|
||||
class VacuumDatabaseWorker(
|
||||
@Assisted workerParams: WorkerParameters,
|
||||
@Assisted params: WorkerParameters,
|
||||
@ApplicationContext private val context: Context,
|
||||
private val matrixClientProvider: MatrixClientProvider,
|
||||
private val analyticsService: AnalyticsService,
|
||||
) : CoroutineWorker(context, workerParams) {
|
||||
) : CoroutineWorker(context, params) {
|
||||
companion object {
|
||||
const val SESSION_ID_PARAM = "session_id"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ interface VoiceMessagePresenterModule {
|
|||
@AssistedInject
|
||||
class VoiceMessagePresenter(
|
||||
voiceMessagePresenterFactory: VoiceMessagePresenterFactory,
|
||||
@Assisted private val item: MediaItem.Voice,
|
||||
@Assisted private val content: MediaItem.Voice,
|
||||
) : Presenter<VoiceMessageState> {
|
||||
@AssistedFactory
|
||||
fun interface Factory : MediaItemPresenterFactory<MediaItem.Voice, VoiceMessageState> {
|
||||
|
|
@ -45,10 +45,10 @@ class VoiceMessagePresenter(
|
|||
}
|
||||
|
||||
private val presenter = voiceMessagePresenterFactory.createVoiceMessagePresenter(
|
||||
eventId = item.eventId,
|
||||
mediaSource = item.mediaSource,
|
||||
mimeType = item.mediaInfo.mimeType,
|
||||
filename = item.mediaInfo.filename,
|
||||
eventId = content.eventId,
|
||||
mediaSource = content.mediaSource,
|
||||
mimeType = content.mediaInfo.mimeType,
|
||||
filename = content.mediaInfo.filename,
|
||||
// TODO Get the duration for the fallback?
|
||||
duration = Duration.ZERO,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ import kotlin.time.Duration.Companion.seconds
|
|||
|
||||
@AssistedInject
|
||||
class FetchNotificationsWorker(
|
||||
@Assisted workerParams: WorkerParameters,
|
||||
@Assisted params: WorkerParameters,
|
||||
@ApplicationContext private val context: Context,
|
||||
private val networkMonitor: NetworkMonitor,
|
||||
private val eventResolver: NotifiableEventResolver,
|
||||
|
|
@ -54,7 +54,7 @@ class FetchNotificationsWorker(
|
|||
private val workerDataConverter: SyncNotificationsWorkerDataConverter,
|
||||
private val buildVersionSdkIntProvider: BuildVersionSdkIntProvider,
|
||||
private val analyticsService: AnalyticsService,
|
||||
) : CoroutineWorker(context, workerParams) {
|
||||
) : CoroutineWorker(context, params) {
|
||||
override suspend fun doWork(): Result {
|
||||
Timber.d("FetchNotificationsWorker started")
|
||||
val requests = workerDataConverter.deserialize(inputData) ?: return Result.failure()
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class FetchNotificationWorkerTest {
|
|||
syncOnNotifiableEvent: SyncOnNotifiableEvent = SyncOnNotifiableEvent {},
|
||||
analyticsService: FakeAnalyticsService = FakeAnalyticsService(),
|
||||
) = FetchNotificationsWorker(
|
||||
workerParams = createWorkerParams(workDataOf("requests" to input)),
|
||||
params = createWorkerParams(workDataOf("requests" to input)),
|
||||
context = InstrumentationRegistry.getInstrumentation().context,
|
||||
networkMonitor = networkMonitor,
|
||||
eventResolver = eventResolver,
|
||||
|
|
|
|||
|
|
@ -63,16 +63,16 @@ class DefaultVoiceMessageMediaRepo(
|
|||
mxcTools: MxcTools,
|
||||
private val matrixMediaLoader: MatrixMediaLoader,
|
||||
@Assisted private val mediaSource: MediaSource,
|
||||
@Assisted("mimeType") private val mimeType: String?,
|
||||
@Assisted("filename") private val filename: String?,
|
||||
@Assisted private val mimeType: String?,
|
||||
@Assisted private val filename: String?,
|
||||
) : VoiceMessageMediaRepo {
|
||||
@ContributesBinding(RoomScope::class)
|
||||
@AssistedFactory
|
||||
fun interface Factory : VoiceMessageMediaRepo.Factory {
|
||||
override fun create(
|
||||
mediaSource: MediaSource,
|
||||
@Assisted("mimeType") mimeType: String?,
|
||||
@Assisted("filename") filename: String?,
|
||||
@Assisted mimeType: String?,
|
||||
@Assisted filename: String?,
|
||||
): DefaultVoiceMessageMediaRepo
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue