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

Commit 6246cbe9 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4425573 from 2bbdd651 to pi-release

Change-Id: I2a7c2309013c0dc1ec350bd932dd26e15b774a1d
parents 49e3b3af 2bbdd651
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -354,7 +354,7 @@ public class FileOperationService extends Service implements Job.Listener {
                job.id, NOTIFICATION_ID_PROGRESS, notification);

        // Set up related monitor
        JobMonitor monitor = new JobMonitor(job, notificationManager, handler);
        JobMonitor monitor = new JobMonitor(job, notificationManager, handler, mJobs);
        monitor.start();
    }

@@ -458,11 +458,14 @@ public class FileOperationService extends Service implements Job.Listener {
        private final Job mJob;
        private final NotificationManager mNotificationManager;
        private final Handler mHandler;
        private final Object mJobsLock;

        private JobMonitor(Job job, NotificationManager notificationManager, Handler handler) {
        private JobMonitor(Job job, NotificationManager notificationManager, Handler handler,
                Object jobsLock) {
            mJob = job;
            mNotificationManager = notificationManager;
            mHandler = handler;
            mJobsLock = jobsLock;
        }

        private void start() {
@@ -471,6 +474,7 @@ public class FileOperationService extends Service implements Job.Listener {

        @Override
        public void run() {
            synchronized (mJobsLock) {
                if (mJob.isFinished()) {
                    // Finish notification is already shown. Progress notification is removed.
                    // Just finish itself.
@@ -486,6 +490,7 @@ public class FileOperationService extends Service implements Job.Listener {
                mHandler.postDelayed(this, PROGRESS_INTERVAL_MILLIS);
            }
        }
    }

    @Override
    public IBinder onBind(Intent intent) {