settings: Change default setting for radios affected by apm mode

* NFC radio is no longer affected by APM mode (this cleanup was missed
when the behavior was changed in b/128384879).
* UWB radio turns off whenever APM mode is enabled (not toggleable in
APM mode in compliance with regulatory requirements).

Bug: 275381319
Test: Flashed device and verified that the settings key values have
changed.

Change-Id: I878b626f4afba36ef4624fe6615c50832cca44bc
This commit is contained in:
Roshan Pius
2023-03-27 11:36:45 -07:00
parent 52339c917c
commit 96cfda772b
2 changed files with 28 additions and 3 deletions

View File

@@ -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>

View File

@@ -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) {