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

Commit 79764127 authored by Daniel Nishi's avatar Daniel Nishi
Browse files

Add a new setting for Bluetooth on while driving.

This also adds a feature flag to read to see if the feature is enabled
on a given device.

Bug: 66679618
Test: Used in Settings Robotest
Change-Id: Idb892aa78f244d026a8d4b7dc104d47e0f611085
parent 411985ba
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -7592,6 +7592,13 @@ public final class Settings {
         */
        public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants";

        /**
         * Flag to set if the system should predictively attempt to re-enable Bluetooth while
         * the user is driving.
         * @hide
         */
        public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving";

        /**
         * This are the settings to be backed up.
         *
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ public class FeatureFlagUtils {
        DEFAULT_FLAGS.put("settings_zone_picker_v2", "true");
        DEFAULT_FLAGS.put("settings_suggestion_ui_v2", "false");
        DEFAULT_FLAGS.put("settings_about_phone_v2", "false");
        DEFAULT_FLAGS.put("settings_bluetooth_while_driving", "false");
    }

    /**
+2 −1
Original line number Diff line number Diff line
@@ -596,8 +596,9 @@ message SecureSettingsProto {
    optional SettingProto lockdown_in_power_menu = 194;
    optional SettingProto backup_manager_constants = 169;
    optional SettingProto show_first_crash_dialog_dev_option = 195;
    optional SettingProto bluetooth_on_while_driving = 196;

    // Next tag = 196
    // Next tag = 197
}

message SystemSettingsProto {
+2 −1
Original line number Diff line number Diff line
@@ -538,7 +538,8 @@ public class SettingsBackupTest {
                 Settings.Secure.BACKUP_MANAGER_CONSTANTS,
                 Settings.Secure.KEYGUARD_SLICE_URI,
                 Settings.Secure.PARENTAL_CONTROL_ENABLED,
                 Settings.Secure.PARENTAL_CONTROL_REDIRECT_URL);
                 Settings.Secure.PARENTAL_CONTROL_REDIRECT_URL,
                 Settings.Secure.BLUETOOTH_ON_WHILE_DRIVING);

    @Test
    public void systemSettingsBackedUpOrBlacklisted() {
+3 −0
Original line number Diff line number Diff line
@@ -1758,6 +1758,9 @@ class SettingsProtoDumpUtil {
        dumpSetting(s, p,
                Settings.Secure.BACKUP_MANAGER_CONSTANTS,
                SecureSettingsProto.BACKUP_MANAGER_CONSTANTS);
        dumpSetting(s, p,
                Settings.Secure.BLUETOOTH_ON_WHILE_DRIVING,
                SecureSettingsProto.BLUETOOTH_ON_WHILE_DRIVING);
    }

    private static void dumpProtoSystemSettingsLocked(