There's odd corner cases where channels can be duplicated. This commit
adds some hard checks where we trim any dead channels, and unset any
notification channels from recipients whose notification channel isn't
present in the system settings.
`DEFAULT_CHANNEL_ID` is a String, but `channel` is a NotificationChannel. Equals will therefore always return `false`. I think my fix (using `getId()`) is what was intended.
Due to an Android P bug, we basically need to stop calling
startService() in onResume()/onPause(). That means I had to turn
MessageRetrieval service into a singlton instead of a service. I also
moved the offending KeyCachingService calls into static methods that
didn't have to start the service.
This could cause us to think push messages were actually sent with
a SIM. We also now prevent rendering SIM info on push messages in
the conversation view.
Fixes#8176
We were getting an IllegalArgumentException during channel creation on
some Samsung phones. Stack trace didn't give me much more than that, so
just adding in some additional safeguards that make sense based on
reading AOSP.
We manually play the ringtone when in-thread notifications are enabled,
but we weren't using the sound specified by the channel in the system
settings. This fixes that problem by reading the NotificationChannel
setting.
When using notification channels, us setting priority actually has
no effect. So instead of having a non-functional setting, we've
routed the notification priority setting to go to the system
notification channel settings page for our Messages channel.
Previously, contact shares would be displayed as "Media Message". Now
it'll show the same as it does in a notification, namely
"{contact-emoji} {contact-name}".
Notifications for replies will no longer display as a "Media Message" if
they do not contain media. Instead, they will just contain the reply
text.
Fixes#7798
The "contact" option in the attachments tray now brings you through an
optimized contact sharing flow, allowing you to select specific fields
to share. The contact is then presented as a special message type,
allowing you to interact with the card to add the contact to your system
contacts, invite them to signal, initiate a signal message, etc.
In a number of locations in the code, there were conversions of message
expiration times from seconds to milliseconds, and then assigned to `long`
contexts. However these conversions were being done as integer multiplication
rather than long multiplication, meaning that there was a potential for
overflows.
Specifically, the maximum value that could be represented before overflowing
was (2^31 / 1000 / 60 / 60 / 24) days = 24.8 days (< 1 month). Luckily the
current allowed timeouts are all less than that value, but this fix would
remove the artificial restriction, effectively allowing values of 1000x greater
(68 years), at least for android.
Related #5775Closes#7338
1. Replace custom ringtone picker with system Intent, since we
don't need it anymore. Fixes#7174
2. Make sure 'silent' ringtone selection is stored appropriately
Fixes#7115Closes#7141
3. Replace any existing file:// notification URIs with the system
default Fixes#7234
Eliminate the concept of 'Recipients' (plural). There is now just
a 'Recipient', which contains an Address that is either an individual
or a group ID.
MMS groups now exist as part of the group database, just like push
groups.
// FREEBIE
This was a holdover from Signal's origins as a pure SMS app.
It causes problems, depends on undefined device specific behavior,
and should no longer be necessary now that we have all the
information we need to E164 all numbers.
// FREEBIE
1) Prefetch identity keys when possible
2) Always accept prefetched keys or keys from incoming messages
3) Block sending only if it's a recent change, or if always
block is enabled
// FREEBIE
getActiveNotifications() seems to throw an NPE on some Motorola
ROMs, all of which appear to be 6.0.1. This change just swallows
the exception.
6.0 doesn't support bundled notifications, so I think it's alright
if they don't get canceled, since the summary notification will
still be displayed correctly.
This would only affect users who have an android wear device
attached to one of these buggy ROMs. By swallowing this exception,
they would not always get notifictions dismissed on their wear
device.
Fixes#6043
// FREEBIE
This adds android auto support accordign to
https://developer.android.com/training/auto/messaging/index.html#messaging
However, since android auto is not officially supported in my country,
the functionality is limited. Which means that I have not been able
to fully test everything yet.
What work is:
* Message notification is shown.
* When you click on it, the message is read.
Closes#5880
by adding an undeniable truth
Until now we use the reminderCount as threadId and
afterwards we updateNotification with a repeat count of always 0
Fixes#3893Closes#3896