Loading packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeDialogContextInteractor.kt +18 −16 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.display.data.repository.DisplayWindowPropertiesRepository import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.display.data.repository.FocusedDisplayRepository import com.android.systemui.shade.data.repository.ShadeDisplaysRepository import com.android.systemui.shade.shared.flag.ShadeWindowGoesAround import com.android.window.flags.Flags Loading @@ -47,16 +47,15 @@ interface ShadeDialogContextInteractor { class ShadeDialogContextInteractorImpl @Inject constructor( @ShadeDisplayAware private val shadeContext: Context, @Main private val defaultContext: Context, private val displayWindowPropertyRepository: Provider<DisplayWindowPropertiesRepository>, private val shadeDisplaysRepository: Provider<ShadeDisplaysRepository>, @Background private val bgScope: CoroutineScope, private val focusedDisplayRepository: FocusedDisplayRepository, ) : CoreStartable, ShadeDialogContextInteractor { override fun start() { if (ShadeWindowGoesAround.isUnexpectedlyInLegacyMode()) return if (!Flags.enableWindowContextOverrideType()) { bgScope.launchTraced(TAG) { shadeDisplaysRepository .get() Loading @@ -70,12 +69,11 @@ constructor( } } } } override val context: Context get() { if (Flags.enableWindowContextOverrideType()) { return shadeContext return focusedDisplayContext } else { if (!ShadeWindowGoesAround.isEnabled) { return defaultContext Loading @@ -85,6 +83,10 @@ constructor( } } /** Context that can be used to open a dialog on the focused display. */ private val focusedDisplayContext: Context get() = getContextOrDefault(focusedDisplayRepository.focusedDisplayId.value) private fun getContextOrDefault(displayId: Int): Context { return try { traceSection({ "Getting dialog context for displayId=$displayId" }) { Loading Loading
packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeDialogContextInteractor.kt +18 −16 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.display.data.repository.DisplayWindowPropertiesRepository import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.display.data.repository.FocusedDisplayRepository import com.android.systemui.shade.data.repository.ShadeDisplaysRepository import com.android.systemui.shade.shared.flag.ShadeWindowGoesAround import com.android.window.flags.Flags Loading @@ -47,16 +47,15 @@ interface ShadeDialogContextInteractor { class ShadeDialogContextInteractorImpl @Inject constructor( @ShadeDisplayAware private val shadeContext: Context, @Main private val defaultContext: Context, private val displayWindowPropertyRepository: Provider<DisplayWindowPropertiesRepository>, private val shadeDisplaysRepository: Provider<ShadeDisplaysRepository>, @Background private val bgScope: CoroutineScope, private val focusedDisplayRepository: FocusedDisplayRepository, ) : CoreStartable, ShadeDialogContextInteractor { override fun start() { if (ShadeWindowGoesAround.isUnexpectedlyInLegacyMode()) return if (!Flags.enableWindowContextOverrideType()) { bgScope.launchTraced(TAG) { shadeDisplaysRepository .get() Loading @@ -70,12 +69,11 @@ constructor( } } } } override val context: Context get() { if (Flags.enableWindowContextOverrideType()) { return shadeContext return focusedDisplayContext } else { if (!ShadeWindowGoesAround.isEnabled) { return defaultContext Loading @@ -85,6 +83,10 @@ constructor( } } /** Context that can be used to open a dialog on the focused display. */ private val focusedDisplayContext: Context get() = getContextOrDefault(focusedDisplayRepository.focusedDisplayId.value) private fun getContextOrDefault(displayId: Int): Context { return try { traceSection({ "Getting dialog context for displayId=$displayId" }) { Loading