[Central Surfaces] Make NotifQSContainer(&Controller) a singleton.

Bug: 277762009
Test: compiles
Test: QS & shade still work
Change-Id: I25640fba97cc89724954dc7afd4e2cdd782ca5ec
This commit is contained in:
Caitlin Shkuratov
2023-05-09 18:39:30 +00:00
parent 2057b58789
commit e684ec3813
3 changed files with 11 additions and 10 deletions

View File

@@ -27,6 +27,7 @@ import androidx.constraintlayout.widget.ConstraintSet.PARENT_ID
import androidx.constraintlayout.widget.ConstraintSet.START
import androidx.constraintlayout.widget.ConstraintSet.TOP
import com.android.systemui.R
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.fragments.FragmentService
import com.android.systemui.navigationbar.NavigationModeController
@@ -45,6 +46,7 @@ import kotlin.reflect.KMutableProperty0
@VisibleForTesting
internal const val INSET_DEBOUNCE_MILLIS = 500L
@SysUISingleton
class NotificationsQSContainerController @Inject constructor(
view: NotificationsQuickSettingsContainer,
private val navigationModeController: NavigationModeController,

View File

@@ -147,6 +147,15 @@ abstract class ShadeModule {
return notificationPanelView.findViewById(R.id.shade_falsing_tap_again)
}
// TODO(b/277762009): Only allow this view's controller to inject the view. See above.
@Provides
@SysUISingleton
fun providesNotificationsQuickSettingsContainer(
notificationShadeWindowView: NotificationShadeWindowView,
): NotificationsQuickSettingsContainer {
return notificationShadeWindowView.findViewById(R.id.notification_container_parent)
}
// TODO(b/277762009): Only allow this view's controller to inject the view. See above.
@Provides
@SysUISingleton

View File

@@ -27,8 +27,6 @@ import com.android.systemui.flags.Flags;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.shade.NotificationPanelView;
import com.android.systemui.shade.NotificationPanelViewController;
import com.android.systemui.shade.NotificationShadeWindowView;
import com.android.systemui.shade.NotificationsQuickSettingsContainer;
import com.android.systemui.shade.ShadeExpansionStateManager;
import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.statusbar.CommandQueue;
@@ -122,14 +120,6 @@ public abstract class StatusBarViewModule {
abstract ShadeViewController bindsShadeViewController(
NotificationPanelViewController notificationPanelViewController);
/** */
@Provides
@CentralSurfacesComponent.CentralSurfacesScope
public static NotificationsQuickSettingsContainer getNotificationsQuickSettingsContainer(
NotificationShadeWindowView notificationShadeWindowView) {
return notificationShadeWindowView.findViewById(R.id.notification_container_parent);
}
@Binds
@IntoSet
abstract StatusBarBoundsProvider.BoundsChangeListener sysBarAttrsListenerAsBoundsListener(