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

Commit eb8bddb1 authored by Edgar Wang's avatar Edgar Wang
Browse files

Set the default value for Secure Settings: AWARE_ENABLED

Bug: 130909059
Test: rebuild & manual test

Change-Id: I892c42953a86348786c3baedc5223d02be9f4578
parent d6bed5bc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -226,4 +226,7 @@

    <!-- Default for Settings.Secure.NOTIFICATION_BUBBLES -->
    <bool name="def_notification_bubbles">true</bool>

    <!-- Default for Settings.Secure.AWARE_ENABLED -->
    <bool name="def_aware_enabled">false</bool>
</resources>
+20 −1
Original line number Diff line number Diff line
@@ -3243,7 +3243,7 @@ public class SettingsProvider extends ContentProvider {
        }

        private final class UpgradeController {
            private static final int SETTINGS_VERSION = 177;
            private static final int SETTINGS_VERSION = 178;

            private final int mUserId;

@@ -4369,6 +4369,25 @@ public class SettingsProvider extends ContentProvider {
                    currentVersion = 177;
                }

                if (currentVersion == 177) {
                    // Version 177: Set the default value for Secure Settings: AWARE_ENABLED

                    final SettingsState secureSettings = getSecureSettingsLocked(userId);

                    final Setting awareEnabled = secureSettings.getSettingLocked(
                            Secure.AWARE_ENABLED);

                    if (awareEnabled.isNull()) {
                        final boolean defAwareEnabled = getContext().getResources().getBoolean(
                                R.bool.def_aware_enabled);
                        secureSettings.insertSettingLocked(
                                Secure.AWARE_ENABLED, defAwareEnabled ? "1" : "0",
                                null, true, SettingsState.SYSTEM_PACKAGE_NAME);
                    }

                    currentVersion = 178;
                }


                // vXXX: Add new settings above this point.