diff options
| author | 2025-02-28 11:39:28 +0000 | |
|---|---|---|
| committer | 2025-02-28 11:43:26 +0000 | |
| commit | f8eb75d57662296ae9dd00b1237e0d6ac994e92c (patch) | |
| tree | a932a945255ba5b3b73142987e19df09f5e03606 | |
| parent | badfb5945b88b604c22142ae37d0602c359d57ba (diff) | |
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
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeDialogContextInteractor.kt | 8 |
1 files 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<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) } |