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

Commit 2403e770 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Crash if Shade window config forwarder is instantiated when the flag is off" into main

parents 7b366e13 3ae978a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ class NotificationShadeWindowViewControllerTest(flags: FlagsParameterization) :
                primaryBouncerInteractor,
                alternateBouncerInteractor,
                mock(BouncerViewBinder::class.java),
                mock(ConfigurationForwarder::class.java),
                { mock(ConfigurationForwarder::class.java) },
                brightnessMirrorShowingInteractor,
            )
        underTest.setupExpandedStatusBar()
+1 −1
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ class NotificationShadeWindowViewTest : SysuiTestCase() {
                primaryBouncerInteractor,
                alternateBouncerInteractor,
                mock(),
                configurationForwarder,
                { configurationForwarder },
                brightnessMirrorShowingInteractor,
            )

+3 −2
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ import java.util.Optional;
import java.util.function.Consumer;

import javax.inject.Inject;
import javax.inject.Provider;

/**
 * Controller for {@link NotificationShadeWindowView}.
@@ -193,7 +194,7 @@ public class NotificationShadeWindowViewController implements Dumpable {
            PrimaryBouncerInteractor primaryBouncerInteractor,
            AlternateBouncerInteractor alternateBouncerInteractor,
            BouncerViewBinder bouncerViewBinder,
            @ShadeDisplayAware ConfigurationForwarder configurationForwarder,
            @ShadeDisplayAware Provider<ConfigurationForwarder> configurationForwarder,
            BrightnessMirrorShowingInteractor brightnessMirrorShowingInteractor) {
        mLockscreenShadeTransitionController = transitionController;
        mFalsingCollector = falsingCollector;
@@ -257,7 +258,7 @@ public class NotificationShadeWindowViewController implements Dumpable {
        }

        if (ShadeWindowGoesAround.isEnabled()) {
            mView.setConfigurationForwarder(configurationForwarder);
            mView.setConfigurationForwarder(configurationForwarder.get());
        }
        dumpManager.registerDumpable(this);
    }
+4 −8
Original line number Diff line number Diff line
@@ -79,12 +79,12 @@ object ShadeDisplayAwareModule {
    fun provideShadeWindowConfigurationController(
        @ShadeDisplayAware shadeContext: Context,
        factory: ConfigurationControllerImpl.Factory,
        @GlobalConfig globalConfigConfigController: ConfigurationController,
        @GlobalConfig globalConfigController: ConfigurationController,
    ): ConfigurationController {
        return if (ShadeWindowGoesAround.isEnabled) {
            factory.create(shadeContext)
        } else {
            globalConfigConfigController
            globalConfigController
        }
    }

@@ -93,12 +93,8 @@ object ShadeDisplayAwareModule {
    @SysUISingleton
    fun provideShadeWindowConfigurationForwarder(
        @ShadeDisplayAware shadeConfigurationController: ConfigurationController,
        @GlobalConfig globalConfigController: ConfigurationController,
    ): ConfigurationForwarder {
        return if (ShadeWindowGoesAround.isEnabled) {
            shadeConfigurationController
        } else {
            globalConfigController
        }
        ShadeWindowGoesAround.isUnexpectedlyInLegacyMode()
        return shadeConfigurationController
    }
}