Support for custom call ringtone selection and per-chat ringtones

This commit is contained in:
Moxie Marlinspike
2018-02-16 11:10:35 -08:00
parent 35a6ec707f
commit 71c7ef5b5e
15 changed files with 408 additions and 125 deletions

View File

@@ -26,9 +26,12 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences;
public class SQLCipherOpenHelper extends SQLiteOpenHelper {
@SuppressWarnings("unused")
private static final String TAG = SQLCipherOpenHelper.class.getSimpleName();
private static final int DATABASE_VERSION = 1;
private static final int RECIPIENT_CALL_RINGTONE_VERSION = 2;
private static final int DATABASE_VERSION = 2;
private static final String DATABASE_NAME = "signal.db";
private final Context context;
@@ -89,7 +92,12 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Log.w(TAG, "Upgrading database: " + oldVersion + ", " + newVersion);
if (oldVersion < RECIPIENT_CALL_RINGTONE_VERSION) {
db.execSQL("ALTER TABLE recipient_preferences ADD COLUMN call_ringtone TEXT DEFAULT NULL");
db.execSQL("ALTER TABLE recipient_preferences ADD COLUMN call_vibrate INTEGER DEFAULT " + RecipientDatabase.VibrateState.DEFAULT.getId());
}
}
public SQLiteDatabase getReadableDatabase() {