Move all binding containers to a di package and normalize their method names

Every @BindingContainer now lives in a di subpackage, in a file named after
it. Containers that were declared inside a shared file (SimplePlayer.kt,
LockScreenConfig.kt, VoiceMessagePresenter.kt, TimelineItemPresenterFactories.kt,
MediaItemPresenterFactories.kt) are extracted into their own file.

Method names are made consistent too:
- @Binds functions are named bind<ConcreteParameterType>, fixing three that
  named something else (notably RoomAliasResolverBindingContainer, whose
  provider was still called providesJoinRoomPresenterFactory).
- @Provides functions are named after what they provide, and all use the
  provides prefix rather than a mix of provide and provides.

ANDROID_KEYSTORE moves back to the cryptography impl package, next to
KeyStoreSecretKeyRepository which uses it; it is not DI specific and would
otherwise be unreachable from there.

No behaviour change: Metro discovers containers via @ContributesTo and does
not care about method names, so the only call site to follow was in
DefaultVoiceRecorderTest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benoit Marty
2026-08-24 11:38:11 +02:00
parent a845763f5b
commit e6116d5840
38 changed files with 204 additions and 131 deletions
@@ -56,7 +56,7 @@ object SessionMatrixBindingContainer {
}
@Provides
fun provideRoomMembershipObserver(matrixClient: MatrixClient): RoomMembershipObserver {
fun providesRoomMembershipObserver(matrixClient: MatrixClient): RoomMembershipObserver {
return matrixClient.roomMembershipObserver
}
@@ -112,7 +112,7 @@ object SessionMatrixBindingContainer {
}
@Provides
fun providesGetUrlResolverClient(matrixClient: MatrixClient): ClientUrlContentFetcher {
fun providesClientUrlContentFetcher(matrixClient: MatrixClient): ClientUrlContentFetcher {
return matrixClient
}