diff options
author | Bryce Lee <brycelee@google.com> | 2014-10-22 16:56:08 -0700 |
---|---|---|
committer | Bryce Lee <brycelee@google.com> | 2014-10-22 16:56:08 -0700 |
commit | fb1cf36aa739da5dbebc64e61900e9ff96134e26 (patch) | |
tree | 8679163a6017516b9b9ae2e12eeebbc1a59ab208 /packages/SettingsProvider | |
parent | 1eb6a2f075bfc0b65f0accf0f03661d7a5152593 (diff) | |
parent | f03ba4f13ba835c670d7c471f91a3083846ab082 (diff) | |
download | frameworks_base-fb1cf36aa739da5dbebc64e61900e9ff96134e26.zip frameworks_base-fb1cf36aa739da5dbebc64e61900e9ff96134e26.tar.gz frameworks_base-fb1cf36aa739da5dbebc64e61900e9ff96134e26.tar.bz2 |
resolved conflicts for merge of f03ba4f1 to lmp-mr1-dev
Change-Id: I9e4cabd2d8a34a348ae888f096c8d3c35226e960
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 | 30 |
2 files changed, 28 insertions, 3 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index efba03d..16c6075 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -21,6 +21,7 @@ <integer name="def_screen_off_timeout">60000</integer> <integer name="def_sleep_timeout">-1</integer> <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> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index f88ea8b..f21bac0 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -71,7 +71,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 = 114; + private static final int DATABASE_VERSION = 116; private Context mContext; private int mUserHandle; @@ -1828,7 +1828,27 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 113; } - if (upgradeVersion < 114) { + // We skipped 114 to handle a merge conflict with the introduction of theater mode. + + if (upgradeVersion < 115) { + if (mUserHandle == UserHandle.USER_OWNER) { + db.beginTransaction(); + SQLiteStatement stmt = null; + try { + stmt = db.compileStatement("INSERT OR IGNORE INTO global(name,value)" + + " VALUES(?,?);"); + loadBooleanSetting(stmt, Global.THEATER_MODE_ON, + R.bool.def_theater_mode_on); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + if (stmt != null) stmt.close(); + } + } + upgradeVersion = 115; + } + + if (upgradeVersion < 116) { if (mUserHandle == UserHandle.USER_OWNER) { db.beginTransaction(); SQLiteStatement stmt = null; @@ -1842,8 +1862,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { if (stmt != null) stmt.close(); } } - upgradeVersion = 114; + upgradeVersion = 116; } + // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { @@ -2440,6 +2461,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadBooleanSetting(stmt, Settings.Global.AIRPLANE_MODE_ON, R.bool.def_airplane_mode_on); + loadBooleanSetting(stmt, Settings.Global.THEATER_MODE_ON, + R.bool.def_theater_mode_on); + loadStringSetting(stmt, Settings.Global.AIRPLANE_MODE_RADIOS, R.string.def_airplane_mode_radios); |