feat(brightness suw): add brightness preferences in suw

Add brightness level and auto brightness preference in
accessibility_settings_for_setup_wizard.xml. Since the flagging has not
be supported yet for non-Manifest resources, for now we add the
preferences by default, and update the preferece availablity status in
each preference controllers based on the flag.

Bug: 311093618
Flag: ACONFIG com.android.settings.accessibility.add_brightness_settings_in_suw DEVELOPMENT
Test: manually
      atest AccessibilitySettingsForSetupWizardTest
      atest AutoBrightnessPreferenceFragmentForSetupWizardTest
      atest AutoBrightnessPreferenceControllerTest
      atest BrightnessLevelPreferenceControllerTest
Change-Id: I350d99138bdd14bf28828a39e42f707b5b1066c1
This commit is contained in:
Roy Chou
2024-04-18 16:34:26 +00:00
parent 23349d60c0
commit 042c8c7328
19 changed files with 490 additions and 24 deletions

View File

@@ -228,6 +228,8 @@ public class BatteryTestUtils {
/** Create a power anomaly event proto of adaptive brightness. */
public static PowerAnomalyEvent createAdaptiveBrightnessAnomalyEvent(boolean changeSettings) {
// TODO: migrate "auto_brightness_entry" to use R.string.preference_key_auto_brightness
// if we can access the Context here. (b/338314718)
WarningBannerInfo.Builder warningBannerInfoBuilder =
WarningBannerInfo.newBuilder()
.setMainButtonDestination(DisplaySettings.class.getName())