am 0de065e6: Merge change 22661 into eclair
Merge commit '0de065e68cc2141513c5b45643123ecb2947858c' into eclair-plus-aosp * commit '0de065e68cc2141513c5b45643123ecb2947858c': SettingsProvider: Fix botched merge from donut to eclair.
This commit is contained in:
@@ -64,7 +64,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
private static final String TAG = "SettingsProvider";
|
private static final String TAG = "SettingsProvider";
|
||||||
private static final String DATABASE_NAME = "settings.db";
|
private static final String DATABASE_NAME = "settings.db";
|
||||||
private static final int DATABASE_VERSION = 38;
|
private static final int DATABASE_VERSION = 39;
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
@@ -387,21 +387,6 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (upgradeVersion == 34) {
|
if (upgradeVersion == 34) {
|
||||||
db.beginTransaction();
|
|
||||||
try {
|
|
||||||
String value =
|
|
||||||
mContext.getResources().getBoolean(R.bool.assisted_gps_enabled) ? "1" : "0";
|
|
||||||
db.execSQL("INSERT OR IGNORE INTO secure(name,value) values('" +
|
|
||||||
Settings.Secure.ASSISTED_GPS_ENABLED + "','" + value + "');");
|
|
||||||
db.setTransactionSuccessful();
|
|
||||||
} finally {
|
|
||||||
db.endTransaction();
|
|
||||||
}
|
|
||||||
|
|
||||||
upgradeVersion = 35;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (upgradeVersion == 35) {
|
|
||||||
db.beginTransaction();
|
db.beginTransaction();
|
||||||
try {
|
try {
|
||||||
SQLiteStatement stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)"
|
SQLiteStatement stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)"
|
||||||
@@ -412,8 +397,15 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
} finally {
|
} finally {
|
||||||
db.endTransaction();
|
db.endTransaction();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// due to a botched merge from donut to eclair, the initialization of ASSISTED_GPS_ENABLED
|
||||||
|
// was accidentally done out of order here.
|
||||||
|
// to fix this, ASSISTED_GPS_ENABLED is now initialized while upgrading from 38 to 39,
|
||||||
|
// and we intentionally do nothing from 35 to 36 now.
|
||||||
|
if (upgradeVersion == 35) {
|
||||||
upgradeVersion = 36;
|
upgradeVersion = 36;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (upgradeVersion == 36) {
|
if (upgradeVersion == 36) {
|
||||||
// This upgrade adds the STREAM_SYSTEM_ENFORCED type to the list of
|
// This upgrade adds the STREAM_SYSTEM_ENFORCED type to the list of
|
||||||
// types affected by ringer modes (silent, vibrate, etc.)
|
// types affected by ringer modes (silent, vibrate, etc.)
|
||||||
@@ -450,6 +442,21 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
upgradeVersion = 38;
|
upgradeVersion = 38;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (upgradeVersion == 38) {
|
||||||
|
db.beginTransaction();
|
||||||
|
try {
|
||||||
|
String value =
|
||||||
|
mContext.getResources().getBoolean(R.bool.assisted_gps_enabled) ? "1" : "0";
|
||||||
|
db.execSQL("INSERT OR IGNORE INTO secure(name,value) values('" +
|
||||||
|
Settings.Secure.ASSISTED_GPS_ENABLED + "','" + value + "');");
|
||||||
|
db.setTransactionSuccessful();
|
||||||
|
} finally {
|
||||||
|
db.endTransaction();
|
||||||
|
}
|
||||||
|
|
||||||
|
upgradeVersion = 39;
|
||||||
|
}
|
||||||
|
|
||||||
if (upgradeVersion != currentVersion) {
|
if (upgradeVersion != currentVersion) {
|
||||||
Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion
|
Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion
|
||||||
+ ", must wipe the settings provider");
|
+ ", must wipe the settings provider");
|
||||||
|
|||||||
Reference in New Issue
Block a user