mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-26 14:09:58 +00:00
Remove database transaction protections for job manager interactions.
Now that the JobDatabase is a separate physical database, we no longer have to worry about people enqueuing jobs while in a transaction.
This commit is contained in:
committed by
Cody Henthorne
parent
5cb54b9ad7
commit
69a1fa0d3c
@@ -58,17 +58,7 @@ public class JobManager implements ConstraintObserver.Notifier {
|
||||
public JobManager(@NonNull Application application, @NonNull Configuration configuration) {
|
||||
this.application = application;
|
||||
this.configuration = configuration;
|
||||
this.executor = new FilteredExecutor(configuration.getExecutorFactory().newSingleThreadExecutor("signal-JobManager"),
|
||||
() -> {
|
||||
if (Util.isMainThread()) {
|
||||
return true;
|
||||
} else if (DatabaseFactory.inTransaction(application)) {
|
||||
Log.w(TAG, "Tried to add a job while in a transaction!", new Throwable());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
this.executor = new FilteredExecutor(configuration.getExecutorFactory().newSingleThreadExecutor("signal-JobManager"), Util::isMainThread);
|
||||
this.jobTracker = configuration.getJobTracker();
|
||||
this.jobController = new JobController(application,
|
||||
configuration.getJobStorage(),
|
||||
|
||||
Reference in New Issue
Block a user