Merge "Protect against multiple starts of device index job" into pi-dev
am: 15700cb779
Change-Id: If34872eb4ddb4b51f4518834aac92a0ef64f163e
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