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

Commit 5d4d7165 authored by Jason Chang's avatar Jason Chang
Browse files

Fix swipe for notification default should be on instead of off

Set SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED value default ON
in SettingsProvider.

Bug: 175084985

Test: manual
Change-Id: I0bf77020f94a88767f4f56c8501ad57f6a949e48
parent 0223a515
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public final class OneHandedSettingsUtil {
     */
    public static boolean getSettingsSwipeToNotificationEnabled(ContentResolver resolver) {
        return Settings.Secure.getInt(resolver,
                Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, 0) == 1;
                Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, 1) == 1;
    }

    protected static void dump(PrintWriter pw, String prefix, ContentResolver resolver) {
+6 −0
Original line number Diff line number Diff line
@@ -241,6 +241,12 @@
    <!-- Default for setting for Settings.Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED -->
    <bool name="def_hdmiControlAutoDeviceOff">false</bool>

    <!-- Default for Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED -->
    <bool name="def_swipe_bottom_to_notification_enabled">true</bool>

    <!-- Default for Settings.Secure.ONE_HANDED_MODE_ENABLED -->
    <bool name="def_one_handed_mode_enabled">false</bool>

    <!-- Default for Settings.Secure.ACCESSIBILITY_MAGNIFICATION_CAPABILITY -->
    <integer name="def_accessibility_magnification_capabilities">3</integer>
</resources>
+30 −1
Original line number Diff line number Diff line
@@ -3342,7 +3342,7 @@ public class SettingsProvider extends ContentProvider {
        }

        private final class UpgradeController {
            private static final int SETTINGS_VERSION = 196;
            private static final int SETTINGS_VERSION = 197;

            private final int mUserId;

@@ -4786,6 +4786,35 @@ public class SettingsProvider extends ContentProvider {
                    currentVersion = 196;
                }

                if (currentVersion == 196) {
                    // Version 196: Set the default value for Secure Settings:
                    // SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED & ONE_HANDED_MODE_ENABLED
                    final SettingsState secureSettings = getSecureSettingsLocked(userId);
                    final Setting swipeNotification = secureSettings.getSettingLocked(
                            Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED);
                    if (swipeNotification.isNull()) {
                        final boolean defSwipeNotification = getContext().getResources()
                                .getBoolean(R.bool.def_swipe_bottom_to_notification_enabled);
                        secureSettings.insertSettingLocked(
                                Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED,
                                defSwipeNotification ? "1" : "0", null, true,
                                SettingsState.SYSTEM_PACKAGE_NAME);
                    }

                    final Setting oneHandedModeEnabled = secureSettings.getSettingLocked(
                            Secure.ONE_HANDED_MODE_ENABLED);
                    if (oneHandedModeEnabled.isNull()) {
                        final boolean defOneHandedModeEnabled = getContext().getResources()
                                .getBoolean(R.bool.def_one_handed_mode_enabled);
                        secureSettings.insertSettingLocked(
                                Secure.ONE_HANDED_MODE_ENABLED,
                                defOneHandedModeEnabled ? "1" : "0", null, true,
                                SettingsState.SYSTEM_PACKAGE_NAME);
                    }

                    currentVersion = 197;
                }

                // vXXX: Add new settings above this point.

                if (currentVersion != newVersion) {