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 Original line Diff line number Diff line
@@ -238,7 +238,7 @@ class NotificationShadeWindowViewControllerTest(flags: FlagsParameterization) :
                primaryBouncerInteractor,
                primaryBouncerInteractor,
                alternateBouncerInteractor,
                alternateBouncerInteractor,
                mock(BouncerViewBinder::class.java),
                mock(BouncerViewBinder::class.java),
                mock(ConfigurationForwarder::class.java),
                { mock(ConfigurationForwarder::class.java) },
                brightnessMirrorShowingInteractor,
                brightnessMirrorShowingInteractor,
            )
            )
        underTest.setupExpandedStatusBar()
        underTest.setupExpandedStatusBar()
+1 −1
Original line number Original line Diff line number Diff line
@@ -203,7 +203,7 @@ class NotificationShadeWindowViewTest : SysuiTestCase() {
                primaryBouncerInteractor,
                primaryBouncerInteractor,
                alternateBouncerInteractor,
                alternateBouncerInteractor,
                mock(),
                mock(),
                configurationForwarder,
                { configurationForwarder },
                brightnessMirrorShowingInteractor,
                brightnessMirrorShowingInteractor,
            )
            )


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


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


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


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


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