Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ecc05c02 authored by Garfield, Tan's avatar Garfield, Tan
Browse files

Fix bad locking.

When synchronizing on a field, it should be final to avoid locking on different
objects.
Missing synchronization on use of mRunning caught by Error Prone's @GuardedBy
checker.
Bug: 27723540

Change-Id: Ib35d07d7bb631aa69c89a1611ef770763d9178f6
parent f1e4cce4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -171,13 +171,13 @@ public class FileOperationService extends Service implements Job.Listener {
            }

            mWakeLock.acquire();
        }

            assert (job != null);
            if (DEBUG) Log.d(TAG, "Scheduling job " + job.id + ".");
            Future<?> future = getExecutorService(operationType).submit(job);
            mRunning.put(jobId, new JobRecord(job, future));
        }
    }

    /**
     * Cancels the operation corresponding to job id, identified in "EXTRA_JOB_ID".