Change automatic brightness summary to absolute brightness.

The brightness slider now always represents the absolute brightness,
including when adaptive brightness is enabled. This changes the summary
of the brightness setting to reflect that.

Bug: 72627086
Test: ROBOTEST_FILTER=BrightnessLevelPreferenceControllerTest m -j RunSettingsRoboTests
Change-Id: I76eed8aa9ee88fe6b70e30d54bfc0d18d1141377
This commit is contained in:
Michael Wright
2018-01-29 16:52:47 +00:00
parent 9024b4eb15
commit 30b66159aa
2 changed files with 8 additions and 23 deletions

View File

@@ -89,8 +89,6 @@ public class BrightnessLevelPreferenceControllerTest {
controller.onStart();
assertThat(shadowContentResolver.getContentObservers(
System.getUriFor(System.SCREEN_BRIGHTNESS_MODE))).isNotEmpty();
assertThat(shadowContentResolver.getContentObservers(
System.getUriFor(System.SCREEN_BRIGHTNESS))).isNotEmpty();
assertThat(shadowContentResolver.getContentObservers(
@@ -110,8 +108,6 @@ public class BrightnessLevelPreferenceControllerTest {
controller.onStart();
controller.onStop();
assertThat(shadowContentResolver.getContentObservers(
System.getUriFor(System.SCREEN_BRIGHTNESS_MODE))).isEmpty();
assertThat(shadowContentResolver.getContentObservers(
System.getUriFor(System.SCREEN_BRIGHTNESS))).isEmpty();
assertThat(shadowContentResolver.getContentObservers(
@@ -136,11 +132,11 @@ public class BrightnessLevelPreferenceControllerTest {
System.putInt(mContentResolver, System.SCREEN_BRIGHTNESS_MODE,
System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC);
System.putFloat(mContentResolver, System.SCREEN_AUTO_BRIGHTNESS_ADJ, 0.0f);
System.putInt(mContentResolver, System.SCREEN_BRIGHTNESS, 31);
mController.updateState(mPreference);
verify(mPreference).setSummary("50%");
verify(mPreference).setSummary("31%");
}
@Test
@@ -175,11 +171,11 @@ public class BrightnessLevelPreferenceControllerTest {
System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC);
reset(mPreference);
System.putFloat(mContentResolver, System.SCREEN_AUTO_BRIGHTNESS_ADJ, 1.5f);
System.putInt(mContentResolver, System.SCREEN_BRIGHTNESS, 115);
mController.updateState(mPreference);
verify(mPreference).setSummary("100%");
System.putFloat(mContentResolver, System.SCREEN_AUTO_BRIGHTNESS_ADJ, -1.5f);
System.putInt(mContentResolver, System.SCREEN_BRIGHTNESS, -10);
mController.updateState(mPreference);
verify(mPreference).setSummary("0%");