Loading packages/SettingsProvider/res/values/defaults.xml +8 −0 Original line number Diff line number Diff line Loading @@ -344,4 +344,12 @@ <!-- Caps minsum contrast from -1.0 (Material API) to 0.0 (Android Support)--> <bool name="config_increaseMinContrast">true</bool> <!-- Default for Settings.System.TEXT_SHOW_PASSWORD. Intentionally left empty. The goal is to set a default for desktop devices without forcing it on other form factors. --> <bool name="def_text_show_password"></bool> </resources> packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +29 −1 Original line number Diff line number Diff line Loading @@ -4254,7 +4254,7 @@ public class SettingsProvider extends ContentProvider { @VisibleForTesting final class UpgradeController { private static final int SETTINGS_VERSION = 230; private static final int SETTINGS_VERSION = 231; private final int mUserId; private final int mDeviceId; Loading Loading @@ -6585,6 +6585,34 @@ public class SettingsProvider extends ContentProvider { currentVersion = 230; } if (currentVersion == 230) { if (Flags.allowDefaultValueForTextShowPassword()) { final SettingsState systemSettings = getSystemSettingsLocked(userId, deviceId); if (systemSettings .getSettingLocked(Settings.System.TEXT_SHOW_PASSWORD) .isNull()) { try { boolean defTextShowPassword = getContext() .getResources() .getBoolean(R.bool.def_text_show_password); systemSettings.insertSettingOverrideableByRestoreLocked( Settings.System.TEXT_SHOW_PASSWORD, defTextShowPassword ? "1" : "0", null /* tag */, true /* makeDefault */, SettingsState.SYSTEM_PACKAGE_NAME); } catch (Resources.NotFoundException e) { // Do nothing } } } currentVersion = 231; } // vXXX: Add new settings above this point. if (currentVersion != newVersion) { Loading packages/SettingsProvider/src/com/android/providers/settings/device_config_service.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -111,3 +111,13 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "allow_default_value_for_text_show_password" namespace: "desktop_privacy" description: "Allows setting a default value for Settings.System.TEXT_SHOW_PASSWORD." bug: "339270220" metadata { purpose: PURPOSE_BUGFIX } } Loading
packages/SettingsProvider/res/values/defaults.xml +8 −0 Original line number Diff line number Diff line Loading @@ -344,4 +344,12 @@ <!-- Caps minsum contrast from -1.0 (Material API) to 0.0 (Android Support)--> <bool name="config_increaseMinContrast">true</bool> <!-- Default for Settings.System.TEXT_SHOW_PASSWORD. Intentionally left empty. The goal is to set a default for desktop devices without forcing it on other form factors. --> <bool name="def_text_show_password"></bool> </resources>
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +29 −1 Original line number Diff line number Diff line Loading @@ -4254,7 +4254,7 @@ public class SettingsProvider extends ContentProvider { @VisibleForTesting final class UpgradeController { private static final int SETTINGS_VERSION = 230; private static final int SETTINGS_VERSION = 231; private final int mUserId; private final int mDeviceId; Loading Loading @@ -6585,6 +6585,34 @@ public class SettingsProvider extends ContentProvider { currentVersion = 230; } if (currentVersion == 230) { if (Flags.allowDefaultValueForTextShowPassword()) { final SettingsState systemSettings = getSystemSettingsLocked(userId, deviceId); if (systemSettings .getSettingLocked(Settings.System.TEXT_SHOW_PASSWORD) .isNull()) { try { boolean defTextShowPassword = getContext() .getResources() .getBoolean(R.bool.def_text_show_password); systemSettings.insertSettingOverrideableByRestoreLocked( Settings.System.TEXT_SHOW_PASSWORD, defTextShowPassword ? "1" : "0", null /* tag */, true /* makeDefault */, SettingsState.SYSTEM_PACKAGE_NAME); } catch (Resources.NotFoundException e) { // Do nothing } } } currentVersion = 231; } // vXXX: Add new settings above this point. if (currentVersion != newVersion) { Loading
packages/SettingsProvider/src/com/android/providers/settings/device_config_service.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -111,3 +111,13 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "allow_default_value_for_text_show_password" namespace: "desktop_privacy" description: "Allows setting a default value for Settings.System.TEXT_SHOW_PASSWORD." bug: "339270220" metadata { purpose: PURPOSE_BUGFIX } }