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

Commit 153bbea9 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Fix context and resources used by some Shade window classes

Those are mainly classes in the statusbar package but related to lockscreen or notifications that were neglected in the past iterations of using the correct context, and not considered by the linter.

Using the @ShadeDisplayAware context for shade related classes is needed
as the shade window might move to a different display with a different
configuration than the default context

Bug: 362719719
Bug: 381217997
Test: Builds + presubmits
Flag: com.android.systemui.shade_window_goes_around
Change-Id: I543fc678b294fee7ef5a1a67b8650388173a8c0e
parent a708b619
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.systemui.media.controls.ui.view.MediaHost
import com.android.systemui.media.controls.ui.view.MediaHostState
import com.android.systemui.media.dagger.MediaModule.KEYGUARD
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.shade.ShadeDisplayAware
import com.android.systemui.statusbar.StatusBarState
import com.android.systemui.statusbar.SysuiStatusBarStateController
import com.android.systemui.statusbar.notification.stack.MediaContainerView
@@ -53,7 +54,7 @@ constructor(
    @param:Named(KEYGUARD) private val mediaHost: MediaHost,
    private val bypassController: KeyguardBypassController,
    private val statusBarStateController: SysuiStatusBarStateController,
    private val context: Context,
    @ShadeDisplayAware private val context: Context,
    configurationController: ConfigurationController,
    private val splitShadeStateController: SplitShadeStateController,
    private val logger: KeyguardMediaControllerLogger,
+2 −1
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import com.android.systemui.media.dream.MediaDreamComplication
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.res.R
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.ShadeDisplayAware
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.CrossFadeHelper
import com.android.systemui.statusbar.StatusBarState
@@ -102,7 +103,7 @@ val View.isShownNotFaded: Boolean
class MediaHierarchyManager
@Inject
constructor(
    private val context: Context,
    @ShadeDisplayAware private val context: Context,
    private val statusBarStateController: SysuiStatusBarStateController,
    private val keyguardStateController: KeyguardStateController,
    private val bypassController: KeyguardBypassController,
+1 −1
Original line number Diff line number Diff line
@@ -95,8 +95,8 @@ class QSFragmentComposeViewModel
@AssistedInject
constructor(
    containerViewModelFactory: QuickSettingsContainerViewModel.Factory,
    @ShadeDisplayAware private val resources: Resources,
    quickQuickSettingsViewModelFactory: QuickQuickSettingsViewModel.Factory,
    @Main private val resources: Resources,
    footerActionsViewModelFactory: FooterActionsViewModel.Factory,
    private val footerActionsController: FooterActionsController,
    private val sysuiStatusBarStateController: SysuiStatusBarStateController,
+2 −2
Original line number Diff line number Diff line
@@ -20,13 +20,13 @@ import android.content.res.Configuration
import android.content.res.Resources
import androidx.compose.runtime.getValue
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.lifecycle.ExclusiveActivatable
import com.android.systemui.lifecycle.Hydrator
import com.android.systemui.media.controls.ui.controller.MediaHostStatesManager
import com.android.systemui.media.controls.ui.controller.MediaLocation
import com.android.systemui.media.controls.ui.view.MediaHostState
import com.android.systemui.qs.composefragment.dagger.QSFragmentComposeModule
import com.android.systemui.shade.ShadeDisplayAware
import com.android.systemui.shade.domain.interactor.ShadeModeInteractor
import com.android.systemui.shade.shared.model.ShadeMode
import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow
@@ -46,7 +46,7 @@ import kotlinx.coroutines.flow.onStart
class MediaInRowInLandscapeViewModel
@AssistedInject
constructor(
    @Main resources: Resources,
    @ShadeDisplayAware resources: Resources,
    configurationInteractor: ConfigurationInteractor,
    shadeModeInteractor: ShadeModeInteractor,
    private val mediaHostStatesManager: MediaHostStatesManager,
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.systemui.qs.pipeline.dagger

import android.content.res.Resources
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.qs.pipeline.domain.autoaddable.A11yShortcutAutoAddable
import com.android.systemui.qs.pipeline.domain.autoaddable.A11yShortcutAutoAddableList
import com.android.systemui.qs.pipeline.domain.autoaddable.AutoAddableSetting
@@ -30,6 +29,7 @@ import com.android.systemui.qs.pipeline.domain.autoaddable.NightDisplayAutoAddab
import com.android.systemui.qs.pipeline.domain.autoaddable.WalletAutoAddable
import com.android.systemui.qs.pipeline.domain.autoaddable.WorkTileAutoAddable
import com.android.systemui.qs.pipeline.domain.model.AutoAddable
import com.android.systemui.shade.ShadeDisplayAware
import dagger.Binds
import dagger.Module
import dagger.Provides
@@ -43,7 +43,7 @@ interface BaseAutoAddableModule {
        @Provides
        @ElementsIntoSet
        fun providesAutoAddableSetting(
            @Main resources: Resources,
            @ShadeDisplayAware resources: Resources,
            autoAddableSettingFactory: AutoAddableSetting.Factory,
        ): Set<AutoAddable> {
            return AutoAddableSettingList.parseSettingsResource(
Loading