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

Commit b775f5b3 authored by Roshan Pius's avatar Roshan Pius Committed by Android (Google) Code Review
Browse files

Merge "settings: Change default setting for radios affected by apm mode" into udc-dev

parents f6b67dc5 96cfda77
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@
    <bool name="def_airplane_mode_on">false</bool>
    <bool name="def_theater_mode_on">false</bool>
    <!-- Comma-separated list of bluetooth, wifi, and cell. -->
    <string name="def_airplane_mode_radios" translatable="false">cell,bluetooth,wifi,nfc,wimax</string>
    <string name="airplane_mode_toggleable_radios" translatable="false">bluetooth,wifi,nfc</string>
    <string name="def_airplane_mode_radios" translatable="false">cell,bluetooth,uwb,wifi,wimax</string>
    <string name="airplane_mode_toggleable_radios" translatable="false">bluetooth,wifi</string>
    <string name="def_bluetooth_disabled_profiles" translatable="false">0</string>
    <bool name="def_auto_time">true</bool>
    <bool name="def_auto_time_zone">true</bool>
+26 −1
Original line number Diff line number Diff line
@@ -3739,7 +3739,7 @@ public class SettingsProvider extends ContentProvider {
        }

        private final class UpgradeController {
            private static final int SETTINGS_VERSION = 215;
            private static final int SETTINGS_VERSION = 216;

            private final int mUserId;

@@ -5737,6 +5737,31 @@ public class SettingsProvider extends ContentProvider {
                    currentVersion = 215;
                }

                if (currentVersion == 215) {
                    // Version 215: default |def_airplane_mode_radios| and
                    // |airplane_mode_toggleable_radios| changed to remove NFC & add UWB.
                    final SettingsState globalSettings = getGlobalSettingsLocked();
                    final String oldApmRadiosValue = globalSettings.getSettingLocked(
                            Settings.Global.AIRPLANE_MODE_RADIOS).getValue();
                    if (TextUtils.equals("cell,bluetooth,wifi,nfc,wimax", oldApmRadiosValue)) {
                        globalSettings.insertSettingOverrideableByRestoreLocked(
                                Settings.Global.AIRPLANE_MODE_RADIOS,
                                getContext().getResources().getString(
                                        R.string.def_airplane_mode_radios),
                                null, true, SettingsState.SYSTEM_PACKAGE_NAME);
                    }
                    final String oldApmToggleableRadiosValue = globalSettings.getSettingLocked(
                            Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS).getValue();
                    if (TextUtils.equals("bluetooth,wifi,nfc", oldApmToggleableRadiosValue)) {
                        globalSettings.insertSettingOverrideableByRestoreLocked(
                                Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS,
                                getContext().getResources().getString(
                                        R.string.airplane_mode_toggleable_radios),
                                null, true, SettingsState.SYSTEM_PACKAGE_NAME);
                    }
                    currentVersion = 216;
                }

                // vXXX: Add new settings above this point.

                if (currentVersion != newVersion) {