Merge "Protect against multiple starts of device index job" into pi-dev am: 15700cb779

am: 679ad8e041

Change-Id: Ie7e29bc63d5f1f2f57d6a55225e14faf85d64b18
This commit is contained in:
Jason Monk
2018-05-14 11:48:31 -07:00
committed by android-build-merger

View File

@@ -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;
}