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

Commit 9634676d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make Job.failureCount volatile" into main

parents 3a9a5068 d2872ad0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -103,7 +103,11 @@ abstract public class Job implements Runnable {

    final UrisSupplier mResourceUris;

    int failureCount = 0;
    /**
     * Number of errors. It is modified by the main thread running setUp(), start() and finish(),
     * and it is read by the progress reporting thread running getJobProgress().
     */
    volatile int failureCount = 0;
    final ArrayList<DocumentInfo> failedDocs = new ArrayList<>();
    final ArrayList<Uri> failedUris = new ArrayList<>();

+3 −7
Original line number Diff line number Diff line
@@ -203,10 +203,8 @@ class UnpackJob(
            if (DEBUG) Log.d(TAG, "Canceled unpacking of ${archiveInfo.derivedUri}")
        } catch (t: Throwable) {
            Log.e(TAG, "Cannot unpack ${redact(archiveInfo.derivedUri)}", t)
            synchronized(this) {
            onFileFailed(archiveInfo)
        }
        }

        return false
    }
@@ -289,11 +287,9 @@ class UnpackJob(
            if (DEBUG) Log.d(TAG, "Canceled unpacking of ${redact(archiveInfo.derivedUri)}")
        } catch (t: Throwable) {
            Log.e(TAG, "Cannot unpack ${redact(archiveInfo.derivedUri)}", t)
            synchronized(this) {
            onFileFailed(archiveInfo)
        }
    }
    }

    private fun extractAllFiles() {
        for (entry in archive!!.entries) {
@@ -325,8 +321,8 @@ class UnpackJob(
            Log.e(TAG, "Cannot extract ${redact(path)} from ${redact(archiveInfo.derivedUri)}", t)
            synchronized(this) {
                tracker.filesRequired--
                onResolveFailed(Uri.withAppendedPath(dirUri, fileName))
            }
            onResolveFailed(Uri.withAppendedPath(dirUri, fileName))
        }

        // Adjust progress expectations after extracting a file.