Commit Graph

30 Commits

Author SHA1 Message Date
Mikunj
efad14fcdc Message syncing. 2019-10-25 14:08:30 +11:00
Niels Andriesse
1822e87f7c Merge Signal 4.41.0 2019-08-07 16:48:54 +10:00
Niels Andriesse
0ef0140b0d Update package 2019-07-24 12:30:23 +10:00
Greyson Parrelli
2a644437fb Add sticker support.
No sticker packs are available for use yet, but we now have the
latent ability to send and receive.
2019-05-30 01:08:01 -04:00
Greyson Parrelli
1e564b6ad1 Fix exponential backoff retry limits. 2019-04-30 12:51:58 -07:00
Greyson Parrelli
49cccc6927 Update job logging. 2019-04-28 11:44:17 -07:00
Greyson Parrelli
2701607810 Reduce the possible number of unique jobs to avoid crash.
Some devices have a limit of 100 unique JobScheduler jobs.
Previously we allowed up to 1,000. Given that we just need
_some_ job running, I lowered the limit to 75 to give us
some head room.
2019-04-16 09:52:12 -04:00
Greyson Parrelli
1c47812877 Fix crash when migrating read receipt jobs.
Fixes #8764
2019-04-15 15:45:16 -04:00
Greyson Parrelli
4a3c173adb Migrated to new JobManager. 2019-04-15 10:56:26 -04:00
Greyson Parrelli
18613e3b6f Remove generic foreground service condition from Job.
I don't think it actually helps at all, meaning it just adds
complexity.

Fixes #8677
2019-03-12 11:29:59 -03:00
Greyson Parrelli
dcae8a8a2f Update WorkManager to beta01. 2019-01-14 11:25:12 -08:00
Greyson Parrelli
19d5ba5c0e Upload attachments in a separate job. 2019-01-13 19:25:40 -08:00
Greyson Parrelli
96c641c2a0 Add support for Job chains. 2019-01-13 19:25:40 -08:00
Greyson Parrelli
1a50910910 Update WorkManager to alpha12. 2019-01-13 19:25:40 -08:00
Greyson Parrelli
bfdad2f47c Updated logging. 2018-12-06 12:43:45 -08:00
Greyson Parrelli
81055e61a6 Update WorkManager to 1.0.0-alpha11. 2018-11-27 12:35:41 -08:00
Greyson Parrelli
a3411072ba Remove MasterSecret job.
It's no longer necessary.
2018-11-21 01:55:30 -08:00
Greyson Parrelli
a2ea115650 Initialize jobs in the try block.
In the case where we add new fields to a Job's InputData, we want to
make sure that initialize() is called in the try block so that if it
fails, it simply fails the job (allowing the user to retry with the new
field) instead of crashing.
2018-11-17 09:56:52 -08: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
ae9c53bdf8 Ensure jobs have a Context during onAdded().
Fixes a crash.
2018-10-20 22:52:14 -07:00
Greyson Parrelli
0d48f10806 Fix issue where a Job had null JobParameters. 2018-10-10 09:00:14 -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
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
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
12afdad291 Log Job retryable exceptions. 2018-10-01 16:14:45 -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
d0db6aa509 Added more logging around message sending and attachment downloads. 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
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
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