From f8eb75d57662296ae9dd00b1237e0d6ac994e92c Mon Sep 17 00:00:00 2001 From: Nicolo' Mazzucato Date: Fri, 28 Feb 2025 11:39:28 +0000 Subject: Make ShadeDialogContextInteractorImpl inject ShadeDisplayReposiory with a Provider This avoids for the class to be instantiated when the flag is off. Bug: 362719719 Bug: 399074879 Test: No error log up startup with flag off Flag: com.android.systemui.shade_window_goes_around Change-Id: If729cd3fe3064db0ab076da46a012dfa707d4939 --- .../shade/domain/interactor/ShadeDialogContextInteractor.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeDialogContextInteractor.kt b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeDialogContextInteractor.kt index 4edba2785e89..3b9870881c60 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeDialogContextInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeDialogContextInteractor.kt @@ -47,14 +47,16 @@ class ShadeDialogContextInteractorImpl constructor( @Main private val defaultContext: Context, private val displayWindowPropertyRepository: Provider, - private val shadeDisplaysRepository: ShadeDisplaysRepository, + private val shadeDisplaysRepository: Provider, @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) } -- cgit v1.2.3-59-g8ed1b