[Central Surfaces] Make CombinedShadeHeadersConstraintManager singleton.

Bug: 277762009
Test: manual: verify privacy chip in QQS still works correctly
Test: atest CombinedShadeHeaderConstraintsTest
Change-Id: Ieee4b442a69a87f33f5bbdb713752e8f7fe992bf
This commit is contained in:
Caitlin Shkuratov
2023-04-25 14:50:10 +00:00
parent 1a9b9d7abb
commit 26d95db9db
3 changed files with 8 additions and 12 deletions

View File

@@ -19,12 +19,12 @@ package com.android.systemui.shade
import android.view.ViewGroup
import androidx.constraintlayout.widget.ConstraintSet
import com.android.systemui.R
import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent
import com.android.systemui.dagger.SysUISingleton
/**
* Standard implementation of [CombinedShadeHeadersConstraintManager].
*/
@CentralSurfacesComponent.CentralSurfacesScope
@SysUISingleton
object CombinedShadeHeadersConstraintManagerImpl : CombinedShadeHeadersConstraintManager {
override fun privacyChipVisibilityConstraints(visible: Boolean): ConstraintsChanges {

View File

@@ -127,5 +127,11 @@ abstract class ShadeModule {
stub.layoutResource = layoutId
return stub.inflate() as MotionLayout
}
@Provides
@SysUISingleton
fun providesCombinedShadeHeadersConstraintManager(): CombinedShadeHeadersConstraintManager {
return CombinedShadeHeadersConstraintManagerImpl
}
}
}

View File

@@ -35,8 +35,6 @@ import com.android.systemui.flags.Flags;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.privacy.OngoingPrivacyChip;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.CombinedShadeHeadersConstraintManager;
import com.android.systemui.shade.CombinedShadeHeadersConstraintManagerImpl;
import com.android.systemui.shade.NotificationPanelView;
import com.android.systemui.shade.NotificationPanelViewController;
import com.android.systemui.shade.NotificationShadeWindowView;
@@ -136,14 +134,6 @@ public abstract class StatusBarViewModule {
abstract ShadeViewController bindsShadeViewController(
NotificationPanelViewController notificationPanelViewController);
/** */
@Provides
@CentralSurfacesComponent.CentralSurfacesScope
public static CombinedShadeHeadersConstraintManager
provideCombinedShadeHeadersConstraintManager() {
return CombinedShadeHeadersConstraintManagerImpl.INSTANCE;
}
/** */
@Provides
@CentralSurfacesComponent.CentralSurfacesScope