Merge "Protect against multiple starts of device index job" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
15700cb779
@@ -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");
|
||||||
|
if (!mRunningJob) {
|
||||||
mRunningJob = true;
|
mRunningJob = true;
|
||||||
Thread thread = new Thread(() -> updateIndex(params));
|
Thread thread = new Thread(() -> updateIndex(params));
|
||||||
thread.setPriority(Thread.MIN_PRIORITY);
|
thread.setPriority(Thread.MIN_PRIORITY);
|
||||||
thread.start();
|
thread.start();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user