Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8bc616c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make ShadeDialogContextInteractorImpl inject ShadeDisplayReposiory with...

Merge "Make ShadeDialogContextInteractorImpl inject ShadeDisplayReposiory with a Provider" into main
parents 46108462 f8eb75d5
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -47,14 +47,16 @@ class ShadeDialogContextInteractorImpl
constructor(
    @Main private val defaultContext: Context,
    private val displayWindowPropertyRepository: Provider<DisplayWindowPropertiesRepository>,
    private val shadeDisplaysRepository: ShadeDisplaysRepository,
    private val shadeDisplaysRepository: Provider<ShadeDisplaysRepository>,
    @Background private val bgScope: CoroutineScope,
) : CoreStartable, ShadeDialogContextInteractor {

    override fun start() {
        if (ShadeWindowGoesAround.isUnexpectedlyInLegacyMode()) return
        bgScope.launchTraced(TAG) {
            shadeDisplaysRepository.displayId
            shadeDisplaysRepository
                .get()
                .displayId
                // No need for default display pre-warming.
                .filter { it != Display.DEFAULT_DISPLAY }
                .collectLatest { displayId ->
@@ -70,7 +72,7 @@ constructor(
            if (!ShadeWindowGoesAround.isEnabled) {
                return defaultContext
            }
            val displayId = shadeDisplaysRepository.displayId.value
            val displayId = shadeDisplaysRepository.get().displayId.value
            return getContextOrDefault(displayId)
        }