Merge "Protect against multiple starts of device index job" into pi-dev

am: 15700cb779

Change-Id: If34872eb4ddb4b51f4518834aac92a0ef64f163e
This commit is contained in:
Jason Monk
2018-05-14 11:41:29 -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;
}