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
|
@Override
|
||||||
public boolean onStartJob(JobParameters params) {
|
public boolean onStartJob(JobParameters params) {
|
||||||
if (DEBUG) Log.d(TAG, "onStartJob");
|
if (DEBUG) Log.d(TAG, "onStartJob");
|
||||||
mRunningJob = true;
|
if (!mRunningJob) {
|
||||||
Thread thread = new Thread(() -> updateIndex(params));
|
mRunningJob = true;
|
||||||
thread.setPriority(Thread.MIN_PRIORITY);
|
Thread thread = new Thread(() -> updateIndex(params));
|
||||||
thread.start();
|
thread.setPriority(Thread.MIN_PRIORITY);
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user