Get Extra Dim availability through ColorDisplayManager

Test: atest ReduceBrightColorsIntensityPreferenceControllerTest
Bug: 170970675
Change-Id: Ibccca13d6491e8861263887e33021dd467fc227f
This commit is contained in:
sallyyuen
2021-04-05 15:47:39 -07:00
parent 9aff855052
commit ee9cb2d147
5 changed files with 18 additions and 11 deletions

View File

@@ -56,7 +56,7 @@ public class ReduceBrightColorsIntensityPreferenceControllerTest {
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED, 1);
doReturn(true).when(mResources).getBoolean(
com.android.internal.R.bool.config_setColorTransformAccelerated);
R.bool.config_reduceBrightColorsAvailable);
assertThat(mPreferenceController.isAvailable()).isTrue();
}
@Test
@@ -64,7 +64,7 @@ public class ReduceBrightColorsIntensityPreferenceControllerTest {
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED, 0);
doReturn(true).when(mResources).getBoolean(
com.android.internal.R.bool.config_setColorTransformAccelerated);
R.bool.config_reduceBrightColorsAvailable);
assertThat(mPreferenceController.isAvailable()).isTrue();
}
@Test
@@ -72,7 +72,7 @@ public class ReduceBrightColorsIntensityPreferenceControllerTest {
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED, 1);
doReturn(false).when(mResources).getBoolean(
com.android.internal.R.bool.config_setColorTransformAccelerated);
R.bool.config_reduceBrightColorsAvailable);
assertThat(mPreferenceController.isAvailable()).isFalse();
}