Protect against multiple starts of device index job

Its rare, but can happen.

Test: existing tests pass
Change-Id: Ie7aaa47902741d5f7fdd954f35e8f13e9466e07c
Fixes: 78898947
This commit is contained in:
Jason Monk
2018-05-14 11:14:19 -04:00
parent 8a9c47e1ba
commit 2e76a9ba54

View File

@@ -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;
}