diff options
author | Mike Lockwood <lockwood@android.com> | 2009-07-29 21:37:14 -0700 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2009-07-29 21:37:14 -0700 |
commit | bd5ddf01e4d629982fa8bb667d4be7c5ec3aa79f (patch) | |
tree | d1e74b94e3b322c137e52f7514072e6d2309000f /packages/SettingsProvider | |
parent | 2ec556ddc840ae71cd1e618e593a6ce8555f5590 (diff) | |
download | frameworks_base-bd5ddf01e4d629982fa8bb667d4be7c5ec3aa79f.zip frameworks_base-bd5ddf01e4d629982fa8bb667d4be7c5ec3aa79f.tar.gz frameworks_base-bd5ddf01e4d629982fa8bb667d4be7c5ec3aa79f.tar.bz2 |
Wifi: Add support for enabling Wifi while in airplane mode.
If the new system settings value for AIRPLANE_MODE_TOGGLEABLE_RADIOS
contains RADIO_WIFI, then the user will be allowed to enable Wifi
while in airplane mode.
Turning on airplane mode will still disable Wifi, but the user will
be free to reenable it in the Settings app.
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 1 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 20 |
2 files changed, 20 insertions, 1 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index c33bdd7..6b20445 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -22,6 +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> <bool name="def_auto_time">true</bool> <bool name="def_accelerometer_rotation">true</bool> <!-- Default screen brightness, from 0 to 255. 102 is 40%. --> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index f00fd39..835c683 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -64,7 +64,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { private static final String TAG = "SettingsProvider"; private static final String DATABASE_NAME = "settings.db"; - private static final int DATABASE_VERSION = 37; + private static final int DATABASE_VERSION = 38; private Context mContext; @@ -435,6 +435,21 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 36; } + if (upgradeVersion == 37) { + db.beginTransaction(); + try { + SQLiteStatement 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); + stmt.close(); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + } + upgradeVersion = 38; + } + if (upgradeVersion != currentVersion) { Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion + ", must wipe the settings provider"); @@ -662,6 +677,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadStringSetting(stmt, Settings.System.AIRPLANE_MODE_RADIOS, R.string.def_airplane_mode_radios); + loadStringSetting(stmt, Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS, + R.string.airplane_mode_toggleable_radios); + loadBooleanSetting(stmt, Settings.System.AUTO_TIME, R.bool.def_auto_time); // Sync time to NITZ |