Merge "settings: add def_enable_back_animation" into main

This commit is contained in:
Treehugger Robot
2023-07-13 09:21:36 +00:00
committed by Android (Google) Code Review
2 changed files with 19 additions and 1 deletions

View File

@@ -321,4 +321,7 @@
<!-- Whether vibrate icon is shown in the status bar by default. -->
<integer name="def_statusBarVibrateIconEnabled">0</integer>
<!-- Whether predictive back animation is enabled by default. -->
<bool name="def_enable_back_animation">false</bool>
</resources>

View File

@@ -3773,7 +3773,7 @@ public class SettingsProvider extends ContentProvider {
}
private final class UpgradeController {
private static final int SETTINGS_VERSION = 220;
private static final int SETTINGS_VERSION = 221;
private final int mUserId;
@@ -5867,6 +5867,21 @@ public class SettingsProvider extends ContentProvider {
currentVersion = 220;
}
if (currentVersion == 220) {
final SettingsState globalSettings = getGlobalSettingsLocked();
final Setting enableBackAnimation =
globalSettings.getSettingLocked(Global.ENABLE_BACK_ANIMATION);
if (enableBackAnimation.isNull()) {
final boolean defEnableBackAnimation =
getContext()
.getResources()
.getBoolean(R.bool.def_enable_back_animation);
initGlobalSettingsDefaultValLocked(
Settings.Global.ENABLE_BACK_ANIMATION, defEnableBackAnimation);
}
currentVersion = 221;
}
// vXXX: Add new settings above this point.
if (currentVersion != newVersion) {