diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index 7ee47f864a..9f47eda02d 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -108,8 +108,8 @@ import org.thoughtcrime.securesms.database.IdentityDatabase.IdentityRecord; import org.thoughtcrime.securesms.database.IdentityDatabase.VerifiedStatus; import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo; import org.thoughtcrime.securesms.database.MmsSmsColumns.Types; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientPreferenceEvent; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientPreferenceEvent; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.database.SmsDatabase; import org.thoughtcrime.securesms.database.ThreadDatabase; import org.thoughtcrime.securesms.database.identity.IdentityRecordList; diff --git a/src/org/thoughtcrime/securesms/GroupCreateActivity.java b/src/org/thoughtcrime/securesms/GroupCreateActivity.java index bcb943a466..e1bc7ee9c1 100644 --- a/src/org/thoughtcrime/securesms/GroupCreateActivity.java +++ b/src/org/thoughtcrime/securesms/GroupCreateActivity.java @@ -54,7 +54,7 @@ import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.GroupDatabase; import org.thoughtcrime.securesms.database.GroupDatabase.GroupRecord; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.database.ThreadDatabase; import org.thoughtcrime.securesms.groups.GroupManager; import org.thoughtcrime.securesms.groups.GroupManager.GroupActionResult; diff --git a/src/org/thoughtcrime/securesms/InviteActivity.java b/src/org/thoughtcrime/securesms/InviteActivity.java index c1d2108f19..4e32243608 100644 --- a/src/org/thoughtcrime/securesms/InviteActivity.java +++ b/src/org/thoughtcrime/securesms/InviteActivity.java @@ -29,7 +29,7 @@ import org.thoughtcrime.securesms.components.ContactFilterToolbar.OnFilterChange import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.DatabaseFactory; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.sms.MessageSender; import org.thoughtcrime.securesms.sms.OutgoingTextMessage; diff --git a/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java b/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java index 90abdf48ac..8a6cda1a4d 100644 --- a/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java +++ b/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java @@ -36,7 +36,7 @@ import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.GroupDatabase; import org.thoughtcrime.securesms.database.IdentityDatabase; import org.thoughtcrime.securesms.database.IdentityDatabase.IdentityRecord; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.VibrateState; +import org.thoughtcrime.securesms.database.RecipientDatabase.VibrateState; import org.thoughtcrime.securesms.jobs.MultiDeviceBlockedUpdateJob; import org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob; import org.thoughtcrime.securesms.preferences.AdvancedRingtonePreference; diff --git a/src/org/thoughtcrime/securesms/database/DatabaseFactory.java b/src/org/thoughtcrime/securesms/database/DatabaseFactory.java index c907350b3e..4d7369c44a 100644 --- a/src/org/thoughtcrime/securesms/database/DatabaseFactory.java +++ b/src/org/thoughtcrime/securesms/database/DatabaseFactory.java @@ -126,7 +126,7 @@ public class DatabaseFactory { private final DraftDatabase draftDatabase; private final PushDatabase pushDatabase; private final GroupDatabase groupDatabase; - private final RecipientPreferenceDatabase recipientPreferenceDatabase; + private final RecipientDatabase recipientDatabase; private final ContactsDatabase contactsDatabase; public static DatabaseFactory getInstance(Context context) { @@ -182,8 +182,8 @@ public class DatabaseFactory { return getInstance(context).groupDatabase; } - public static RecipientPreferenceDatabase getRecipientPreferenceDatabase(Context context) { - return getInstance(context).recipientPreferenceDatabase; + public static RecipientDatabase getRecipientPreferenceDatabase(Context context) { + return getInstance(context).recipientDatabase; } public static ContactsDatabase getContactsDatabase(Context context) { @@ -203,7 +203,7 @@ public class DatabaseFactory { this.draftDatabase = new DraftDatabase(context, databaseHelper); this.pushDatabase = new PushDatabase(context, databaseHelper); this.groupDatabase = new GroupDatabase(context, databaseHelper); - this.recipientPreferenceDatabase = new RecipientPreferenceDatabase(context, databaseHelper); + this.recipientDatabase = new RecipientDatabase(context, databaseHelper); this.contactsDatabase = new ContactsDatabase(context); } @@ -221,7 +221,7 @@ public class DatabaseFactory { this.draftDatabase.reset(databaseHelper); this.pushDatabase.reset(databaseHelper); this.groupDatabase.reset(databaseHelper); - this.recipientPreferenceDatabase.reset(databaseHelper); + this.recipientDatabase.reset(databaseHelper); old.close(); } @@ -534,7 +534,7 @@ public class DatabaseFactory { db.execSQL(DraftDatabase.CREATE_TABLE); db.execSQL(PushDatabase.CREATE_TABLE); db.execSQL(GroupDatabase.CREATE_TABLE); - db.execSQL(RecipientPreferenceDatabase.CREATE_TABLE); + db.execSQL(RecipientDatabase.CREATE_TABLE); executeStatements(db, SmsDatabase.CREATE_INDEXS); executeStatements(db, MmsDatabase.CREATE_INDEXS); diff --git a/src/org/thoughtcrime/securesms/database/RecipientPreferenceDatabase.java b/src/org/thoughtcrime/securesms/database/RecipientDatabase.java similarity index 98% rename from src/org/thoughtcrime/securesms/database/RecipientPreferenceDatabase.java rename to src/org/thoughtcrime/securesms/database/RecipientDatabase.java index c678729785..5f571a8909 100644 --- a/src/org/thoughtcrime/securesms/database/RecipientPreferenceDatabase.java +++ b/src/org/thoughtcrime/securesms/database/RecipientDatabase.java @@ -24,9 +24,9 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; -public class RecipientPreferenceDatabase extends Database { +public class RecipientDatabase extends Database { - private static final String TAG = RecipientPreferenceDatabase.class.getSimpleName(); + private static final String TAG = RecipientDatabase.class.getSimpleName(); private static final String RECIPIENT_PREFERENCES_URI = "content://textsecure/recipients/"; static final String TABLE_NAME = "recipient_preferences"; @@ -93,7 +93,7 @@ public class RecipientPreferenceDatabase extends Database { SIGNAL_PROFILE_AVATAR + " TEXT DEFAULT NULL, " + PROFILE_SHARING + " INTEGER DEFAULT 0);"; - public RecipientPreferenceDatabase(Context context, SQLiteOpenHelper databaseHelper) { + public RecipientDatabase(Context context, SQLiteOpenHelper databaseHelper) { super(context, databaseHelper); } diff --git a/src/org/thoughtcrime/securesms/database/ThreadDatabase.java b/src/org/thoughtcrime/securesms/database/ThreadDatabase.java index 6084867f61..c9418ef668 100644 --- a/src/org/thoughtcrime/securesms/database/ThreadDatabase.java +++ b/src/org/thoughtcrime/securesms/database/ThreadDatabase.java @@ -33,7 +33,7 @@ import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.crypto.MasterCipher; import org.thoughtcrime.securesms.database.GroupDatabase.GroupRecord; import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.database.model.DisplayRecord; import org.thoughtcrime.securesms.database.model.MediaMmsMessageRecord; import org.thoughtcrime.securesms.database.model.MessageRecord; @@ -99,7 +99,7 @@ public class ThreadDatabase extends Database { .toList(); private static final List COMBINED_THREAD_RECIPIENT_GROUP_PROJECTION = Stream.concat(Stream.concat(Stream.of(TYPED_THREAD_PROJECTION), - Stream.of(RecipientPreferenceDatabase.TYPED_RECIPIENT_PROJECTION)), + Stream.of(RecipientDatabase.TYPED_RECIPIENT_PROJECTION)), Stream.of(GroupDatabase.TYPED_GROUP_PROJECTION)) .toList(); @@ -347,8 +347,8 @@ public class ThreadDatabase extends Database { String projection = Util.join(COMBINED_THREAD_RECIPIENT_GROUP_PROJECTION, ","); SQLiteDatabase db = databaseHelper.getReadableDatabase(); Cursor cursor = db.rawQuery("SELECT " + projection + " FROM " + TABLE_NAME + - " LEFT OUTER JOIN " + RecipientPreferenceDatabase.TABLE_NAME + - " ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientPreferenceDatabase.TABLE_NAME + "." + RecipientPreferenceDatabase.ADDRESS + + " LEFT OUTER JOIN " + RecipientDatabase.TABLE_NAME + + " ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.ADDRESS + " LEFT OUTER JOIN " + GroupDatabase.TABLE_NAME + " ON " + TABLE_NAME + "." + ADDRESS + " = " + GroupDatabase.TABLE_NAME + "." + GroupDatabase.GROUP_ID + " WHERE " + ARCHIVED + " = ? AND " + MESSAGE_COUNT + " != 0" + @@ -365,8 +365,8 @@ public class ThreadDatabase extends Database { String projection = Util.join(COMBINED_THREAD_RECIPIENT_GROUP_PROJECTION, ","); return db.rawQuery("SELECT " + projection + " FROM " + TABLE_NAME + - " LEFT OUTER JOIN " + RecipientPreferenceDatabase.TABLE_NAME + - " ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientPreferenceDatabase.TABLE_NAME + "." + ADDRESS + + " LEFT OUTER JOIN " + RecipientDatabase.TABLE_NAME + + " ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientDatabase.TABLE_NAME + "." + ADDRESS + " ORDER BY " + TABLE_NAME + "." + DATE + " DESC", null); } diff --git a/src/org/thoughtcrime/securesms/jobs/MultiDeviceBlockedUpdateJob.java b/src/org/thoughtcrime/securesms/jobs/MultiDeviceBlockedUpdateJob.java index 3f358eb6cf..4a4c135522 100644 --- a/src/org/thoughtcrime/securesms/jobs/MultiDeviceBlockedUpdateJob.java +++ b/src/org/thoughtcrime/securesms/jobs/MultiDeviceBlockedUpdateJob.java @@ -4,8 +4,8 @@ import android.content.Context; import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.database.DatabaseFactory; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.BlockedReader; +import org.thoughtcrime.securesms.database.RecipientDatabase; +import org.thoughtcrime.securesms.database.RecipientDatabase.BlockedReader; import org.thoughtcrime.securesms.dependencies.InjectableType; import org.thoughtcrime.securesms.dependencies.SignalCommunicationModule.SignalMessageSenderFactory; import org.thoughtcrime.securesms.jobs.requirements.MasterSecretRequirement; @@ -45,10 +45,10 @@ public class MultiDeviceBlockedUpdateJob extends MasterSecretJob implements Inje public void onRun(MasterSecret masterSecret) throws IOException, UntrustedIdentityException { - RecipientPreferenceDatabase database = DatabaseFactory.getRecipientPreferenceDatabase(context); - SignalServiceMessageSender messageSender = messageSenderFactory.create(); - BlockedReader reader = database.readerForBlocked(database.getBlocked()); - List blocked = new LinkedList<>(); + RecipientDatabase database = DatabaseFactory.getRecipientPreferenceDatabase(context); + SignalServiceMessageSender messageSender = messageSenderFactory.create(); + BlockedReader reader = database.readerForBlocked(database.getBlocked()); + List blocked = new LinkedList<>(); Recipient recipient; diff --git a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java index a2017b0413..35f3ac69b6 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java @@ -25,8 +25,8 @@ import org.thoughtcrime.securesms.database.MessagingDatabase.SyncMessageId; import org.thoughtcrime.securesms.database.MmsDatabase; import org.thoughtcrime.securesms.database.NoSuchMessageException; import org.thoughtcrime.securesms.database.PushDatabase; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.database.SmsDatabase; import org.thoughtcrime.securesms.database.ThreadDatabase; import org.thoughtcrime.securesms.groups.GroupMessageProcessor; @@ -803,7 +803,7 @@ public class PushDecryptJob extends ContextJob { private void handleProfileKey(@NonNull SignalServiceEnvelope envelope, @NonNull SignalServiceDataMessage message) { - RecipientPreferenceDatabase database = DatabaseFactory.getRecipientPreferenceDatabase(context); + RecipientDatabase database = DatabaseFactory.getRecipientPreferenceDatabase(context); Address sourceAddress = Address.fromExternal(context, envelope.getSource()); Optional preferences = database.getRecipientsPreferences(sourceAddress); diff --git a/src/org/thoughtcrime/securesms/jobs/PushReceivedJob.java b/src/org/thoughtcrime/securesms/jobs/PushReceivedJob.java index 0cca40c451..669989c9e9 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushReceivedJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushReceivedJob.java @@ -7,7 +7,7 @@ import org.thoughtcrime.securesms.ApplicationContext; import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.MessagingDatabase.SyncMessageId; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.service.KeyCachingService; import org.thoughtcrime.securesms.util.Util; diff --git a/src/org/thoughtcrime/securesms/jobs/PushSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushSendJob.java index 12b87af299..813bd5b981 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushSendJob.java @@ -11,8 +11,7 @@ import org.thoughtcrime.securesms.attachments.Attachment; import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.DatabaseFactory; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.events.PartProgressEvent; import org.thoughtcrime.securesms.jobs.requirements.MasterSecretRequirement; import org.thoughtcrime.securesms.mms.PartAuthority; diff --git a/src/org/thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java b/src/org/thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java index 37f5283248..c8be5b87e8 100644 --- a/src/org/thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java +++ b/src/org/thoughtcrime/securesms/jobs/RetrieveProfileAvatarJob.java @@ -6,8 +6,8 @@ import android.text.TextUtils; import android.util.Log; import org.thoughtcrime.securesms.database.DatabaseFactory; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.dependencies.InjectableType; import org.thoughtcrime.securesms.profiles.AvatarHelper; import org.thoughtcrime.securesms.recipients.Recipient; @@ -51,7 +51,7 @@ public class RetrieveProfileAvatarJob extends ContextJob implements InjectableTy @Override public void onRun() throws IOException { - RecipientPreferenceDatabase database = DatabaseFactory.getRecipientPreferenceDatabase(context); + RecipientDatabase database = DatabaseFactory.getRecipientPreferenceDatabase(context); Optional recipientsPreferences = database.getRecipientsPreferences(recipient.getAddress()); if (!recipientsPreferences.isPresent()) { diff --git a/src/org/thoughtcrime/securesms/jobs/RetrieveProfileJob.java b/src/org/thoughtcrime/securesms/jobs/RetrieveProfileJob.java index 2c1b71c561..80227e3c11 100644 --- a/src/org/thoughtcrime/securesms/jobs/RetrieveProfileJob.java +++ b/src/org/thoughtcrime/securesms/jobs/RetrieveProfileJob.java @@ -8,7 +8,7 @@ import android.util.Log; import org.thoughtcrime.securesms.ApplicationContext; import org.thoughtcrime.securesms.database.DatabaseFactory; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.dependencies.InjectableType; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.service.MessageRetrievalService; diff --git a/src/org/thoughtcrime/securesms/notifications/AbstractNotificationBuilder.java b/src/org/thoughtcrime/securesms/notifications/AbstractNotificationBuilder.java index d37efc507c..e3621da760 100644 --- a/src/org/thoughtcrime/securesms/notifications/AbstractNotificationBuilder.java +++ b/src/org/thoughtcrime/securesms/notifications/AbstractNotificationBuilder.java @@ -11,7 +11,7 @@ import android.text.SpannableStringBuilder; import android.text.TextUtils; import org.thoughtcrime.securesms.R; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase; +import org.thoughtcrime.securesms.database.RecipientDatabase; import org.thoughtcrime.securesms.preferences.NotificationPrivacyPreference; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.util.TextSecurePreferences; @@ -40,15 +40,15 @@ public abstract class AbstractNotificationBuilder extends NotificationCompat.Bui return builder; } - public void setAlarms(@Nullable Uri ringtone, RecipientPreferenceDatabase.VibrateState vibrate) { + public void setAlarms(@Nullable Uri ringtone, RecipientDatabase.VibrateState vibrate) { String defaultRingtoneName = TextSecurePreferences.getNotificationRingtone(context); boolean defaultVibrate = TextSecurePreferences.isNotificationVibrateEnabled(context); if (ringtone == null && !TextUtils.isEmpty(defaultRingtoneName)) setSound(Uri.parse(defaultRingtoneName)); else if (ringtone != null && !ringtone.toString().isEmpty()) setSound(ringtone); - if (vibrate == RecipientPreferenceDatabase.VibrateState.ENABLED || - (vibrate == RecipientPreferenceDatabase.VibrateState.DEFAULT && defaultVibrate)) + if (vibrate == RecipientDatabase.VibrateState.ENABLED || + (vibrate == RecipientDatabase.VibrateState.DEFAULT && defaultVibrate)) { setDefaults(Notification.DEFAULT_VIBRATE); } diff --git a/src/org/thoughtcrime/securesms/notifications/AndroidAutoReplyReceiver.java b/src/org/thoughtcrime/securesms/notifications/AndroidAutoReplyReceiver.java index 9450564e31..020bcd0b56 100644 --- a/src/org/thoughtcrime/securesms/notifications/AndroidAutoReplyReceiver.java +++ b/src/org/thoughtcrime/securesms/notifications/AndroidAutoReplyReceiver.java @@ -29,7 +29,7 @@ import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.mms.OutgoingMediaMessage; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.sms.MessageSender; diff --git a/src/org/thoughtcrime/securesms/notifications/FailedNotificationBuilder.java b/src/org/thoughtcrime/securesms/notifications/FailedNotificationBuilder.java index 7491316a3f..1003b9a0d7 100644 --- a/src/org/thoughtcrime/securesms/notifications/FailedNotificationBuilder.java +++ b/src/org/thoughtcrime/securesms/notifications/FailedNotificationBuilder.java @@ -6,7 +6,7 @@ import android.content.Intent; import android.graphics.BitmapFactory; import org.thoughtcrime.securesms.R; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase; +import org.thoughtcrime.securesms.database.RecipientDatabase; import org.thoughtcrime.securesms.preferences.NotificationPrivacyPreference; public class FailedNotificationBuilder extends AbstractNotificationBuilder { @@ -22,7 +22,7 @@ public class FailedNotificationBuilder extends AbstractNotificationBuilder { setTicker(context.getString(R.string.MessageNotifier_error_delivering_message)); setContentIntent(PendingIntent.getActivity(context, 0, intent, 0)); setAutoCancel(true); - setAlarms(null, RecipientPreferenceDatabase.VibrateState.DEFAULT); + setAlarms(null, RecipientDatabase.VibrateState.DEFAULT); } diff --git a/src/org/thoughtcrime/securesms/notifications/NotificationState.java b/src/org/thoughtcrime/securesms/notifications/NotificationState.java index 28ba3e3ccc..89c58a5d86 100644 --- a/src/org/thoughtcrime/securesms/notifications/NotificationState.java +++ b/src/org/thoughtcrime/securesms/notifications/NotificationState.java @@ -10,7 +10,7 @@ import android.util.Log; import org.thoughtcrime.securesms.ConversationActivity; import org.thoughtcrime.securesms.ConversationPopupActivity; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.VibrateState; +import org.thoughtcrime.securesms.database.RecipientDatabase.VibrateState; import org.thoughtcrime.securesms.recipients.Recipient; import java.util.LinkedHashSet; diff --git a/src/org/thoughtcrime/securesms/notifications/PendingMessageNotificationBuilder.java b/src/org/thoughtcrime/securesms/notifications/PendingMessageNotificationBuilder.java index 3874beb9b9..bf0863e0ce 100644 --- a/src/org/thoughtcrime/securesms/notifications/PendingMessageNotificationBuilder.java +++ b/src/org/thoughtcrime/securesms/notifications/PendingMessageNotificationBuilder.java @@ -8,7 +8,7 @@ import android.support.v4.app.NotificationCompat; import org.thoughtcrime.securesms.ConversationListActivity; import org.thoughtcrime.securesms.R; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase; +import org.thoughtcrime.securesms.database.RecipientDatabase; import org.thoughtcrime.securesms.preferences.NotificationPrivacyPreference; import org.thoughtcrime.securesms.util.TextSecurePreferences; @@ -30,6 +30,6 @@ public class PendingMessageNotificationBuilder extends AbstractNotificationBuild setContentIntent(PendingIntent.getActivity(context, 0, intent, 0)); setAutoCancel(true); - setAlarms(null, RecipientPreferenceDatabase.VibrateState.DEFAULT); + setAlarms(null, RecipientDatabase.VibrateState.DEFAULT); } } diff --git a/src/org/thoughtcrime/securesms/notifications/RemoteReplyReceiver.java b/src/org/thoughtcrime/securesms/notifications/RemoteReplyReceiver.java index 0d5656ae67..696b1280b8 100644 --- a/src/org/thoughtcrime/securesms/notifications/RemoteReplyReceiver.java +++ b/src/org/thoughtcrime/securesms/notifications/RemoteReplyReceiver.java @@ -29,7 +29,7 @@ import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.mms.OutgoingMediaMessage; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.sms.MessageSender; diff --git a/src/org/thoughtcrime/securesms/recipients/Recipient.java b/src/org/thoughtcrime/securesms/recipients/Recipient.java index 5c48e72a7a..6624f4cfa3 100644 --- a/src/org/thoughtcrime/securesms/recipients/Recipient.java +++ b/src/org/thoughtcrime/securesms/recipients/Recipient.java @@ -21,7 +21,6 @@ import android.content.Intent; import android.net.Uri; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.text.TextUtils; import android.util.Log; import org.thoughtcrime.securesms.color.MaterialColor; @@ -30,8 +29,8 @@ import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto; import org.thoughtcrime.securesms.contacts.avatars.ContactPhotoFactory; import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.GroupDatabase; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.VibrateState; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.VibrateState; import org.thoughtcrime.securesms.recipients.RecipientProvider.RecipientDetails; import org.thoughtcrime.securesms.util.FutureTaskListener; import org.thoughtcrime.securesms.util.ListenableFutureTask; diff --git a/src/org/thoughtcrime/securesms/recipients/RecipientProvider.java b/src/org/thoughtcrime/securesms/recipients/RecipientProvider.java index ea4196207b..709b660687 100644 --- a/src/org/thoughtcrime/securesms/recipients/RecipientProvider.java +++ b/src/org/thoughtcrime/securesms/recipients/RecipientProvider.java @@ -33,8 +33,8 @@ import org.thoughtcrime.securesms.contacts.avatars.ContactPhotoFactory; import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.GroupDatabase.GroupRecord; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.VibrateState; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.VibrateState; import org.thoughtcrime.securesms.util.LRUCache; import org.thoughtcrime.securesms.util.ListenableFutureTask; import org.thoughtcrime.securesms.util.Util; diff --git a/src/org/thoughtcrime/securesms/service/QuickResponseService.java b/src/org/thoughtcrime/securesms/service/QuickResponseService.java index 8557b87c31..0f909d7eef 100644 --- a/src/org/thoughtcrime/securesms/service/QuickResponseService.java +++ b/src/org/thoughtcrime/securesms/service/QuickResponseService.java @@ -11,7 +11,7 @@ import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.DatabaseFactory; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.sms.MessageSender; import org.thoughtcrime.securesms.sms.OutgoingTextMessage; diff --git a/src/org/thoughtcrime/securesms/sms/MessageSender.java b/src/org/thoughtcrime/securesms/sms/MessageSender.java index 672b278425..a6b88ac6e5 100644 --- a/src/org/thoughtcrime/securesms/sms/MessageSender.java +++ b/src/org/thoughtcrime/securesms/sms/MessageSender.java @@ -27,8 +27,8 @@ import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.EncryptingSmsDatabase; import org.thoughtcrime.securesms.database.MmsDatabase; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.database.SmsDatabase; import org.thoughtcrime.securesms.database.ThreadDatabase; import org.thoughtcrime.securesms.database.model.MessageRecord; @@ -265,7 +265,7 @@ public class MessageSender { } private static boolean isPushDestination(Context context, Address destination) { - RecipientPreferenceDatabase recipientsDatabase = DatabaseFactory.getRecipientPreferenceDatabase(context); + RecipientDatabase recipientsDatabase = DatabaseFactory.getRecipientPreferenceDatabase(context); Optional recipientPreferences = recipientsDatabase.getRecipientsPreferences(destination); if (recipientPreferences.isPresent()) { diff --git a/src/org/thoughtcrime/securesms/util/DirectoryHelper.java b/src/org/thoughtcrime/securesms/util/DirectoryHelper.java index 22d022bdd2..4639c1d088 100644 --- a/src/org/thoughtcrime/securesms/util/DirectoryHelper.java +++ b/src/org/thoughtcrime/securesms/util/DirectoryHelper.java @@ -24,8 +24,8 @@ import org.thoughtcrime.securesms.crypto.SessionUtil; import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.MessagingDatabase.InsertResult; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase; -import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences; +import org.thoughtcrime.securesms.database.RecipientDatabase; +import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences; import org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob; import org.thoughtcrime.securesms.notifications.MessageNotifier; import org.thoughtcrime.securesms.push.AccountManagerFactory; @@ -75,8 +75,8 @@ public class DirectoryHelper { return new RefreshResult(new LinkedList<>(), false); } - RecipientPreferenceDatabase recipientPreferenceDatabase = DatabaseFactory.getRecipientPreferenceDatabase(context); - Set
eligibleContactNumbers = recipientPreferenceDatabase.getAllRecipients(); + RecipientDatabase recipientDatabase = DatabaseFactory.getRecipientPreferenceDatabase(context); + Set
eligibleContactNumbers = recipientDatabase.getAllRecipients(); eligibleContactNumbers.addAll(ContactAccessor.getInstance().getAllContactsWithNumbers(context)); Set serializedAddress = Stream.of(eligibleContactNumbers).map(Address::serialize).collect(Collectors.toSet()); @@ -92,7 +92,7 @@ public class DirectoryHelper { inactiveAddresses.remove(activeAddress); } - recipientPreferenceDatabase.setRegistered(activeAddresses, new LinkedList<>(inactiveAddresses)); + recipientDatabase.setRegistered(activeAddresses, new LinkedList<>(inactiveAddresses)); return updateContactsDatabase(context, activeAddresses, true); } @@ -104,7 +104,7 @@ public class DirectoryHelper { @NonNull Recipient recipient) throws IOException { - RecipientPreferenceDatabase recipientDatabase = DatabaseFactory.getRecipientPreferenceDatabase(context); + RecipientDatabase recipientDatabase = DatabaseFactory.getRecipientPreferenceDatabase(context); SignalServiceAccountManager accountManager = AccountManagerFactory.createManager(context); String number = recipient.getAddress().serialize(); Optional details = accountManager.getContact(number); @@ -146,7 +146,7 @@ public class DirectoryHelper { return Capability.SUPPORTED; } - final RecipientPreferenceDatabase recipientDatabase = DatabaseFactory.getRecipientPreferenceDatabase(context); + final RecipientDatabase recipientDatabase = DatabaseFactory.getRecipientPreferenceDatabase(context); final Optional recipientPreferences = recipientDatabase.getRecipientsPreferences(recipient.getAddress()); if (recipientPreferences.isPresent() && recipientPreferences.get().isRegistered()) return Capability.SUPPORTED; @@ -163,7 +163,7 @@ public class DirectoryHelper { .setRegisteredUsers(account.get().getAccount(), activeAddresses, removeMissing); Cursor cursor = ContactAccessor.getInstance().getAllSystemContacts(context); - RecipientPreferenceDatabase.BulkOperationsHandle handle = DatabaseFactory.getRecipientPreferenceDatabase(context).resetAllDisplayNames(); + RecipientDatabase.BulkOperationsHandle handle = DatabaseFactory.getRecipientPreferenceDatabase(context).resetAllDisplayNames(); try { while (cursor != null && cursor.moveToNext()) {