+
+ // Upgrade from schema version 8.
+ case 8:
+ // Add the new proxy columns to the preferences table.
+ importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + PROXY + " TEXT");
+ importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + PROXY_CUSTOM_HOST + " TEXT");
+ importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + PROXY_CUSTOM_PORT + " TEXT");
+
+ // Get the current proxy values.
+ String proxy = sharedPreferences.getString(PROXY, context.getString(R.string.proxy_default_value));
+ String proxyCustomHost = sharedPreferences.getString(PROXY_CUSTOM_HOST, context.getString(R.string.proxy_custom_host_default_value));
+ String proxyCustomPort = sharedPreferences.getString(PROXY_CUSTOM_PORT, context.getString(R.string.proxy_custom_port_default_value));
+
+ // Populate the table with the current proxy values.
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + PROXY + " = '" + proxy + "'");
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + PROXY_CUSTOM_HOST + " = '" + proxyCustomHost + "'");
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + PROXY_CUSTOM_PORT + " = '" + proxyCustomPort +"'");