Loading packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +20 −4 Original line number Original line Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion' // 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 // is properly propagated through your change. Not doing so will result in a loss of user // settings. // settings. private static final int DATABASE_VERSION = 91; private static final int DATABASE_VERSION = 92; private Context mContext; private Context mContext; private int mUserHandle; private int mUserHandle; Loading Loading @@ -1433,6 +1433,22 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 91; upgradeVersion = 91; } } if (upgradeVersion == 91) { if (mUserHandle == UserHandle.USER_OWNER) { db.beginTransaction(); try { // Move ringer mode from system to global settings String[] settingsToMove = { Settings.System.MODE_RINGER }; moveSettingsToNewTable(db, TABLE_SYSTEM, TABLE_GLOBAL, settingsToMove, true); db.setTransactionSuccessful(); } finally { db.endTransaction(); } } upgradeVersion = 92; } // *** Remember to update DATABASE_VERSION above! // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { if (upgradeVersion != currentVersion) { Loading Loading @@ -1757,9 +1773,6 @@ public class DatabaseHelper extends SQLiteOpenHelper { Settings.System.VOLUME_BLUETOOTH_SCO, Settings.System.VOLUME_BLUETOOTH_SCO, AudioManager.DEFAULT_STREAM_VOLUME[AudioManager.STREAM_BLUETOOTH_SCO]); AudioManager.DEFAULT_STREAM_VOLUME[AudioManager.STREAM_BLUETOOTH_SCO]); loadSetting(stmt, Settings.System.MODE_RINGER, AudioManager.RINGER_MODE_NORMAL); // By default: // By default: // - ringtones, notification, system and music streams are affected by ringer mode // - ringtones, notification, system and music streams are affected by ringer mode // on non voice capable devices (tablets) // on non voice capable devices (tablets) Loading Loading @@ -2049,6 +2062,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadIntegerSetting(stmt, Settings.Global.WIFI_SLEEP_POLICY, loadIntegerSetting(stmt, Settings.Global.WIFI_SLEEP_POLICY, R.integer.def_wifi_sleep_policy); R.integer.def_wifi_sleep_policy); loadSetting(stmt, Settings.Global.MODE_RINGER, AudioManager.RINGER_MODE_NORMAL); // --- Previously in 'secure' // --- Previously in 'secure' loadBooleanSetting(stmt, Settings.Global.PACKAGE_VERIFIER_ENABLE, loadBooleanSetting(stmt, Settings.Global.PACKAGE_VERIFIER_ENABLE, R.bool.def_package_verifier_enable); R.bool.def_package_verifier_enable); Loading Loading
packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +20 −4 Original line number Original line Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion' // 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 // is properly propagated through your change. Not doing so will result in a loss of user // settings. // settings. private static final int DATABASE_VERSION = 91; private static final int DATABASE_VERSION = 92; private Context mContext; private Context mContext; private int mUserHandle; private int mUserHandle; Loading Loading @@ -1433,6 +1433,22 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 91; upgradeVersion = 91; } } if (upgradeVersion == 91) { if (mUserHandle == UserHandle.USER_OWNER) { db.beginTransaction(); try { // Move ringer mode from system to global settings String[] settingsToMove = { Settings.System.MODE_RINGER }; moveSettingsToNewTable(db, TABLE_SYSTEM, TABLE_GLOBAL, settingsToMove, true); db.setTransactionSuccessful(); } finally { db.endTransaction(); } } upgradeVersion = 92; } // *** Remember to update DATABASE_VERSION above! // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { if (upgradeVersion != currentVersion) { Loading Loading @@ -1757,9 +1773,6 @@ public class DatabaseHelper extends SQLiteOpenHelper { Settings.System.VOLUME_BLUETOOTH_SCO, Settings.System.VOLUME_BLUETOOTH_SCO, AudioManager.DEFAULT_STREAM_VOLUME[AudioManager.STREAM_BLUETOOTH_SCO]); AudioManager.DEFAULT_STREAM_VOLUME[AudioManager.STREAM_BLUETOOTH_SCO]); loadSetting(stmt, Settings.System.MODE_RINGER, AudioManager.RINGER_MODE_NORMAL); // By default: // By default: // - ringtones, notification, system and music streams are affected by ringer mode // - ringtones, notification, system and music streams are affected by ringer mode // on non voice capable devices (tablets) // on non voice capable devices (tablets) Loading Loading @@ -2049,6 +2062,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadIntegerSetting(stmt, Settings.Global.WIFI_SLEEP_POLICY, loadIntegerSetting(stmt, Settings.Global.WIFI_SLEEP_POLICY, R.integer.def_wifi_sleep_policy); R.integer.def_wifi_sleep_policy); loadSetting(stmt, Settings.Global.MODE_RINGER, AudioManager.RINGER_MODE_NORMAL); // --- Previously in 'secure' // --- Previously in 'secure' loadBooleanSetting(stmt, Settings.Global.PACKAGE_VERIFIER_ENABLE, loadBooleanSetting(stmt, Settings.Global.PACKAGE_VERIFIER_ENABLE, R.bool.def_package_verifier_enable); R.bool.def_package_verifier_enable); Loading