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

Commit 26c13423 authored by Liana Kazanova (xWF)'s avatar Liana Kazanova (xWF) Committed by Android (Google) Code Review
Browse files

Revert "Add screen density as a extra large tiles factor"

Revert submission 35588486-441085034

Reason for revert: DroidMonitor: Potential culprit for http://b/444233458 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Fix: 444233458

Reverted changes: /q/submissionid:35588486-441085034

Change-Id: I8b29557c734cc66ff4117a2bc0f6d603c7187219
parent d36cc579
Loading
Loading
Loading
Loading
+1 −24
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ class LargeTileSpanRepositoryTest : SysuiTestCase() {
    private val Kosmos.underTest by Kosmos.Fixture { largeTileSpanRepository }

    @Test
    fun useExtraLargeTiles_tracksFontScale() =
    fun useExtraLargeTiles_tracksConfig() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.useExtraLargeTiles)

@@ -65,29 +65,6 @@ class LargeTileSpanRepositoryTest : SysuiTestCase() {
            assertThat(latest).isTrue()
        }

    @Test
    fun useExtraLargeTiles_tracksScreenDensity() =
        kosmos.runTest {
            val latest by collectLastValue(underTest.useExtraLargeTiles)

            val configuration = Configuration().apply { this.densityDpi = 400 }
            context.orCreateTestableResources.overrideConfiguration(configuration)
            fakeConfigurationRepository.onConfigurationChange()
            assertThat(latest).isFalse()

            configuration.densityDpi = 470
            fakeConfigurationRepository.onConfigurationChange()
            assertThat(latest).isFalse()

            configuration.densityDpi = 480
            fakeConfigurationRepository.onConfigurationChange()
            assertThat(latest).isTrue()

            configuration.densityDpi = 600
            fakeConfigurationRepository.onConfigurationChange()
            assertThat(latest).isTrue()
        }

    @Test
    fun tileMaxWidth_tracksConfig() =
        kosmos.runTest {
+0 −5
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.systemui.qs.panels.ui.viewmodel

import android.content.res.Configuration
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
@@ -71,10 +70,6 @@ class QuickQuickSettingsViewModelTest : SysuiTestCase() {
                R.integer.quick_settings_infinite_grid_num_columns,
                4,
            )
            // Manually set the screen density to avoid triggering extra large tiles
            testCase.context.orCreateTestableResources.overrideConfiguration(
                Configuration().apply { this.densityDpi = 400 }
            )
            fakeConfigurationRepository.onConfigurationChange()
            usingMediaInComposeFragment = true
        }
+3 −7
Original line number Diff line number Diff line
@@ -50,18 +50,14 @@ constructor(

    val defaultTileMaxWidth: Int = DEFAULT_LARGE_TILE_WIDTH

    /** Use extra large tiles if the font scale or the screen density are past the thresholds. */
    private val currentUseExtraLargeTiles: Boolean
        get() =
            resources.configuration.fontScale >= FONT_SCALE_THRESHOLD ||
                resources.configuration.densityDpi >= DENSITY_THRESHOLD
    val currentUseExtraLargeTiles: Boolean
        get() = resources.configuration.fontScale >= FONT_SCALE_THRESHOLD

    private val currentTileMaxWidth: Int
    val currentTileMaxWidth: Int
        get() = resources.getInteger(R.integer.quick_settings_infinite_grid_tile_max_width)

    private companion object {
        const val FONT_SCALE_THRESHOLD = 1.8f
        const val DENSITY_THRESHOLD = 480
        const val DEFAULT_LARGE_TILE_WIDTH = 2
    }
}