Commit graph

2611 commits

Author SHA1 Message Date
Greyson Parrelli 446585ad68 Fix emoji variation selector on older devices.
Weird platform-specific bug was preventing the display of the
PopupWindow.
2018-11-13 11:19:29 -08:00
Greyson Parrelli 78627ecb08 Updated libsignal-service-java to 2.12.1 2018-11-09 12:37:24 -08:00
Greyson Parrelli bf9582c97e Only set UNRESTRICTED mode if recipients have a non-null verifier.
Otherwise we could send UD messages to people with non-UD linked
devices.
2018-11-06 09:58:45 -08:00
Greyson Parrelli 1ab3d57378 Fix some places where we were using the Android Logger.
We pretty much always want to be using our own logger.
2018-11-06 09:22:25 -08:00
Greyson Parrelli e31029da89 Update recipient's sealed sender status in more places. 2018-10-31 11:18:35 -07:00
Yassine El Khadiri 787bcf7752 Fix backup MAC checking.
if(MessageDigest.isEqual(ourMac, theirMac) was always returning false
since ourMac was of length 32 and theirMac was of length 10.
2018-10-31 11:17:29 -07:00
Greyson Parrelli 8c3d50c6dc Ignore messages without content. 2018-10-31 08:26:45 -07:00
Greyson Parrelli 532431b0ad Guard against notifying for errors on non-existent SMS threads.
All of the other send jobs do this already, just didn't do it here.
2018-10-31 08:19:33 -07:00
Greyson Parrelli cfeee25488 Use correct link for Sealed Sender blog post.
Fixes #8324
2018-10-30 14:12:34 -07:00
Greyson Parrelli 2acab563d9 Support for sealed sender - Part 2 2018-10-30 08:48:08 -07:00
Moxie Marlinspike 5f31762220 Support for sealed sender - Part 1 2018-10-30 08:48:08 -07:00
Greyson Parrelli b7b9554364 Prevent multiple instances of the same job running concurrently.
There are rare corner cases where a Job could be preempted by the
JobScheduler and then be rescheduled before the preempted job finished
running. This could create weird race conditions with bad consequences.

To fix this, we create a fun locking system that prevents two jobs with
the same UUID from running at the same time.
2018-10-30 08:48:07 -07:00
Greyson Parrelli f15fb904bf Fix desktop double notification bug.
There were situations where we were posting two notifications for messages
when you had an 'active desktop'. This removes that.
2018-10-30 08:48:07 -07:00
Greyson Parrelli 86e4221182 Use a unique notification icon for backups. 2018-10-27 23:34:18 -07:00
Greyson Parrelli dfe8b25dd7 Use a unique notification icon for the persistent background connection. 2018-10-27 23:32:28 -07:00
Greyson Parrelli 53050b3845 Fix issue with group avatar display.
Some legacy code was making the contact photo visible when it shouldn't
be.
2018-10-27 23:12:25 -07:00
Greyson Parrelli 6ce278114f Ensure profile photo in ConversationList is accurate.
Fixes #8270
2018-10-26 11:05:14 -07:00
Greyson Parrelli 48ff9673b9 Allow the selection of fitzpatrick emoji. 2018-10-26 11:05:10 -07:00
Greyson Parrelli 1999d09901 Updated emoji set.
Includes display support for more genders, and more notably, skin tones.
These are not currently selectable in the UI, but they will be rendered
properly when other clients send them.
2018-10-24 17:11:17 -07:00
Greyson Parrelli bf452dfa92 Slightly shorten time before we show a foreground notification for pushes.
There's some ANRs, not many, that are likely caused by us riding the
5-second ANR timeout a little too closely. Giving us a little buffer to
see if that helps.
2018-10-24 10:58:06 -07:00
Greyson Parrelli 2b14c98eb0 Do not call bluetooth state listener after service is destroyed. 2018-10-24 10:43:08 -07:00
Greyson Parrelli f164ac90db Disallow punctuation in icon initials. 2018-10-24 09:57:48 -07:00
Greyson Parrelli 91db26437d Fix camera scaling issues on some phones.
Some phones, notably the Pixel 3, had some problems with scaling after
taking photos. This fixes it by using the takePicture API instead of
pulling the bitmap from the TextureView.

Fixes #8292
2018-10-22 01:12:05 -07:00
Greyson Parrelli 76054a9e33 Ignore events after BluetoothStateManager is destroyed.
Fixes crash.
2018-10-21 13:03:28 -07:00
Greyson Parrelli ae9c53bdf8 Ensure jobs have a Context during onAdded().
Fixes a crash.
2018-10-20 22:52:14 -07:00
Greyson Parrelli 0dd7b39bb1 Fix recipient prefrence display problem on Android P.
Android P's new ringtone selector is a whole new activity that can cause
RecipientPreferenceActivity to go through the full onCreate() flow after
the ringtone selection. This could cause a race between setting the
preference and reading the preference from the notification channel.
Just threw them on a serial executor to guarantee ordering.
2018-10-20 22:42:35 -07:00
Greyson Parrelli 4a0ea0c51c Handle contexts more consistently in RecipientPreferences.
Fixes a crash that was happening on the Pixel 3.
2018-10-20 22:22:07 -07:00
Greyson Parrelli 668e8dee5d Catch more camera exceptions.
Some devices will simply fail to open the camera with a runtime
exception. In this case, all we can do is catch it and report the error.
2018-10-19 15:57:34 -07:00
Greyson Parrelli a287408a7a Only start the screen lock timeout when the app is backgrounded. 2018-10-18 09:40:32 -07:00
Greyson Parrelli 45e0bb281f Turn MessageRetrievalService into IncomingMessageObserver.
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.
2018-10-17 13:58:47 -07:00
Greyson Parrelli feb9e1d513 Post startService() in onPause() as a possible fix to an Android P bug.
We already did it for onResume(), and while it fixed the crash there,
the crash just moved to onPause(). Let's see if the same magic works.
2018-10-16 22:54:29 -07:00
Greyson Parrelli 7e485b8095 Post startService() in onResume() as a possible fix to an Android P bug.
Got confirmation that the crash we're seeing is a bug, and this might be
a possible workaround.
2018-10-16 11:47:58 -07:00
Greyson Parrelli 7cadb0d35a Properly set the document download icon tint. 2018-10-16 10:58:19 -07:00
Greyson Parrelli e1f572e1f4 Update GCM foreground notification icon.
Using the default Signal icon can confuse people into thinking they're
message notifications.
2018-10-15 16:56:24 -07:00
Greyson Parrelli ead323c1af Don't unnecessarily stack GCM message processing.
If we already have two active processing GCM messages, there's no
benefit to a third. In fact, enqueuing additional ones will likely only
end up showing the foreground notification unnecessariliy.
2018-10-15 10:37:30 -07:00
Greyson Parrelli 20c059280c Refactor OrderEnforcer. 2018-10-12 09:30:01 -07:00
Greyson Parrelli 5219d79e27 Remove unnecessary start of KeyCachingService. 2018-10-11 09:55:46 -07:00
Greyson Parrelli 89f97f57cb Update our boot receiver to schedule a message pull.
Previously we were starting a background service, which isn't allowed
for targetSdk 26. This will do the same thing but at a time decided by
the system.
2018-10-11 09:55:46 -07:00
Greyson Parrelli 4c63428b71 Ensure GenericForegroundService is started with startForegroundService.
If we don't, we run the risk of the app crashing if the service is
started in the background.
2018-10-11 09:55:46 -07:00
Greyson Parrelli 0d48f10806 Fix issue where a Job had null JobParameters. 2018-10-10 09:00:14 -07:00
Greyson Parrelli 275ca9e3ba Remove the ability to set a color for a group.
No longer applicable given that we're adding back per-person colors in
groups.
2018-10-09 15:34:08 -07:00
Greyson Parrelli 710fa4a6f0 Switch the conversation color back to incoming messages. 2018-10-09 15:34:04 -07:00
Greyson Parrelli 1b736e9e04 Ensure notifications are processed after receiving GCM message.
It's unreliable to run these tasks on WorkManager, as there's no
scheduling guarantees.
2018-10-08 10:00:15 -07:00
Greyson Parrelli 1c197ad93d Reset attachment transfer state if auto-download requirements are not met. 2018-10-07 14:21:33 -07:00
Greyson Parrelli f26c6f890f Fix non-contact icon in recipient preferences being too small.
Relates to #8252
2018-10-04 11:35:19 -07:00
Greyson Parrelli eb11d5ceda Make avatar color in toolbar match conversation color.
Relates to #8252
2018-10-04 11:27:12 -07:00
Greyson Parrelli 1d7f7b6c38 Do not auto-assign Steel as a color for contacts/groups.
Should be reserved for non-contacts, but selectable in the color picker.

Fixes #8247
2018-10-04 09:22:24 -07:00
Greyson Parrelli 07d7af6e75 Initialize WorkManager ourself.
This gives us more control over when it happens, as well as lets us set
things like the debug level. Also let's us get rid of the synchronized
block we had in Application#onCreate().
2018-10-04 09:09:04 -07:00
Greyson Parrelli 0840175d6f Remove shutter sound on camera capture.
This sound isn't supposed to play when you have notification sound off,
but apparently some Huawei phones will play it anyway. Until we can
figure out a better way to handle it, we're just removing it.
2018-10-03 18:11:50 -07:00
Greyson Parrelli 547b7a3c6f Migrate legacy color palette.
We don't store non-user-selected colors in the database. That means that
when we update the palette, we still have to hash based off of the legacy
palette when generating a color if we want to migrate to a
similar-looking color.

Unfortunately, because the new palette is smaller, some colors are
"overloaded", meaning that when we hash based off of the legacy palette,
some colors will be more/less common than others. To fix this, we simply
persist all current colors in the database, then switch our hashing list
to what we really want.
2018-10-03 14:25:17 -07:00
Greyson Parrelli 5eec3c9541 Add hairline border to avatars. 2018-10-03 14:24:00 -07:00
Greyson Parrelli f725dd5a7e Show profile avatar in toolbar. 2018-10-03 14:24:00 -07:00
Greyson Parrelli a3cba66450 Update fallback avatars. 2018-10-03 14:24:00 -07:00
Greyson Parrelli bab92fca7b Move unread indicator to be above the avatar. 2018-10-03 14:23:59 -07:00
Greyson Parrelli c37c1dffd4 Allow setting the color for a group. 2018-10-03 14:23:59 -07:00
Greyson Parrelli 127505af0b Implement new color palette. 2018-10-03 14:23:59 -07:00
Greyson Parrelli cfd20d23e8 Fix double onClick() notifications in preferences.
Fixes #8241
2018-10-03 11:31:07 -07:00
Greyson Parrelli e4b56d4e40 Show foreground notification for jobs when network is restricted.
Occasionally a job may be run when the app is in a network-restricted
mode, like a form of doze. When this happens, jobs can timeout due to
lack of network access, causing a cascade of job delays. This is
particularly bad in the case of message retrieval.

To prevent this, if a job that normally requires network detects that no
network is available when running, then we start a foreground
notification.
2018-10-03 10:00:42 -07:00
Greyson Parrelli 5a623810cb Broaden exception handling around Camera#startPreview().
Some devices will randomly throw RuntimeExceptions here due to hardware
issues. We were already doing broader catch statement in CameraView, so
I moved it here as well.
2018-10-02 12:47:07 -07:00
Greyson Parrelli 444e01deae Improve key presence checking in SafeData.
This isn't a perfect check either, but it should be safer and more
consistent than using static "invalid values".
2018-10-02 12:31:12 -07:00
Greyson Parrelli d25ebdc818 Fix indentation in preference fragments.
Unfortunately, while there does exist an XML property to disable the
indentation, it's bugged for category headings, so we have to do this
silly thing where we strip the padding in the adapter. Hopefully they'll
fix the bug and we can move to use the sanctioned property.

See: https://issuetracker.google.com/issues/111662669

Fixes #8233
2018-10-02 12:08:01 -07:00
Greyson Parrelli 24e82abf80 Don't report contact discovery accuracy if it encountered an error.
Otherwise we're double-reporting. Also made the sanitize method more
accurate.
2018-10-02 09:16:37 -07:00
Greyson Parrelli cfa13867e5 Allow null for profileAvatar in RetrieveProfileAvatarJob. 2018-10-02 08:43:18 -07:00
Greyson Parrelli 34770a2333 Fixed Camera capture crash on API <= 19.
On older versions of Android, TextureView#getBitmap() needs to be called
on the main thread. On mid range phones, this is ~50ms. Normally that'd
be bad, but the UI isn't doing anything at that point anyway.

Fixes #8232
2018-10-01 23:53:33 -07:00
Greyson Parrelli 2c5fa155ae Fix re-enabling tab switching in MediaOverview.
We were being inconsistent in how we were handling exiting multiselect,
and it wasn't behaving properly when you left by clicking the 'x'. Now
it's all handled centrally.

Fixes #8234
2018-10-01 23:38:07 -07:00
Greyson Parrelli 12afdad291 Log Job retryable exceptions. 2018-10-01 16:14:45 -07:00
Greyson Parrelli 2f530dc970 Remove CameraView usage of JobManager.
WorkManager flat-out can't handle anonymous implementations of Worker
classes due to it using reflection to instantiate them.
2018-10-01 12:12:50 -07:00
Greyson Parrelli 87e6aa48bb Schedule jobs with WorkManager.
Should help solve most of our pressing targetSdk=26 migration issues.
2018-10-01 12:12:50 -07:00
Greyson Parrelli d10a44f8eb Suppress some noisy logs. 2018-10-01 12:12:50 -07:00
Greyson Parrelli 6359961a82 Ensure numbers are properly formatted before giving them to contact discovery service.
We were sending "Unknown" addresses, which would cause the service to
choke.
2018-10-01 12:12:12 -07:00
Greyson Parrelli 616912d85f Prefer local state in dial click listener. 2018-09-27 11:45:56 -07:00
Greyson Parrelli bd38b96095 Long-press timestamps in message details to copy. 2018-09-27 11:34:43 -07:00
Greyson Parrelli 12d9d7741b Clean up batch saving.
- Post a better string for when batch saving completes successfully
- Exit multi-select after saving
2018-09-27 10:35:56 -07:00
FeuRenard 91a119393c Allow batch saving in media overview 2018-09-27 10:35:56 -07:00
FeuRenard c82afd8944 Allow selecting all media in overview 2018-09-27 10:35:56 -07:00
Greyson Parrelli 84c71fce16 Disable tab switching in media overview during multiselect.
Multiselect only applies to items in the "media" tab, so people
shouldn't be able to switch tabs during multiselect.
2018-09-27 10:35:56 -07:00
Greyson Parrelli a0ab252bc9 Add preliminary contact discovery service support. 2018-09-27 10:35:56 -07:00
Greyson Parrelli 08ace15f95 Implemented new camera capture flow.
A new, fullscreen camera capture flow that easily allows you to capture
and edit a photo before sending it. Replaces the current half-screen
camera button.
2018-09-27 10:35:56 -07:00
Greyson Parrelli e9a38bab1e Turned SingleUseBlobProvider into MemoryBlobProvider.
Keep the single-use behavior, but allow the creation of multi-use memory
blobs that can be deleted when we're done with them. Will help out with
having URI's for temporary images during the camera capture flow.
2018-09-27 10:35:56 -07:00
Greyson Parrelli e63773e5c8 Added OrderEnforcer class to schedule ordered tasks. 2018-09-27 10:35:56 -07:00
Greyson Parrelli bcebf58b76 Added a new Stopwatch class to easily log timings. 2018-09-27 10:35:56 -07:00
Greyson Parrelli 6eb8693546 Don't block messages from unknown groups.
We were incorrectly considering unknown groups to have been "left".
2018-09-25 10:00:14 -07:00
Greyson Parrelli 11127c0d97 Clear external cache upon upgrade. 2018-09-19 16:41:51 -07:00
Greyson Parrelli 45c4eafbd7 Add the ability to block groups.
This also fixes the situation where we block group-leave messages,
preventing blocked contacts from leaving groups.

Fixes #7970

Also, this forced us to upgrade libsignal-service, which fixes the
websocket timeout issues. Thanks to @dpapavas!

Fixes #6644
2018-09-18 15:26:50 -07:00
Greyson Parrelli 741b775d3e Ensure external camera blob is deleted. 2018-09-17 20:29:21 -07:00
Greyson Parrelli e09c99102e Clear Glide disk cache after image deletion. 2018-09-17 19:17:36 -07:00
Greyson Parrelli 1d4020ffc6 Disable forwarding for shared contacts.
Forwarding of shared contacts currently just creates an empty draft.
You can't preview a shared contact before you send, which would make the
forwarding flow inconsistent across media types. So it's easier to just
hide it for now.

Fixes #8195
2018-09-16 22:50:59 -07:00
Greyson Parrelli 5d11e321a8 Fix setting global notification sound to 'None'.
Fixes #8206
2018-09-16 22:29:55 -07:00
Greyson Parrelli 9dd3e50ebd Don't set subscriptionId for quick-reply push messages.
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
2018-09-08 10:08:22 -07:00
Greyson Parrelli 440ad70d79 Allow submitting a debug log during registration. 2018-09-08 07:48:20 -07:00
Greyson Parrelli a1b2887bf3 Fixed off-by-one crash when navigating to message from FTS.
Related to #8145
2018-09-08 07:48:20 -07:00
Greyson Parrelli db9bfb4b2f Update ExoPlayer to 2.8.4 2018-09-08 07:48:20 -07:00
Greyson Parrelli c3bdc48ee3 Create placeholder ContentProviders for database observations.
Required for the API 26 migration.

See https://developer.android.com/about/versions/oreo/android-8.0-changes#ccn
2018-09-08 07:48:20 -07:00
Greyson Parrelli 7c5e1db6a2 Fix NPE in MultiDeviceContactUpdateJob.
Fixes #8180
2018-09-07 17:52:50 -07:00
Greyson Parrelli 82c0ea792a Fix animation crash.
Shoutout to @bomba1990 for fixing this around the same time as me :)

Fixes #8182
2018-09-07 17:52:50 -07:00
Greyson Parrelli 70eecb754e Address bugs in notification channel backup restore. 2018-09-07 17:49:15 -07:00
Greyson Parrelli ad036b0d6a Fix backup restore issues from restoring newer Signal backups.
Fixes #8184
2018-09-07 16:08:45 -07:00
Greyson Parrelli 15b4517e35 Prevent restoring newer backups into older versions of Signal.
Relates to #8184
2018-09-07 15:54:38 -07:00
Greyson Parrelli 8d43fb850d Make group notifications use the latest sender's ringtone. 2018-09-04 18:10:47 -07:00
Greyson Parrelli 11d34512a0 Fix double notifications in O+. 2018-09-04 18:10:42 -07:00
Greyson Parrelli 73b18fc1dd Fix NotificationChannel backup import.
We were recreating the channels before the database upgrade. We
have to do it after.

Fixes #8174
2018-09-04 10:57:33 -07:00
Greyson Parrelli d9ba6962c7 Fixed NPE during channel update. 2018-09-03 17:48:55 -07:00
Greyson Parrelli 3da1a3e270 Restore notification channels after backup. 2018-08-31 12:00:46 -07:00
Greyson Parrelli e840dc6687 Move notification preferences back in-app for O+.
Fixes #8147
2018-08-31 11:10:54 -07:00
Greyson Parrelli 5d91a94252 Fix shortcut images being too large.
We were hitting the transaction limit size. This change scales down
shortcut icons to be at most 300x300, which comes out to ~360kb, which
should be safely under the limit of 1mb.

Fixes #8139
2018-08-25 10:40:58 -07:00
Greyson Parrelli ab58eab9f4 Fix potential crash with recipient preferences. 2018-08-24 12:00:02 -07:00
Greyson Parrelli cedab7f504 Fix migration of group names when creating Notification Channels. 2018-08-22 14:19:37 -07:00
Greyson Parrelli ca2efcac8a Added safeguards during NotificationChannel creation.
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.
2018-08-22 13:19:59 -07:00
Greyson Parrelli f1efe2b589 Use correct in-thread message tone on O+.
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.
2018-08-22 11:58:41 -07:00
Greyson Parrelli e1f8e87327 Fix log submission OOM, improve log scrolling.
We were getting a TransactionTooLargeException when giving an
EditText a very large (1.5MB+) text block. This has been resolved
by switching to a RecyclerView to show the text line-by-line. As a
side-effect, this improves scroll performance on lower-end devices.

Also, I added a button to jump to the bottom of the log because I
really wanted one :)

Fixes #8124
2018-08-20 01:24:36 -07:00
Greyson Parrelli 88d94cad92 Substantially improve Scrubber performance.
Previously, we were making a new copy of the entire source string after
every scrubbed substitution. In the case of our new, larger log files,
this was very slow. It's been changed so we only ever create one new
copy.

In practice, on a Moto E (2014), scrubbing a 1.5MB log went from
>4000ms to ~100ms.
2018-08-19 23:19:08 -07:00
Greyson Parrelli e9b85a10a6 Add per-contact notification channels.
Fixes #8119
Fixes #8121
Fixes #8122
2018-08-17 15:51:01 -07:00
Greyson Parrelli c49b0348bd Add failsafe for invalid shortcuts.
Some launchers may create broken shortcuts, so we just want to have
a smooth fallback in that scenario.

Fixes #8109
2018-08-15 12:48:04 -07:00
Greyson Parrelli 3c6b8bcf9b Hide inline attachment button when attachment present. 2018-08-15 12:35:41 -07:00
Greyson Parrelli a6473bc922 Link priority setting to message channel setting on Oreo+
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.
2018-08-15 12:11:10 -07:00
Greyson Parrelli 10a790df88 Fix notifications triggering too often. 2018-08-14 20:19:25 -07:00
Greyson Parrelli eabaead700 Revert "Fingerprint unlock UX improvements"
This reverts commit 8441ac4091.

Fixes #8106
2018-08-14 13:04:33 -07:00
Greyson Parrelli d581525a61 Fix Log secret reading.
Accidentally typed '>' instead of '>='.

Fixes #8107
2018-08-14 15:09:24 -04:00
Greyson Parrelli d79564021f Remove extra space below notification text.
Special thanks to @dwong

Fixes #7905
2018-08-13 18:38:59 -04:00
Greyson Parrelli 2acbea014b Fix videos losing their extension after forwarding.
Special thanks to @signalien

Fixes #7783
2018-08-13 18:38:59 -04:00
Greyson Parrelli 2882ef6d9f Reset register button status after an error.
Fixes #8052
2018-08-13 18:38:59 -04:00
art1fa 8441ac4091 Fingerprint unlock UX improvements 2018-08-13 18:38:59 -04:00
Greyson Parrelli 20c896413b Stop linkifying addresses.
Address linkification on Android is pretty busted, and the docs
acknowledge it (see Linkify#MAP_ADDRESSES). Safest thing to do
at the moment is remove it. Looks like we may be able to get
better address linkification on API >= 28, but adding it will
be more involved.

Fixes #7730
2018-08-13 18:38:59 -04:00
Greyson Parrelli 13c72779af Visually note quotes for messages you don't have.
We will now show a small footer under quotes for messages that you
don't have locally.

Also fixes #7850
2018-08-13 18:38:59 -04:00
Greyson Parrelli 5cdf5499d0 Clean up shortcut code. 2018-08-13 18:38:59 -04:00
Leonard Ehrenfried c3c44e324b Allow users to add conversation shortcuts to the home screen. 2018-08-13 18:38:59 -04:00
Greyson Parrelli c7da83a702 Show attachment button while composing text.
Previously, we'd only show the attachment button when the user had
yet to enter any text. To add an attachment after text was entered,
you'd have to go to the three-dot menu. Now we just show a little
attach button in the text area.

I also took the opportunity to clean up other button paddings and
stuff in the compose area so things look better and react to text
sizes more predictably.
2018-08-13 18:38:59 -04:00
Greyson Parrelli dbd42c4af2 Add notification channel support.
Bucket our notifications into channels. Required to target API 26.
2018-08-13 18:38:53 -04:00
Greyson Parrelli d0db6aa509 Added more logging around message sending and attachment downloads. 2018-08-06 10:50:06 -04:00
Greyson Parrelli 43068e0613 Reduce usage of Log.w() 2018-08-06 10:50:06 -04:00
Greyson Parrelli a498176043 Switch logs to use new Log class. 2018-08-06 10:50:06 -04:00
Greyson Parrelli acb40c6133 Added new logger.
Added a new logger that persists logs for a longer duration to the
user's cache directory. Logs are encrypted. The new logs are sent
in addition to the user's logcat output.
2018-08-06 10:50:06 -04:00
Greyson Parrelli b7d83c7a1f Make libpaste a source dependency. 2018-08-06 10:50:06 -04:00
Greyson Parrelli c8571d7bc7 Use correct timestamp for footer collapse.
Fixes #8071
2018-08-06 10:34:02 -04:00
Greyson Parrelli d42cecc32a Fix timer issue with sync messages from desktop.
Related to #8068
2018-08-03 14:08:16 -04:00
Greyson Parrelli c5014f9471 Fix quote crash when we decode an image of 0 length.
Fixes #7983
2018-08-02 15:57:30 -04:00
Greyson Parrelli 6db3f249c6 Populate contact name when adding shared contact.
Fixes #8016
2018-08-02 15:16:51 -04:00
Greyson Parrelli 5a1ef31b49 Fix crash with moveToLastSeen() 2018-08-02 11:57:10 -04:00
art1fa faea8fd2ec Apply message bubble paddings to both top and bottom
Batch selecting messages now feels better. Fixes #8035.
2018-07-27 16:15:37 -04:00
Greyson Parrelli 79830049c4 Fix emoji vertical positioning.
Fixes #8023
2018-07-27 16:01:52 -04:00
Greyson Parrelli a3115c14ac Use proper target for Glide bitmap requests.
Fixes #8042
2018-07-27 09:12:54 -04:00
Greyson Parrelli 67190774cc Jump to the oldest unread message after loading a draft. 2018-07-25 13:10:35 -04:00
Greyson Parrelli d5753bc306 Fix spacing issue between short clustered group chats.
For short messages in a cluster, the contact photo was sometimes taller
than the actual bubble, leading to extra weird space. So instead we use
a container to hold the width of the cell, and set the avatar to be GONE
instead of INVISIBLE.
2018-07-25 01:16:48 -04:00
Greyson Parrelli e96a02ab35 Fix next/prev message detection with fastRecords.
The previous way we were getting the next/previous record didn't take into
consideration that some records aren't in the cursor -- some are in the
fastRecords map. We now use the proper position to get the next/previous
message.
2018-07-25 00:24:49 -04:00
Christian Ascheberg 0bb44f2034 Improve disappearing message time strings
Fixes #7501
2018-07-24 20:35:51 -04:00
Moxie Marlinspike fbd3f3db3f Update webrtc to M68 2018-07-24 17:06:43 -07:00
Greyson Parrelli d82e91ca20 Fix message button in conversation settings.
Switching to use our convenience methods for start texts and calls.

Fixes #8026
2018-07-24 17:15:03 -04:00
Greyson Parrelli c7fb1d79c4 Properly show group message header after a date divider. 2018-07-24 16:33:45 -04:00
Greyson Parrelli 0ced767ef2 Use person's name in call update text. 2018-07-24 16:33:05 -04:00
Greyson Parrelli 39b27a9d7a Properly map hashed legacy colors to the new color palette.
Fixes #8021
2018-07-24 12:53:36 -04:00
Greyson Parrelli 6a1fd8b1c6 Increase difference between read/unread conversations in list.
Updating to match the design.
2018-07-24 12:34:21 -04:00
Greyson Parrelli d8ddb142a9 Fixed bug in onMeasure() overflow safeguard.
Fixes #8008
2018-07-23 07:54:24 -07:00
Greyson Parrelli 214658b99e Fix recording not resetting properly after a send on older API's.
Apparently onAnimationEnd is not a reliable event on some Android
versions, so I've moved to instead using a simple postDelayed() that is
the same length as the animation.
2018-07-20 19:02:19 -07:00
Greyson Parrelli 415fe3463d Don't collapse outgoing footers for pending or failed messages. 2018-07-20 18:45:18 -07:00
Greyson Parrelli 6234e56e78 Allow outgoing messages to collapse footers. 2018-07-20 18:35:04 -07:00
Greyson Parrelli f82b2c0d3f Prevent author name from making media messages too wide.
The media size traditionally determines the bubble size, but the author
could make it wider, which would lead to rendering issues. In the case
of media attachments (images, videos, and shared contacts), we restrict
the width of the author name. When there's a number+profile name combo,
we split the space 50/50 between the two.
2018-07-20 18:24:52 -07:00
Greyson Parrelli a4214300ec Fix crash with conversations with "uknown contact" header.
We weren't accounting for ConversationAdapter header position when
getting the next and previous record in a conversation.
2018-07-20 17:50:54 -07:00
Greyson Parrelli c9bb3dd469 Remove now-unnecessary thumbnail onMeasure(). 2018-07-20 16:16:19 -07:00
Greyson Parrelli aa25f39fe9 Fix footer icon tints. 2018-07-20 15:40:13 -07:00
Greyson Parrelli 860047c2d3 Remove CornerMaskingView. 2018-07-20 14:24:04 -07:00
Greyson Parrelli d0eaee60e9 Add additional safeguards for picking an expiration timer frame.
Fixes #8010
2018-07-20 14:08:58 -07:00
Greyson Parrelli d303a88803 Fix quote dismiss button not showing up.
Fixes #8006
2018-07-20 14:03:03 -07:00
Greyson Parrelli 8f551c8b32 Fix various redesign issues with Android 4.x.
In particular, there were many issues with drawing corners.
Unfortunately, there's no pretty way to get masking working on every
Android version, so we have to switch back to using custom backgrounds
and then using multiple masking methods depending on Android version.

Also, I had to remove attr references in drawables. They crash on 4.x.
2018-07-18 16:53:36 -07:00
Jonathan Fung 85d963047e Adding a long press icon description for the Search icon
Fixes #7836
2018-07-18 09:04:42 -07:00
floesche df9833472f Add z5 compact (E5823) to AEC blacklist
Following fixes for other models to reduce echo on callee side during Signal call. 

The problem has been reported for this model for example in #6241
2018-07-18 08:53:27 -07:00
Greyson Parrelli bf692e8da3 Throttle background contact syncs to once every 6 hours.
Unfortunately, there's apps out there that trigger contact changes
very frequently. Because we listen to the system for contact
changes to tell us when to sync, that could result in us sending
an abundance of contact syncs to linked desktop instances.

This throttles contact sync requests using the following methodology:

- By default, throttle contact syncs to 6 hrs while the app is
  backgrounded.
- If a sync is throttled in the background, we set a dirty flag and
  will execute the sync the next time the app is foregrounded.
- Syncs explicitly requested by desktop are never throttled.
2018-07-17 12:06:50 -07:00
Greyson Parrelli 8579c30909 Styling improvements and code cleanup. 2018-07-17 12:06:42 -07:00
Greyson Parrelli 845fcf0864 Remove ability to set group conversation colors (for now). 2018-07-17 09:54:13 -07:00
Greyson Parrelli 24b062d8dd Improve the look of message bubbles. 2018-07-17 09:53:52 -07:00
Greyson Parrelli b02dda405c Use NetworkBackoffRequirement for group messages. 2018-07-12 10:59:10 -07:00
Moxie Marlinspike bc60cba2b8 Fix default SMS app intent >= N
Fixes #7964
2018-07-10 10:14:35 -07:00
Greyson Parrelli 84e2fcad54 Update UI of toggling shared contact photo. 2018-07-05 10:05:54 -07:00
Greyson Parrelli 6ce8516b93 Make contact photos optional when sharing contacts.
Previously, if you had a contact photo for a user, we'd always send it
Now you can choose whether or not it is sent.
2018-07-03 17:16:50 -07:00
Greyson Parrelli 67407ec667 Hard-code migration for full-text search. 2018-07-02 18:10:11 -07:00
b0m0x 2290549349 add Mi A1 to hardware AEC blacklist
See #7635
2018-07-02 17:45:55 -07:00
Greyson Parrelli bf07048d7b Use earlier read timestamp when syncing read status with desktop.
Previously, we'd always use the value desktop gave us. However, if we
have an earlier read time locally, we want to use that instead.
2018-07-02 17:39:10 -07:00
Greyson Parrelli 3134837d56 Remove plaintext backup import option.
We have our own secure backup solution built into the app now.
No need to support plaintext backups.
2018-07-02 17:11:13 -07:00
Greyson Parrelli c7066c0796 Cast to MmsMessageRecord in ConversationFragment#handleForwardMessage.
Was causing a crash for MMS messages.

Fixes #7951
2018-07-02 08:56:11 -07:00
Greyson Parrelli 18756aedf6 Remove the ability to save backups to the external SD card.
The directory we were previously saving backups to on the external SD
card is actually deleted upon app uninstall and/or clearing the app's
data. There's also no reliable way to write to the root of an external
SD card (that isn't comically inconvenient), so for now it's safer if we
just move back to getting the regular 'ol standard external storage
directory (which is likely internal storage, despite its name).

Fixes #7845
2018-06-29 14:10:45 -07:00
Greyson Parrelli 290b184491 Enable shared contact sending. 2018-06-29 11:08:13 -07:00
Greyson Parrelli 0d386d3c14 Fix progress bar showing for self-sends.
For self-sends, we were never marking attachments as uploaded. I made is
so that happens now, but to prevent it for showing for already-sent
messages, we also don't show controls for self-send conversations.
2018-06-28 12:07:23 -07:00
Greyson Parrelli fd6d947df3 Fix ClassCastException in ThreadDatabase.
I casted too deep. Forgot about NotificationMmsMessageRecord.
2018-06-27 09:43:02 -07:00
Greyson Parrelli 381547d668 Fix crash with formatting emails in recipient settings.
Fixes #7868
2018-06-22 13:24:36 -07:00
Greyson Parrelli f72f75ee61 Show a link for privacy policy. 2018-06-22 13:09:43 -07:00
Greyson Parrelli b39a7ac939 Add expiration time to group update requests. 2018-06-22 11:29:16 -07:00
Greyson Parrelli b5d4cac90a Send/receive expiration times for group updates.
This particularly helps with the bug where people who were newly added
to a group wouldn't receive an expiration timer until the first message
was sent.
2018-06-22 11:01:55 -07:00
Greyson Parrelli dae655fd01 Fix conversation snippet for contact shares.
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}".
2018-06-22 10:59:53 -07:00
Greyson Parrelli 933be54035 Update scheduling of ServiceOutageDetectionJob.
Previously, we were running this job in PushSendJob#onCanceled().
However, with the new retry logic, this won't happen for 24 hours.

Instead, we now schedule the job in PushSendJob#onRetry().
2018-06-22 10:59:53 -07:00
2-4601 f1d8fd8838 Add devices to hardware AEC blacklist
- Moto G4
- Nokia 5 (TA-1053)

Alleviates #7635
2018-06-22 10:59:53 -07:00
Greyson Parrelli a50edc3d25 Keep retrying message sends for 24 hours.
Previously, we retried based on a count. Now we've added the ability to
keep retrying for a specified time, using exponential backoff to
throttle attempts.
2018-06-22 10:59:53 -07:00
Greyson Parrelli 62c42a3513 Fix disappearing message corner case.
We never properly registered the ExpirationListener, meaning we were
relying on the wait-notify loop of ExpirationManager to delete things.
This normally works, but fails when your phone goes to sleep. So I
properly registered the receiver, and then added a failsafe to re-run
the ExpirationManager if we're about to render an expired message.

Fixes #7906
2018-06-22 10:59:53 -07:00
Greyson Parrelli 42f1baaf61 Imported JobManager as a source dependency.
We have to make some changes, and it's gotten to the point where
maintaining it as a separate library is more hassle than it's worth,
especially with Google releasing WorkManager as the preferred job
scheduling library.
2018-06-22 10:59:53 -07:00
Greyson Parrelli 5f99470226 Allow searching for words with apostrophes.
Previously, because apostrophes were 'banned' characters, searching for
them wouldn't work. That meant you couldn't find words like "I'm". Now
we just replace the apostrophe with a space and things "just work"
because of the nature of SQLite tokenization and prefix queries.
2018-06-22 10:59:53 -07:00
Greyson Parrelli afec9e8cb0 Improve highlighting in search results.
Previously, we didn't support highlighting search results that had
tokens in the middle of the matches, which is a possibility with FTS.
Now we do more robust highlighting, as well as highlight matches in
phone numbers.
2018-06-22 10:59:53 -07:00
Greyson Parrelli 89fd7dda23 Break FTS queries into multiple prefix queries.
Previously, we made each full-text search query a single prefix query.
That means that the query "do c" would turn into "do c*". That means it
would match "do cat" but not "dog cat".

Now, we make each token a prefix query. So "do c" would turn into
"do* c*". That means it would match both "do cat" and "dog cat".
2018-06-22 10:59:53 -07:00
Greyson Parrelli 3563efc7de Update search query results when messages disappear.
Previously, if a message disappeared while looking at it in the search
results, it'd still stick around. Now they'll disappear from the results
in real-time.
2018-06-22 10:59:53 -07:00
Greyson Parrelli ea4ac9db30 Fixed issue where self-sends didn't auto download.
1) There was an issue where we wouldn't auto-download group syncs.
2) There was another issue where we didn't show the download controls
   for messages you sent yourself.

Fixed #7920
2018-06-22 10:37:07 -07:00
Greyson Parrelli 71a34dac5f Fix backup/import issue with expiring messages.
There was an issue where we were backing up group receipts and attachments
that were for expiring messages (which are already excluded from the backup).

This commit excludes these items from the backup, and for backups made
before this change, this commit also deletes these invalid entries at
the end of the restore process.

We also do a little database migration to cleanup any bad state that may
have been imported in the past.
2018-06-21 19:07:27 -07:00
Greyson Parrelli 61b2da9c8a Fix NPE during busy call. 2018-06-21 18:47:14 -07:00
Greyson Parrelli 3a85c966d0 Fix false-positive outage detection.
Turns out that there's some weird quasi-state when you come out of
airplane mode, that if you do an InetAdress lookup, it returns some
weird IPv6-looking garbage address. Going to retry in that scenario
instead of assuming an outage.
2018-06-20 13:24:33 -07:00