Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e76a9ba authored by Jason Monk's avatar Jason Monk
Browse files

Protect against multiple starts of device index job

Its rare, but can happen.

Test: existing tests pass
Change-Id: Ie7aaa47902741d5f7fdd954f35e8f13e9466e07c
Fixes: 78898947
parent 8a9c47e1
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -53,10 +53,12 @@ public class DeviceIndexUpdateJobService extends JobService {
    @Override
    public boolean onStartJob(JobParameters params) {
        if (DEBUG) Log.d(TAG, "onStartJob");
        if (!mRunningJob) {
            mRunningJob = true;
            Thread thread = new Thread(() -> updateIndex(params));
            thread.setPriority(Thread.MIN_PRIORITY);
            thread.start();
        }
        return true;
    }