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

Commit 10ae1962 authored by Anton Potapov's avatar Anton Potapov
Browse files

Migrate to new tiles aconfig flags

Bug: b/311147395
Test: atest QSPipelineFlagsRepositoryTest
Test: atest CurrentTilesInteractorImplTest
Test: atest QSTileHostTest
Flag: ACONFIG com.android.systemui.qs_new_pipeline DISABLED
Change-Id: I60606b6f7edd0ed08dbd7dfef0bd3a0d2f230ad2
parent 1987dead
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -137,6 +137,13 @@ flag {
    bug: "241772429"
}

flag {
   name: "qs_new_tiles"
   namespace: "systemui"
   description: "Use the new tiles in the Quick Settings. Should have no behavior changes."
   bug: "241772429"
}

flag {
    name: "coroutine_tracing"
    namespace: "systemui"
+3 −7
Original line number Diff line number Diff line
@@ -25,11 +25,10 @@ import android.service.quicksettings.Tile
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.Flags.FLAG_QS_NEW_PIPELINE
import com.android.systemui.Flags.FLAG_QS_NEW_TILES
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.dump.nano.SystemUIProtoDump
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.plugins.qs.QSTile
import com.android.systemui.plugins.qs.QSTile.BooleanState
import com.android.systemui.qs.FakeQSFactory
@@ -81,8 +80,7 @@ class CurrentTilesInteractorImplTest : SysuiTestCase() {
    private val tileFactory = FakeQSFactory(::tileCreator)
    private val customTileAddedRepository: CustomTileAddedRepository =
        FakeCustomTileAddedRepository()
    private val featureFlags = FakeFeatureFlags()
    private val pipelineFlags = QSPipelineFlagsRepository(featureFlags)
    private val pipelineFlags = QSPipelineFlagsRepository()
    private val tileLifecycleManagerFactory = TLMFactory()

    @Mock private lateinit var customTileStatePersister: CustomTileStatePersister
@@ -100,14 +98,12 @@ class CurrentTilesInteractorImplTest : SysuiTestCase() {

    private lateinit var underTest: CurrentTilesInteractorImpl

    @OptIn(ExperimentalCoroutinesApi::class)
    @Before
    fun setup() {
        MockitoAnnotations.initMocks(this)

        mSetFlagsRule.enableFlags(FLAG_QS_NEW_PIPELINE)
        // TODO(b/299909337): Add test checking the new factory is used when the flag is on
        featureFlags.set(Flags.QS_PIPELINE_NEW_TILES, true)
        mSetFlagsRule.enableFlags(FLAG_QS_NEW_TILES)

        userRepository.setUserInfos(listOf(USER_INFO_0, USER_INFO_1))

+0 −4
Original line number Diff line number Diff line
@@ -289,10 +289,6 @@ object Flags {
            "qs_user_detail_shortcut"
        )

    // TODO(b/296357483): Tracking Bug
    @JvmField
    val QS_PIPELINE_NEW_TILES = unreleasedFlag("qs_pipeline_new_tiles")

    // TODO(b/254512383): Tracking Bug
    @JvmField
    val FULL_SCREEN_USER_SWITCHER =
+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ public class LogModule {
            LogBufferFactory factory,
            QSPipelineFlagsRepository flags
    ) {
        if (flags.getPipelineTilesEnabled()) {
        if (flags.getTilesEnabled()) {
            // we use
            return factory.create("QSLog", 450 /* maxSize */, false /* systrace */);
        } else {
+3 −3
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService.Tunable;
import com.android.systemui.util.settings.SecureSettings;

import dagger.Lazy;

import org.jetbrains.annotations.NotNull;

import java.io.PrintWriter;
@@ -73,8 +75,6 @@ import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.inject.Provider;

import dagger.Lazy;

/** Platform implementation of the quick settings tile host
 *
 * This class keeps track of the set of current tiles and is the in memory source of truth
@@ -151,7 +151,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, P

        mShadeController = shadeController;

        if (featureFlags.getPipelineTilesEnabled()) {
        if (featureFlags.getTilesEnabled()) {
            mQsFactories.add(newQsTileFactoryProvider.get());
        }
        mQsFactories.add(defaultFactory);
Loading