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

Commit 02d762ec authored by Wilson Wu's avatar Wilson Wu Committed by Android (Google) Code Review
Browse files

Merge "Default keyboard vibration settings to touch feedback" into main

parents 5bf78506 e46b6d5c
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
@@ -3812,7 +3812,7 @@ public class SettingsProvider extends ContentProvider {
        }

        private final class UpgradeController {
            private static final int SETTINGS_VERSION = 225;
            private static final int SETTINGS_VERSION = 226;

            private final int mUserId;

@@ -6011,6 +6011,28 @@ public class SettingsProvider extends ContentProvider {
                    currentVersion = 225;
                }

                // Version 225: Set the System#KEYBOARD_VIBRATION_ENABLED based on touch
                // feedback enabled state.
                if (currentVersion == 225) {
                    final SettingsState systemSettings = getSystemSettingsLocked(userId);
                    final Setting touchFeedbackSettings = systemSettings
                            .getSettingLocked(Settings.System.HAPTIC_FEEDBACK_ENABLED);
                    final Setting keyboardVibrationSettings = systemSettings
                            .getSettingLocked(Settings.System.KEYBOARD_VIBRATION_ENABLED);
                    if (keyboardVibrationSettings.isNull()) {
                        if (!touchFeedbackSettings.isNull()) {
                            // Use touch feedback settings.
                            systemSettings.insertSettingOverrideableByRestoreLocked(
                                    Settings.System.KEYBOARD_VIBRATION_ENABLED,
                                    touchFeedbackSettings.getValue(),
                                    touchFeedbackSettings.getTag(),
                                    touchFeedbackSettings.isDefaultFromSystem(),
                                    SettingsState.SYSTEM_PACKAGE_NAME);
                        }
                    }
                    currentVersion = 226;
                }

                // vXXX: Add new settings above this point.

                if (currentVersion != newVersion) {