Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd18bc9b authored by Yifei Zhang's avatar Yifei Zhang
Browse files

settings: add def_enable_back_animation

- Provide default value for Settings.Global.ENABLE_BACK_ANIMATION
- Defaults to true in values-watch

Test: build / flash
Bug: 290802058
Change-Id: I39451a47845c7261f6e8d8aa0693f7f88d86be4b
parent 10fe36a1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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>
+16 −1
Original line number Diff line number Diff line
@@ -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) {