| commit | bc6fa22519d4592060b7ded9c3b7608d9bef4501 | [log] [tgz] |
|---|---|---|
| author | Yanning Jia <yanning@google.com> | Sun Feb 25 23:04:26 2024 +0000 |
| committer | Yanning Jia <yanning@google.com> | Mon Feb 26 13:33:54 2024 +0000 |
| tree | 72916943cbd9e26f7124fd8b341e3a1568e3305b | |
| parent | 8a4866b91b63d7a44295c0477ac90ec6ed27d8ad [diff] |
Update download processing job to report failure when any of the async download processing task finished exceptionally Bug: 323574204 Test: atest OnDevicePersonalizationDownloadProcessingJobServiceTests -c, manual Change-Id: Ieaf8cb1dfef1dfba50da6d0be705d0a49fcc2245
diff --git a/src/com/android/ondevicepersonalization/services/download/OnDevicePersonalizationDownloadProcessingJobService.java b/src/com/android/ondevicepersonalization/services/download/OnDevicePersonalizationDownloadProcessingJobService.java index 0298e3d..9425871 100644 --- a/src/com/android/ondevicepersonalization/services/download/OnDevicePersonalizationDownloadProcessingJobService.java +++ b/src/com/android/ondevicepersonalization/services/download/OnDevicePersonalizationDownloadProcessingJobService.java
@@ -109,11 +109,20 @@ } var unused = Futures.whenAllComplete(mFutures).call(() -> { boolean wantsReschedule = false; + boolean allSuccess = true; + for (ListenableFuture<Void> future : mFutures) { + try { + future.get(); + } catch (Exception e) { + allSuccess = false; + break; + } + } OdpJobServiceLogger.getInstance( OnDevicePersonalizationDownloadProcessingJobService.this) .recordJobFinished( DOWNLOAD_PROCESSING_TASK_JOB_ID, - /* isSuccessful= */ false, + /* isSuccessful= */ allSuccess, wantsReschedule); jobFinished(params, wantsReschedule); return null;