Merge "Protect against multiple starts of device index job" into pi-dev am: 15700cb779
am: 679ad8e041
Change-Id: Ie7e29bc63d5f1f2f57d6a55225e14faf85d64b18
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");
|
||||
mRunningJob = true;
|
||||
Thread thread = new Thread(() -> updateIndex(params));
|
||||
thread.setPriority(Thread.MIN_PRIORITY);
|
||||
thread.start();
|
||||
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