Reduce RBC test flakiness

Read the setting directly, which is successfully being set by the
display manager

Bug: 182099323
Test: forrest
Change-Id: Ia68c8206187995fc5a615d6815f04b8ad01f9312
This commit is contained in:
sallyyuen
2021-03-18 09:19:39 -07:00
committed by Sally Yuen
parent e12ad9777e
commit b75902f0ba

View File

@@ -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);
}