Merge "Remove "ask each time" SIP call setting. (1/2)" into lmp-dev

This commit is contained in:
Tyler Gunn
2014-09-02 17:31:38 +00:00
committed by Android (Google) Code Review
2 changed files with 27 additions and 3 deletions

View File

@@ -2566,7 +2566,6 @@ public final class Settings {
* Call Preference String.
* "SIP_ALWAYS" : Always use SIP with network access
* "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
* "SIP_ASK_ME_EACH_TIME" : Always ask me each time
* @hide
*/
public static final String SIP_CALL_OPTIONS = "sip_call_options";
@@ -2584,9 +2583,13 @@ public final class Settings {
public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
/**
* One of the sip call options: Always ask me each time.
* @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
* the user should be prompted each time a call is made whether it should be placed using
* SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
* SIP_ADDRESS_ONLY.
* @hide
*/
@Deprecated
public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
/**

View File

@@ -70,7 +70,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 = 109;
private static final int DATABASE_VERSION = 110;
private Context mContext;
private int mUserHandle;
@@ -1749,6 +1749,27 @@ public class DatabaseHelper extends SQLiteOpenHelper {
upgradeVersion = 109;
}
if (upgradeVersion < 110) {
// The SIP_CALL_OPTIONS value SIP_ASK_EACH_TIME is being deprecated.
// If the SIP_CALL_OPTIONS setting is set to SIP_ASK_EACH_TIME, default to
// SIP_ADDRESS_ONLY.
db.beginTransaction();
SQLiteStatement stmt = null;
try {
stmt = db.compileStatement("UPDATE system SET value = ? " +
"WHERE name = ? AND value = ?;");
stmt.bindString(1, Settings.System.SIP_ADDRESS_ONLY);
stmt.bindString(2, Settings.System.SIP_CALL_OPTIONS);
stmt.bindString(3, Settings.System.SIP_ASK_ME_EACH_TIME);
stmt.execute();
db.setTransactionSuccessful();
} finally {
db.endTransaction();
if (stmt != null) stmt.close();
}
upgradeVersion = 110;
}
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {