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

Commit ee9624ac authored by Austin Tankiang's avatar Austin Tankiang
Browse files

Plumb through the operation type in job progress

Bug: 400353584
Test: atest -c 'DocumentsUIGoogleTests:com.android.documentsui.services'
Flag: com.android.documentsui.flags.visual_signals_ro
Change-Id: I8950e4bca93f02ce7c09465a97a0289f3a6fde92
parent 308ab18b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -227,6 +227,7 @@ class CopyJob extends ResolvedResourcesJob {
        if (mProgressTracker == null) {
            return new JobProgress(
                    id,
                    operationType,
                    getState(),
                    getProgressMessage(),
                    hasFailures());
@@ -234,6 +235,7 @@ class CopyJob extends ResolvedResourcesJob {
        mProgressTracker.updateEstimateRemainingTime();
        return new JobProgress(
                id,
                operationType,
                getState(),
                getProgressMessage(),
                hasFailures(),
+1 −0
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ final class DeleteJob extends ResolvedResourcesJob {
    JobProgress getJobProgress() {
        return new JobProgress(
                id,
                operationType,
                getState(),
                getProgressMessage(),
                hasFailures());
+3 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.os.Parcelable
 */
data class JobProgress @JvmOverloads constructor(
    @JvmField val id: String,
    @JvmField @FileOperationService.OpType val operationType: Int,
    @JvmField @Job.State val state: Int,
    @JvmField val msg: String?,
    @JvmField val hasFailures: Boolean,
@@ -50,6 +51,7 @@ data class JobProgress @JvmOverloads constructor(
    override fun writeToParcel(dest: Parcel, flags: Int) {
        dest.apply {
            writeString(id)
            writeInt(operationType)
            writeInt(state)
            writeString(msg)
            writeBoolean(hasFailures)
@@ -64,6 +66,7 @@ data class JobProgress @JvmOverloads constructor(
            return JobProgress(
                parcel.readString()!!,
                parcel.readInt(),
                parcel.readInt(),
                parcel.readString(),
                parcel.readBoolean(),
                parcel.readLong(),
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public class TestJob extends Job {
    }

    JobProgress getJobProgress() {
        return new JobProgress(id, getState(), "test job", false);
        return new JobProgress(id, operationType, getState(), "test job", false);
    }

    @Override
+12 −1
Original line number Diff line number Diff line
@@ -15,11 +15,13 @@
 */
package com.android.documentsui.testing

import com.android.documentsui.services.FileOperationService
import com.android.documentsui.services.Job
import com.android.documentsui.services.JobProgress

data class MutableJobProgress(
    var id: String,
    @FileOperationService.OpType val operationType: Int,
    @Job.State var state: Int,
    var msg: String?,
    var hasFailures: Boolean,
@@ -28,5 +30,14 @@ data class MutableJobProgress(
    var msRemaining: Long = -1,
) {
    fun toJobProgress() =
        JobProgress(id, state, msg, hasFailures, currentBytes, requiredBytes, msRemaining)
        JobProgress(
            id,
            operationType,
            state,
            msg,
            hasFailures,
            currentBytes,
            requiredBytes,
            msRemaining
        )
}
Loading