Commit Graph

2440 Commits

Author SHA1 Message Date
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