summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
author Austin Tankiang <austinct@google.com> 2025-02-07 06:36:40 +0000
committer Austin Tankiang <austinct@google.com> 2025-03-03 08:02:02 +0000
commit77f3e752b26b58e8ccbe2a40cb8ff0bb44b66628 (patch)
treef0964c2593a5b4aece083e6138f168aefc6a097b /tests
parente5ed5939712aae6965459f3ac32d641a96136f73 (diff)
Add functions to Jobs to retrieve current progress
There is no change in behaviour as this patch just adds functions. Due to limitations in the current job implementations, there are a few shortcominings: * Failure reasons aren't exposed. * Transfers of zero bytes (e.g. folder only or empty file) show as indeterminate progress. * In cases where file size can't be determined, the job keeps track via files processed, but these will show as indeterminate progress. Bug: 385841721 Test: atest -c 'DocumentsUIGoogleTests:com.android.documentsui.services' Flag: com.android.documentsui.flags.visual_signals Change-Id: I7b0d863bf7b974090c0e1a17f06c0f7160c59699
Diffstat (limited to 'tests')
-rw-r--r--tests/common/com/android/documentsui/services/TestJob.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/common/com/android/documentsui/services/TestJob.java b/tests/common/com/android/documentsui/services/TestJob.java
index 10addebd9..426cb9575 100644
--- a/tests/common/com/android/documentsui/services/TestJob.java
+++ b/tests/common/com/android/documentsui/services/TestJob.java
@@ -23,11 +23,11 @@ import android.app.Notification;
import android.app.Notification.Builder;
import android.content.Context;
-import com.android.documentsui.base.Features;
-import com.android.documentsui.clipping.UrisSupplier;
import com.android.documentsui.R;
import com.android.documentsui.base.DocumentInfo;
import com.android.documentsui.base.DocumentStack;
+import com.android.documentsui.base.Features;
+import com.android.documentsui.clipping.UrisSupplier;
import com.android.documentsui.services.FileOperationService.OpType;
import java.text.NumberFormat;
@@ -97,6 +97,10 @@ public class TestJob extends Job {
throw new UnsupportedOperationException();
}
+ JobProgress getJobProgress() {
+ return new JobProgress(id, getState(), "test job", false);
+ }
+
@Override
Builder createProgressBuilder() {
++mNumOfNotifications;