Allow Bluetooth radio to be toggled in Airplane mode.
Add "bluetooth" to the list of toggleable radios. Because this string is in the Settings DB, I had to bump the version number. Why is this in the settings DB anyway, rather than a carrier config option? I also discovered that the SystemUI package copied the entire contents of res/values/defaults.xml from SettingsProvider, when I originally tried to update the unreferenced SystemUI version of the setting. To prevent future confusion, I removed all of the values from the SystemUI version of res/values/defaults.xml. Change-Id: Ib8a75c85b9db5c1963b65538ee2765d5087e67d2
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<bool name="def_airplane_mode_on">false</bool>
|
||||
<!-- Comma-separated list of bluetooth, wifi, and cell. -->
|
||||
<string name="def_airplane_mode_radios" translatable="false">cell,bluetooth,wifi</string>
|
||||
<string name="airplane_mode_toggleable_radios" translatable="false">wifi</string>
|
||||
<string name="airplane_mode_toggleable_radios" translatable="false">bluetooth,wifi</string>
|
||||
<bool name="def_auto_time">true</bool>
|
||||
<bool name="def_accelerometer_rotation">true</bool>
|
||||
<!-- Default screen brightness, from 0 to 255. 102 is 40%. -->
|
||||
|
||||
@@ -64,7 +64,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
|
||||
// is properly propagated through your change. Not doing so will result in a loss of user
|
||||
// settings.
|
||||
private static final int DATABASE_VERSION = 56;
|
||||
private static final int DATABASE_VERSION = 57;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
@@ -713,6 +713,27 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
}
|
||||
upgradeVersion = 56;
|
||||
}
|
||||
|
||||
if (upgradeVersion == 56) {
|
||||
/*
|
||||
* Add Bluetooth to list of toggleable radios in airplane mode
|
||||
*/
|
||||
db.beginTransaction();
|
||||
SQLiteStatement stmt = null;
|
||||
try {
|
||||
db.execSQL("DELETE FROM system WHERE name='"
|
||||
+ Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS + "'");
|
||||
stmt = db.compileStatement("INSERT OR IGNORE INTO system(name,value)"
|
||||
+ " VALUES(?,?);");
|
||||
loadStringSetting(stmt, Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS,
|
||||
R.string.airplane_mode_toggleable_radios);
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
if (stmt != null) stmt.close();
|
||||
}
|
||||
upgradeVersion = 57;
|
||||
}
|
||||
// *** Remember to update DATABASE_VERSION above!
|
||||
|
||||
if (upgradeVersion != currentVersion) {
|
||||
|
||||
@@ -17,62 +17,4 @@
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<bool name="def_dim_screen">true</bool>
|
||||
<integer name="def_screen_off_timeout">60000</integer>
|
||||
<bool name="def_airplane_mode_on">false</bool>
|
||||
<!-- Comma-separated list of bluetooth, wifi, and cell. -->
|
||||
<string name="def_airplane_mode_radios" translatable="false">cell,bluetooth,wifi</string>
|
||||
<string name="airplane_mode_toggleable_radios" translatable="false">wifi</string>
|
||||
<bool name="def_auto_time">true</bool>
|
||||
<bool name="def_accelerometer_rotation">true</bool>
|
||||
<!-- Default screen brightness, from 0 to 255. 102 is 40%. -->
|
||||
<integer name="def_screen_brightness">102</integer>
|
||||
<bool name="def_screen_brightness_automatic_mode">false</bool>
|
||||
<fraction name="def_window_animation_scale">100%</fraction>
|
||||
<fraction name="def_window_transition_scale">100%</fraction>
|
||||
<bool name="def_haptic_feedback">true</bool>
|
||||
|
||||
<bool name="def_bluetooth_on">false</bool>
|
||||
<bool name="def_install_non_market_apps">false</bool>
|
||||
<!-- Comma-separated list of location providers.
|
||||
Network location is off by default because it requires
|
||||
user opt-in via Setup Wizard or Settings.
|
||||
-->
|
||||
<string name="def_location_providers_allowed" translatable="false">gps</string>
|
||||
<bool name="assisted_gps_enabled">true</bool>
|
||||
<!-- 0 == mobile, 1 == wifi. -->
|
||||
<integer name="def_network_preference">1</integer>
|
||||
<bool name="def_usb_mass_storage_enabled">true</bool>
|
||||
<bool name="def_wifi_on">false</bool>
|
||||
<bool name="def_networks_available_notification_on">true</bool>
|
||||
|
||||
<bool name="def_backup_enabled">false</bool>
|
||||
<string name="def_backup_transport" translatable="false"></string>
|
||||
<!-- Default value for whether or not to pulse the notification LED when there is a
|
||||
pending notification -->
|
||||
<bool name="def_notification_pulse">true</bool>
|
||||
|
||||
<bool name="def_mount_play_notification_snd">true</bool>
|
||||
<bool name="def_mount_ums_autostart">false</bool>
|
||||
<bool name="def_mount_ums_prompt">true</bool>
|
||||
<bool name="def_mount_ums_notify_enabled">true</bool>
|
||||
<!-- Enable User preference for setting install location -->
|
||||
<bool name="set_install_location">true</bool>
|
||||
<!-- Default install location if user preference for setting install location is turned on. -->
|
||||
<integer name="def_install_location">2</integer>
|
||||
|
||||
<!-- user interface sound effects -->
|
||||
<integer name="def_power_sounds_enabled">1</integer>
|
||||
<string name="def_low_battery_sound" translatable="false">/system/media/audio/ui/LowBattery.ogg</string>
|
||||
<integer name="def_dock_sounds_enabled">0</integer>
|
||||
<string name="def_desk_dock_sound" translatable="false">/system/media/audio/ui/Dock.ogg</string>
|
||||
<string name="def_desk_undock_sound" translatable="false">/system/media/audio/ui/Undock.ogg</string>
|
||||
<string name="def_car_dock_sound" translatable="false">/system/media/audio/ui/Dock.ogg</string>
|
||||
<string name="def_car_undock_sound" translatable="false">/system/media/audio/ui/Undock.ogg</string>
|
||||
<integer name="def_lockscreen_sounds_enabled">0</integer>
|
||||
<string name="def_lock_sound" translatable="false">/system/media/audio/ui/Lock.ogg</string>
|
||||
<string name="def_unlock_sound" translatable="false">/system/media/audio/ui/Unlock.ogg</string>
|
||||
|
||||
<!-- Default for Settings.System.VIBRATE_IN_SILENT -->
|
||||
<bool name="def_vibrate_in_silent">true</bool>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user