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