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

Commit fab325c3 authored by Daniel Chapin's avatar Daniel Chapin Committed by Android (Google) Code Review
Browse files

Revert^2 "Provide @ShadeDisplayAware ConfigurationInteractor"

This reverts commit ca337dfb.

Reason for revert: Incorrect CL reverted

Change-Id: I0ec2277a23f688db0055caeda0cf0acd2303f826
parent ca337dfb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ class ConfigurationInteractorTest : SysuiTestCase() {
        testableResources.overrideConfiguration(configuration)
        configurationRepository = FakeConfigurationRepository()
        testScope = TestScope()
        underTest = ConfigurationInteractor(configurationRepository)
        underTest = ConfigurationInteractorImpl(configurationRepository)
    }

    @Test
@@ -207,7 +207,7 @@ class ConfigurationInteractorTest : SysuiTestCase() {
            updateDisplay(
                width = DISPLAY_HEIGHT,
                height = DISPLAY_WIDTH,
                rotation = Surface.ROTATION_90
                rotation = Surface.ROTATION_90,
            )
            runCurrent()

@@ -217,7 +217,7 @@ class ConfigurationInteractorTest : SysuiTestCase() {
    private fun updateDisplay(
        width: Int = DISPLAY_WIDTH,
        height: Int = DISPLAY_HEIGHT,
        @Surface.Rotation rotation: Int = Surface.ROTATION_0
        @Surface.Rotation rotation: Int = Surface.ROTATION_0,
    ) {
        configuration.windowConfiguration.maxBounds.set(Rect(0, 0, width, height))
        configuration.windowConfiguration.displayRotation = rotation
+3 −3
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.ui.data.repository.FakeConfigurationRepository
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractorImpl
import com.android.systemui.keyboard.data.repository.FakeKeyboardRepository
import com.android.systemui.keyboard.docking.domain.interactor.KeyboardDockingIndicationInteractor
import com.google.common.truth.Truth.assertThat
@@ -59,7 +59,7 @@ class KeyboardDockingIndicationViewModelTest : SysuiTestCase() {

        val keyboardDockingIndicationInteractor =
            KeyboardDockingIndicationInteractor(keyboardRepository)
        val configurationInteractor = ConfigurationInteractor(configurationRepository)
        val configurationInteractor = ConfigurationInteractorImpl(configurationRepository)

        underTest =
            KeyboardDockingIndicationViewModel(
@@ -67,7 +67,7 @@ class KeyboardDockingIndicationViewModelTest : SysuiTestCase() {
                context,
                keyboardDockingIndicationInteractor,
                configurationInteractor,
                testScope.backgroundScope
                testScope.backgroundScope,
            )
    }

+4 −10
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.biometrics.domain.interactor.displayStateInteractor
import com.android.systemui.common.ui.data.repository.FakeConfigurationRepository
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractorImpl
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.display.data.repository.displayStateRepository
import com.android.systemui.dump.DumpManager
@@ -101,7 +101,7 @@ class QSSceneAdapterImplTest : SysuiTestCase() {

    private val fakeConfigurationRepository =
        FakeConfigurationRepository().apply { onConfigurationChange(configuration) }
    private val configurationInteractor = ConfigurationInteractor(fakeConfigurationRepository)
    private val configurationInteractor = ConfigurationInteractorImpl(fakeConfigurationRepository)

    private val mockAsyncLayoutInflater =
        mock<AsyncLayoutInflater>() {
@@ -151,10 +151,7 @@ class QSSceneAdapterImplTest : SysuiTestCase() {
            inOrder.verify(qsImpl!!).onCreate(nullable())
            inOrder
                .verify(qsImpl!!)
                .onComponentCreated(
                    eq(qsSceneComponentFactory.components[0]),
                    any(),
                )
                .onComponentCreated(eq(qsSceneComponentFactory.components[0]), any())
        }

    @Test
@@ -422,10 +419,7 @@ class QSSceneAdapterImplTest : SysuiTestCase() {
            inOrder.verify(newQSImpl).onCreate(nullable())
            inOrder
                .verify(newQSImpl)
                .onComponentCreated(
                    qsSceneComponentFactory.components[1],
                    bundleArgCaptor.value,
                )
                .onComponentCreated(qsSceneComponentFactory.components[1], bundleArgCaptor.value)
        }

    @Test
+6 −6
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.ui.data.repository.ConfigurationRepositoryImpl
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractorImpl
import com.android.systemui.coroutines.collectValues
import com.android.systemui.power.data.repository.FakePowerRepository
import com.android.systemui.power.domain.interactor.PowerInteractor
@@ -75,9 +75,9 @@ open class HideNotificationsInteractorTest : SysuiTestCase() {
            configurationController,
            context,
            testScope.backgroundScope,
            mock()
            mock(),
        )
    private val configurationInteractor = ConfigurationInteractor(configurationRepository)
    private val configurationInteractor = ConfigurationInteractorImpl(configurationRepository)

    private val unfoldTransitionRepository =
        UnfoldTransitionRepositoryImpl(Optional.of(unfoldTransitionProgressProvider))
@@ -103,7 +103,7 @@ open class HideNotificationsInteractorTest : SysuiTestCase() {
                unfoldTransitionInteractor,
                configurationInteractor,
                animationStatus,
                powerInteractor
                powerInteractor,
            )
    }

@@ -140,7 +140,7 @@ open class HideNotificationsInteractorTest : SysuiTestCase() {
            updateDisplay(
                width = INITIAL_DISPLAY_HEIGHT,
                height = INITIAL_DISPLAY_WIDTH,
                rotation = ROTATION_90
                rotation = ROTATION_90,
            )
            runCurrent()

@@ -284,7 +284,7 @@ open class HideNotificationsInteractorTest : SysuiTestCase() {
    private fun updateDisplay(
        width: Int = INITIAL_DISPLAY_WIDTH,
        height: Int = INITIAL_DISPLAY_HEIGHT,
        @Surface.Rotation rotation: Int = ROTATION_0
        @Surface.Rotation rotation: Int = ROTATION_0,
    ) {
        configuration.windowConfiguration.maxBounds.set(Rect(0, 0, width, height))
        configuration.windowConfiguration.displayRotation = rotation
+13 −13
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import androidx.test.filters.SmallTest
import com.android.internal.R
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.ui.data.repository.ConfigurationRepositoryImpl
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractorImpl
import com.android.systemui.defaultDeviceState
import com.android.systemui.deviceStateManager
import com.android.systemui.display.data.repository.DeviceStateRepository
@@ -107,9 +107,9 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
            configurationController,
            context,
            testScope.backgroundScope,
            mock()
            mock(),
        )
    private val configurationInteractor = ConfigurationInteractor(configurationRepository)
    private val configurationInteractor = ConfigurationInteractorImpl(configurationRepository)
    private val unfoldTransitionProgressProvider = FakeUnfoldTransitionProvider()
    private val unfoldTransitionRepository =
        UnfoldTransitionRepositoryImpl(Optional.of(unfoldTransitionProgressProvider))
@@ -145,7 +145,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
                testScope.backgroundScope,
                displaySwitchLatencyLogger,
                systemClock,
                deviceStateManager
                deviceStateManager,
            )
    }

@@ -174,7 +174,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
                DisplaySwitchLatencyEvent(
                    latencyMs = 250,
                    fromFoldableDeviceState = FOLDABLE_DEVICE_STATE_CLOSED,
                    toFoldableDeviceState = FOLDABLE_DEVICE_STATE_HALF_OPEN
                    toFoldableDeviceState = FOLDABLE_DEVICE_STATE_HALF_OPEN,
                )
            assertThat(loggedEvent).isEqualTo(expectedLoggedEvent)
        }
@@ -200,7 +200,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
                    testScope.backgroundScope,
                    displaySwitchLatencyLogger,
                    systemClock,
                    deviceStateManager
                    deviceStateManager,
                )
            areAnimationEnabled.emit(true)

@@ -226,7 +226,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
                DisplaySwitchLatencyEvent(
                    latencyMs = 50,
                    fromFoldableDeviceState = FOLDABLE_DEVICE_STATE_CLOSED,
                    toFoldableDeviceState = FOLDABLE_DEVICE_STATE_HALF_OPEN
                    toFoldableDeviceState = FOLDABLE_DEVICE_STATE_HALF_OPEN,
                )
            assertThat(loggedEvent).isEqualTo(expectedLoggedEvent)
        }
@@ -259,7 +259,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
                DisplaySwitchLatencyEvent(
                    latencyMs = 50,
                    fromFoldableDeviceState = FOLDABLE_DEVICE_STATE_CLOSED,
                    toFoldableDeviceState = FOLDABLE_DEVICE_STATE_HALF_OPEN
                    toFoldableDeviceState = FOLDABLE_DEVICE_STATE_HALF_OPEN,
                )
            assertThat(loggedEvent).isEqualTo(expectedLoggedEvent)
        }
@@ -289,7 +289,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
                DisplaySwitchLatencyEvent(
                    latencyMs = 200,
                    fromFoldableDeviceState = FOLDABLE_DEVICE_STATE_HALF_OPEN,
                    toFoldableDeviceState = FOLDABLE_DEVICE_STATE_CLOSED
                    toFoldableDeviceState = FOLDABLE_DEVICE_STATE_CLOSED,
                )
            assertThat(loggedEvent).isEqualTo(expectedLoggedEvent)
        }
@@ -310,7 +310,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
            lastWakefulnessEvent.emit(
                WakefulnessModel(
                    internalWakefulnessState = WakefulnessState.ASLEEP,
                    lastSleepReason = WakeSleepReason.FOLD
                    lastSleepReason = WakeSleepReason.FOLD,
                )
            )
            screenPowerState.emit(ScreenPowerState.SCREEN_OFF)
@@ -326,7 +326,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
                    latencyMs = 200,
                    fromFoldableDeviceState = FOLDABLE_DEVICE_STATE_HALF_OPEN,
                    toFoldableDeviceState = FOLDABLE_DEVICE_STATE_CLOSED,
                    toState = SysUiStatsLog.DISPLAY_SWITCH_LATENCY_TRACKED__TO_STATE__AOD
                    toState = SysUiStatsLog.DISPLAY_SWITCH_LATENCY_TRACKED__TO_STATE__AOD,
                )
            assertThat(loggedEvent).isEqualTo(expectedLoggedEvent)
        }
@@ -372,7 +372,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
            lastWakefulnessEvent.emit(
                WakefulnessModel(
                    internalWakefulnessState = WakefulnessState.ASLEEP,
                    lastSleepReason = WakeSleepReason.FOLD
                    lastSleepReason = WakeSleepReason.FOLD,
                )
            )
            screenPowerState.emit(ScreenPowerState.SCREEN_OFF)
@@ -385,7 +385,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
                    latencyMs = 0,
                    fromFoldableDeviceState = FOLDABLE_DEVICE_STATE_HALF_OPEN,
                    toFoldableDeviceState = FOLDABLE_DEVICE_STATE_CLOSED,
                    toState = SysUiStatsLog.DISPLAY_SWITCH_LATENCY_TRACKED__TO_STATE__SCREEN_OFF
                    toState = SysUiStatsLog.DISPLAY_SWITCH_LATENCY_TRACKED__TO_STATE__SCREEN_OFF,
                )
            assertThat(loggedEvent).isEqualTo(expectedLoggedEvent)
        }
Loading