From b75902f0ba193ce043d9c344d5141760eadbead1 Mon Sep 17 00:00:00 2001 From: sallyyuen Date: Thu, 18 Mar 2021 09:19:39 -0700 Subject: [PATCH] Reduce RBC test flakiness Read the setting directly, which is successfully being set by the display manager Bug: 182099323 Test: forrest Change-Id: Ia68c8206187995fc5a615d6815f04b8ad01f9312 --- .../ReduceBrightColorsIntensityPreferenceControllerTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/unit/src/com/android/settings/accessibility/ReduceBrightColorsIntensityPreferenceControllerTest.java b/tests/unit/src/com/android/settings/accessibility/ReduceBrightColorsIntensityPreferenceControllerTest.java index 8dac89318a0..22d0b298059 100644 --- a/tests/unit/src/com/android/settings/accessibility/ReduceBrightColorsIntensityPreferenceControllerTest.java +++ b/tests/unit/src/com/android/settings/accessibility/ReduceBrightColorsIntensityPreferenceControllerTest.java @@ -24,7 +24,6 @@ import static org.mockito.Mockito.when; import android.content.Context; import android.content.res.Resources; -import android.hardware.display.ColorDisplayManager; import android.provider.Settings; import androidx.test.core.app.ApplicationProvider; @@ -83,8 +82,8 @@ public class ReduceBrightColorsIntensityPreferenceControllerTest { Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED, 1); mPreferenceController.onPreferenceChange(/* preference= */ null, 20); assertThat( - mContext.getSystemService( - ColorDisplayManager.class).getReduceBrightColorsStrength()) + Settings.Secure.getInt(mContext.getContentResolver(), + Settings.Secure.REDUCE_BRIGHT_COLORS_LEVEL, 0)) .isEqualTo(20); }