[Regional Preference] Add new flag to SettingsProvider

- Add a SettingsProvider flag to save the user's preference.

Bug: b/259487708
Test: Maunal test passed
Change-Id: Ic098c06fb59b11d4a5e836fe2b9531f4b2ee1c38
This commit is contained in:
tom hsu
2022-12-01 20:40:20 +08:00
parent 383a053610
commit 4debea9085
3 changed files with 17 additions and 1 deletions

View File

@@ -5588,6 +5588,19 @@ public final class Settings {
@Readable
public static final String DESKTOP_MODE = "desktop_mode";
/**
* The information of locale preference. This records user's preference to avoid
* unsynchronized and existing locale preference in
* {@link Locale#getDefault(Locale.Category)}.
*
* <p><b>Note:</b> The format follow the
* <a href="https://www.rfc-editor.org/rfc/bcp/bcp47.txt">IETF BCP47 expression</a>
*
* E.g. : und-u-ca-gregorian-hc-h23
* @hide
*/
public static final String LOCALE_PREFERENCES = "locale_preferences";
/**
* IMPORTANT: If you add a new public settings you also have to add it to
* PUBLIC_SETTINGS below. If the new setting is hidden you have to add
@@ -5716,6 +5729,7 @@ public final class Settings {
PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE_VENDOR_HINT);
PRIVATE_SETTINGS.add(DESKTOP_MODE);
PRIVATE_SETTINGS.add(LOCALE_PREFERENCES);
}
/**

View File

@@ -91,6 +91,7 @@ public class SystemSettings {
Settings.System.WEAR_ACCESSIBILITY_GESTURE_ENABLED,
Settings.System.CLOCKWORK_BLUETOOTH_SETTINGS_PREF,
Settings.System.UNREAD_NOTIFICATION_DOT_INDICATOR,
Settings.System.AUTO_LAUNCH_MEDIA_CONTROLS
Settings.System.AUTO_LAUNCH_MEDIA_CONTROLS,
Settings.System.LOCALE_PREFERENCES
};
}

View File

@@ -210,5 +210,6 @@ public class SystemSettingsValidators {
VALIDATORS.put(System.CLOCKWORK_BLUETOOTH_SETTINGS_PREF, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.UNREAD_NOTIFICATION_DOT_INDICATOR, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.AUTO_LAUNCH_MEDIA_CONTROLS, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.LOCALE_PREFERENCES, ANY_STRING_VALIDATOR);
}
}