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

Commit 26d95db9 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[Central Surfaces] Make CombinedShadeHeadersConstraintManager singleton.

Bug: 277762009
Test: manual: verify privacy chip in QQS still works correctly
Test: atest CombinedShadeHeaderConstraintsTest
Change-Id: Ieee4b442a69a87f33f5bbdb713752e8f7fe992bf
parent 1a9b9d7a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 {
+6 −0
Original line number Diff line number Diff line
@@ -127,5 +127,11 @@ abstract class ShadeModule {
            stub.layoutResource = layoutId
            return stub.inflate() as MotionLayout
        }

        @Provides
        @SysUISingleton
        fun providesCombinedShadeHeadersConstraintManager(): CombinedShadeHeadersConstraintManager {
            return CombinedShadeHeadersConstraintManagerImpl
        }
    }
}
+0 −10
Original line number Diff line number Diff line
@@ -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