summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddableTest.kt15
-rw-r--r--packages/SystemUI/res/values/config.xml3
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddable.kt5
3 files changed, 17 insertions, 6 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddableTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddableTest.kt
index 6d6fd754341d..d0699aa12a43 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddableTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddableTest.kt
@@ -16,7 +16,9 @@
package com.android.systemui.qs.pipeline.domain.autoaddable
-import android.platform.test.annotations.EnabledOnRavenwood
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
+import android.view.accessibility.Flags
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
@@ -44,7 +46,6 @@ import org.mockito.MockitoAnnotations
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
-@EnabledOnRavenwood
@RunWith(AndroidJUnit4::class)
class ReduceBrightColorsAutoAddableTest : SysuiTestCase() {
@@ -67,12 +68,14 @@ class ReduceBrightColorsAutoAddableTest : SysuiTestCase() {
}
@Test
+ @DisableFlags(Flags.FLAG_A11Y_QS_SHORTCUT)
fun available_strategyIfNotAdded() =
testWithFeatureAvailability(available = true) {
assertThat(underTest.autoAddTracking).isEqualTo(AutoAddTracking.IfNotAdded(SPEC))
}
@Test
+ @DisableFlags(Flags.FLAG_A11Y_QS_SHORTCUT)
fun activated_addSignal() = testWithFeatureAvailability {
val signal by collectLastValue(underTest.autoAddSignal(0))
runCurrent()
@@ -85,6 +88,7 @@ class ReduceBrightColorsAutoAddableTest : SysuiTestCase() {
}
@Test
+ @DisableFlags(Flags.FLAG_A11Y_QS_SHORTCUT)
fun notActivated_noSignal() = testWithFeatureAvailability {
val signal by collectLastValue(underTest.autoAddSignal(0))
runCurrent()
@@ -96,6 +100,13 @@ class ReduceBrightColorsAutoAddableTest : SysuiTestCase() {
assertThat(signal).isNull()
}
+ @Test
+ @EnableFlags(Flags.FLAG_A11Y_QS_SHORTCUT)
+ fun available_a11yQsShortcutFlagEnabled_strategyDisabled() =
+ testWithFeatureAvailability(available = true) {
+ assertThat(underTest.autoAddTracking).isEqualTo(AutoAddTracking.Disabled)
+ }
+
private fun testWithFeatureAvailability(
available: Boolean = true,
body: suspend TestScope.() -> TestResult
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index a6f6d4dcf2f9..fa9d507dbff5 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -116,9 +116,6 @@
The syntax is setting-name:spec. If the tile is a TileService, the spec should be specified
as custom(package/class). Relative class name is supported. -->
<string-array name="config_quickSettingsAutoAdd" translatable="false">
- <item>accessibility_display_daltonizer_enabled:color_correction</item>
- <item>accessibility_display_inversion_enabled:inversion</item>
- <item>one_handed_mode_enabled:onehanded</item>
<item>accessibility_font_scaling_has_been_changed:font_scaling</item>
</string-array>
diff --git a/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddable.kt b/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddable.kt
index 267e2b7d0609..9c1b85799648 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddable.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddable.kt
@@ -16,6 +16,7 @@
package com.android.systemui.qs.pipeline.domain.autoaddable
+import android.view.accessibility.Flags
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.qs.ReduceBrightColorsController
import com.android.systemui.qs.dagger.QSFlagsModule.RBC_AVAILABLE
@@ -58,7 +59,9 @@ constructor(
override val autoAddTracking
get() =
- if (available) {
+ if (Flags.a11yQsShortcut()) {
+ AutoAddTracking.Disabled
+ } else if (available) {
super.autoAddTracking
} else {
AutoAddTracking.Disabled