Commit Graph

20 Commits (58e68f968cfe80d10e2cbfca984e6a70b43ba089)

Author SHA1 Message Date
Anton Chekulaev ab6ab5c625 Use WorkManager for background poll task. 5 years ago
nielsandriesse 96736a8095 Raise deployment target and migrate to AndroidX 5 years ago
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.
6 years ago
Greyson Parrelli 4a3c173adb Migrated to new JobManager. 6 years ago
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
6 years ago
Greyson Parrelli dcae8a8a2f Update WorkManager to beta01. 6 years ago
Greyson Parrelli 96c641c2a0 Add support for Job chains. 6 years ago
Greyson Parrelli 1a50910910 Update WorkManager to alpha12. 6 years ago
Greyson Parrelli bfdad2f47c Updated logging. 6 years ago
Greyson Parrelli 81055e61a6 Update WorkManager to 1.0.0-alpha11. 7 years ago
Greyson Parrelli a3411072ba Remove MasterSecret job.
It's no longer necessary.
7 years ago
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.
7 years ago
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.
7 years ago
Greyson Parrelli ae9c53bdf8 Ensure jobs have a Context during onAdded().
Fixes a crash.
7 years ago
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().
7 years ago
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.
7 years ago
Greyson Parrelli 12afdad291 Log Job retryable exceptions. 7 years ago
Greyson Parrelli 87e6aa48bb Schedule jobs with WorkManager.
Should help solve most of our pressing targetSdk=26 migration issues.
7 years ago
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.
7 years ago
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.
7 years ago