diff options
author | Nick Pelly <npelly@google.com> | 2011-08-09 07:03:49 -0700 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2011-08-09 16:31:46 -0700 |
commit | 8d32a01bd24b8a0d1a98f0581b3394a78fab8242 (patch) | |
tree | f1684fadc90c4701943f98d57f6997ed4fefd7e2 /packages/SettingsProvider | |
parent | a4418e0fd94f27c0b40abe17d42af0880cb3effb (diff) | |
download | frameworks_base-8d32a01bd24b8a0d1a98f0581b3394a78fab8242.zip frameworks_base-8d32a01bd24b8a0d1a98f0581b3394a78fab8242.tar.gz frameworks_base-8d32a01bd24b8a0d1a98f0581b3394a78fab8242.tar.bz2 |
Add NFC to airplane mode
NFC now observes airplanes mode, and is by default toggleable in airplane mode.
Change-Id: I5f19d35422c9eb1cffb0b5e0631b3f3c5eeaedcf
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 4 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 21 |
2 files changed, 22 insertions, 3 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 12dbdf9..3920257 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -21,8 +21,8 @@ <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">bluetooth,wifi</string> + <string name="def_airplane_mode_radios" translatable="false">cell,bluetooth,wifi,nfc</string> + <string name="airplane_mode_toggleable_radios" translatable="false">bluetooth,wifi,nfc</string> <bool name="def_auto_time">true</bool> <bool name="def_auto_time_zone">true</bool> <bool name="def_accelerometer_rotation">true</bool> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index f4890e0..5495d08 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -63,7 +63,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 = 69; + private static final int DATABASE_VERSION = 70; private Context mContext; @@ -917,6 +917,25 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 69; } + if (upgradeVersion == 69) { + // Add RADIO_NFC to AIRPLANE_MODE_RADIO and AIRPLANE_MODE_TOGGLEABLE_RADIOS + String airplaneRadios = mContext.getResources().getString( + R.string.def_airplane_mode_radios); + String toggleableRadios = mContext.getResources().getString( + R.string.airplane_mode_toggleable_radios); + db.beginTransaction(); + try { + db.execSQL("UPDATE system SET value='" + airplaneRadios + "' " + + "WHERE name='" + Settings.System.AIRPLANE_MODE_RADIOS + "'"); + db.execSQL("UPDATE system SET value='" + toggleableRadios + "' " + + "WHERE name='" + Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS + "'"); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + } + upgradeVersion = 70; + } + // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { |