Merge "Better null handling for OverviewComponentObserver.getContainerInterface" into main

This commit is contained in:
Treehugger Robot authored and Android (Google) Code Review committed 2025-05-13 05:26:16 -07:00
commit 61962ec222
24 files changed
+137 -111

No files matched your search

@@ -124,22 +124,15 @@ object PerDisplayRepositoriesModule {
@Provides
@LauncherAppSingleton
fun provideFallbackWindowInterfaceRepo(
repositoryFactory: PerDisplayInstanceRepositoryImpl.Factory<FallbackWindowInterface>,
instanceFactory: FallbackWindowInterface.Factory,
recentsWindowManagerRepository: PerDisplayRepository<RecentsWindowManager>,
repositoryFactory: PerDisplayInstanceRepositoryImpl.Factory<FallbackWindowInterface>
): PerDisplayRepository<FallbackWindowInterface> {
return if (enableOverviewOnConnectedDisplays()) {
repositoryFactory.create(
"FallbackWindowInterfaceRepo",
{ displayId ->
recentsWindowManagerRepository[displayId]?.let { instanceFactory.create(it) }
},
{ _ -> FallbackWindowInterface() },
)
} else {
SingleInstanceRepositoryImpl(
"FallbackWindowInterfaceRepo",
instanceFactory.create(recentsWindowManagerRepository[DEFAULT_DISPLAY]),
)
SingleInstanceRepositoryImpl("FallbackWindowInterfaceRepo", FallbackWindowInterface())
}
}