mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
move old message notifier to optimized message notifier
This commit is contained in:
parent
871d707460
commit
2a88de3f61
@ -69,8 +69,10 @@ import org.thoughtcrime.securesms.loki.protocol.EphemeralMessage;
|
|||||||
import org.thoughtcrime.securesms.loki.protocol.LokiSessionResetImplementation;
|
import org.thoughtcrime.securesms.loki.protocol.LokiSessionResetImplementation;
|
||||||
import org.thoughtcrime.securesms.loki.protocol.PushEphemeralMessageSendJob;
|
import org.thoughtcrime.securesms.loki.protocol.PushEphemeralMessageSendJob;
|
||||||
import org.thoughtcrime.securesms.loki.utilities.Broadcaster;
|
import org.thoughtcrime.securesms.loki.utilities.Broadcaster;
|
||||||
|
import org.thoughtcrime.securesms.notifications.DefaultMessageNotifier;
|
||||||
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
||||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||||
|
import org.thoughtcrime.securesms.notifications.OptimizedMessageNotifier;
|
||||||
import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
||||||
import org.thoughtcrime.securesms.providers.BlobProvider;
|
import org.thoughtcrime.securesms.providers.BlobProvider;
|
||||||
import org.thoughtcrime.securesms.push.SignalServiceNetworkAccess;
|
import org.thoughtcrime.securesms.push.SignalServiceNetworkAccess;
|
||||||
@ -148,6 +150,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
private PersistentLogger persistentLogger;
|
private PersistentLogger persistentLogger;
|
||||||
|
|
||||||
// Loki
|
// Loki
|
||||||
|
public MessageNotifier messageNotifier = null;
|
||||||
public LokiPoller lokiPoller = null;
|
public LokiPoller lokiPoller = null;
|
||||||
public LokiPublicChatManager lokiPublicChatManager = null;
|
public LokiPublicChatManager lokiPublicChatManager = null;
|
||||||
private LokiPublicChatAPI lokiPublicChatAPI = null;
|
private LokiPublicChatAPI lokiPublicChatAPI = null;
|
||||||
@ -173,6 +176,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
|
ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
|
||||||
// Loki
|
// Loki
|
||||||
// ========
|
// ========
|
||||||
|
messageNotifier = new OptimizedMessageNotifier(new DefaultMessageNotifier());
|
||||||
broadcaster = new Broadcaster(this);
|
broadcaster = new Broadcaster(this);
|
||||||
LokiAPIDatabase apiDB = DatabaseFactory.getLokiAPIDatabase(this);
|
LokiAPIDatabase apiDB = DatabaseFactory.getLokiAPIDatabase(this);
|
||||||
LokiThreadDatabase threadDB = DatabaseFactory.getLokiThreadDatabase(this);
|
LokiThreadDatabase threadDB = DatabaseFactory.getLokiThreadDatabase(this);
|
||||||
@ -222,7 +226,9 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
executePendingContactSync();
|
executePendingContactSync();
|
||||||
KeyCachingService.onAppForegrounded(this);
|
KeyCachingService.onAppForegrounded(this);
|
||||||
// Loki
|
// Loki
|
||||||
|
if (lokiPoller != null) { lokiPoller.shouldCatchUp(); }
|
||||||
startPollingIfNeeded();
|
startPollingIfNeeded();
|
||||||
|
lokiPublicChatManager.shouldAllCatchUp();
|
||||||
lokiPublicChatManager.startPollersIfNeeded();
|
lokiPublicChatManager.startPollersIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +237,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
isAppVisible = false;
|
isAppVisible = false;
|
||||||
Log.i(TAG, "App is no longer visible.");
|
Log.i(TAG, "App is no longer visible.");
|
||||||
KeyCachingService.onAppBackgrounded(this);
|
KeyCachingService.onAppBackgrounded(this);
|
||||||
MessageNotifier.setVisibleThread(-1);
|
messageNotifier.setVisibleThread(-1);
|
||||||
// Loki
|
// Loki
|
||||||
if (lokiPoller != null) { lokiPoller.stopIfNeeded(); }
|
if (lokiPoller != null) { lokiPoller.stopIfNeeded(); }
|
||||||
if (lokiPublicChatManager != null) { lokiPublicChatManager.stopPollers(); }
|
if (lokiPublicChatManager != null) { lokiPublicChatManager.stopPollers(); }
|
||||||
|
@ -298,7 +298,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
|||||||
Context context = ConversationListActivity.this;
|
Context context = ConversationListActivity.this;
|
||||||
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(context).setAllThreadsRead();
|
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(context).setAllThreadsRead();
|
||||||
|
|
||||||
MessageNotifier.updateNotification(context);
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context);
|
||||||
MarkReadReceiver.process(context, messageIds);
|
MarkReadReceiver.process(context, messageIds);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -324,8 +324,9 @@ public class ConversationListFragment extends Fragment
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
DatabaseFactory.getThreadDatabase(getActivity()).deleteConversations(selectedConversations);
|
Context context = getActivity();
|
||||||
MessageNotifier.updateNotification(getActivity());
|
DatabaseFactory.getThreadDatabase(context).deleteConversations(selectedConversations);
|
||||||
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,9 +543,10 @@ public class ConversationListFragment extends Fragment
|
|||||||
DatabaseFactory.getThreadDatabase(getActivity()).archiveConversation(threadId);
|
DatabaseFactory.getThreadDatabase(getActivity()).archiveConversation(threadId);
|
||||||
|
|
||||||
if (unreadCount > 0) {
|
if (unreadCount > 0) {
|
||||||
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(getActivity()).setRead(threadId, false);
|
Context context = getActivity();
|
||||||
MessageNotifier.updateNotification(getActivity());
|
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(context).setRead(threadId, false);
|
||||||
MarkReadReceiver.process(getActivity(), messageIds);
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context);
|
||||||
|
MarkReadReceiver.process(context, messageIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -553,8 +555,9 @@ public class ConversationListFragment extends Fragment
|
|||||||
DatabaseFactory.getThreadDatabase(getActivity()).unarchiveConversation(threadId);
|
DatabaseFactory.getThreadDatabase(getActivity()).unarchiveConversation(threadId);
|
||||||
|
|
||||||
if (unreadCount > 0) {
|
if (unreadCount > 0) {
|
||||||
DatabaseFactory.getThreadDatabase(getActivity()).incrementUnread(threadId, unreadCount);
|
Context context = getActivity();
|
||||||
MessageNotifier.updateNotification(getActivity());
|
DatabaseFactory.getThreadDatabase(context).incrementUnread(threadId, unreadCount);
|
||||||
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, threadId);
|
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, threadId);
|
||||||
|
@ -176,7 +176,7 @@ public class DatabaseUpgradeActivity extends BaseActivity {
|
|||||||
new AsyncTask<Void, Void, Void>() {
|
new AsyncTask<Void, Void, Void>() {
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
MessageNotifier.updateNotification(context);
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
|
@ -133,13 +133,13 @@ public class MessageDetailsActivity extends PassphraseRequiredActionBarActivity
|
|||||||
assert getSupportActionBar() != null;
|
assert getSupportActionBar() != null;
|
||||||
getSupportActionBar().setTitle("Message Details");
|
getSupportActionBar().setTitle("Message Details");
|
||||||
|
|
||||||
MessageNotifier.setVisibleThread(threadId);
|
ApplicationContext.getInstance(this).messageNotifier.setVisibleThread(threadId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
MessageNotifier.setVisibleThread(-1L);
|
ApplicationContext.getInstance(this).messageNotifier.setVisibleThread(-1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -550,7 +550,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
setGroupShareProfileReminder(recipient);
|
setGroupShareProfileReminder(recipient);
|
||||||
calculateCharactersRemaining();
|
calculateCharactersRemaining();
|
||||||
|
|
||||||
MessageNotifier.setVisibleThread(threadId);
|
ApplicationContext.getInstance(this).messageNotifier.setVisibleThread(threadId);
|
||||||
markThreadAsRead();
|
markThreadAsRead();
|
||||||
|
|
||||||
DatabaseFactory.getLokiThreadDatabase(this).setDelegate(this);
|
DatabaseFactory.getLokiThreadDatabase(this).setDelegate(this);
|
||||||
@ -565,7 +565,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
MessageNotifier.setVisibleThread(-1L);
|
ApplicationContext.getInstance(this).messageNotifier.setVisibleThread(-1L);
|
||||||
if (isFinishing()) overridePendingTransition(R.anim.fade_scale_in, R.anim.slide_to_right);
|
if (isFinishing()) overridePendingTransition(R.anim.fade_scale_in, R.anim.slide_to_right);
|
||||||
inputPanel.onPause();
|
inputPanel.onPause();
|
||||||
|
|
||||||
@ -2244,7 +2244,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
if (refreshFragment) {
|
if (refreshFragment) {
|
||||||
fragment.reload(recipient, threadId);
|
fragment.reload(recipient, threadId);
|
||||||
MessageNotifier.setVisibleThread(threadId);
|
ApplicationContext.getInstance(this).messageNotifier.setVisibleThread(threadId);
|
||||||
}
|
}
|
||||||
|
|
||||||
fragment.scrollToBottom();
|
fragment.scrollToBottom();
|
||||||
|
@ -12,6 +12,7 @@ import android.text.TextUtils;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.DatabaseUpgradeActivity;
|
import org.thoughtcrime.securesms.DatabaseUpgradeActivity;
|
||||||
import org.thoughtcrime.securesms.crypto.AttachmentSecret;
|
import org.thoughtcrime.securesms.crypto.AttachmentSecret;
|
||||||
import org.thoughtcrime.securesms.crypto.ClassicDecryptingPartInputStream;
|
import org.thoughtcrime.securesms.crypto.ClassicDecryptingPartInputStream;
|
||||||
@ -423,7 +424,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
|
|||||||
db.endTransaction();
|
db.endTransaction();
|
||||||
|
|
||||||
// DecryptingQueue.schedulePendingDecrypts(context, masterSecret);
|
// DecryptingQueue.schedulePendingDecrypts(context, masterSecret);
|
||||||
MessageNotifier.updateNotification(context);
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -281,7 +281,7 @@ public class GroupMessageProcessor {
|
|||||||
Optional<InsertResult> insertResult = smsDatabase.insertMessageInbox(groupMessage);
|
Optional<InsertResult> insertResult = smsDatabase.insertMessageInbox(groupMessage);
|
||||||
|
|
||||||
if (insertResult.isPresent()) {
|
if (insertResult.isPresent()) {
|
||||||
MessageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
||||||
return insertResult.get().getThreadId();
|
return insertResult.get().getThreadId();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
@ -5,6 +5,7 @@ import android.support.annotation.VisibleForTesting;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.attachments.Attachment;
|
import org.thoughtcrime.securesms.attachments.Attachment;
|
||||||
import org.thoughtcrime.securesms.attachments.AttachmentId;
|
import org.thoughtcrime.securesms.attachments.AttachmentId;
|
||||||
import org.thoughtcrime.securesms.attachments.DatabaseAttachment;
|
import org.thoughtcrime.securesms.attachments.DatabaseAttachment;
|
||||||
@ -107,7 +108,7 @@ public class AttachmentDownloadJob extends BaseJob implements InjectableType {
|
|||||||
@Override
|
@Override
|
||||||
public void onRun() throws IOException {
|
public void onRun() throws IOException {
|
||||||
doWork();
|
doWork();
|
||||||
MessageNotifier.updateNotification(context, 0);
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doWork() throws IOException {
|
public void doWork() throws IOException {
|
||||||
|
@ -10,6 +10,7 @@ import com.google.android.mms.pdu_alt.PduBody;
|
|||||||
import com.google.android.mms.pdu_alt.PduPart;
|
import com.google.android.mms.pdu_alt.PduPart;
|
||||||
import com.google.android.mms.pdu_alt.RetrieveConf;
|
import com.google.android.mms.pdu_alt.RetrieveConf;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.attachments.Attachment;
|
import org.thoughtcrime.securesms.attachments.Attachment;
|
||||||
import org.thoughtcrime.securesms.attachments.UriAttachment;
|
import org.thoughtcrime.securesms.attachments.UriAttachment;
|
||||||
import org.thoughtcrime.securesms.database.Address;
|
import org.thoughtcrime.securesms.database.Address;
|
||||||
@ -57,6 +58,7 @@ public class MmsDownloadJob extends BaseJob {
|
|||||||
private long messageId;
|
private long messageId;
|
||||||
private long threadId;
|
private long threadId;
|
||||||
private boolean automatic;
|
private boolean automatic;
|
||||||
|
private MessageNotifier messageNotifier;
|
||||||
|
|
||||||
public MmsDownloadJob(long messageId, long threadId, boolean automatic) {
|
public MmsDownloadJob(long messageId, long threadId, boolean automatic) {
|
||||||
this(new Job.Parameters.Builder()
|
this(new Job.Parameters.Builder()
|
||||||
@ -75,6 +77,7 @@ public class MmsDownloadJob extends BaseJob {
|
|||||||
this.messageId = messageId;
|
this.messageId = messageId;
|
||||||
this.threadId = threadId;
|
this.threadId = threadId;
|
||||||
this.automatic = automatic;
|
this.automatic = automatic;
|
||||||
|
this.messageNotifier = ApplicationContext.getInstance(context).messageNotifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -94,7 +97,7 @@ public class MmsDownloadJob extends BaseJob {
|
|||||||
public void onAdded() {
|
public void onAdded() {
|
||||||
if (automatic && KeyCachingService.isLocked(context)) {
|
if (automatic && KeyCachingService.isLocked(context)) {
|
||||||
DatabaseFactory.getMmsDatabase(context).markIncomingNotificationReceived(threadId);
|
DatabaseFactory.getMmsDatabase(context).markIncomingNotificationReceived(threadId);
|
||||||
MessageNotifier.updateNotification(context);
|
messageNotifier.updateNotification(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,7 +180,7 @@ public class MmsDownloadJob extends BaseJob {
|
|||||||
|
|
||||||
if (automatic) {
|
if (automatic) {
|
||||||
database.markIncomingNotificationReceived(threadId);
|
database.markIncomingNotificationReceived(threadId);
|
||||||
MessageNotifier.updateNotification(context, threadId);
|
messageNotifier.updateNotification(context, threadId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,7 +255,7 @@ public class MmsDownloadJob extends BaseJob {
|
|||||||
|
|
||||||
if (insertResult.isPresent()) {
|
if (insertResult.isPresent()) {
|
||||||
database.delete(messageId);
|
database.delete(messageId);
|
||||||
MessageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
messageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,7 +267,7 @@ public class MmsDownloadJob extends BaseJob {
|
|||||||
|
|
||||||
if (automatic) {
|
if (automatic) {
|
||||||
db.markIncomingNotificationReceived(threadId);
|
db.markIncomingNotificationReceived(threadId);
|
||||||
MessageNotifier.updateNotification(context, threadId);
|
messageNotifier.updateNotification(context, threadId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ import com.google.android.mms.pdu_alt.SendReq;
|
|||||||
import com.google.android.mms.smil.SmilHelper;
|
import com.google.android.mms.smil.SmilHelper;
|
||||||
import com.klinker.android.send_message.Utils;
|
import com.klinker.android.send_message.Utils;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.attachments.Attachment;
|
import org.thoughtcrime.securesms.attachments.Attachment;
|
||||||
import org.thoughtcrime.securesms.database.Address;
|
import org.thoughtcrime.securesms.database.Address;
|
||||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||||
@ -304,7 +305,7 @@ public class MmsSendJob extends SendJob {
|
|||||||
Recipient recipient = DatabaseFactory.getThreadDatabase(context).getRecipientForThreadId(threadId);
|
Recipient recipient = DatabaseFactory.getThreadDatabase(context).getRecipientForThreadId(threadId);
|
||||||
|
|
||||||
if (recipient != null) {
|
if (recipient != null) {
|
||||||
MessageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId);
|
ApplicationContext.getInstance(context).messageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,6 +159,9 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
private long messageId;
|
private long messageId;
|
||||||
private long smsMessageId;
|
private long smsMessageId;
|
||||||
|
|
||||||
|
//Loki
|
||||||
|
private MessageNotifier messageNotifier;
|
||||||
|
|
||||||
@Inject SignalServiceMessageSender messageSender;
|
@Inject SignalServiceMessageSender messageSender;
|
||||||
private Address author;
|
private Address author;
|
||||||
|
|
||||||
@ -178,6 +181,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
pushMessageId,
|
pushMessageId,
|
||||||
smsMessageId);
|
smsMessageId);
|
||||||
setContext(context);
|
setContext(context);
|
||||||
|
this.messageNotifier = ApplicationContext.getInstance(context).messageNotifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
private PushDecryptJob(@NonNull Job.Parameters parameters, long pushMessageId, long smsMessageId) {
|
private PushDecryptJob(@NonNull Job.Parameters parameters, long pushMessageId, long smsMessageId) {
|
||||||
@ -546,7 +550,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
|
|
||||||
if (threadId != null) {
|
if (threadId != null) {
|
||||||
SessionManagementProtocol.handleEndSessionMessageIfNeeded(context, content);
|
SessionManagementProtocol.handleEndSessionMessageIfNeeded(context, content);
|
||||||
MessageNotifier.updateNotification(context, threadId);
|
messageNotifier.updateNotification(context, threadId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -709,10 +713,10 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
|
|
||||||
if (threadId != null) {
|
if (threadId != null) {
|
||||||
DatabaseFactory.getThreadDatabase(context).setRead(threadId, true);
|
DatabaseFactory.getThreadDatabase(context).setRead(threadId, true);
|
||||||
MessageNotifier.updateNotification(context);
|
messageNotifier.updateNotification(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageNotifier.setLastDesktopActivityTimestamp(message.getTimestamp());
|
messageNotifier.setLastDesktopActivityTimestamp(message.getTimestamp());
|
||||||
} catch (MmsException e) {
|
} catch (MmsException e) {
|
||||||
throw new StorageFailedException(e, content.getSender(), content.getSenderDevice());
|
throw new StorageFailedException(e, content.getSender(), content.getSenderDevice());
|
||||||
}
|
}
|
||||||
@ -775,9 +779,9 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageNotifier.setLastDesktopActivityTimestamp(envelopeTimestamp);
|
messageNotifier.setLastDesktopActivityTimestamp(envelopeTimestamp);
|
||||||
MessageNotifier.cancelDelayedNotifications();
|
messageNotifier.cancelDelayedNotifications();
|
||||||
MessageNotifier.updateNotification(context);
|
messageNotifier.updateNotification(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleMediaMessage(@NonNull SignalServiceContent content,
|
public void handleMediaMessage(@NonNull SignalServiceContent content,
|
||||||
@ -843,7 +847,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (insertResult.isPresent()) {
|
if (insertResult.isPresent()) {
|
||||||
MessageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
messageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loki - Store message open group server ID if needed
|
// Loki - Store message open group server ID if needed
|
||||||
@ -1015,7 +1019,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
if (smsMessageId.isPresent()) database.deleteMessage(smsMessageId.get());
|
if (smsMessageId.isPresent()) database.deleteMessage(smsMessageId.get());
|
||||||
|
|
||||||
if (threadId != null) {
|
if (threadId != null) {
|
||||||
MessageNotifier.updateNotification(context, threadId);
|
messageNotifier.updateNotification(context, threadId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (insertResult.isPresent()) {
|
if (insertResult.isPresent()) {
|
||||||
@ -1116,7 +1120,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
|
|
||||||
if (insertResult.isPresent()) {
|
if (insertResult.isPresent()) {
|
||||||
smsDatabase.markAsInvalidVersionKeyExchange(insertResult.get().getMessageId());
|
smsDatabase.markAsInvalidVersionKeyExchange(insertResult.get().getMessageId());
|
||||||
MessageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
messageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
smsDatabase.markAsInvalidVersionKeyExchange(smsMessageId.get());
|
smsDatabase.markAsInvalidVersionKeyExchange(smsMessageId.get());
|
||||||
@ -1133,7 +1137,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
|
|
||||||
if (insertResult.isPresent()) {
|
if (insertResult.isPresent()) {
|
||||||
smsDatabase.markAsDecryptFailed(insertResult.get().getMessageId());
|
smsDatabase.markAsDecryptFailed(insertResult.get().getMessageId());
|
||||||
MessageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
messageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
smsDatabase.markAsDecryptFailed(smsMessageId.get());
|
smsDatabase.markAsDecryptFailed(smsMessageId.get());
|
||||||
@ -1151,7 +1155,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
|
|
||||||
if (insertResult.isPresent()) {
|
if (insertResult.isPresent()) {
|
||||||
smsDatabase.markAsNoSession(insertResult.get().getMessageId());
|
smsDatabase.markAsNoSession(insertResult.get().getMessageId());
|
||||||
MessageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
messageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
smsDatabase.markAsNoSession(smsMessageId.get());
|
smsDatabase.markAsNoSession(smsMessageId.get());
|
||||||
@ -1169,7 +1173,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
|
|
||||||
if (insertResult.isPresent()) {
|
if (insertResult.isPresent()) {
|
||||||
smsDatabase.markAsLegacyVersion(insertResult.get().getMessageId());
|
smsDatabase.markAsLegacyVersion(insertResult.get().getMessageId());
|
||||||
MessageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
messageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
smsDatabase.markAsLegacyVersion(smsMessageId.get());
|
smsDatabase.markAsLegacyVersion(smsMessageId.get());
|
||||||
|
@ -182,7 +182,7 @@ public abstract class PushSendJob extends SendJob {
|
|||||||
Recipient recipient = DatabaseFactory.getThreadDatabase(context).getRecipientForThreadId(threadId);
|
Recipient recipient = DatabaseFactory.getThreadDatabase(context).getRecipientForThreadId(threadId);
|
||||||
|
|
||||||
if (threadId != -1 && recipient != null) {
|
if (threadId != -1 && recipient != null) {
|
||||||
MessageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId);
|
ApplicationContext.getInstance(context).messageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ public class PushTextSendJob extends PushSendJob implements InjectableType {
|
|||||||
warn(TAG, "Couldn't send message due to error: ", e);
|
warn(TAG, "Couldn't send message due to error: ", e);
|
||||||
if (messageId >= 0) {
|
if (messageId >= 0) {
|
||||||
database.markAsPendingInsecureSmsFallback(record.getId());
|
database.markAsPendingInsecureSmsFallback(record.getId());
|
||||||
MessageNotifier.notifyMessageDeliveryFailed(context, record.getRecipient(), record.getThreadId());
|
ApplicationContext.getInstance(context).messageNotifier.notifyMessageDeliveryFailed(context, record.getRecipient(), record.getThreadId());
|
||||||
}
|
}
|
||||||
} catch (UntrustedIdentityException e) {
|
} catch (UntrustedIdentityException e) {
|
||||||
warn(TAG, "Couldn't send message due to error: ", e);
|
warn(TAG, "Couldn't send message due to error: ", e);
|
||||||
@ -198,7 +198,7 @@ public class PushTextSendJob extends PushSendJob implements InjectableType {
|
|||||||
Recipient recipient = DatabaseFactory.getThreadDatabase(context).getRecipientForThreadId(threadId);
|
Recipient recipient = DatabaseFactory.getThreadDatabase(context).getRecipientForThreadId(threadId);
|
||||||
|
|
||||||
if (threadId != -1 && recipient != null) {
|
if (threadId != -1 && recipient != null) {
|
||||||
MessageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId);
|
ApplicationContext.getInstance(context).messageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import android.support.annotation.NonNull;
|
|||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.telephony.SmsMessage;
|
import android.telephony.SmsMessage;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.jobmanager.Data;
|
import org.thoughtcrime.securesms.jobmanager.Data;
|
||||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||||
import org.thoughtcrime.securesms.jobmanager.impl.SqlCipherMigrationConstraint;
|
import org.thoughtcrime.securesms.jobmanager.impl.SqlCipherMigrationConstraint;
|
||||||
@ -79,7 +80,7 @@ public class SmsReceiveJob extends BaseJob {
|
|||||||
Optional<InsertResult> insertResult = storeMessage(message.get());
|
Optional<InsertResult> insertResult = storeMessage(message.get());
|
||||||
|
|
||||||
if (insertResult.isPresent()) {
|
if (insertResult.isPresent()) {
|
||||||
MessageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
||||||
}
|
}
|
||||||
} else if (message.isPresent()) {
|
} else if (message.isPresent()) {
|
||||||
Log.w(TAG, "*** Received blocked SMS, ignoring...");
|
Log.w(TAG, "*** Received blocked SMS, ignoring...");
|
||||||
|
@ -9,6 +9,7 @@ import android.support.annotation.NonNull;
|
|||||||
import android.telephony.PhoneNumberUtils;
|
import android.telephony.PhoneNumberUtils;
|
||||||
import android.telephony.SmsManager;
|
import android.telephony.SmsManager;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.jobmanager.Data;
|
import org.thoughtcrime.securesms.jobmanager.Data;
|
||||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||||
import org.thoughtcrime.securesms.jobmanager.impl.NetworkOrCellServiceConstraint;
|
import org.thoughtcrime.securesms.jobmanager.impl.NetworkOrCellServiceConstraint;
|
||||||
@ -88,7 +89,7 @@ public class SmsSendJob extends SendJob {
|
|||||||
} catch (UndeliverableMessageException ude) {
|
} catch (UndeliverableMessageException ude) {
|
||||||
warn(TAG, ude);
|
warn(TAG, ude);
|
||||||
DatabaseFactory.getSmsDatabase(context).markAsSentFailed(record.getId());
|
DatabaseFactory.getSmsDatabase(context).markAsSentFailed(record.getId());
|
||||||
MessageNotifier.notifyMessageDeliveryFailed(context, record.getRecipient(), record.getThreadId());
|
ApplicationContext.getInstance(context).messageNotifier.notifyMessageDeliveryFailed(context, record.getRecipient(), record.getThreadId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +107,7 @@ public class SmsSendJob extends SendJob {
|
|||||||
DatabaseFactory.getSmsDatabase(context).markAsSentFailed(messageId);
|
DatabaseFactory.getSmsDatabase(context).markAsSentFailed(messageId);
|
||||||
|
|
||||||
if (threadId != -1 && recipient != null) {
|
if (threadId != -1 && recipient != null) {
|
||||||
MessageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId);
|
ApplicationContext.getInstance(context).messageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ public class SmsSentJob extends BaseJob {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
database.markAsSentFailed(messageId);
|
database.markAsSentFailed(messageId);
|
||||||
MessageNotifier.notifyMessageDeliveryFailed(context, record.getRecipient(), record.getThreadId());
|
ApplicationContext.getInstance(context).messageNotifier.notifyMessageDeliveryFailed(context, record.getRecipient(), record.getThreadId());
|
||||||
}
|
}
|
||||||
} catch (NoSuchMessageException e) {
|
} catch (NoSuchMessageException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
|
@ -78,7 +78,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
|
|||||||
val threadID = archivedConversations.getLong(archivedConversations.getColumnIndex(ThreadDatabase.ID))
|
val threadID = archivedConversations.getLong(archivedConversations.getColumnIndex(ThreadDatabase.ID))
|
||||||
AsyncTask.execute {
|
AsyncTask.execute {
|
||||||
threadDatabase.deleteConversation(threadID)
|
threadDatabase.deleteConversation(threadID)
|
||||||
MessageNotifier.updateNotification(this)
|
(applicationContext as ApplicationContext).messageNotifier.updateNotification(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
deleteThreadAtCurrentPosition()
|
deleteThreadAtCurrentPosition()
|
||||||
@ -314,7 +314,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
|
|||||||
ApplicationContext.getInstance(activity).lokiPublicChatAPI!!.leave(publicChat.channel, publicChat.server)
|
ApplicationContext.getInstance(activity).lokiPublicChatAPI!!.leave(publicChat.channel, publicChat.server)
|
||||||
}
|
}
|
||||||
threadDatabase.deleteConversation(threadID)
|
threadDatabase.deleteConversation(threadID)
|
||||||
MessageNotifier.updateNotification(activity)
|
ApplicationContext.getInstance(activity).messageNotifier.updateNotification(activity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ import android.content.Intent;
|
|||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.support.v4.app.NotificationManagerCompat;
|
import android.support.v4.app.NotificationManagerCompat;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||||
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
|
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
|
||||||
import org.whispersystems.libsignal.logging.Log;
|
import org.whispersystems.libsignal.logging.Log;
|
||||||
@ -66,7 +67,7 @@ public class AndroidAutoHeardReceiver extends BroadcastReceiver {
|
|||||||
messageIdsCollection.addAll(messageIds);
|
messageIdsCollection.addAll(messageIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageNotifier.updateNotification(context);
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context);
|
||||||
MarkReadReceiver.process(context, messageIdsCollection);
|
MarkReadReceiver.process(context, messageIdsCollection);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -25,6 +25,7 @@ import android.os.AsyncTask;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.RemoteInput;
|
import android.support.v4.app.RemoteInput;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.database.Address;
|
import org.thoughtcrime.securesms.database.Address;
|
||||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||||
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
|
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
|
||||||
@ -86,7 +87,7 @@ public class AndroidAutoReplyReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(context).setRead(replyThreadId, true);
|
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(context).setRead(replyThreadId, true);
|
||||||
|
|
||||||
MessageNotifier.updateNotification(context);
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context);
|
||||||
MarkReadReceiver.process(context, messageIds);
|
MarkReadReceiver.process(context, messageIds);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -6,6 +6,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||||
|
|
||||||
public class DeleteNotificationReceiver extends BroadcastReceiver {
|
public class DeleteNotificationReceiver extends BroadcastReceiver {
|
||||||
@ -18,7 +19,7 @@ public class DeleteNotificationReceiver extends BroadcastReceiver {
|
|||||||
@Override
|
@Override
|
||||||
public void onReceive(final Context context, Intent intent) {
|
public void onReceive(final Context context, Intent intent) {
|
||||||
if (DELETE_NOTIFICATION_ACTION.equals(intent.getAction())) {
|
if (DELETE_NOTIFICATION_ACTION.equals(intent.getAction())) {
|
||||||
MessageNotifier.clearReminder(context);
|
ApplicationContext.getInstance(context).messageNotifier.clearReminder(context);
|
||||||
|
|
||||||
final long[] ids = intent.getLongArrayExtra(EXTRA_IDS);
|
final long[] ids = intent.getLongArrayExtra(EXTRA_IDS);
|
||||||
final boolean[] mms = intent.getBooleanArrayExtra(EXTRA_MMS);
|
final boolean[] mms = intent.getBooleanArrayExtra(EXTRA_MMS);
|
||||||
|
@ -61,7 +61,7 @@ public class MarkReadReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
process(context, messageIdsCollection);
|
process(context, messageIdsCollection);
|
||||||
|
|
||||||
MessageNotifier.updateNotification(context);
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ import android.os.AsyncTask;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.RemoteInput;
|
import android.support.v4.app.RemoteInput;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.database.Address;
|
import org.thoughtcrime.securesms.database.Address;
|
||||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||||
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
|
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
|
||||||
@ -59,7 +60,7 @@ public class RemoteReplyReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
final Address address = intent.getParcelableExtra(ADDRESS_EXTRA);
|
final Address address = intent.getParcelableExtra(ADDRESS_EXTRA);
|
||||||
final ReplyMethod replyMethod = (ReplyMethod) intent.getSerializableExtra(REPLY_METHOD);
|
final ReplyMethod replyMethod = (ReplyMethod) intent.getSerializableExtra(REPLY_METHOD);
|
||||||
final CharSequence responseText = remoteInput.getCharSequence(MessageNotifier.EXTRA_REMOTE_REPLY);
|
final CharSequence responseText = remoteInput.getCharSequence(DefaultMessageNotifier.EXTRA_REMOTE_REPLY);
|
||||||
|
|
||||||
if (address == null) throw new AssertionError("No address specified");
|
if (address == null) throw new AssertionError("No address specified");
|
||||||
if (replyMethod == null) throw new AssertionError("No reply method specified");
|
if (replyMethod == null) throw new AssertionError("No reply method specified");
|
||||||
@ -91,7 +92,7 @@ public class RemoteReplyReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(context).setRead(threadId, true);
|
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(context).setRead(threadId, true);
|
||||||
|
|
||||||
MessageNotifier.updateNotification(context);
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context);
|
||||||
MarkReadReceiver.process(context, messageIds);
|
MarkReadReceiver.process(context, messageIds);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -177,14 +177,14 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil
|
|||||||
replyAction = new Action.Builder(R.drawable.ic_reply_white_36dp,
|
replyAction = new Action.Builder(R.drawable.ic_reply_white_36dp,
|
||||||
actionName,
|
actionName,
|
||||||
wearableReplyIntent)
|
wearableReplyIntent)
|
||||||
.addRemoteInput(new RemoteInput.Builder(MessageNotifier.EXTRA_REMOTE_REPLY).setLabel(label).build())
|
.addRemoteInput(new RemoteInput.Builder(DefaultMessageNotifier.EXTRA_REMOTE_REPLY).setLabel(label).build())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action wearableReplyAction = new Action.Builder(R.drawable.ic_reply,
|
Action wearableReplyAction = new Action.Builder(R.drawable.ic_reply,
|
||||||
actionName,
|
actionName,
|
||||||
wearableReplyIntent)
|
wearableReplyIntent)
|
||||||
.addRemoteInput(new RemoteInput.Builder(MessageNotifier.EXTRA_REMOTE_REPLY).setLabel(label).build())
|
.addRemoteInput(new RemoteInput.Builder(DefaultMessageNotifier.EXTRA_REMOTE_REPLY).setLabel(label).build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
|
|||||||
new AsyncTask<Void, Void, Void>() {
|
new AsyncTask<Void, Void, Void>() {
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
MessageNotifier.updateNotification(getActivity());
|
ApplicationContext.getInstance(getActivity()).messageNotifier.updateNotification(getActivity());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
|
@ -115,7 +115,7 @@ public class KeyCachingService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
if (!DatabaseUpgradeActivity.isUpdate(KeyCachingService.this)) {
|
if (!DatabaseUpgradeActivity.isUpdate(KeyCachingService.this)) {
|
||||||
MessageNotifier.updateNotification(KeyCachingService.this);
|
ApplicationContext.getInstance(KeyCachingService.this).messageNotifier.updateNotification(KeyCachingService.this);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ public class KeyCachingService extends Service {
|
|||||||
new AsyncTask<Void, Void, Void>() {
|
new AsyncTask<Void, Void, Void>() {
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
MessageNotifier.updateNotification(KeyCachingService.this);
|
ApplicationContext.getInstance(KeyCachingService.this).messageNotifier.updateNotification(KeyCachingService.this);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
|
@ -721,7 +721,7 @@ public class WebRtcCallService extends Service implements InjectableType,
|
|||||||
|
|
||||||
private void insertMissedCall(@NonNull Recipient recipient, boolean signal) {
|
private void insertMissedCall(@NonNull Recipient recipient, boolean signal) {
|
||||||
Pair<Long, Long> messageAndThreadId = DatabaseFactory.getSmsDatabase(this).insertMissedCall(recipient.getAddress());
|
Pair<Long, Long> messageAndThreadId = DatabaseFactory.getSmsDatabase(this).insertMissedCall(recipient.getAddress());
|
||||||
MessageNotifier.updateNotification(this, messageAndThreadId.second, signal);
|
ApplicationContext.getInstance(this).messageNotifier.updateNotification(this, messageAndThreadId.second, signal);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleAnswerCall(Intent intent) {
|
private void handleAnswerCall(Intent intent) {
|
||||||
|
@ -6,6 +6,7 @@ import android.support.annotation.NonNull;
|
|||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.annotation.StringRes;
|
import android.support.annotation.StringRes;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
import org.thoughtcrime.securesms.crypto.storage.TextSecureIdentityKeyStore;
|
import org.thoughtcrime.securesms.crypto.storage.TextSecureIdentityKeyStore;
|
||||||
import org.thoughtcrime.securesms.crypto.storage.TextSecureSessionStore;
|
import org.thoughtcrime.securesms.crypto.storage.TextSecureSessionStore;
|
||||||
import org.thoughtcrime.securesms.database.Address;
|
import org.thoughtcrime.securesms.database.Address;
|
||||||
@ -143,7 +144,7 @@ public class IdentityUtil {
|
|||||||
Optional<InsertResult> insertResult = smsDatabase.insertMessageInbox(individualUpdate);
|
Optional<InsertResult> insertResult = smsDatabase.insertMessageInbox(individualUpdate);
|
||||||
|
|
||||||
if (insertResult.isPresent()) {
|
if (insertResult.isPresent()) {
|
||||||
MessageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
ApplicationContext.getInstance(context).messageNotifier.updateNotification(context, insertResult.get().getThreadId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user