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

Commit 9b98386d authored by Johannes Gallmann's avatar Johannes Gallmann
Browse files

Cleanup TopUiController refactor flag

Bug: 427091875
Test: presubmit
Flag: EXEMPT flag cleanup
Change-Id: Ie73f435ceb7df0b6cb2f4b5ea0604af3dcb0c1b2
parent d40f9b88
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2667,7 +2667,7 @@ public class BubbleController implements ConfigurationChangeListener,

            if (collapseStack) {
                mBubbleViewCallback.expansionChanged(/* expanded= */ false);
                mSysuiProxy.requestNotificationShadeTopUi(false, TAG);
                mSysuiProxy.requestTopUi(false, TAG);
            }

            if (update.selectionChanged) {
@@ -2677,7 +2677,7 @@ public class BubbleController implements ConfigurationChangeListener,
            // Expanding? Apply this last.
            if (update.expandedChanged && update.expanded) {
                mBubbleViewCallback.expansionChanged(/* expanded= */ true);
                mSysuiProxy.requestNotificationShadeTopUi(true, TAG);
                mSysuiProxy.requestTopUi(true, TAG);
            }

            if (!update.removedBubbles.isEmpty() && !mBubbleData.hasBubbles()) {
+1 −1
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ public interface Bubbles {

        void setNotificationInterruption(String key);

        void requestNotificationShadeTopUi(boolean requestTopUi, String componentTag);
        void requestTopUi(boolean requestTopUi, String componentTag);

        void notifyRemoveNotification(String key, int reason);

+0 −10
Original line number Diff line number Diff line
@@ -1878,16 +1878,6 @@ flag {
    bug: "392942321"
}

flag {
    name: "enable_top_ui_controller"
    namespace: "systemui"
    description: "Extracts top ui requests into TopUiController"
    bug: "411061512"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "qs_tile_transition_interaction_refinement"
    namespace: "systemui"
+0 −10
Original line number Diff line number Diff line
@@ -17,10 +17,8 @@
package com.android.systemui.topui

import android.app.activityManagerInterface
import android.platform.test.annotations.EnableFlags
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.dumpManager
import com.android.systemui.kosmos.runTest
@@ -57,7 +55,6 @@ class TopUiControllerImplTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_TOP_UI_CONTROLLER)
    fun firstRequest_setsHasTopUiTrue() =
        kosmos.runTest {
            underTest.setRequestTopUi(true, "tag1")
@@ -68,7 +65,6 @@ class TopUiControllerImplTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_TOP_UI_CONTROLLER)
    fun duplicateRequest_noExtraCall() =
        kosmos.runTest {
            // Initial request
@@ -83,7 +79,6 @@ class TopUiControllerImplTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_TOP_UI_CONTROLLER)
    fun secondRequest_differentTag_noExtraCall() =
        kosmos.runTest {
            // Initial request
@@ -98,7 +93,6 @@ class TopUiControllerImplTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_TOP_UI_CONTROLLER)
    fun releaseOneOfTwo_noCall() =
        kosmos.runTest {
            // Setup with two requesters
@@ -115,7 +109,6 @@ class TopUiControllerImplTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_TOP_UI_CONTROLLER)
    fun releaseLast_setsHasTopUiFalse() =
        kosmos.runTest {
            // Setup with two requesters
@@ -137,7 +130,6 @@ class TopUiControllerImplTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_TOP_UI_CONTROLLER)
    fun duplicateRelease_noExtraCall() =
        kosmos.runTest {
            // Setup and release all
@@ -154,7 +146,6 @@ class TopUiControllerImplTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_TOP_UI_CONTROLLER)
    fun releaseNonExistent_noCall() =
        kosmos.runTest {
            // Setup with one requester
@@ -174,7 +165,6 @@ class TopUiControllerImplTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_TOP_UI_CONTROLLER)
    fun requestReleaseRequest_correctCalls() =
        kosmos.runTest {
            // Request
+2 −12
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import androidx.core.animation.AnimatorTestRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.concurrency.fakeExecutor
import com.android.systemui.haptics.fakeVibratorHelper
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.advanceTimeBy
@@ -33,7 +32,6 @@ import com.android.systemui.kosmos.testScope
import com.android.systemui.kosmos.useUnconfinedTestDispatcher
import com.android.systemui.statusbar.notificationShadeWindowController
import com.android.systemui.testKosmos
import com.android.systemui.topui.TopUiControllerRefactor
import com.android.systemui.topui.mockTopUiController
import com.android.systemui.topwindoweffects.data.repository.InvocationEffectPreferencesImpl.Companion.DEFAULT_OUTWARD_EFFECT_DURATION_MS
import com.android.systemui.topwindoweffects.data.repository.SqueezeEffectRepositoryImpl.Companion.DEFAULT_INITIAL_DELAY_MILLIS
@@ -95,9 +93,7 @@ class TopLevelWindowEffectsTest : SysuiTestCase() {
                    SqueezeEffectInteractor(squeezeEffectRepository = fakeSqueezeEffectRepository),
                appZoomOutOptional = appZoomOutOptional,
                squeezeEffectHapticPlayerFactory = squeezeEffectHapticPlayerFactory,
                notificationShadeWindowController = notificationShadeWindowController,
                topUiController = mockTopUiController,
                mainExecutor = fakeExecutor,
                mainHandler = kosmos.fakeHandler,
            )
        }
@@ -499,14 +495,8 @@ class TopLevelWindowEffectsTest : SysuiTestCase() {
        }

    private fun verifySetRequestTopUi(isRequested: Boolean) {
        if (TopUiControllerRefactor.isEnabled) {
        verify(kosmos.mockTopUiController, times(1))
            .setRequestTopUi(isRequested, TopLevelWindowEffects.TAG)
        } else {
            kosmos.fakeExecutor.runAllReady()
            verify(kosmos.notificationShadeWindowController, times(1))
                .setRequestTopUi(isRequested, TopLevelWindowEffects.TAG)
        }
    }

    private fun Kosmos.setInvocationEffectEnabled(enabled: Boolean) {
Loading