am 9a147340: Merge "Don\'t update global table when upgrading secondary users\' database." into jb-mr1.1-dev
* commit '9a1473406f634ea541bd1643dc70d9aae8c10e77':
Don't update global table when upgrading secondary users' database.
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index ba19307..2454fb0 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -1507,17 +1507,19 @@
if (upgradeVersion == 94) {
// Add wireless charging started sound setting
- db.beginTransaction();
- SQLiteStatement stmt = null;
- try {
- stmt = db.compileStatement("INSERT OR REPLACE INTO global(name,value)"
- + " VALUES(?,?);");
- loadStringSetting(stmt, Settings.Global.WIRELESS_CHARGING_STARTED_SOUND,
- R.string.def_wireless_charging_started_sound);
- db.setTransactionSuccessful();
- } finally {
- db.endTransaction();
- if (stmt != null) stmt.close();
+ if (mUserHandle == UserHandle.USER_OWNER) {
+ db.beginTransaction();
+ SQLiteStatement stmt = null;
+ try {
+ stmt = db.compileStatement("INSERT OR REPLACE INTO global(name,value)"
+ + " VALUES(?,?);");
+ loadStringSetting(stmt, Settings.Global.WIRELESS_CHARGING_STARTED_SOUND,
+ R.string.def_wireless_charging_started_sound);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ if (stmt != null) stmt.close();
+ }
}
upgradeVersion = 95;
}