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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user